jsondiffpatch-react
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -33,7 +33,4 @@ "use strict"; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** | ||
* Created by guoguangyu on 2016/10/25. | ||
*/ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var formatters = Jsondiffpatch.formatters; | ||
@@ -60,3 +57,4 @@ | ||
annotated = _props$annotated === undefined ? false : _props$annotated, | ||
tips = _props.tips, | ||
_props$tips = _props.tips, | ||
tips = _props$tips === undefined ? "Both objects are identical." : _props$tips, | ||
objectHash = _props.objectHash; | ||
@@ -69,7 +67,7 @@ | ||
show ? formatters.html.showUnchanged() : formatters.html.hideUnchanged(); | ||
return html ? _react2.default.createElement("div", { dangerouslySetInnerHTML: { __html: html } }) : _react2.default.createElement( | ||
return html ? _react2.default.createElement("div", { dangerouslySetInnerHTML: { __html: html } }) : typeof tips === "string" ? _react2.default.createElement( | ||
"p", | ||
{ style: { fontSize: 12, color: "#999" } }, | ||
tips || "Both objects are identical." | ||
); | ||
tips | ||
) : tips; | ||
} | ||
@@ -86,5 +84,5 @@ }]); | ||
annotated: _propTypes2.default.bool, | ||
tips: _propTypes2.default.string, | ||
tips: _propTypes2.default.any, | ||
objectHash: _propTypes2.default.func | ||
}; | ||
exports.default = JsonDiffReact; |
{ | ||
"name": "jsondiffpatch-react", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "jsondiffpatch react", | ||
@@ -5,0 +5,0 @@ "main": "./lib/jsondiff-for-react.js", |
@@ -67,2 +67,3 @@ # jsondiffpatch-react | ||
To publish to NPM, change the version number in `package.json` and `npm publish` | ||
once complete. | ||
once complete. Then, go to Github Releases and follow the instructions to | ||
publish a new version there too. |
@@ -15,3 +15,3 @@ import React, { Component } from "react"; | ||
annotated: PropTypes.bool, | ||
tips: PropTypes.string, | ||
tips: PropTypes.any, | ||
objectHash: PropTypes.func, | ||
@@ -25,3 +25,3 @@ }; | ||
annotated = false, | ||
tips, | ||
tips = "Both objects are identical.", | ||
objectHash, | ||
@@ -38,6 +38,6 @@ } = this.props; | ||
<div dangerouslySetInnerHTML={{ __html: html }} /> | ||
) : typeof tips === "string" ? ( | ||
<p style={{ fontSize: 12, color: "#999" }}>{tips}</p> | ||
) : ( | ||
<p style={{ fontSize: 12, color: "#999" }}> | ||
{tips || "Both objects are identical."} | ||
</p> | ||
tips | ||
); | ||
@@ -44,0 +44,0 @@ } |
Sorry, the diff of this file is not supported yet
69
18115
246