Skip to content

Commit bfacb08

Browse files
author
unknown
committed
4.25.0
1 parent 78df102 commit bfacb08

File tree

21 files changed

+1432
-1129
lines changed

21 files changed

+1432
-1129
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ All fully responsive. All compatible with different browsers.
5959

6060
# Version:
6161

62-
- MDBReact 4.24.0
63-
- React 16.12.0
62+
- MDBReact 4.25.0
63+
- React 16.9.0
6464

6565
# Quick start
6666

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Material Design for Bootstrap
22

3-
Version: MDB React 4.24.0
3+
Version: MDB React 4.25.0
44

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

dist/css/mdb.css

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mdbreact.esm.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,8 @@ function (_Component) {
351351
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Animation)).call.apply(_getPrototypeOf2, [this].concat(args)));
352352

353353
_defineProperty(_assertThisInitialized(_this), "state", {
354-
// eslint-disable-next-line react/destructuring-assignment
355-
isVisible: !_this.props.reveal,
356-
// eslint-disable-next-line react/destructuring-assignment
357-
revealed: !_this.props.reveal,
354+
isVisible: false,
355+
revealed: false,
358356
countIterations: 0
359357
});
360358

@@ -439,6 +437,10 @@ function (_Component) {
439437
key: "componentDidMount",
440438
value: function componentDidMount() {
441439
var reveal = this.props.reveal;
440+
this.setState({
441+
isVisible: !reveal,
442+
revealed: !reveal
443+
});
442444

443445
if (reveal) {
444446
window.addEventListener('scroll', this.updatePredicate);
@@ -1060,19 +1062,9 @@ var CardFooter = function CardFooter(props) {
10601062
var classes = classNames((_classNames = {
10611063
'white-text': color && !text
10621064
}, _defineProperty(_classNames, "border-".concat(border), border), _defineProperty(_classNames, 'bg-transparent', transparent), _defineProperty(_classNames, 'text-muted', muted), _defineProperty(_classNames, "".concat(text, "-text"), text), _classNames), 'card-footer', color, className);
1063-
var component = React.createElement(Tag, _extends({
1064-
"data-test": "card-footer"
1065-
}, attributes, {
1065+
return React.createElement(Tag, _extends({}, attributes, {
10661066
className: classes
1067-
}));
1068-
1069-
if (small) {
1070-
component = React.createElement(Tag, _extends({}, attributes, {
1071-
className: classes
1072-
}), React.createElement("small", null, " ", children, " "));
1073-
}
1074-
1075-
return component;
1067+
}), small ? React.createElement("small", null, " ", children, " ") : children);
10761068
};
10771069

10781070
CardFooter.propTypes = {
@@ -3556,7 +3548,12 @@ function (_Component) {
35563548
this.fetchData(data, this.paginateRows);
35573549
}
35583550

3559-
order.length && this.handleSort(order[0], order[1]);
3551+
if (order.length > 0) {
3552+
this.handleSort(order[0], order[1]);
3553+
} else {
3554+
this.handleSort();
3555+
}
3556+
35603557
this.setUnsearchable(columns);
35613558

35623559
if (paging) {
@@ -3761,7 +3758,7 @@ DataTable.propTypes = {
37613758
fixed: PropTypes.bool,
37623759
hover: PropTypes.bool,
37633760
info: PropTypes.bool,
3764-
infoLabel: PropTypes.arrayOf(PropTypes.string),
3761+
infoLabel: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
37653762
maxHeight: PropTypes.string,
37663763
noBottomColumns: PropTypes.bool,
37673764
noRecordsFoundLabel: PropTypes.string,
@@ -5685,19 +5682,21 @@ function (_Component) {
56855682
}
56865683
});
56875684

5688-
_defineProperty(_assertThisInitialized(_this), "handleOnExited", function (node) {
5685+
_defineProperty(_assertThisInitialized(_this), "handleOnExited", function () {
56895686
_this.props.hiddenModal && _this.props.hiddenModal();
56905687
});
56915688

56925689
_defineProperty(_assertThisInitialized(_this), "handleBackdropClick", function (e) {
5693-
console.log(e);
5694-
56955690
if (!_this.props.backdrop || e.target.closest('[role="dialog"]') && !e.target.classList.contains('modal')) {
56965691
return;
56975692
}
56985693

5699-
if (!_this.modalContent.contains(e.target)) {
5700-
_this.props.toggle();
5694+
if (!(e.clientX > e.target.clientWidth || e.clientY > e.target.clientHeight)) {
5695+
if (!_this.modalContent.contains(e.target)) {
5696+
if (!_this.props.disableBackdrop) {
5697+
_this.props.toggle();
5698+
}
5699+
}
57015700
}
57025701
});
57035702

@@ -5749,11 +5748,13 @@ function (_Component) {
57495748
'modal-frame': frame,
57505749
'modal-dialog-centered': centered
57515750
}, _defineProperty(_classNames, "modal-".concat(size), size), _defineProperty(_classNames, "modal-".concat(position), position), _defineProperty(_classNames, "modal-notify white-text modal-".concat(modalStyle), modalStyle), _classNames), 'modal-dialog', className);
5752-
var wrapperClasses = classNames(_defineProperty({
5751+
var positionSplited = position.split('-');
5752+
var wrapperClasses = classNames({
57535753
modal: !inline,
57545754
fade: fade,
5755-
top: fade && !animation && !position
5756-
}, "".concat(animation), fade && animation), fade && position && position.split('-')[1], wrapClassName);
5755+
top: fade && !animation && !position,
5756+
animation: fade && animation
5757+
}, fade && position && position && positionSplited.length > 1 ? positionSplited[1] : positionSplited[0], wrapClassName);
57575758
var backdropClasses = classNames('modal-backdrop', fade ? 'fade' : 'show', backdropClassName);
57585759
var contentClasses = classNames('modal-content', contentClassName);
57595760
var modalAttributes = returnAttributes({
@@ -5819,12 +5820,14 @@ Modal.defaultProps = {
58195820
autoFocus: true,
58205821
backdrop: true,
58215822
backdropTransitionTimeout: 150,
5823+
disableBackdrop: false,
58225824
disableFocusTrap: true,
58235825
fade: true,
58245826
isOpen: false,
58255827
keyboard: true,
58265828
modalTransitionTimeout: 300,
58275829
overflowScroll: true,
5830+
position: '',
58285831
role: 'dialog',
58295832
tabIndex: '-1',
58305833
zIndex: 1050
@@ -5838,6 +5841,7 @@ Modal.propTypes = {
58385841
children: PropTypes.node,
58395842
className: PropTypes.string,
58405843
contentClassName: PropTypes.string,
5844+
disableBackdrop: PropTypes.bool,
58415845
disableFocusTrap: PropTypes.bool,
58425846
fade: PropTypes.bool,
58435847
frame: PropTypes.bool,

dist/mdbreact.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,8 @@ function (_Component) {
358358
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Animation)).call.apply(_getPrototypeOf2, [this].concat(args)));
359359

360360
_defineProperty(_assertThisInitialized(_this), "state", {
361-
// eslint-disable-next-line react/destructuring-assignment
362-
isVisible: !_this.props.reveal,
363-
// eslint-disable-next-line react/destructuring-assignment
364-
revealed: !_this.props.reveal,
361+
isVisible: false,
362+
revealed: false,
365363
countIterations: 0
366364
});
367365

@@ -446,6 +444,10 @@ function (_Component) {
446444
key: "componentDidMount",
447445
value: function componentDidMount() {
448446
var reveal = this.props.reveal;
447+
this.setState({
448+
isVisible: !reveal,
449+
revealed: !reveal
450+
});
449451

450452
if (reveal) {
451453
window.addEventListener('scroll', this.updatePredicate);
@@ -1067,19 +1069,9 @@ var CardFooter = function CardFooter(props) {
10671069
var classes = classNames((_classNames = {
10681070
'white-text': color && !text
10691071
}, _defineProperty(_classNames, "border-".concat(border), border), _defineProperty(_classNames, 'bg-transparent', transparent), _defineProperty(_classNames, 'text-muted', muted), _defineProperty(_classNames, "".concat(text, "-text"), text), _classNames), 'card-footer', color, className);
1070-
var component = React__default.createElement(Tag, _extends({
1071-
"data-test": "card-footer"
1072-
}, attributes, {
1072+
return React__default.createElement(Tag, _extends({}, attributes, {
10731073
className: classes
1074-
}));
1075-
1076-
if (small) {
1077-
component = React__default.createElement(Tag, _extends({}, attributes, {
1078-
className: classes
1079-
}), React__default.createElement("small", null, " ", children, " "));
1080-
}
1081-
1082-
return component;
1074+
}), small ? React__default.createElement("small", null, " ", children, " ") : children);
10831075
};
10841076

10851077
CardFooter.propTypes = {
@@ -3563,7 +3555,12 @@ function (_Component) {
35633555
this.fetchData(data, this.paginateRows);
35643556
}
35653557

3566-
order.length && this.handleSort(order[0], order[1]);
3558+
if (order.length > 0) {
3559+
this.handleSort(order[0], order[1]);
3560+
} else {
3561+
this.handleSort();
3562+
}
3563+
35673564
this.setUnsearchable(columns);
35683565

35693566
if (paging) {
@@ -3768,7 +3765,7 @@ DataTable.propTypes = {
37683765
fixed: PropTypes.bool,
37693766
hover: PropTypes.bool,
37703767
info: PropTypes.bool,
3771-
infoLabel: PropTypes.arrayOf(PropTypes.string),
3768+
infoLabel: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
37723769
maxHeight: PropTypes.string,
37733770
noBottomColumns: PropTypes.bool,
37743771
noRecordsFoundLabel: PropTypes.string,
@@ -5692,19 +5689,21 @@ function (_Component) {
56925689
}
56935690
});
56945691

5695-
_defineProperty(_assertThisInitialized(_this), "handleOnExited", function (node) {
5692+
_defineProperty(_assertThisInitialized(_this), "handleOnExited", function () {
56965693
_this.props.hiddenModal && _this.props.hiddenModal();
56975694
});
56985695

56995696
_defineProperty(_assertThisInitialized(_this), "handleBackdropClick", function (e) {
5700-
console.log(e);
5701-
57025697
if (!_this.props.backdrop || e.target.closest('[role="dialog"]') && !e.target.classList.contains('modal')) {
57035698
return;
57045699
}
57055700

5706-
if (!_this.modalContent.contains(e.target)) {
5707-
_this.props.toggle();
5701+
if (!(e.clientX > e.target.clientWidth || e.clientY > e.target.clientHeight)) {
5702+
if (!_this.modalContent.contains(e.target)) {
5703+
if (!_this.props.disableBackdrop) {
5704+
_this.props.toggle();
5705+
}
5706+
}
57085707
}
57095708
});
57105709

@@ -5756,11 +5755,13 @@ function (_Component) {
57565755
'modal-frame': frame,
57575756
'modal-dialog-centered': centered
57585757
}, _defineProperty(_classNames, "modal-".concat(size), size), _defineProperty(_classNames, "modal-".concat(position), position), _defineProperty(_classNames, "modal-notify white-text modal-".concat(modalStyle), modalStyle), _classNames), 'modal-dialog', className);
5759-
var wrapperClasses = classNames(_defineProperty({
5758+
var positionSplited = position.split('-');
5759+
var wrapperClasses = classNames({
57605760
modal: !inline,
57615761
fade: fade,
5762-
top: fade && !animation && !position
5763-
}, "".concat(animation), fade && animation), fade && position && position.split('-')[1], wrapClassName);
5762+
top: fade && !animation && !position,
5763+
animation: fade && animation
5764+
}, fade && position && position && positionSplited.length > 1 ? positionSplited[1] : positionSplited[0], wrapClassName);
57645765
var backdropClasses = classNames('modal-backdrop', fade ? 'fade' : 'show', backdropClassName);
57655766
var contentClasses = classNames('modal-content', contentClassName);
57665767
var modalAttributes = returnAttributes({
@@ -5826,12 +5827,14 @@ Modal.defaultProps = {
58265827
autoFocus: true,
58275828
backdrop: true,
58285829
backdropTransitionTimeout: 150,
5830+
disableBackdrop: false,
58295831
disableFocusTrap: true,
58305832
fade: true,
58315833
isOpen: false,
58325834
keyboard: true,
58335835
modalTransitionTimeout: 300,
58345836
overflowScroll: true,
5837+
position: '',
58355838
role: 'dialog',
58365839
tabIndex: '-1',
58375840
zIndex: 1050
@@ -5845,6 +5848,7 @@ Modal.propTypes = {
58455848
children: PropTypes.node,
58465849
className: PropTypes.string,
58475850
contentClassName: PropTypes.string,
5851+
disableBackdrop: PropTypes.bool,
58485852
disableFocusTrap: PropTypes.bool,
58495853
fade: PropTypes.bool,
58505854
frame: PropTypes.bool,

dist/scss/core/_typography.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@ h1, h2, h3, h4, h5, h6 {
9393
.font-small {
9494
font-size: $font-size-small;
9595
}
96+
97+
strong {
98+
font-weight: 500;
99+
}

dist/scss/core/bootstrap/_functions.scss

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$prev-key: null;
99
$prev-num: null;
1010
@each $key, $num in $map {
11-
@if $prev-num == null or unit($num) == "%" {
11+
@if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" {
1212
// Do nothing
1313
} @else if not comparable($prev-num, $num) {
1414
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
@@ -48,6 +48,17 @@
4848
@return $string;
4949
}
5050

51+
// See https://codepen.io/kevinweber/pen/dXWoRw
52+
@function escape-svg($string) {
53+
@if str-index($string, "data:image/svg+xml") {
54+
@each $char, $encoded in $escaped-characters {
55+
$string: str-replace($string, $char, $encoded);
56+
}
57+
}
58+
59+
@return $string;
60+
}
61+
5162
// Color contrast
5263
@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
5364
$r: red($color);
@@ -84,3 +95,40 @@
8495

8596
@return mix($color-base, $color, $level * $theme-color-interval);
8697
}
98+
99+
// Return valid calc
100+
@function add($value1, $value2, $return-calc: true) {
101+
@if $value1 == null {
102+
@return $value2;
103+
}
104+
105+
@if $value2 == null {
106+
@return $value1;
107+
}
108+
109+
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
110+
@return $value1 + $value2;
111+
}
112+
113+
@return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
114+
}
115+
116+
@function subtract($value1, $value2, $return-calc: true) {
117+
@if $value1 == null and $value2 == null {
118+
@return null;
119+
}
120+
121+
@if $value1 == null {
122+
@return -$value2;
123+
}
124+
125+
@if $value2 == null {
126+
@return $value1;
127+
}
128+
129+
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
130+
@return $value1 - $value2;
131+
}
132+
133+
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
134+
}

dist/scss/core/bootstrap/_rfs.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $rfs-rem-value: 16 !default;
3636
$rfs-safari-iframe-resize-bug-fix: false !default;
3737

3838
// Disable RFS by setting $enable-responsive-font-sizes to false
39-
$enable-responsive-font-sizes: true !important;
39+
$enable-responsive-font-sizes: true !default;
4040

4141
// Cache $rfs-base-font-size unit
4242
$rfs-base-font-size-unit: unit($rfs-base-font-size);

0 commit comments

Comments
 (0)