react-height
Advanced tools
+30
| { | ||
| "name": "react-height", | ||
| "version": "0.0.0", | ||
| "description": "Component-wrapper to determine and report children elements height", | ||
| "main": [ | ||
| "build/react-height.js", | ||
| "build/react-height.js.map", | ||
| "build/react-height.min.js", | ||
| "build/react-height.min.js.map" | ||
| ], | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/nkbt/react-height.git" | ||
| }, | ||
| "keywords": [ | ||
| "component", | ||
| "react-component", | ||
| "react", | ||
| "height", | ||
| "height-reporter" | ||
| ], | ||
| "authors": [ | ||
| "Nik Butenko <nik@butenko.me> (http://butenko.me/)" | ||
| ], | ||
| "license": "MIT", | ||
| "homepage": "https://github.com/nkbt/react-height", | ||
| "dependencies": { | ||
| "react": "^0.14" | ||
| } | ||
| } |
| (function webpackUniversalModuleDefinition(root, factory) { | ||
| if(typeof exports === 'object' && typeof module === 'object') | ||
| module.exports = factory(require("react")); | ||
| else if(typeof define === 'function' && define.amd) | ||
| define(["react"], factory); | ||
| else if(typeof exports === 'object') | ||
| exports["ReactHeight"] = factory(require("react")); | ||
| else | ||
| root["ReactHeight"] = factory(root["React"]); | ||
| })(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { | ||
| return /******/ (function(modules) { // webpackBootstrap | ||
| /******/ // The module cache | ||
| /******/ var installedModules = {}; | ||
| /******/ | ||
| /******/ // The require function | ||
| /******/ function __webpack_require__(moduleId) { | ||
| /******/ | ||
| /******/ // Check if module is in cache | ||
| /******/ if(installedModules[moduleId]) | ||
| /******/ return installedModules[moduleId].exports; | ||
| /******/ | ||
| /******/ // Create a new module (and put it into the cache) | ||
| /******/ var module = installedModules[moduleId] = { | ||
| /******/ exports: {}, | ||
| /******/ id: moduleId, | ||
| /******/ loaded: false | ||
| /******/ }; | ||
| /******/ | ||
| /******/ // Execute the module function | ||
| /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
| /******/ | ||
| /******/ // Flag the module as loaded | ||
| /******/ module.loaded = true; | ||
| /******/ | ||
| /******/ // Return the exports of the module | ||
| /******/ return module.exports; | ||
| /******/ } | ||
| /******/ | ||
| /******/ | ||
| /******/ // expose the modules object (__webpack_modules__) | ||
| /******/ __webpack_require__.m = modules; | ||
| /******/ | ||
| /******/ // expose the module cache | ||
| /******/ __webpack_require__.c = installedModules; | ||
| /******/ | ||
| /******/ // __webpack_public_path__ | ||
| /******/ __webpack_require__.p = ""; | ||
| /******/ | ||
| /******/ // Load entry module and return exports | ||
| /******/ return __webpack_require__(0); | ||
| /******/ }) | ||
| /************************************************************************/ | ||
| /******/ ([ | ||
| /* 0 */ | ||
| /***/ function(module, exports, __webpack_require__) { | ||
| 'use strict'; | ||
| // Babel6 does not hack the default behaviour of ES Modules anymore, so we should export | ||
| var ReactHeight = __webpack_require__(1).default; | ||
| module.exports = ReactHeight; | ||
| /***/ }, | ||
| /* 1 */ | ||
| /***/ function(module, exports, __webpack_require__) { | ||
| 'use strict'; | ||
| var _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; }; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| var _react = __webpack_require__(2); | ||
| var _react2 = _interopRequireDefault(_react); | ||
| var _reactAddonsPureRenderMixin = __webpack_require__(3); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } /* eslint "react/no-did-mount-set-state":0, "react/no-did-update-set-state":0 */ | ||
| var ReactHeight = _react2.default.createClass({ | ||
| displayName: 'ReactHeight', | ||
| propTypes: { | ||
| children: _react2.default.PropTypes.node.isRequired, | ||
| onHeightReady: _react2.default.PropTypes.func.isRequired, | ||
| hidden: _react2.default.PropTypes.bool, | ||
| dirty: _react2.default.PropTypes.bool | ||
| }, | ||
| getDefaultProps: function getDefaultProps() { | ||
| return { hidden: false, dirty: true }; | ||
| }, | ||
| getInitialState: function getInitialState() { | ||
| return { | ||
| height: 0, dirty: this.props.dirty | ||
| }; | ||
| }, | ||
| componentDidMount: function componentDidMount() { | ||
| var _this = this; | ||
| if (!this.refs.wrapper) { | ||
| return; | ||
| } | ||
| var height = this.refs.wrapper.clientHeight; | ||
| var dirty = false; | ||
| this.setState({ height: height, dirty: dirty }, function () { | ||
| return _this.props.onHeightReady(_this.state.height); | ||
| }); | ||
| }, | ||
| componentWillReceiveProps: function componentWillReceiveProps(_ref) { | ||
| var children = _ref.children; | ||
| var dirty = _ref.dirty; | ||
| if (children !== this.props.children || dirty) { | ||
| this.setState({ dirty: true }); | ||
| } | ||
| }, | ||
| shouldComponentUpdate: _reactAddonsPureRenderMixin.shouldComponentUpdate, | ||
| componentDidUpdate: function componentDidUpdate() { | ||
| var _this2 = this; | ||
| if (!this.refs.wrapper) { | ||
| return; | ||
| } | ||
| var height = this.refs.wrapper.clientHeight; | ||
| var dirty = false; | ||
| if (height === this.state.height) { | ||
| this.setState({ dirty: dirty }); | ||
| } else { | ||
| this.setState({ height: height, dirty: dirty }, function () { | ||
| return _this2.props.onHeightReady(_this2.state.height); | ||
| }); | ||
| } | ||
| }, | ||
| render: function render() { | ||
| var _props = this.props; | ||
| var onHeightReady = _props.onHeightReady; | ||
| var hidden = _props.hidden; | ||
| var children = _props.children; | ||
| var props = _objectWithoutProperties(_props, ['onHeightReady', 'hidden', 'children']); | ||
| var dirty = this.state.dirty; | ||
| if (hidden && !dirty) { | ||
| return null; | ||
| } | ||
| if (hidden) { | ||
| return _react2.default.createElement( | ||
| 'div', | ||
| { style: { height: 0, overflow: 'hidden' } }, | ||
| _react2.default.createElement( | ||
| 'div', | ||
| _extends({ ref: 'wrapper' }, props), | ||
| children | ||
| ) | ||
| ); | ||
| } | ||
| return _react2.default.createElement( | ||
| 'div', | ||
| _extends({ ref: 'wrapper' }, props), | ||
| children | ||
| ); | ||
| } | ||
| }); | ||
| exports.default = ReactHeight; | ||
| /***/ }, | ||
| /* 2 */ | ||
| /***/ function(module, exports) { | ||
| module.exports = __WEBPACK_EXTERNAL_MODULE_2__; | ||
| /***/ }, | ||
| /* 3 */ | ||
| /***/ function(module, exports, __webpack_require__) { | ||
| module.exports = __webpack_require__(4); | ||
| /***/ }, | ||
| /* 4 */ | ||
| /***/ function(module, exports, __webpack_require__) { | ||
| /** | ||
| * Copyright 2013-2015, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| * | ||
| * @providesModule ReactComponentWithPureRenderMixin | ||
| */ | ||
| 'use strict'; | ||
| var shallowCompare = __webpack_require__(5); | ||
| /** | ||
| * If your React component's render function is "pure", e.g. it will render the | ||
| * same result given the same props and state, provide this Mixin for a | ||
| * considerable performance boost. | ||
| * | ||
| * Most React components have pure render functions. | ||
| * | ||
| * Example: | ||
| * | ||
| * var ReactComponentWithPureRenderMixin = | ||
| * require('ReactComponentWithPureRenderMixin'); | ||
| * React.createClass({ | ||
| * mixins: [ReactComponentWithPureRenderMixin], | ||
| * | ||
| * render: function() { | ||
| * return <div className={this.props.className}>foo</div>; | ||
| * } | ||
| * }); | ||
| * | ||
| * Note: This only checks shallow equality for props and state. If these contain | ||
| * complex data structures this mixin may have false-negatives for deeper | ||
| * differences. Only mixin to components which have simple props and state, or | ||
| * use `forceUpdate()` when you know deep data structures have changed. | ||
| */ | ||
| var ReactComponentWithPureRenderMixin = { | ||
| shouldComponentUpdate: function (nextProps, nextState) { | ||
| return shallowCompare(this, nextProps, nextState); | ||
| } | ||
| }; | ||
| module.exports = ReactComponentWithPureRenderMixin; | ||
| /***/ }, | ||
| /* 5 */ | ||
| /***/ function(module, exports, __webpack_require__) { | ||
| /** | ||
| * Copyright 2013-2015, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| * | ||
| * @providesModule shallowCompare | ||
| */ | ||
| 'use strict'; | ||
| var shallowEqual = __webpack_require__(6); | ||
| /** | ||
| * Does a shallow comparison for props and state. | ||
| * See ReactComponentWithPureRenderMixin | ||
| */ | ||
| function shallowCompare(instance, nextProps, nextState) { | ||
| return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState); | ||
| } | ||
| module.exports = shallowCompare; | ||
| /***/ }, | ||
| /* 6 */ | ||
| /***/ function(module, exports) { | ||
| /** | ||
| * Copyright 2013-2015, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| * | ||
| * @providesModule shallowEqual | ||
| * @typechecks | ||
| * | ||
| */ | ||
| 'use strict'; | ||
| var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
| /** | ||
| * Performs equality by iterating through keys on an object and returning false | ||
| * when any key has values which are not strictly equal between the arguments. | ||
| * Returns true when the values of all keys are strictly equal. | ||
| */ | ||
| function shallowEqual(objA, objB) { | ||
| if (objA === objB) { | ||
| return true; | ||
| } | ||
| if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { | ||
| return false; | ||
| } | ||
| var keysA = Object.keys(objA); | ||
| var keysB = Object.keys(objB); | ||
| if (keysA.length !== keysB.length) { | ||
| return false; | ||
| } | ||
| // Test for A's keys different from B. | ||
| var bHasOwnProperty = hasOwnProperty.bind(objB); | ||
| for (var i = 0; i < keysA.length; i++) { | ||
| if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
| module.exports = shallowEqual; | ||
| /***/ } | ||
| /******/ ]) | ||
| }); | ||
| ; | ||
| //# sourceMappingURL=react-height.js.map |
| {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1afef0a41a433e7db0e8","webpack:///./src/index.js","webpack:///./src/ReactHeight.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./~/react-addons-pure-render-mixin/index.js","webpack:///./~/react/lib/ReactComponentWithPureRenderMixin.js","webpack:///./~/react/lib/shallowCompare.js","webpack:///./~/fbjs/lib/shallowEqual.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,aAAY;;;AAAC;AAGb,KAAM,WAAW,GAAG,mBAAO,CAAC,CAAe,CAAC,CAAC,OAAO,CAAC;;AAErD,OAAM,CAAC,OAAO,GAAG,WAAW,C;;;;;;;;;;;;;;;;;;;;;;;;ACE5B,KAAM,WAAW,GAAG,gBAAM,WAAW,CAAC;;;AACpC,YAAS,EAAE;AACT,aAAQ,EAAE,gBAAM,SAAS,CAAC,IAAI,CAAC,UAAU;AACzC,kBAAa,EAAE,gBAAM,SAAS,CAAC,IAAI,CAAC,UAAU;AAC9C,WAAM,EAAE,gBAAM,SAAS,CAAC,IAAI;AAC5B,UAAK,EAAE,gBAAM,SAAS,CAAC,IAAI;IAC5B;;AAGD,kBAAe,6BAAG;AAChB,YAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;IACrC;AAGD,kBAAe,6BAAG;AAChB,YAAO;AACL,aAAM,EAAE,CAAC,EAAE,KAAK,EAAE,I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height.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHeight\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHeight\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 1afef0a41a433e7db0e8\n **/","'use strict';\n\n// Babel6 does not hack the default behaviour of ES Modules anymore, so we should export\nconst ReactHeight = require('./ReactHeight').default;\n\nmodule.exports = ReactHeight;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","/* eslint \"react/no-did-mount-set-state\":0, \"react/no-did-update-set-state\":0 */\n\n\nimport React from 'react';\nimport {shouldComponentUpdate} from 'react-addons-pure-render-mixin';\n\n\nconst ReactHeight = React.createClass({\n propTypes: {\n children: React.PropTypes.node.isRequired,\n onHeightReady: React.PropTypes.func.isRequired,\n hidden: React.PropTypes.bool,\n dirty: React.PropTypes.bool\n },\n\n\n getDefaultProps() {\n return {hidden: false, dirty: true};\n },\n\n\n getInitialState() {\n return {\n height: 0, dirty: this.props.dirty\n };\n },\n\n\n componentDidMount() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n },\n\n\n componentWillReceiveProps({children, dirty}) {\n if (children !== this.props.children || dirty) {\n this.setState({dirty: true});\n }\n },\n\n\n shouldComponentUpdate,\n\n\n componentDidUpdate() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n if (height === this.state.height) {\n this.setState({dirty});\n } else {\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n }\n },\n\n\n render() {\n const {onHeightReady, hidden, children, ...props} = this.props;\n const {dirty} = this.state;\n\n if (hidden && !dirty) {\n return null;\n }\n\n if (hidden) {\n return (\n <div style={{height: 0, overflow: 'hidden'}}>\n <div ref=\"wrapper\" {...props}>{children}</div>\n </div>\n );\n }\n\n return <div ref=\"wrapper\" {...props}>{children}</div>;\n }\n});\n\n\nexport default ReactHeight;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/ReactHeight.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = require('react/lib/ReactComponentWithPureRenderMixin');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react-addons-pure-render-mixin/index.js\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactComponentWithPureRenderMixin\n */\n\n'use strict';\n\nvar shallowCompare = require('./shallowCompare');\n\n/**\n * If your React component's render function is \"pure\", e.g. it will render the\n * same result given the same props and state, provide this Mixin for a\n * considerable performance boost.\n *\n * Most React components have pure render functions.\n *\n * Example:\n *\n * var ReactComponentWithPureRenderMixin =\n * require('ReactComponentWithPureRenderMixin');\n * React.createClass({\n * mixins: [ReactComponentWithPureRenderMixin],\n *\n * render: function() {\n * return <div className={this.props.className}>foo</div>;\n * }\n * });\n *\n * Note: This only checks shallow equality for props and state. If these contain\n * complex data structures this mixin may have false-negatives for deeper\n * differences. Only mixin to components which have simple props and state, or\n * use `forceUpdate()` when you know deep data structures have changed.\n */\nvar ReactComponentWithPureRenderMixin = {\n shouldComponentUpdate: function (nextProps, nextState) {\n return shallowCompare(this, nextProps, nextState);\n }\n};\n\nmodule.exports = ReactComponentWithPureRenderMixin;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react/lib/ReactComponentWithPureRenderMixin.js\n ** module id = 4\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n* @providesModule shallowCompare\n*/\n\n'use strict';\n\nvar shallowEqual = require('fbjs/lib/shallowEqual');\n\n/**\n * Does a shallow comparison for props and state.\n * See ReactComponentWithPureRenderMixin\n */\nfunction shallowCompare(instance, nextProps, nextState) {\n return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n}\n\nmodule.exports = shallowCompare;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react/lib/shallowCompare.js\n ** module id = 5\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule shallowEqual\n * @typechecks\n * \n */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n var bHasOwnProperty = hasOwnProperty.bind(objB);\n for (var i = 0; i < keysA.length; i++) {\n if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = shallowEqual;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/fbjs/lib/shallowEqual.js\n ** module id = 6\n ** module chunks = 0\n **/"],"sourceRoot":""} |
| !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactHeight=t(require("react")):e.ReactHeight=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1)["default"];e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),a=n(s),u=r(3),p=a["default"].createClass({displayName:"ReactHeight",propTypes:{children:a["default"].PropTypes.node.isRequired,onHeightReady:a["default"].PropTypes.func.isRequired,hidden:a["default"].PropTypes.bool,dirty:a["default"].PropTypes.bool},getDefaultProps:function(){return{hidden:!1,dirty:!0}},getInitialState:function(){return{height:0,dirty:this.props.dirty}},componentDidMount:function(){var e=this;if(this.refs.wrapper){var t=this.refs.wrapper.clientHeight,r=!1;this.setState({height:t,dirty:r},function(){return e.props.onHeightReady(e.state.height)})}},componentWillReceiveProps:function(e){var t=e.children,r=e.dirty;(t!==this.props.children||r)&&this.setState({dirty:!0})},shouldComponentUpdate:u.shouldComponentUpdate,componentDidUpdate:function(){var e=this;if(this.refs.wrapper){var t=this.refs.wrapper.clientHeight,r=!1;t===this.state.height?this.setState({dirty:r}):this.setState({height:t,dirty:r},function(){return e.props.onHeightReady(e.state.height)})}},render:function(){var e=this.props,t=(e.onHeightReady,e.hidden),r=e.children,n=i(e,["onHeightReady","hidden","children"]),s=this.state.dirty;return t&&!s?null:t?a["default"].createElement("div",{style:{height:0,overflow:"hidden"}},a["default"].createElement("div",o({ref:"wrapper"},n),r)):a["default"].createElement("div",o({ref:"wrapper"},n),r)}});t["default"]=p},function(t,r){t.exports=e},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";var n=r(5),i={shouldComponentUpdate:function(e,t){return n(this,e,t)}};e.exports=i},function(e,t,r){"use strict";function n(e,t,r){return!i(e.props,t)||!i(e.state,r)}var i=r(6);e.exports=n},function(e,t){"use strict";function r(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=n.bind(t),s=0;s<r.length;s++)if(!o(r[s])||e[r[s]]!==t[r[s]])return!1;return!0}var n=Object.prototype.hasOwnProperty;e.exports=r}])}); | ||
| //# sourceMappingURL=react-height.min.js.map |
| {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-height.min.js","webpack:///webpack/bootstrap 57f6157bef740ac9fce1","webpack:///./src/index.js","webpack:///./src/ReactHeight.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./~/react-addons-pure-render-mixin/index.js","webpack:///./~/react/lib/ReactComponentWithPureRenderMixin.js","webpack:///./~/react/lib/shallowCompare.js","webpack:///./~/fbjs/lib/shallowEqual.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_2__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","ReactHeight","_interopRequireDefault","obj","__esModule","default","_objectWithoutProperties","keys","target","i","indexOf","Object","prototype","hasOwnProperty","_extends","assign","arguments","length","source","key","defineProperty","value","_react","_react2","_reactAddonsPureRenderMixin","createClass","displayName","propTypes","children","PropTypes","node","isRequired","onHeightReady","func","hidden","bool","dirty","getDefaultProps","getInitialState","height","props","componentDidMount","_this","refs","wrapper","clientHeight","setState","state","componentWillReceiveProps","_ref","shouldComponentUpdate","componentDidUpdate","_this2","render","_props","createElement","style","overflow","ref","shallowCompare","ReactComponentWithPureRenderMixin","nextProps","nextState","instance","shallowEqual","objA","objB","keysA","keysB","bHasOwnProperty","bind"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,YAAAD,EAAAG,QAAA,UAEAJ,EAAA,YAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAA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A,ILmMM,SAASP,EAAQD,EAASQ,GMxLhC,YAEA,IAAAmE,GAAAnE,EAAA,GA0BAoE,GACAV,sBAAA,SAAAW,EAAAC,GACA,MAAAH,GAAAtE,KAAAwE,EAAAC,IAIA7E,GAAAD,QAAA4E,GNyMM,SAAS3E,EAAQD,EAASQ,GO3OhC,YAQA,SAAAmE,GAAAI,EAAAF,EAAAC,GACA,OAAAE,EAAAD,EAAAvB,MAAAqB,KAAAG,EAAAD,EAAAhB,MAAAe,GAPA,GAAAE,GAAAxE,EAAA,EAUAP,GAAAD,QAAA2E,GP4PM,SAAS1E,EAAQD,GQtQvB,YASA,SAAAgF,GAAAC,EAAAC,GACA,GAAAD,IAAAC,EACA,QAGA,oBAAAD,IAAA,OAAAA,GAAA,gBAAAC,IAAA,OAAAA,EACA,QAGA,IAAAC,GAAAxD,OAAAJ,KAAA0D,GACAG,EAAAzD,OAAAJ,KAAA2D,EAEA,IAAAC,EAAAlD,SAAAmD,EAAAnD,OACA,QAKA,QADAoD,GAAAxD,EAAAyD,KAAAJ,GACAzD,EAAA,EAAiBA,EAAA0D,EAAAlD,OAAkBR,IACnC,IAAA4D,EAAAF,EAAA1D,KAAAwD,EAAAE,EAAA1D,MAAAyD,EAAAC,EAAA1D,IACA,QAIA,UA/BA,GAAAI,GAAAF,OAAAC,UAAAC,cAkCA5B,GAAAD,QAAAgF","file":"react-height.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHeight\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHeight\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHeight\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHeight\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t// Babel6 does not hack the default behaviour of ES Modules anymore, so we should export\n\t\n\tvar ReactHeight = __webpack_require__(1).default;\n\t\n\tmodule.exports = ReactHeight;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _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; };\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactAddonsPureRenderMixin = __webpack_require__(3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } /* eslint \"react/no-did-mount-set-state\":0, \"react/no-did-update-set-state\":0 */\n\t\n\tvar ReactHeight = _react2.default.createClass({\n\t displayName: 'ReactHeight',\n\t\n\t propTypes: {\n\t children: _react2.default.PropTypes.node.isRequired,\n\t onHeightReady: _react2.default.PropTypes.func.isRequired,\n\t hidden: _react2.default.PropTypes.bool,\n\t dirty: _react2.default.PropTypes.bool\n\t },\n\t\n\t getDefaultProps: function getDefaultProps() {\n\t return { hidden: false, dirty: true };\n\t },\n\t getInitialState: function getInitialState() {\n\t return {\n\t height: 0, dirty: this.props.dirty\n\t };\n\t },\n\t componentDidMount: function componentDidMount() {\n\t var _this = this;\n\t\n\t if (!this.refs.wrapper) {\n\t return;\n\t }\n\t var height = this.refs.wrapper.clientHeight;\n\t var dirty = false;\n\t\n\t this.setState({ height: height, dirty: dirty }, function () {\n\t return _this.props.onHeightReady(_this.state.height);\n\t });\n\t },\n\t componentWillReceiveProps: function componentWillReceiveProps(_ref) {\n\t var children = _ref.children;\n\t var dirty = _ref.dirty;\n\t\n\t if (children !== this.props.children || dirty) {\n\t this.setState({ dirty: true });\n\t }\n\t },\n\t\n\t shouldComponentUpdate: _reactAddonsPureRenderMixin.shouldComponentUpdate,\n\t\n\t componentDidUpdate: function componentDidUpdate() {\n\t var _this2 = this;\n\t\n\t if (!this.refs.wrapper) {\n\t return;\n\t }\n\t var height = this.refs.wrapper.clientHeight;\n\t var dirty = false;\n\t\n\t if (height === this.state.height) {\n\t this.setState({ dirty: dirty });\n\t } else {\n\t this.setState({ height: height, dirty: dirty }, function () {\n\t return _this2.props.onHeightReady(_this2.state.height);\n\t });\n\t }\n\t },\n\t render: function render() {\n\t var _props = this.props;\n\t var onHeightReady = _props.onHeightReady;\n\t var hidden = _props.hidden;\n\t var children = _props.children;\n\t\n\t var props = _objectWithoutProperties(_props, ['onHeightReady', 'hidden', 'children']);\n\t\n\t var dirty = this.state.dirty;\n\t\n\t if (hidden && !dirty) {\n\t return null;\n\t }\n\t\n\t if (hidden) {\n\t return _react2.default.createElement(\n\t 'div',\n\t { style: { height: 0, overflow: 'hidden' } },\n\t _react2.default.createElement(\n\t 'div',\n\t _extends({ ref: 'wrapper' }, props),\n\t children\n\t )\n\t );\n\t }\n\t\n\t return _react2.default.createElement(\n\t 'div',\n\t _extends({ ref: 'wrapper' }, props),\n\t children\n\t );\n\t }\n\t});\n\t\n\texports.default = ReactHeight;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(4);\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright 2013-2015, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t * @providesModule ReactComponentWithPureRenderMixin\n\t */\n\t\n\t'use strict';\n\t\n\tvar shallowCompare = __webpack_require__(5);\n\t\n\t/**\n\t * If your React component's render function is \"pure\", e.g. it will render the\n\t * same result given the same props and state, provide this Mixin for a\n\t * considerable performance boost.\n\t *\n\t * Most React components have pure render functions.\n\t *\n\t * Example:\n\t *\n\t * var ReactComponentWithPureRenderMixin =\n\t * require('ReactComponentWithPureRenderMixin');\n\t * React.createClass({\n\t * mixins: [ReactComponentWithPureRenderMixin],\n\t *\n\t * render: function() {\n\t * return <div className={this.props.className}>foo</div>;\n\t * }\n\t * });\n\t *\n\t * Note: This only checks shallow equality for props and state. If these contain\n\t * complex data structures this mixin may have false-negatives for deeper\n\t * differences. Only mixin to components which have simple props and state, or\n\t * use `forceUpdate()` when you know deep data structures have changed.\n\t */\n\tvar ReactComponentWithPureRenderMixin = {\n\t shouldComponentUpdate: function (nextProps, nextState) {\n\t return shallowCompare(this, nextProps, nextState);\n\t }\n\t};\n\t\n\tmodule.exports = ReactComponentWithPureRenderMixin;\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright 2013-2015, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t* @providesModule shallowCompare\n\t*/\n\t\n\t'use strict';\n\t\n\tvar shallowEqual = __webpack_require__(6);\n\t\n\t/**\n\t * Does a shallow comparison for props and state.\n\t * See ReactComponentWithPureRenderMixin\n\t */\n\tfunction shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}\n\t\n\tmodule.exports = shallowCompare;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Copyright 2013-2015, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t * @providesModule shallowEqual\n\t * @typechecks\n\t * \n\t */\n\t\n\t'use strict';\n\t\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\t\n\t/**\n\t * Performs equality by iterating through keys on an object and returning false\n\t * when any key has values which are not strictly equal between the arguments.\n\t * Returns true when the values of all keys are strictly equal.\n\t */\n\tfunction shallowEqual(objA, objB) {\n\t if (objA === objB) {\n\t return true;\n\t }\n\t\n\t if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n\t return false;\n\t }\n\t\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t\n\t if (keysA.length !== keysB.length) {\n\t return false;\n\t }\n\t\n\t // Test for A's keys different from B.\n\t var bHasOwnProperty = hasOwnProperty.bind(objB);\n\t for (var i = 0; i < keysA.length; i++) {\n\t if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tmodule.exports = shallowEqual;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-height.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 57f6157bef740ac9fce1\n **/","'use strict';\n\n// Babel6 does not hack the default behaviour of ES Modules anymore, so we should export\nconst ReactHeight = require('./ReactHeight').default;\n\nmodule.exports = ReactHeight;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","/* eslint \"react/no-did-mount-set-state\":0, \"react/no-did-update-set-state\":0 */\n\n\nimport React from 'react';\nimport {shouldComponentUpdate} from 'react-addons-pure-render-mixin';\n\n\nconst ReactHeight = React.createClass({\n propTypes: {\n children: React.PropTypes.node.isRequired,\n onHeightReady: React.PropTypes.func.isRequired,\n hidden: React.PropTypes.bool,\n dirty: React.PropTypes.bool\n },\n\n\n getDefaultProps() {\n return {hidden: false, dirty: true};\n },\n\n\n getInitialState() {\n return {\n height: 0, dirty: this.props.dirty\n };\n },\n\n\n componentDidMount() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n },\n\n\n componentWillReceiveProps({children, dirty}) {\n if (children !== this.props.children || dirty) {\n this.setState({dirty: true});\n }\n },\n\n\n shouldComponentUpdate,\n\n\n componentDidUpdate() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n if (height === this.state.height) {\n this.setState({dirty});\n } else {\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n }\n },\n\n\n render() {\n const {onHeightReady, hidden, children, ...props} = this.props;\n const {dirty} = this.state;\n\n if (hidden && !dirty) {\n return null;\n }\n\n if (hidden) {\n return (\n <div style={{height: 0, overflow: 'hidden'}}>\n <div ref=\"wrapper\" {...props}>{children}</div>\n </div>\n );\n }\n\n return <div ref=\"wrapper\" {...props}>{children}</div>;\n }\n});\n\n\nexport default ReactHeight;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/ReactHeight.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = require('react/lib/ReactComponentWithPureRenderMixin');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react-addons-pure-render-mixin/index.js\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ReactComponentWithPureRenderMixin\n */\n\n'use strict';\n\nvar shallowCompare = require('./shallowCompare');\n\n/**\n * If your React component's render function is \"pure\", e.g. it will render the\n * same result given the same props and state, provide this Mixin for a\n * considerable performance boost.\n *\n * Most React components have pure render functions.\n *\n * Example:\n *\n * var ReactComponentWithPureRenderMixin =\n * require('ReactComponentWithPureRenderMixin');\n * React.createClass({\n * mixins: [ReactComponentWithPureRenderMixin],\n *\n * render: function() {\n * return <div className={this.props.className}>foo</div>;\n * }\n * });\n *\n * Note: This only checks shallow equality for props and state. If these contain\n * complex data structures this mixin may have false-negatives for deeper\n * differences. Only mixin to components which have simple props and state, or\n * use `forceUpdate()` when you know deep data structures have changed.\n */\nvar ReactComponentWithPureRenderMixin = {\n shouldComponentUpdate: function (nextProps, nextState) {\n return shallowCompare(this, nextProps, nextState);\n }\n};\n\nmodule.exports = ReactComponentWithPureRenderMixin;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react/lib/ReactComponentWithPureRenderMixin.js\n ** module id = 4\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n* @providesModule shallowCompare\n*/\n\n'use strict';\n\nvar shallowEqual = require('fbjs/lib/shallowEqual');\n\n/**\n * Does a shallow comparison for props and state.\n * See ReactComponentWithPureRenderMixin\n */\nfunction shallowCompare(instance, nextProps, nextState) {\n return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n}\n\nmodule.exports = shallowCompare;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react/lib/shallowCompare.js\n ** module id = 5\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule shallowEqual\n * @typechecks\n * \n */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n var bHasOwnProperty = hasOwnProperty.bind(objB);\n for (var i = 0; i < keysA.length; i++) {\n if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = shallowEqual;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/fbjs/lib/shallowEqual.js\n ** module id = 6\n ** module chunks = 0\n **/"],"sourceRoot":""} |
+3
-10
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { | ||
| value: true | ||
| }); | ||
| // Babel6 does not hack the default behaviour of ES Modules anymore, so we should export | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
| var ReactHeight = require('./ReactHeight').default; | ||
| var _ReactHeight = require('./ReactHeight'); | ||
| var _ReactHeight2 = _interopRequireDefault(_ReactHeight); | ||
| exports['default'] = _ReactHeight2['default']; | ||
| module.exports = exports['default']; | ||
| module.exports = ReactHeight; | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;2BAAwB,eAAe","file":"index.js","sourcesContent":["import ReactHeight from './ReactHeight';\n\n\nexport default ReactHeight;\n"]} | ||
| {"version":3,"sources":["../src/index.js"],"names":[],"mappings":"AAAA,YAAY;;;AAAC;AAGb,IAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC;;AAErD,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC","file":"index.js","sourcesContent":["'use strict';\n\n// Babel6 does not hack the default behaviour of ES Modules anymore, so we should export\nconst ReactHeight = require('./ReactHeight').default;\n\nmodule.exports = ReactHeight;\n"]} |
+19
-26
@@ -1,15 +0,9 @@ | ||
| /* eslint "react/no-did-mount-set-state":0, "react/no-did-update-set-state":0 */ | ||
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { | ||
| var _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; }; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| var _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; }; | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
| function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
| var _react = require('react'); | ||
@@ -21,10 +15,14 @@ | ||
| var ReactHeight = _react2['default'].createClass({ | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } /* eslint "react/no-did-mount-set-state":0, "react/no-did-update-set-state":0 */ | ||
| var ReactHeight = _react2.default.createClass({ | ||
| displayName: 'ReactHeight', | ||
| propTypes: { | ||
| children: _react2['default'].PropTypes.node.isRequired, | ||
| onHeightReady: _react2['default'].PropTypes.func.isRequired, | ||
| hidden: _react2['default'].PropTypes.bool, | ||
| dirty: _react2['default'].PropTypes.bool | ||
| children: _react2.default.PropTypes.node.isRequired, | ||
| onHeightReady: _react2.default.PropTypes.func.isRequired, | ||
| hidden: _react2.default.PropTypes.bool, | ||
| dirty: _react2.default.PropTypes.bool | ||
| }, | ||
@@ -35,3 +33,2 @@ | ||
| }, | ||
| getInitialState: function getInitialState() { | ||
@@ -42,3 +39,2 @@ return { | ||
| }, | ||
| componentDidMount: function componentDidMount() { | ||
@@ -57,3 +53,2 @@ var _this = this; | ||
| }, | ||
| componentWillReceiveProps: function componentWillReceiveProps(_ref) { | ||
@@ -79,11 +74,10 @@ var children = _ref.children; | ||
| if (height !== this.state.height) { | ||
| if (height === this.state.height) { | ||
| this.setState({ dirty: dirty }); | ||
| } else { | ||
| this.setState({ height: height, dirty: dirty }, function () { | ||
| return _this2.props.onHeightReady(_this2.state.height); | ||
| }); | ||
| } else { | ||
| this.setState({ dirty: dirty }); | ||
| } | ||
| }, | ||
| render: function render() { | ||
@@ -104,6 +98,6 @@ var _props = this.props; | ||
| if (hidden) { | ||
| return _react2['default'].createElement( | ||
| return _react2.default.createElement( | ||
| 'div', | ||
| { style: { height: 0, overflow: 'hidden' } }, | ||
| _react2['default'].createElement( | ||
| _react2.default.createElement( | ||
| 'div', | ||
@@ -116,3 +110,3 @@ _extends({ ref: 'wrapper' }, props), | ||
| return _react2['default'].createElement( | ||
| return _react2.default.createElement( | ||
| 'div', | ||
@@ -125,4 +119,3 @@ _extends({ ref: 'wrapper' }, props), | ||
| exports['default'] = ReactHeight; | ||
| module.exports = exports['default']; | ||
| exports.default = ReactHeight; | ||
| //# sourceMappingURL=ReactHeight.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/ReactHeight.js"],"names":[],"mappings":";;;;;;;;;;;;;;qBAGkB,OAAO;;;;0CACW,gCAAgC;;AAGpE,IAAM,WAAW,GAAG,mBAAM,WAAW,CAAC;;;AACpC,WAAS,EAAE;AACT,YAAQ,EAAE,mBAAM,SAAS,CAAC,IAAI,CAAC,UAAU;AACzC,iBAAa,EAAE,mBAAM,SAAS,CAAC,IAAI,CAAC,UAAU;AAC9C,UAAM,EAAE,mBAAM,SAAS,CAAC,IAAI;AAC5B,SAAK,EAAE,mBAAM,SAAS,CAAC,IAAI;GAC5B;;AAGD,iBAAe,EAAA,2BAAG;AAChB,WAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;GACrC;;AAGD,iBAAe,EAAA,2BAAG;AAChB,WAAO;AACL,YAAM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;KACnC,CAAC;GACH;;AAGD,mBAAiB,EAAA,6BAAG;;;AAClB,QAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACtB,aAAO;KACR;AACD,QAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;AAC9C,QAAM,KAAK,GAAG,KAAK,CAAC;;AAEpB,QAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAN,MAAM,EAAE,KAAK,EAAL,KAAK,EAAC,EAAE;aAAM,MAAK,KAAK,CAAC,aAAa,CAAC,MAAK,KAAK,CAAC,MAAM,CA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AQ,EAAE,QAAQ,EAAC,AAAC;QAC1C;;qBAAK,GAAG,EAAC,SAAS,IAAK,KAAK;UAAG,QAAQ;SAAO;OAC1C,CACN;KACH;;AAED,WAAO;;iBAAK,GAAG,EAAC,SAAS,IAAK,KAAK;MAAG,QAAQ;KAAO,CAAC;GACvD;CACF,CAAC,CAAC;;qBAGY,WAAW","file":"ReactHeight.js","sourcesContent":["/* eslint \"react/no-did-mount-set-state\":0, \"react/no-did-update-set-state\":0 */\n\n\nimport React from 'react';\nimport {shouldComponentUpdate} from 'react-addons-pure-render-mixin';\n\n\nconst ReactHeight = React.createClass({\n propTypes: {\n children: React.PropTypes.node.isRequired,\n onHeightReady: React.PropTypes.func.isRequired,\n hidden: React.PropTypes.bool,\n dirty: React.PropTypes.bool\n },\n\n\n getDefaultProps() {\n return {hidden: false, dirty: true};\n },\n\n\n getInitialState() {\n return {\n height: 0, dirty: this.props.dirty\n };\n },\n\n\n componentDidMount() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n },\n\n\n componentWillReceiveProps({children, dirty}) {\n if (children !== this.props.children || dirty) {\n this.setState({dirty: true});\n }\n },\n\n\n shouldComponentUpdate,\n\n\n componentDidUpdate() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n if (height !== this.state.height) {\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n } else {\n this.setState({dirty});\n }\n },\n\n\n render() {\n const {onHeightReady, hidden, children, ...props} = this.props;\n const {dirty} = this.state;\n\n if (hidden && !dirty) {\n return null;\n }\n\n if (hidden) {\n return (\n <div style={{height: 0, overflow: 'hidden'}}>\n <div ref=\"wrapper\" {...props}>{children}</div>\n </div>\n );\n }\n\n return <div ref=\"wrapper\" {...props}>{children}</div>;\n }\n});\n\n\nexport default ReactHeight;\n"]} | ||
| {"version":3,"sources":["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;AACnB,QAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACtB,aAAO;KACR;AACD,QAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;AAC9C,QAAM,KAAK,GAAG,KAAK,CAAC;;AAEpB,QAAI,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AAChC,UAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAL,KAAK,EAAC,CAAC,CAAC;KACxB,MAAM;AACL,UAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAN,MAAM,EAAE,KAAK,EAAL,KAAK,EAAC,EAAE;eAAM,OAAK,KAAK,CAAC,aAAa,CAAC,OAAK,KAAK,CAAC,MAAM,CAAC;OAAA,CAAC,CAAC;KACnF;GACF;AAGD,QAAM,oBAAG;iBAC6C,IAAI,CAAC,KAAK;QAAvD,aAAa,UAAb,aAAa;QAAE,MAAM,UAAN,MAAM;QAAE,QAAQ,UAAR,QAAQ;;QAAK,KAAK;;QACzC,KAAK,GAAI,IAAI,CAAC,KAAK,CAAnB,KAAK;;AAEZ,QAAI,MAAM,IAAI,CAAC,KAAK,EAAE;AACpB,aAAO,IAAI,CAAC;KACb;;AAED,QAAI,MAAM,EAAE;AACV,aACE;;UAAK,KAAK,EAAE,EAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAC,AAAC;QAC1C;;qBAAK,GAAG,EAAC,SAAS,IAAK,KAAK;UAAG,QAAQ;SAAO;OAC1C,CACN;KACH;;AAED,WAAO;;iBAAK,GAAG,EAAC,SAAS,IAAK,KAAK;MAAG,QAAQ;KAAO,CAAC;GACvD;CACF,CAAC,CAAC;;kBAGY,WAAW","file":"ReactHeight.js","sourcesContent":["/* eslint \"react/no-did-mount-set-state\":0, \"react/no-did-update-set-state\":0 */\n\n\nimport React from 'react';\nimport {shouldComponentUpdate} from 'react-addons-pure-render-mixin';\n\n\nconst ReactHeight = React.createClass({\n propTypes: {\n children: React.PropTypes.node.isRequired,\n onHeightReady: React.PropTypes.func.isRequired,\n hidden: React.PropTypes.bool,\n dirty: React.PropTypes.bool\n },\n\n\n getDefaultProps() {\n return {hidden: false, dirty: true};\n },\n\n\n getInitialState() {\n return {\n height: 0, dirty: this.props.dirty\n };\n },\n\n\n componentDidMount() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n },\n\n\n componentWillReceiveProps({children, dirty}) {\n if (children !== this.props.children || dirty) {\n this.setState({dirty: true});\n }\n },\n\n\n shouldComponentUpdate,\n\n\n componentDidUpdate() {\n if (!this.refs.wrapper) {\n return;\n }\n const height = this.refs.wrapper.clientHeight;\n const dirty = false;\n\n if (height === this.state.height) {\n this.setState({dirty});\n } else {\n this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height));\n }\n },\n\n\n render() {\n const {onHeightReady, hidden, children, ...props} = this.props;\n const {dirty} = this.state;\n\n if (hidden && !dirty) {\n return null;\n }\n\n if (hidden) {\n return (\n <div style={{height: 0, overflow: 'hidden'}}>\n <div ref=\"wrapper\" {...props}>{children}</div>\n </div>\n );\n }\n\n return <div ref=\"wrapper\" {...props}>{children}</div>;\n }\n});\n\n\nexport default ReactHeight;\n"]} |
+46
-48
| { | ||
| "name": "react-height", | ||
| "version": "1.1.0", | ||
| "version": "2.0.0", | ||
| "description": "Component-wrapper to determine and report children elements height", | ||
@@ -9,30 +9,19 @@ "main": "lib/index.js", | ||
| "gh-pages": "git checkout gh-pages && git rebase origin/master --force-rebase && npm run build && git add . && git commit --amend --no-edit && git push --force && git checkout master", | ||
| "build": "parallelshell -w \"npm run build:lib -s\" \"npm run build:example -s\" \"npm run build:bower -s\"", | ||
| "build": "parallelshell -w \"npm run build:lib -s\" \"npm run build:ghPages -s\" \"npm run build:dist -s\" \"npm run build:min -s\"", | ||
| "prebuild": "rimraf lib example build", | ||
| "build:lib": "babel src --out-dir lib --source-maps --ignore src/example", | ||
| "build:example": "webpack --config webpack.config.js", | ||
| "build:bower": "webpack --config webpack.config.bower.js", | ||
| "prepublish": "npm run build -s", | ||
| "start": "webpack-dev-server --config webpack.config.development.js", | ||
| "test": "babel-node node_modules/tape/bin/tape test/**/*-test.js", | ||
| "test:dev": "babel-node node_modules/tape/bin/tape test/**/*-test.js | tap-nyan", | ||
| "test:cov": "babel-node node_modules/isparta/bin/isparta cover --report text --report html --dir reports/coverage --include \"**/!(*-test).js\" test", | ||
| "test:e2e": "node scripts/test-e2e.js", | ||
| "build:lib": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps --ignore src/example", | ||
| "build:ghPages": "cross-env NODE_ENV=production BUILD=ghPages webpack", | ||
| "build:dist": "cross-env NODE_ENV=production BUILD=dist webpack", | ||
| "build:min": "cross-env NODE_ENV=production BUILD=min webpack", | ||
| "prepublish": "parallelshell -w \"npm run build:lib -s\" \"npm run build:dist -s\" \"npm run build:min -s\"", | ||
| "start": "cross-env NODE_ENV=development webpack-dev-server", | ||
| "test": "cross-env NODE_ENV=test babel-node test", | ||
| "test:dev": "cross-env NODE_ENV=test babel-node test | tap-nyan", | ||
| "test:cov": "cross-env NODE_ENV=test babel-node node_modules/isparta/bin/isparta cover --report text --report html --report lcov --dir reports/coverage test", | ||
| "test:e2e": "cross-env NODE_ENV=development nightwatch-autorun", | ||
| "lint": "eslint --cache .", | ||
| "coveralls": "minicat reports/coverage/lcov.info | coveralls", | ||
| "precommit": "npm run lint -s", | ||
| "prepush": "npm run test -s && npm run test:e2e -s", | ||
| "postversion": "git push --follow-tags", | ||
| "bower:create-repo": "./scripts/create-repo.sh", | ||
| "bower:publish": "./scripts/publish.sh", | ||
| "bower:register": "./scripts/register.sh" | ||
| "postversion": "git push --follow-tags" | ||
| }, | ||
| "engines": { | ||
| "node": ">=0.10" | ||
| }, | ||
| "os": [ | ||
| "darwin", | ||
| "linux", | ||
| "win32" | ||
| ], | ||
| "repository": { | ||
@@ -56,3 +45,3 @@ "type": "git", | ||
| "peerDependencies": { | ||
| "react": "^0.13 || ^0.14" | ||
| "react": "^0.14" | ||
| }, | ||
@@ -63,29 +52,38 @@ "dependencies": { | ||
| "devDependencies": { | ||
| "babel": "^5.8.23", | ||
| "babel-core": "^5.8.25", | ||
| "babel-eslint": "^4.1.3", | ||
| "babel-loader": "^5.3.2", | ||
| "coveralls": "^2.11.4", | ||
| "eslint": "^1.7.3", | ||
| "eslint-loader": "^1.1.0", | ||
| "eslint-plugin-react": "^3.6.3", | ||
| "glob": "^5.0.15", | ||
| "html-webpack-plugin": "^1.6.2", | ||
| "husky": "^0.10.1", | ||
| "isparta": "^3.1.0", | ||
| "babel-cli": "^6.4.0", | ||
| "babel-core": "^6.4.0", | ||
| "babel-eslint": "^5.0.0-beta6", | ||
| "babel-loader": "^6.2.1", | ||
| "babel-plugin-react-transform": "^2.0.0", | ||
| "babel-plugin-transform-object-rest-spread": "^6.3.13", | ||
| "babel-plugin-webpack-loaders": "^0.1.1", | ||
| "babel-preset-es2015": "^6.3.13", | ||
| "babel-preset-react": "^6.3.13", | ||
| "codecov.io": "^0.1.6", | ||
| "cross-env": "^1.0.7", | ||
| "css-loader": "^0.23.1", | ||
| "eslint": "^1.10.3", | ||
| "eslint-loader": "^1.2.0", | ||
| "eslint-plugin-react": "^3.14.0", | ||
| "glob": "^6.0.4", | ||
| "html-webpack-plugin": "^1.7.0", | ||
| "husky": "^0.10.2", | ||
| "isparta": "^4.0.0", | ||
| "json-loader": "^0.5.4", | ||
| "nightwatch-autorun": "^2.0.1", | ||
| "minicat": "^1.0.0", | ||
| "nightwatch": "^0.8.6", | ||
| "node-libs-browser": "^0.5.3", | ||
| "parallelshell": "^2.0.0", | ||
| "react": "^0.14.0", | ||
| "react-dom": "^0.14.0", | ||
| "react-hot-loader": "^1.3.0", | ||
| "rimraf": "^2.4.3", | ||
| "selenium-standalone": "^4.7.1", | ||
| "react": "^0.14.6", | ||
| "react-dom": "^0.14.6", | ||
| "react-transform-catch-errors": "^1.0.1", | ||
| "react-transform-hmr": "^1.0.1", | ||
| "redbox-react": "^1.2.0", | ||
| "rimraf": "^2.5.0", | ||
| "sinon": "^1.17.2", | ||
| "tap-nyan": "0.0.2", | ||
| "tap-xunit": "^1.2.1", | ||
| "tape": "^4.2.2", | ||
| "webpack": "^1.12.2", | ||
| "webpack-dev-server": "^1.12.1" | ||
| "tap-xunit": "^1.3.1", | ||
| "tape": "^4.4.0", | ||
| "webpack": "^1.12.10", | ||
| "webpack-dev-server": "^1.14.0" | ||
| } | ||
| } |
+48
-9
@@ -5,6 +5,7 @@ # react-height | ||
| [](https://circleci.com/gh/nkbt/react-height) | ||
| [](https://coveralls.io/r/nkbt/react-height?branch=master) | ||
| [](https://david-dm.org/nkbt/react-height) | ||
| [](https://david-dm.org/nkbt/react-height#info=devDependencies) | ||
| [](https://circleci.com/gh/nkbt/react-component-template) | ||
| [](https://ci.appveyor.com/project/nkbt/react-height) | ||
| [](https://codecov.io/github/nkbt/react-component-template?branch=master) | ||
| [](https://david-dm.org/nkbt/react-component-template) | ||
| [](https://david-dm.org/nkbt/react-component-template#info=devDependencies) | ||
@@ -19,3 +20,3 @@ Component-wrapper to determine and report children elements height | ||
| ### npm | ||
| ### NPM | ||
@@ -26,8 +27,31 @@ ```sh | ||
| ### bower | ||
| ```js | ||
| bower install --save react-height | ||
| ### Bower: | ||
| ```sh | ||
| bower install --save https://npmcdn.com/react-height/bower.zip | ||
| ``` | ||
| or in `bower.json` | ||
| ```json | ||
| { | ||
| "dependencies": { | ||
| "react-height": "https://npmcdn.com/react-height/bower.zip" | ||
| } | ||
| } | ||
| ``` | ||
| then include as | ||
| ```html | ||
| <script src="bower_components/react-height/build/react-height.js"></script> | ||
| ``` | ||
| ### 1998 Script Tag: | ||
| ```html | ||
| <script src="https://npmcdn.com/react-height/build/react-height.js"></script> | ||
| (Module exposed as `ReactHeight`) | ||
| ``` | ||
| ## Demo | ||
@@ -102,4 +126,7 @@ | ||
| To run example covering `ReactHeight` features, use `npm start`, which will compile `src/example/Example.js` | ||
| Currently is being developed and tested with the latest stable `Node 5` on `OSX` and `Windows`. | ||
| Should be ok with Node 4, but not guaranteed. | ||
| To run example covering all `ReactHeight` features, use `npm start`, which will compile `src/example/Example.js` | ||
| ```bash | ||
@@ -115,4 +142,16 @@ git clone git@github.com:nkbt/react-height.git | ||
| ## Tests | ||
| ```bash | ||
| npm test | ||
| # to run tests in watch mode for development | ||
| npm run test:dev | ||
| # to generate test coverage (./reports/coverage) | ||
| npm run test:cov | ||
| ``` | ||
| ## License | ||
| MIT |
+4
-2
@@ -1,4 +0,6 @@ | ||
| import ReactHeight from './ReactHeight'; | ||
| 'use strict'; | ||
| // Babel6 does not hack the default behaviour of ES Modules anymore, so we should export | ||
| const ReactHeight = require('./ReactHeight').default; | ||
| export default ReactHeight; | ||
| module.exports = ReactHeight; |
@@ -57,6 +57,6 @@ /* eslint "react/no-did-mount-set-state":0, "react/no-did-update-set-state":0 */ | ||
| if (height !== this.state.height) { | ||
| if (height === this.state.height) { | ||
| this.setState({dirty}); | ||
| } else { | ||
| this.setState({height, dirty}, () => this.props.onHeightReady(this.state.height)); | ||
| } else { | ||
| this.setState({dirty}); | ||
| } | ||
@@ -63,0 +63,0 @@ }, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
66375
299.7%14
55.56%477
192.64%153
34.21%35
34.62%1
Infinity%1
Infinity%1
Infinity%