Skip to content

Commit

Permalink
release: 1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Jan 20, 2022
1 parent 5862c84 commit 181b358
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 38 deletions.
18 changes: 9 additions & 9 deletions docs/dist/bundle.js

Large diffs are not rendered by default.

31 changes: 17 additions & 14 deletions lib/rodal.esm.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

/* ===============================
* Rodal v1.7.0 https://chenjiahan.github.com/rodal
* Rodal v1.8.2 https://chenjiahan.github.com/rodal
* =============================== */
import React from 'react';
import PropTypes from 'prop-types';
Expand All @@ -20,7 +22,7 @@ var IS_IE_9 = UA && UA.indexOf('msie 9.0') > 0;
var Dialog = function Dialog(props) {
var animation = (props.animationType === 'enter' ? props.enterAnimation : props.leaveAnimation) || props.animation;
var className = "rodal-dialog rodal-" + animation + "-" + props.animationType;
var CloseButton = props.showCloseButton ? React.createElement("span", {
var CloseButton = props.showCloseButton ? /*#__PURE__*/React.createElement("span", {
className: "rodal-close",
onClick: props.onClose,
onKeyPress: function onKeyPress(event) {
Expand All @@ -34,25 +36,25 @@ var Dialog = function Dialog(props) {
height = props.height,
measure = props.measure,
duration = props.duration,
customStyles = props.customStyles;
customStyles = props.customStyles,
id = props.id;
var style = {
width: width + measure,
height: height + measure,
animationDuration: duration + 'ms',
WebkitAnimationDuration: duration + 'ms'
};

var mergedStyles = _extends({}, style, {}, customStyles);
var mergedStyles = _extends({}, style, customStyles);

return React.createElement("div", {
return /*#__PURE__*/React.createElement("div", {
style: mergedStyles,
className: className
className: className,
id: id
}, props.children, CloseButton);
};

var Rodal =
/*#__PURE__*/
function (_React$Component) {
var Rodal = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Rodal, _React$Component);

function Rodal() {
Expand Down Expand Up @@ -146,7 +148,7 @@ function (_React$Component) {
var _this$state = this.state,
isShow = _this$state.isShow,
animationType = _this$state.animationType;
var Mask = showMask ? React.createElement("div", {
var Mask = showMask ? /*#__PURE__*/React.createElement("div", {
className: "rodal-mask",
style: customMaskStyles,
onClick: closeMaskOnClick ? onClose : void 0
Expand All @@ -156,7 +158,7 @@ function (_React$Component) {
animationDuration: duration + 'ms',
WebkitAnimationDuration: duration + 'ms'
};
return React.createElement("div", {
return /*#__PURE__*/React.createElement("div", {
style: style,
className: cx('rodal', "rodal-fade-" + animationType, className),
onAnimationEnd: this.animationEnd,
Expand All @@ -165,7 +167,7 @@ function (_React$Component) {
_this2.el = el;
},
onKeyUp: this.onKeyUp
}, Mask, React.createElement(Dialog, _extends({}, this.props, {
}, Mask, /*#__PURE__*/React.createElement(Dialog, _extends({}, this.props, {
animationType: animationType
}), children));
};
Expand All @@ -190,7 +192,8 @@ _defineProperty(Rodal, "propTypes", {
customStyles: PropTypes.object,
customMaskStyles: PropTypes.object,
onClose: PropTypes.func.isRequired,
onAnimationEnd: PropTypes.func
onAnimationEnd: PropTypes.func,
id: PropTypes.string
});

_defineProperty(Rodal, "defaultProps", {
Expand Down
29 changes: 16 additions & 13 deletions lib/rodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

Expand All @@ -27,7 +29,7 @@ var IS_IE_9 = UA && UA.indexOf('msie 9.0') > 0;
var Dialog = function Dialog(props) {
var animation = (props.animationType === 'enter' ? props.enterAnimation : props.leaveAnimation) || props.animation;
var className = "rodal-dialog rodal-" + animation + "-" + props.animationType;
var CloseButton = props.showCloseButton ? _react["default"].createElement("span", {
var CloseButton = props.showCloseButton ? /*#__PURE__*/_react["default"].createElement("span", {
className: "rodal-close",
onClick: props.onClose,
onKeyPress: function onKeyPress(event) {
Expand All @@ -41,25 +43,25 @@ var Dialog = function Dialog(props) {
height = props.height,
measure = props.measure,
duration = props.duration,
customStyles = props.customStyles;
customStyles = props.customStyles,
id = props.id;
var style = {
width: width + measure,
height: height + measure,
animationDuration: duration + 'ms',
WebkitAnimationDuration: duration + 'ms'
};

var mergedStyles = _extends({}, style, {}, customStyles);
var mergedStyles = _extends({}, style, customStyles);

return _react["default"].createElement("div", {
return /*#__PURE__*/_react["default"].createElement("div", {
style: mergedStyles,
className: className
className: className,
id: id
}, props.children, CloseButton);
};

var Rodal =
/*#__PURE__*/
function (_React$Component) {
var Rodal = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Rodal, _React$Component);

function Rodal() {
Expand Down Expand Up @@ -153,7 +155,7 @@ function (_React$Component) {
var _this$state = this.state,
isShow = _this$state.isShow,
animationType = _this$state.animationType;
var Mask = showMask ? _react["default"].createElement("div", {
var Mask = showMask ? /*#__PURE__*/_react["default"].createElement("div", {
className: "rodal-mask",
style: customMaskStyles,
onClick: closeMaskOnClick ? onClose : void 0
Expand All @@ -163,7 +165,7 @@ function (_React$Component) {
animationDuration: duration + 'ms',
WebkitAnimationDuration: duration + 'ms'
};
return _react["default"].createElement("div", {
return /*#__PURE__*/_react["default"].createElement("div", {
style: style,
className: (0, _classnames["default"])('rodal', "rodal-fade-" + animationType, className),
onAnimationEnd: this.animationEnd,
Expand All @@ -172,7 +174,7 @@ function (_React$Component) {
_this2.el = el;
},
onKeyUp: this.onKeyUp
}, Mask, _react["default"].createElement(Dialog, _extends({}, this.props, {
}, Mask, /*#__PURE__*/_react["default"].createElement(Dialog, _extends({}, this.props, {
animationType: animationType
}), children));
};
Expand All @@ -197,7 +199,8 @@ _defineProperty(Rodal, "propTypes", {
customStyles: _propTypes["default"].object,
customMaskStyles: _propTypes["default"].object,
onClose: _propTypes["default"].func.isRequired,
onAnimationEnd: _propTypes["default"].func
onAnimationEnd: _propTypes["default"].func,
id: _propTypes["default"].string
});

_defineProperty(Rodal, "defaultProps", {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rodal",
"version": "1.8.1",
"version": "1.8.2",
"description": "A React modal with animations.",
"main": "lib/rodal.js",
"module": "lib/rodal.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion src/rodal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ===============================
* Rodal v1.7.0 https://chenjiahan.github.com/rodal
* Rodal v1.8.2 https://chenjiahan.github.com/rodal
* =============================== */

import React from 'react';
Expand Down

0 comments on commit 181b358

Please sign in to comment.