@trendmicro/react-navs
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -1,2 +0,2 @@ | ||
/*! react-navs v0.11.1 | (c) 2018 Trend Micro Inc. | MIT | https://github.com/trendmicro-frontend/react-navs */ | ||
/*! react-navs v0.11.2 | (c) 2018 Trend Micro Inc. | MIT | https://github.com/trendmicro-frontend/react-navs */ | ||
module.exports = | ||
@@ -72,3 +72,3 @@ /******/ (function(modules) { // webpackBootstrap | ||
module.exports = require("prop-types"); | ||
module.exports = require("classnames"); | ||
@@ -79,3 +79,3 @@ /***/ }), | ||
module.exports = require("classnames"); | ||
module.exports = require("prop-types"); | ||
@@ -93,3 +93,3 @@ /***/ }), | ||
// removed by extract-text-webpack-plugin | ||
module.exports = {"caret":"navs---caret---3CkEt","nav":"navs---nav---1zbOb","nav-tabs":"navs---nav-tabs---3lUn4","navTabs":"navs---nav-tabs---3lUn4","nav-light-tabs":"navs---nav-light-tabs---2sgeU","navLightTabs":"navs---nav-light-tabs---2sgeU","nav-panel-tabs":"navs---nav-panel-tabs---3rU6S","navPanelTabs":"navs---nav-panel-tabs---3rU6S","dropup":"navs---dropup---30DnN","navbar-nav":"navs---navbar-nav---31TRb","navbarNav":"navs---navbar-nav---31TRb","disabled":"navs---disabled---eCY9b","open":"navs---open---1ju75","nav-divider":"navs---nav-divider---3l4ju","navDivider":"navs---nav-divider---3l4ju","navbar-default":"navs---navbar-default---3rqTh","navbarDefault":"navs---navbar-default---3rqTh","active":"navs---active---2-a32","nav-justified":"navs---nav-justified---10iqz","navJustified":"navs---nav-justified---10iqz","nav-stacked":"navs---nav-stacked---32oCw","navStacked":"navs---nav-stacked---32oCw"}; | ||
module.exports = {"caret":"navs---caret---3CkEt","nav":"navs---nav---1zbOb","nav-tabs":"navs---nav-tabs---3lUn4","navTabs":"navs---nav-tabs---3lUn4","nav-light-tabs":"navs---nav-light-tabs---2sgeU","navLightTabs":"navs---nav-light-tabs---2sgeU","nav-panel-tabs":"navs---nav-panel-tabs---3rU6S","navPanelTabs":"navs---nav-panel-tabs---3rU6S","dropup":"navs---dropup---30DnN","navbar-nav":"navs---navbar-nav---31TRb","navbarNav":"navs---navbar-nav---31TRb","disabled":"navs---disabled---eCY9b","open":"navs---open---1ju75","nav-divider":"navs---nav-divider---3l4ju","navDivider":"navs---nav-divider---3l4ju","navbar-default":"navs---navbar-default---3rqTh","navbarDefault":"navs---navbar-default---3rqTh","active":"navs---active---2-a32","nav-justified":"navs---nav-justified---10iqz","navJustified":"navs---nav-justified---10iqz","nav-stacked":"navs---nav-stacked---32oCw","navStacked":"navs---nav-stacked---32oCw","tab-content":"navs---tab-content---2VBNa","tabContent":"navs---tab-content---2VBNa","tab-pane":"navs---tab-pane---2dbBX","tabPane":"navs---tab-pane---2dbBX"}; | ||
@@ -123,22 +123,52 @@ /***/ }), | ||
var _propTypes = __webpack_require__(0); | ||
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; }; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = __webpack_require__(1); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _classnames = __webpack_require__(0); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _index = __webpack_require__(3); | ||
var _index2 = _interopRequireDefault(_index); | ||
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 TabPane = function TabPane(_ref) { | ||
var _cx; | ||
var active = _ref.active, | ||
children = _ref.children; | ||
lazy = _ref.lazy, | ||
eventKey = _ref.eventKey, | ||
className = _ref.className, | ||
props = _objectWithoutProperties(_ref, ['active', 'lazy', 'eventKey', 'className']); | ||
if (!active) { | ||
if (!active && lazy) { | ||
return null; | ||
} | ||
return children; | ||
return _react2.default.createElement('div', _extends({}, props, { | ||
className: (0, _classnames2.default)(className, _index2.default.tabPane, (_cx = {}, _cx[_index2.default.active] = active, _cx)) | ||
})); | ||
}; | ||
TabPane.propTypes = { | ||
active: _propTypes2.default.bool | ||
active: _propTypes2.default.bool, | ||
eventKey: _propTypes2.default.any, | ||
lazy: _propTypes2.default.bool | ||
}; | ||
TabPane.defaultProps = { | ||
active: false, | ||
lazy: false | ||
}; | ||
exports.default = TabPane; | ||
@@ -210,7 +240,7 @@ | ||
var _classnames = __webpack_require__(1); | ||
var _classnames = __webpack_require__(0); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _propTypes = __webpack_require__(0); | ||
var _propTypes = __webpack_require__(1); | ||
@@ -359,7 +389,7 @@ var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _classnames = __webpack_require__(1); | ||
var _classnames = __webpack_require__(0); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _propTypes = __webpack_require__(0); | ||
var _propTypes = __webpack_require__(1); | ||
@@ -499,7 +529,7 @@ var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _classnames = __webpack_require__(1); | ||
var _classnames = __webpack_require__(0); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _propTypes = __webpack_require__(0); | ||
var _propTypes = __webpack_require__(1); | ||
@@ -690,7 +720,7 @@ var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _classnames = __webpack_require__(1); | ||
var _classnames = __webpack_require__(0); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _propTypes = __webpack_require__(0); | ||
var _propTypes = __webpack_require__(1); | ||
@@ -745,2 +775,3 @@ var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var active = child.props.eventKey === activeKey; | ||
return (0, _react.cloneElement)(child, { | ||
@@ -747,0 +778,0 @@ active: active |
{ | ||
"name": "@trendmicro/react-navs", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Trend Micro Components: React Navs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -31,3 +31,3 @@ # react-navs [![build status](https://travis-ci.org/trendmicro-frontend/react-navs.svg?branch=master)](https://travis-ci.org/trendmicro-frontend/react-navs) [![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-navs/badge.svg?branch=master)](https://coveralls.io/github/trendmicro-frontend/react-navs?branch=master) | ||
import '@trendmicro/react-navs/dist/react-navs.css'; | ||
// [Optional] Include react-dropdown.css when using NavDropdown | ||
@@ -198,9 +198,10 @@ import '@trendmicro/react-dropdown/dist/react-dropdown.css' | ||
#### TabPane | ||
Name | Type | Default | Description | ||
:--- | :--- | :------ | :---------- | ||
eventKey | any | | | ||
Name | Type | Default | Description | ||
---------|---------|---------|------------ | ||
eventKey | any | | | ||
lazy | boolean | false | If `true`, the TabPane will be unmounted when inactive. | ||
## License | ||
MIT |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91033
955
206