mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-01-25 22:24:26 +00:00
5962 lines
169 KiB
JavaScript
Executable File
5962 lines
169 KiB
JavaScript
Executable File
(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["ReactBootstrap"] = factory(require("react"));
|
||
else
|
||
root["ReactBootstrap"] = factory(root["React"]);
|
||
})(this, function(__WEBPACK_EXTERNAL_MODULE_51__) {
|
||
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";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var Accordion = _interopRequire(__webpack_require__(1));
|
||
|
||
var Affix = _interopRequire(__webpack_require__(2));
|
||
|
||
var AffixMixin = _interopRequire(__webpack_require__(3));
|
||
|
||
var Alert = _interopRequire(__webpack_require__(4));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Badge = _interopRequire(__webpack_require__(6));
|
||
|
||
var Button = _interopRequire(__webpack_require__(7));
|
||
|
||
var ButtonGroup = _interopRequire(__webpack_require__(8));
|
||
|
||
var ButtonToolbar = _interopRequire(__webpack_require__(9));
|
||
|
||
var CollapsableNav = _interopRequire(__webpack_require__(10));
|
||
|
||
var Carousel = _interopRequire(__webpack_require__(11));
|
||
|
||
var CarouselItem = _interopRequire(__webpack_require__(12));
|
||
|
||
var Col = _interopRequire(__webpack_require__(13));
|
||
|
||
var CollapsableMixin = _interopRequire(__webpack_require__(14));
|
||
|
||
var DropdownButton = _interopRequire(__webpack_require__(15));
|
||
|
||
var DropdownMenu = _interopRequire(__webpack_require__(16));
|
||
|
||
var DropdownStateMixin = _interopRequire(__webpack_require__(17));
|
||
|
||
var FadeMixin = _interopRequire(__webpack_require__(18));
|
||
|
||
var Glyphicon = _interopRequire(__webpack_require__(19));
|
||
|
||
var Grid = _interopRequire(__webpack_require__(20));
|
||
|
||
var Input = _interopRequire(__webpack_require__(21));
|
||
|
||
var Interpolate = _interopRequire(__webpack_require__(22));
|
||
|
||
var Jumbotron = _interopRequire(__webpack_require__(23));
|
||
|
||
var Label = _interopRequire(__webpack_require__(24));
|
||
|
||
var ListGroup = _interopRequire(__webpack_require__(25));
|
||
|
||
var ListGroupItem = _interopRequire(__webpack_require__(26));
|
||
|
||
var MenuItem = _interopRequire(__webpack_require__(27));
|
||
|
||
var Modal = _interopRequire(__webpack_require__(28));
|
||
|
||
var Nav = _interopRequire(__webpack_require__(29));
|
||
|
||
var Navbar = _interopRequire(__webpack_require__(30));
|
||
|
||
var NavItem = _interopRequire(__webpack_require__(31));
|
||
|
||
var ModalTrigger = _interopRequire(__webpack_require__(32));
|
||
|
||
var OverlayTrigger = _interopRequire(__webpack_require__(33));
|
||
|
||
var OverlayMixin = _interopRequire(__webpack_require__(34));
|
||
|
||
var PageHeader = _interopRequire(__webpack_require__(35));
|
||
|
||
var Panel = _interopRequire(__webpack_require__(36));
|
||
|
||
var PanelGroup = _interopRequire(__webpack_require__(37));
|
||
|
||
var PageItem = _interopRequire(__webpack_require__(38));
|
||
|
||
var Pager = _interopRequire(__webpack_require__(39));
|
||
|
||
var Popover = _interopRequire(__webpack_require__(40));
|
||
|
||
var ProgressBar = _interopRequire(__webpack_require__(41));
|
||
|
||
var Row = _interopRequire(__webpack_require__(42));
|
||
|
||
var SplitButton = _interopRequire(__webpack_require__(43));
|
||
|
||
var SubNav = _interopRequire(__webpack_require__(44));
|
||
|
||
var TabbedArea = _interopRequire(__webpack_require__(45));
|
||
|
||
var Table = _interopRequire(__webpack_require__(46));
|
||
|
||
var TabPane = _interopRequire(__webpack_require__(47));
|
||
|
||
var Tooltip = _interopRequire(__webpack_require__(48));
|
||
|
||
var Well = _interopRequire(__webpack_require__(49));
|
||
|
||
var constants = _interopRequire(__webpack_require__(50));
|
||
|
||
module.exports = {
|
||
Accordion: Accordion,
|
||
Affix: Affix,
|
||
AffixMixin: AffixMixin,
|
||
Alert: Alert,
|
||
BootstrapMixin: BootstrapMixin,
|
||
Badge: Badge,
|
||
Button: Button,
|
||
ButtonGroup: ButtonGroup,
|
||
ButtonToolbar: ButtonToolbar,
|
||
CollapsableNav: CollapsableNav,
|
||
Carousel: Carousel,
|
||
CarouselItem: CarouselItem,
|
||
Col: Col,
|
||
CollapsableMixin: CollapsableMixin,
|
||
DropdownButton: DropdownButton,
|
||
DropdownMenu: DropdownMenu,
|
||
DropdownStateMixin: DropdownStateMixin,
|
||
FadeMixin: FadeMixin,
|
||
Glyphicon: Glyphicon,
|
||
Grid: Grid,
|
||
Input: Input,
|
||
Interpolate: Interpolate,
|
||
Jumbotron: Jumbotron,
|
||
Label: Label,
|
||
ListGroup: ListGroup,
|
||
ListGroupItem: ListGroupItem,
|
||
MenuItem: MenuItem,
|
||
Modal: Modal,
|
||
Nav: Nav,
|
||
Navbar: Navbar,
|
||
NavItem: NavItem,
|
||
ModalTrigger: ModalTrigger,
|
||
OverlayTrigger: OverlayTrigger,
|
||
OverlayMixin: OverlayMixin,
|
||
PageHeader: PageHeader,
|
||
Panel: Panel,
|
||
PanelGroup: PanelGroup,
|
||
PageItem: PageItem,
|
||
Pager: Pager,
|
||
Popover: Popover,
|
||
ProgressBar: ProgressBar,
|
||
Row: Row,
|
||
SplitButton: SplitButton,
|
||
SubNav: SubNav,
|
||
TabbedArea: TabbedArea,
|
||
Table: Table,
|
||
TabPane: TabPane,
|
||
Tooltip: Tooltip,
|
||
Well: Well,
|
||
constants: constants
|
||
};
|
||
|
||
/***/ },
|
||
/* 1 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var PanelGroup = _interopRequire(__webpack_require__(37));
|
||
|
||
var Accordion = React.createClass({
|
||
displayName: "Accordion",
|
||
|
||
render: function render() {
|
||
return React.createElement(
|
||
PanelGroup,
|
||
_extends({}, this.props, { accordion: true }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Accordion;
|
||
|
||
/***/ },
|
||
/* 2 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var AffixMixin = _interopRequire(__webpack_require__(3));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var Affix = React.createClass({
|
||
displayName: "Affix",
|
||
|
||
statics: {
|
||
domUtils: domUtils
|
||
},
|
||
|
||
mixins: [AffixMixin],
|
||
|
||
render: function render() {
|
||
var holderStyle = { top: this.state.affixPositionTop };
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, this.state.affixClass),
|
||
style: holderStyle }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Affix;
|
||
|
||
/***/ },
|
||
/* 3 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var EventListener = _interopRequire(__webpack_require__(53));
|
||
|
||
var AffixMixin = {
|
||
propTypes: {
|
||
offset: React.PropTypes.number,
|
||
offsetTop: React.PropTypes.number,
|
||
offsetBottom: React.PropTypes.number
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
affixClass: "affix-top"
|
||
};
|
||
},
|
||
|
||
getPinnedOffset: function getPinnedOffset(DOMNode) {
|
||
if (this.pinnedOffset) {
|
||
return this.pinnedOffset;
|
||
}
|
||
|
||
DOMNode.className = DOMNode.className.replace(/affix-top|affix-bottom|affix/, "");
|
||
DOMNode.className += DOMNode.className.length ? " affix" : "affix";
|
||
|
||
this.pinnedOffset = domUtils.getOffset(DOMNode).top - window.pageYOffset;
|
||
|
||
return this.pinnedOffset;
|
||
},
|
||
|
||
checkPosition: function checkPosition() {
|
||
var DOMNode = undefined,
|
||
scrollHeight = undefined,
|
||
scrollTop = undefined,
|
||
position = undefined,
|
||
offsetTop = undefined,
|
||
offsetBottom = undefined,
|
||
affix = undefined,
|
||
affixType = undefined,
|
||
affixPositionTop = undefined;
|
||
|
||
// TODO: or not visible
|
||
if (!this.isMounted()) {
|
||
return;
|
||
}
|
||
|
||
DOMNode = React.findDOMNode(this);
|
||
scrollHeight = document.documentElement.offsetHeight;
|
||
scrollTop = window.pageYOffset;
|
||
position = domUtils.getOffset(DOMNode);
|
||
|
||
if (this.affixed === "top") {
|
||
position.top += scrollTop;
|
||
}
|
||
|
||
offsetTop = this.props.offsetTop != null ? this.props.offsetTop : this.props.offset;
|
||
offsetBottom = this.props.offsetBottom != null ? this.props.offsetBottom : this.props.offset;
|
||
|
||
if (offsetTop == null && offsetBottom == null) {
|
||
return;
|
||
}
|
||
if (offsetTop == null) {
|
||
offsetTop = 0;
|
||
}
|
||
if (offsetBottom == null) {
|
||
offsetBottom = 0;
|
||
}
|
||
|
||
if (this.unpin != null && scrollTop + this.unpin <= position.top) {
|
||
affix = false;
|
||
} else if (offsetBottom != null && position.top + DOMNode.offsetHeight >= scrollHeight - offsetBottom) {
|
||
affix = "bottom";
|
||
} else if (offsetTop != null && scrollTop <= offsetTop) {
|
||
affix = "top";
|
||
} else {
|
||
affix = false;
|
||
}
|
||
|
||
if (this.affixed === affix) {
|
||
return;
|
||
}
|
||
|
||
if (this.unpin != null) {
|
||
DOMNode.style.top = "";
|
||
}
|
||
|
||
affixType = "affix" + (affix ? "-" + affix : "");
|
||
|
||
this.affixed = affix;
|
||
this.unpin = affix === "bottom" ? this.getPinnedOffset(DOMNode) : null;
|
||
|
||
if (affix === "bottom") {
|
||
DOMNode.className = DOMNode.className.replace(/affix-top|affix-bottom|affix/, "affix-bottom");
|
||
affixPositionTop = scrollHeight - offsetBottom - DOMNode.offsetHeight - domUtils.getOffset(DOMNode).top;
|
||
}
|
||
|
||
this.setState({
|
||
affixClass: affixType,
|
||
affixPositionTop: affixPositionTop
|
||
});
|
||
},
|
||
|
||
checkPositionWithEventLoop: function checkPositionWithEventLoop() {
|
||
setTimeout(this.checkPosition, 0);
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
this._onWindowScrollListener = EventListener.listen(window, "scroll", this.checkPosition);
|
||
this._onDocumentClickListener = EventListener.listen(domUtils.ownerDocument(this), "click", this.checkPositionWithEventLoop);
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
if (this._onWindowScrollListener) {
|
||
this._onWindowScrollListener.remove();
|
||
}
|
||
|
||
if (this._onDocumentClickListener) {
|
||
this._onDocumentClickListener.remove();
|
||
}
|
||
},
|
||
|
||
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
|
||
if (prevState.affixClass === this.state.affixClass) {
|
||
this.checkPositionWithEventLoop();
|
||
}
|
||
}
|
||
};
|
||
|
||
module.exports = AffixMixin;
|
||
|
||
/***/ },
|
||
/* 4 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Alert = React.createClass({
|
||
displayName: "Alert",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
onDismiss: React.PropTypes.func,
|
||
dismissAfter: React.PropTypes.number
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "alert",
|
||
bsStyle: "info"
|
||
};
|
||
},
|
||
|
||
renderDismissButton: function renderDismissButton() {
|
||
return React.createElement(
|
||
"button",
|
||
{
|
||
type: "button",
|
||
className: "close",
|
||
onClick: this.props.onDismiss,
|
||
"aria-hidden": "true" },
|
||
"×"
|
||
);
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
var isDismissable = !!this.props.onDismiss;
|
||
|
||
classes["alert-dismissable"] = isDismissable;
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
isDismissable ? this.renderDismissButton() : null,
|
||
this.props.children
|
||
);
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
if (this.props.dismissAfter && this.props.onDismiss) {
|
||
this.dismissTimer = setTimeout(this.props.onDismiss, this.props.dismissAfter);
|
||
}
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
clearTimeout(this.dismissTimer);
|
||
}
|
||
});
|
||
|
||
module.exports = Alert;
|
||
|
||
/***/ },
|
||
/* 5 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var constants = _interopRequire(__webpack_require__(50));
|
||
|
||
var BootstrapMixin = {
|
||
propTypes: {
|
||
bsClass: React.PropTypes.oneOf(Object.keys(constants.CLASSES)),
|
||
bsStyle: React.PropTypes.oneOf(Object.keys(constants.STYLES)),
|
||
bsSize: React.PropTypes.oneOf(Object.keys(constants.SIZES))
|
||
},
|
||
|
||
getBsClassSet: function getBsClassSet() {
|
||
var classes = {};
|
||
|
||
var bsClass = this.props.bsClass && constants.CLASSES[this.props.bsClass];
|
||
if (bsClass) {
|
||
classes[bsClass] = true;
|
||
|
||
var prefix = bsClass + "-";
|
||
|
||
var bsSize = this.props.bsSize && constants.SIZES[this.props.bsSize];
|
||
if (bsSize) {
|
||
classes[prefix + bsSize] = true;
|
||
}
|
||
|
||
var bsStyle = this.props.bsStyle && constants.STYLES[this.props.bsStyle];
|
||
if (this.props.bsStyle) {
|
||
classes[prefix + bsStyle] = true;
|
||
}
|
||
}
|
||
|
||
return classes;
|
||
},
|
||
|
||
prefixClass: function prefixClass(subClass) {
|
||
return constants.CLASSES[this.props.bsClass] + "-" + subClass;
|
||
}
|
||
};
|
||
|
||
module.exports = BootstrapMixin;
|
||
|
||
/***/ },
|
||
/* 6 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var Badge = React.createClass({
|
||
displayName: "Badge",
|
||
|
||
propTypes: {
|
||
pullRight: React.PropTypes.bool
|
||
},
|
||
|
||
hasContent: function hasContent() {
|
||
return ValidComponentChildren.hasValidComponent(this.props.children) || typeof this.props.children === "string" || typeof this.props.children === "number";
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
"pull-right": this.props.pullRight,
|
||
badge: this.hasContent()
|
||
};
|
||
return React.createElement(
|
||
"span",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Badge;
|
||
|
||
/***/ },
|
||
/* 7 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Button = React.createClass({
|
||
displayName: "Button",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
active: React.PropTypes.bool,
|
||
disabled: React.PropTypes.bool,
|
||
block: React.PropTypes.bool,
|
||
navItem: React.PropTypes.bool,
|
||
navDropdown: React.PropTypes.bool,
|
||
componentClass: React.PropTypes.node,
|
||
href: React.PropTypes.string,
|
||
target: React.PropTypes.string
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "button",
|
||
bsStyle: "default",
|
||
type: "button"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.props.navDropdown ? {} : this.getBsClassSet();
|
||
var renderFuncName = undefined;
|
||
|
||
classes = _extends({
|
||
active: this.props.active,
|
||
"btn-block": this.props.block }, classes);
|
||
|
||
if (this.props.navItem) {
|
||
return this.renderNavItem(classes);
|
||
}
|
||
|
||
renderFuncName = this.props.href || this.props.target || this.props.navDropdown ? "renderAnchor" : "renderButton";
|
||
|
||
return this[renderFuncName](classes);
|
||
},
|
||
|
||
renderAnchor: function renderAnchor(classes) {
|
||
|
||
var Component = this.props.componentClass || "a";
|
||
var href = this.props.href || "#";
|
||
classes.disabled = this.props.disabled;
|
||
|
||
return React.createElement(
|
||
Component,
|
||
_extends({}, this.props, {
|
||
href: href,
|
||
className: classNames(this.props.className, classes),
|
||
role: "button" }),
|
||
this.props.children
|
||
);
|
||
},
|
||
|
||
renderButton: function renderButton(classes) {
|
||
var Component = this.props.componentClass || "button";
|
||
|
||
return React.createElement(
|
||
Component,
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
},
|
||
|
||
renderNavItem: function renderNavItem(classes) {
|
||
var liClasses = {
|
||
active: this.props.active
|
||
};
|
||
|
||
return React.createElement(
|
||
"li",
|
||
{ className: classNames(liClasses) },
|
||
this.renderAnchor(classes)
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Button;
|
||
|
||
/***/ },
|
||
/* 8 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var ButtonGroup = React.createClass({
|
||
displayName: "ButtonGroup",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
vertical: React.PropTypes.bool,
|
||
justified: React.PropTypes.bool
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "button-group"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
classes["btn-group"] = !this.props.vertical;
|
||
classes["btn-group-vertical"] = this.props.vertical;
|
||
classes["btn-group-justified"] = this.props.justified;
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = ButtonGroup;
|
||
|
||
/***/ },
|
||
/* 9 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var ButtonToolbar = React.createClass({
|
||
displayName: "ButtonToolbar",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "button-toolbar"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, {
|
||
role: "toolbar",
|
||
className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = ButtonToolbar;
|
||
|
||
/***/ },
|
||
/* 10 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _react = __webpack_require__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var CollapsableMixin = _interopRequire(__webpack_require__(14));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var CollapsableNav = React.createClass({
|
||
displayName: "CollapsableNav",
|
||
|
||
mixins: [BootstrapMixin, CollapsableMixin],
|
||
|
||
propTypes: {
|
||
onSelect: React.PropTypes.func,
|
||
activeHref: React.PropTypes.string,
|
||
activeKey: React.PropTypes.any,
|
||
collapsable: React.PropTypes.bool,
|
||
expanded: React.PropTypes.bool,
|
||
eventKey: React.PropTypes.any
|
||
},
|
||
|
||
getCollapsableDOMNode: function getCollapsableDOMNode() {
|
||
return this.getDOMNode();
|
||
},
|
||
|
||
getCollapsableDimensionValue: function getCollapsableDimensionValue() {
|
||
var height = 0;
|
||
var nodes = this.refs;
|
||
for (var key in nodes) {
|
||
if (nodes.hasOwnProperty(key)) {
|
||
|
||
var n = nodes[key].getDOMNode(),
|
||
h = n.offsetHeight,
|
||
computedStyles = domUtils.getComputedStyles(n);
|
||
|
||
height += h + parseInt(computedStyles.marginTop, 10) + parseInt(computedStyles.marginBottom, 10);
|
||
}
|
||
}
|
||
return height;
|
||
},
|
||
|
||
render: function render() {
|
||
/*
|
||
* this.props.collapsable is set in NavBar when a eventKey is supplied.
|
||
*/
|
||
var classes = this.props.collapsable ? this.getCollapsableClassSet() : {};
|
||
/*
|
||
* prevent duplicating navbar-collapse call if passed as prop. kind of overkill... good cadidate to have check implemented as a util that can
|
||
* also be used elsewhere.
|
||
*/
|
||
if (this.props.className === undefined || this.props.className.split(" ").indexOf("navbar-collapse") === -2) {
|
||
classes["navbar-collapse"] = this.props.collapsable;
|
||
}
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ eventKey: this.props.eventKey, className: classNames(this.props.className, classes) },
|
||
ValidComponentChildren.map(this.props.children, this.props.collapsable ? this.renderCollapsableNavChildren : this.renderChildren)
|
||
);
|
||
},
|
||
|
||
getChildActiveProp: function getChildActiveProp(child) {
|
||
if (child.props.active) {
|
||
return true;
|
||
}
|
||
if (this.props.activeKey != null) {
|
||
if (child.props.eventKey === this.props.activeKey) {
|
||
return true;
|
||
}
|
||
}
|
||
if (this.props.activeHref != null) {
|
||
if (child.props.href === this.props.activeHref) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
return child.props.active;
|
||
},
|
||
|
||
renderChildren: function renderChildren(child, index) {
|
||
var key = child.key ? child.key : index;
|
||
return cloneElement(child, {
|
||
activeKey: this.props.activeKey,
|
||
activeHref: this.props.activeHref,
|
||
ref: "nocollapse_" + key,
|
||
key: key,
|
||
navItem: true
|
||
});
|
||
},
|
||
|
||
renderCollapsableNavChildren: function renderCollapsableNavChildren(child, index) {
|
||
var key = child.key ? child.key : index;
|
||
return cloneElement(child, {
|
||
active: this.getChildActiveProp(child),
|
||
activeKey: this.props.activeKey,
|
||
activeHref: this.props.activeHref,
|
||
onSelect: createChainedFunction(child.props.onSelect, this.props.onSelect),
|
||
ref: "collapsable_" + key,
|
||
key: key,
|
||
navItem: true
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = CollapsableNav;
|
||
|
||
/***/ },
|
||
/* 11 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var Carousel = React.createClass({
|
||
displayName: "Carousel",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
slide: React.PropTypes.bool,
|
||
indicators: React.PropTypes.bool,
|
||
interval: React.PropTypes.number,
|
||
controls: React.PropTypes.bool,
|
||
pauseOnHover: React.PropTypes.bool,
|
||
wrap: React.PropTypes.bool,
|
||
onSelect: React.PropTypes.func,
|
||
onSlideEnd: React.PropTypes.func,
|
||
activeIndex: React.PropTypes.number,
|
||
defaultActiveIndex: React.PropTypes.number,
|
||
direction: React.PropTypes.oneOf(["prev", "next"])
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
slide: true,
|
||
interval: 5000,
|
||
pauseOnHover: true,
|
||
wrap: true,
|
||
indicators: true,
|
||
controls: true
|
||
};
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
activeIndex: this.props.defaultActiveIndex == null ? 0 : this.props.defaultActiveIndex,
|
||
previousActiveIndex: null,
|
||
direction: null
|
||
};
|
||
},
|
||
|
||
getDirection: function getDirection(prevIndex, index) {
|
||
if (prevIndex === index) {
|
||
return null;
|
||
}
|
||
|
||
return prevIndex > index ? "prev" : "next";
|
||
},
|
||
|
||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
|
||
var activeIndex = this.getActiveIndex();
|
||
|
||
if (nextProps.activeIndex != null && nextProps.activeIndex !== activeIndex) {
|
||
clearTimeout(this.timeout);
|
||
this.setState({
|
||
previousActiveIndex: activeIndex,
|
||
direction: nextProps.direction != null ? nextProps.direction : this.getDirection(activeIndex, nextProps.activeIndex)
|
||
});
|
||
}
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
this.waitForNext();
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
clearTimeout(this.timeout);
|
||
},
|
||
|
||
next: function next(e) {
|
||
if (e) {
|
||
e.preventDefault();
|
||
}
|
||
|
||
var index = this.getActiveIndex() + 1;
|
||
var count = ValidComponentChildren.numberOf(this.props.children);
|
||
|
||
if (index > count - 1) {
|
||
if (!this.props.wrap) {
|
||
return;
|
||
}
|
||
index = 0;
|
||
}
|
||
|
||
this.handleSelect(index, "next");
|
||
},
|
||
|
||
prev: function prev(e) {
|
||
if (e) {
|
||
e.preventDefault();
|
||
}
|
||
|
||
var index = this.getActiveIndex() - 1;
|
||
|
||
if (index < 0) {
|
||
if (!this.props.wrap) {
|
||
return;
|
||
}
|
||
index = ValidComponentChildren.numberOf(this.props.children) - 1;
|
||
}
|
||
|
||
this.handleSelect(index, "prev");
|
||
},
|
||
|
||
pause: function pause() {
|
||
this.isPaused = true;
|
||
clearTimeout(this.timeout);
|
||
},
|
||
|
||
play: function play() {
|
||
this.isPaused = false;
|
||
this.waitForNext();
|
||
},
|
||
|
||
waitForNext: function waitForNext() {
|
||
if (!this.isPaused && this.props.slide && this.props.interval && this.props.activeIndex == null) {
|
||
this.timeout = setTimeout(this.next, this.props.interval);
|
||
}
|
||
},
|
||
|
||
handleMouseOver: function handleMouseOver() {
|
||
if (this.props.pauseOnHover) {
|
||
this.pause();
|
||
}
|
||
},
|
||
|
||
handleMouseOut: function handleMouseOut() {
|
||
if (this.isPaused) {
|
||
this.play();
|
||
}
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
carousel: true,
|
||
slide: this.props.slide
|
||
};
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes),
|
||
onMouseOver: this.handleMouseOver,
|
||
onMouseOut: this.handleMouseOut }),
|
||
this.props.indicators ? this.renderIndicators() : null,
|
||
React.createElement(
|
||
"div",
|
||
{ className: "carousel-inner", ref: "inner" },
|
||
ValidComponentChildren.map(this.props.children, this.renderItem)
|
||
),
|
||
this.props.controls ? this.renderControls() : null
|
||
);
|
||
},
|
||
|
||
renderPrev: function renderPrev() {
|
||
return React.createElement(
|
||
"a",
|
||
{ className: "left carousel-control", href: "#prev", key: 0, onClick: this.prev },
|
||
React.createElement("span", { className: "glyphicon glyphicon-chevron-left" })
|
||
);
|
||
},
|
||
|
||
renderNext: function renderNext() {
|
||
return React.createElement(
|
||
"a",
|
||
{ className: "right carousel-control", href: "#next", key: 1, onClick: this.next },
|
||
React.createElement("span", { className: "glyphicon glyphicon-chevron-right" })
|
||
);
|
||
},
|
||
|
||
renderControls: function renderControls() {
|
||
if (!this.props.wrap) {
|
||
var activeIndex = this.getActiveIndex();
|
||
var count = ValidComponentChildren.numberOf(this.props.children);
|
||
|
||
return [activeIndex !== 0 ? this.renderPrev() : null, activeIndex !== count - 1 ? this.renderNext() : null];
|
||
}
|
||
|
||
return [this.renderPrev(), this.renderNext()];
|
||
},
|
||
|
||
renderIndicator: function renderIndicator(child, index) {
|
||
var className = index === this.getActiveIndex() ? "active" : null;
|
||
|
||
return React.createElement("li", {
|
||
key: index,
|
||
className: className,
|
||
onClick: this.handleSelect.bind(this, index, null) });
|
||
},
|
||
|
||
renderIndicators: function renderIndicators() {
|
||
var indicators = [];
|
||
ValidComponentChildren.forEach(this.props.children, function (child, index) {
|
||
indicators.push(this.renderIndicator(child, index),
|
||
|
||
// Force whitespace between indicator elements, bootstrap
|
||
// requires this for correct spacing of elements.
|
||
" ");
|
||
}, this);
|
||
|
||
return React.createElement(
|
||
"ol",
|
||
{ className: "carousel-indicators" },
|
||
indicators
|
||
);
|
||
},
|
||
|
||
getActiveIndex: function getActiveIndex() {
|
||
return this.props.activeIndex != null ? this.props.activeIndex : this.state.activeIndex;
|
||
},
|
||
|
||
handleItemAnimateOutEnd: function handleItemAnimateOutEnd() {
|
||
this.setState({
|
||
previousActiveIndex: null,
|
||
direction: null
|
||
}, function () {
|
||
this.waitForNext();
|
||
|
||
if (this.props.onSlideEnd) {
|
||
this.props.onSlideEnd();
|
||
}
|
||
});
|
||
},
|
||
|
||
renderItem: function renderItem(child, index) {
|
||
var activeIndex = this.getActiveIndex();
|
||
var isActive = index === activeIndex;
|
||
var isPreviousActive = this.state.previousActiveIndex != null && this.state.previousActiveIndex === index && this.props.slide;
|
||
|
||
return cloneElement(child, {
|
||
active: isActive,
|
||
ref: child.ref,
|
||
key: child.key ? child.key : index,
|
||
index: index,
|
||
animateOut: isPreviousActive,
|
||
animateIn: isActive && this.state.previousActiveIndex != null && this.props.slide,
|
||
direction: this.state.direction,
|
||
onAnimateOutEnd: isPreviousActive ? this.handleItemAnimateOutEnd : null
|
||
});
|
||
},
|
||
|
||
handleSelect: function handleSelect(index, direction) {
|
||
clearTimeout(this.timeout);
|
||
|
||
var previousActiveIndex = this.getActiveIndex();
|
||
direction = direction || this.getDirection(previousActiveIndex, index);
|
||
|
||
if (this.props.onSelect) {
|
||
this.props.onSelect(index, direction);
|
||
}
|
||
|
||
if (this.props.activeIndex == null && index !== previousActiveIndex) {
|
||
if (this.state.previousActiveIndex != null) {
|
||
// If currently animating don't activate the new index.
|
||
// TODO: look into queuing this canceled call and
|
||
// animating after the current animation has ended.
|
||
return;
|
||
}
|
||
|
||
this.setState({
|
||
activeIndex: index,
|
||
previousActiveIndex: previousActiveIndex,
|
||
direction: direction
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
module.exports = Carousel;
|
||
|
||
/***/ },
|
||
/* 12 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var TransitionEvents = _interopRequire(__webpack_require__(56));
|
||
|
||
var CarouselItem = React.createClass({
|
||
displayName: "CarouselItem",
|
||
|
||
propTypes: {
|
||
direction: React.PropTypes.oneOf(["prev", "next"]),
|
||
onAnimateOutEnd: React.PropTypes.func,
|
||
active: React.PropTypes.bool,
|
||
animateIn: React.PropTypes.bool,
|
||
animateOut: React.PropTypes.bool,
|
||
caption: React.PropTypes.node,
|
||
index: React.PropTypes.number
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
direction: null
|
||
};
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
animation: true
|
||
};
|
||
},
|
||
|
||
handleAnimateOutEnd: function handleAnimateOutEnd() {
|
||
if (this.props.onAnimateOutEnd && this.isMounted()) {
|
||
this.props.onAnimateOutEnd(this.props.index);
|
||
}
|
||
},
|
||
|
||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
|
||
if (this.props.active !== nextProps.active) {
|
||
this.setState({
|
||
direction: null
|
||
});
|
||
}
|
||
},
|
||
|
||
componentDidUpdate: function componentDidUpdate(prevProps) {
|
||
if (!this.props.active && prevProps.active) {
|
||
TransitionEvents.addEndEventListener(React.findDOMNode(this), this.handleAnimateOutEnd);
|
||
}
|
||
|
||
if (this.props.active !== prevProps.active) {
|
||
setTimeout(this.startAnimation, 20);
|
||
}
|
||
},
|
||
|
||
startAnimation: function startAnimation() {
|
||
if (!this.isMounted()) {
|
||
return;
|
||
}
|
||
|
||
this.setState({
|
||
direction: this.props.direction === "prev" ? "right" : "left"
|
||
});
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
item: true,
|
||
active: this.props.active && !this.props.animateIn || this.props.animateOut,
|
||
next: this.props.active && this.props.animateIn && this.props.direction === "next",
|
||
prev: this.props.active && this.props.animateIn && this.props.direction === "prev"
|
||
};
|
||
|
||
if (this.state.direction && (this.props.animateIn || this.props.animateOut)) {
|
||
classes[this.state.direction] = true;
|
||
}
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children,
|
||
this.props.caption ? this.renderCaption() : null
|
||
);
|
||
},
|
||
|
||
renderCaption: function renderCaption() {
|
||
return React.createElement(
|
||
"div",
|
||
{ className: "carousel-caption" },
|
||
this.props.caption
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = CarouselItem;
|
||
|
||
/***/ },
|
||
/* 13 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var constants = _interopRequire(__webpack_require__(50));
|
||
|
||
var Col = React.createClass({
|
||
displayName: "Col",
|
||
|
||
propTypes: {
|
||
xs: React.PropTypes.number,
|
||
sm: React.PropTypes.number,
|
||
md: React.PropTypes.number,
|
||
lg: React.PropTypes.number,
|
||
xsOffset: React.PropTypes.number,
|
||
smOffset: React.PropTypes.number,
|
||
mdOffset: React.PropTypes.number,
|
||
lgOffset: React.PropTypes.number,
|
||
xsPush: React.PropTypes.number,
|
||
smPush: React.PropTypes.number,
|
||
mdPush: React.PropTypes.number,
|
||
lgPush: React.PropTypes.number,
|
||
xsPull: React.PropTypes.number,
|
||
smPull: React.PropTypes.number,
|
||
mdPull: React.PropTypes.number,
|
||
lgPull: React.PropTypes.number,
|
||
componentClass: React.PropTypes.node.isRequired
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
componentClass: "div"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var ComponentClass = this.props.componentClass;
|
||
var classes = {};
|
||
|
||
Object.keys(constants.SIZES).forEach(function (key) {
|
||
var size = constants.SIZES[key];
|
||
var prop = size;
|
||
var classPart = size + "-";
|
||
|
||
if (this.props[prop]) {
|
||
classes["col-" + classPart + this.props[prop]] = true;
|
||
}
|
||
|
||
prop = size + "Offset";
|
||
classPart = size + "-offset-";
|
||
if (this.props[prop] >= 0) {
|
||
classes["col-" + classPart + this.props[prop]] = true;
|
||
}
|
||
|
||
prop = size + "Push";
|
||
classPart = size + "-push-";
|
||
if (this.props[prop] >= 0) {
|
||
classes["col-" + classPart + this.props[prop]] = true;
|
||
}
|
||
|
||
prop = size + "Pull";
|
||
classPart = size + "-pull-";
|
||
if (this.props[prop] >= 0) {
|
||
classes["col-" + classPart + this.props[prop]] = true;
|
||
}
|
||
}, this);
|
||
|
||
return React.createElement(
|
||
ComponentClass,
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Col;
|
||
|
||
/***/ },
|
||
/* 14 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var TransitionEvents = _interopRequire(__webpack_require__(61));
|
||
|
||
var CollapsableMixin = {
|
||
|
||
propTypes: {
|
||
defaultExpanded: React.PropTypes.bool,
|
||
expanded: React.PropTypes.bool
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
var defaultExpanded = this.props.defaultExpanded != null ? this.props.defaultExpanded : this.props.expanded != null ? this.props.expanded : false;
|
||
|
||
return {
|
||
expanded: defaultExpanded,
|
||
collapsing: false
|
||
};
|
||
},
|
||
|
||
componentWillUpdate: function componentWillUpdate(nextProps, nextState) {
|
||
var willExpanded = nextProps.expanded != null ? nextProps.expanded : nextState.expanded;
|
||
if (willExpanded === this.isExpanded()) {
|
||
return;
|
||
}
|
||
|
||
// if the expanded state is being toggled, ensure node has a dimension value
|
||
// this is needed for the animation to work and needs to be set before
|
||
// the collapsing class is applied (after collapsing is applied the in class
|
||
// is removed and the node's dimension will be wrong)
|
||
|
||
var node = this.getCollapsableDOMNode();
|
||
var dimension = this.dimension();
|
||
var value = "0";
|
||
|
||
if (!willExpanded) {
|
||
value = this.getCollapsableDimensionValue();
|
||
}
|
||
|
||
node.style[dimension] = value + "px";
|
||
|
||
this._afterWillUpdate();
|
||
},
|
||
|
||
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
|
||
// check if expanded is being toggled; if so, set collapsing
|
||
this._checkToggleCollapsing(prevProps, prevState);
|
||
|
||
// check if collapsing was turned on; if so, start animation
|
||
this._checkStartAnimation();
|
||
},
|
||
|
||
// helps enable test stubs
|
||
_afterWillUpdate: function _afterWillUpdate() {},
|
||
|
||
_checkStartAnimation: function _checkStartAnimation() {
|
||
if (!this.state.collapsing) {
|
||
return;
|
||
}
|
||
|
||
var node = this.getCollapsableDOMNode();
|
||
var dimension = this.dimension();
|
||
var value = this.getCollapsableDimensionValue();
|
||
|
||
// setting the dimension here starts the transition animation
|
||
var result = undefined;
|
||
if (this.isExpanded()) {
|
||
result = value + "px";
|
||
} else {
|
||
result = "0px";
|
||
}
|
||
node.style[dimension] = result;
|
||
},
|
||
|
||
_checkToggleCollapsing: function _checkToggleCollapsing(prevProps, prevState) {
|
||
var wasExpanded = prevProps.expanded != null ? prevProps.expanded : prevState.expanded;
|
||
var isExpanded = this.isExpanded();
|
||
if (wasExpanded !== isExpanded) {
|
||
if (wasExpanded) {
|
||
this._handleCollapse();
|
||
} else {
|
||
this._handleExpand();
|
||
}
|
||
}
|
||
},
|
||
|
||
_handleExpand: function _handleExpand() {
|
||
var _this = this;
|
||
|
||
var node = this.getCollapsableDOMNode();
|
||
var dimension = this.dimension();
|
||
|
||
var complete = function () {
|
||
_this._removeEndEventListener(node, complete);
|
||
// remove dimension value - this ensures the collapsable item can grow
|
||
// in dimension after initial display (such as an image loading)
|
||
node.style[dimension] = "";
|
||
_this.setState({
|
||
collapsing: false
|
||
});
|
||
};
|
||
|
||
this._addEndEventListener(node, complete);
|
||
|
||
this.setState({
|
||
collapsing: true
|
||
});
|
||
},
|
||
|
||
_handleCollapse: function _handleCollapse() {
|
||
var _this = this;
|
||
|
||
var node = this.getCollapsableDOMNode();
|
||
|
||
var complete = function () {
|
||
_this._removeEndEventListener(node, complete);
|
||
_this.setState({
|
||
collapsing: false
|
||
});
|
||
};
|
||
|
||
this._addEndEventListener(node, complete);
|
||
|
||
this.setState({
|
||
collapsing: true
|
||
});
|
||
},
|
||
|
||
// helps enable test stubs
|
||
_addEndEventListener: function _addEndEventListener(node, complete) {
|
||
TransitionEvents.addEndEventListener(node, complete);
|
||
},
|
||
|
||
// helps enable test stubs
|
||
_removeEndEventListener: function _removeEndEventListener(node, complete) {
|
||
TransitionEvents.removeEndEventListener(node, complete);
|
||
},
|
||
|
||
dimension: function dimension() {
|
||
return typeof this.getCollapsableDimension === "function" ? this.getCollapsableDimension() : "height";
|
||
},
|
||
|
||
isExpanded: function isExpanded() {
|
||
return this.props.expanded != null ? this.props.expanded : this.state.expanded;
|
||
},
|
||
|
||
getCollapsableClassSet: function getCollapsableClassSet(className) {
|
||
var classes = {};
|
||
|
||
if (typeof className === "string") {
|
||
className.split(" ").forEach(function (subClasses) {
|
||
if (subClasses) {
|
||
classes[subClasses] = true;
|
||
}
|
||
});
|
||
}
|
||
|
||
classes.collapsing = this.state.collapsing;
|
||
classes.collapse = !this.state.collapsing;
|
||
classes["in"] = this.isExpanded() && !this.state.collapsing;
|
||
|
||
return classes;
|
||
}
|
||
};
|
||
|
||
module.exports = CollapsableMixin;
|
||
|
||
/***/ },
|
||
/* 15 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var DropdownStateMixin = _interopRequire(__webpack_require__(17));
|
||
|
||
var Button = _interopRequire(__webpack_require__(7));
|
||
|
||
var ButtonGroup = _interopRequire(__webpack_require__(8));
|
||
|
||
var DropdownMenu = _interopRequire(__webpack_require__(16));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var DropdownButton = React.createClass({
|
||
displayName: "DropdownButton",
|
||
|
||
mixins: [BootstrapMixin, DropdownStateMixin],
|
||
|
||
propTypes: {
|
||
pullRight: React.PropTypes.bool,
|
||
dropup: React.PropTypes.bool,
|
||
title: React.PropTypes.node,
|
||
href: React.PropTypes.string,
|
||
onClick: React.PropTypes.func,
|
||
onSelect: React.PropTypes.func,
|
||
navItem: React.PropTypes.bool,
|
||
noCaret: React.PropTypes.bool
|
||
},
|
||
|
||
render: function render() {
|
||
var renderMethod = this.props.navItem ? "renderNavItem" : "renderButtonGroup";
|
||
|
||
var caret = this.props.noCaret ? null : React.createElement("span", { className: "caret" });
|
||
|
||
return this[renderMethod]([React.createElement(
|
||
Button,
|
||
_extends({}, this.props, {
|
||
ref: "dropdownButton",
|
||
className: "dropdown-toggle",
|
||
onClick: this.handleDropdownClick,
|
||
key: 0,
|
||
navDropdown: this.props.navItem,
|
||
navItem: null,
|
||
title: null,
|
||
pullRight: null,
|
||
dropup: null }),
|
||
this.props.title,
|
||
" ",
|
||
caret
|
||
), React.createElement(
|
||
DropdownMenu,
|
||
{
|
||
ref: "menu",
|
||
"aria-labelledby": this.props.id,
|
||
pullRight: this.props.pullRight,
|
||
key: 1 },
|
||
ValidComponentChildren.map(this.props.children, this.renderMenuItem)
|
||
)]);
|
||
},
|
||
|
||
renderButtonGroup: function renderButtonGroup(children) {
|
||
var groupClasses = {
|
||
open: this.state.open,
|
||
dropup: this.props.dropup
|
||
};
|
||
|
||
return React.createElement(
|
||
ButtonGroup,
|
||
{
|
||
bsSize: this.props.bsSize,
|
||
className: classNames(this.props.className, groupClasses) },
|
||
children
|
||
);
|
||
},
|
||
|
||
renderNavItem: function renderNavItem(children) {
|
||
var classes = {
|
||
dropdown: true,
|
||
open: this.state.open,
|
||
dropup: this.props.dropup
|
||
};
|
||
|
||
return React.createElement(
|
||
"li",
|
||
{ className: classNames(this.props.className, classes) },
|
||
children
|
||
);
|
||
},
|
||
|
||
renderMenuItem: function renderMenuItem(child, index) {
|
||
// Only handle the option selection if an onSelect prop has been set on the
|
||
// component or it's child, this allows a user not to pass an onSelect
|
||
// handler and have the browser preform the default action.
|
||
var handleOptionSelect = this.props.onSelect || child.props.onSelect ? this.handleOptionSelect : null;
|
||
|
||
return cloneElement(child, {
|
||
// Capture onSelect events
|
||
onSelect: createChainedFunction(child.props.onSelect, handleOptionSelect),
|
||
key: child.key ? child.key : index
|
||
});
|
||
},
|
||
|
||
handleDropdownClick: function handleDropdownClick(e) {
|
||
e.preventDefault();
|
||
|
||
this.setDropdownState(!this.state.open);
|
||
},
|
||
|
||
handleOptionSelect: function handleOptionSelect(key) {
|
||
if (this.props.onSelect) {
|
||
this.props.onSelect(key);
|
||
}
|
||
|
||
this.setDropdownState(false);
|
||
}
|
||
});
|
||
|
||
module.exports = DropdownButton;
|
||
|
||
/***/ },
|
||
/* 16 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var DropdownMenu = React.createClass({
|
||
displayName: "DropdownMenu",
|
||
|
||
propTypes: {
|
||
pullRight: React.PropTypes.bool,
|
||
onSelect: React.PropTypes.func
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
"dropdown-menu": true,
|
||
"dropdown-menu-right": this.props.pullRight
|
||
};
|
||
|
||
return React.createElement(
|
||
"ul",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes),
|
||
role: "menu" }),
|
||
ValidComponentChildren.map(this.props.children, this.renderMenuItem)
|
||
);
|
||
},
|
||
|
||
renderMenuItem: function renderMenuItem(child, index) {
|
||
return cloneElement(child, {
|
||
// Capture onSelect events
|
||
onSelect: createChainedFunction(child.props.onSelect, this.props.onSelect),
|
||
|
||
// Force special props to be transferred
|
||
key: child.key ? child.key : index
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = DropdownMenu;
|
||
|
||
/***/ },
|
||
/* 17 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var EventListener = _interopRequire(__webpack_require__(53));
|
||
|
||
/**
|
||
* Checks whether a node is within
|
||
* a root nodes tree
|
||
*
|
||
* @param {DOMElement} node
|
||
* @param {DOMElement} root
|
||
* @returns {boolean}
|
||
*/
|
||
function isNodeInRoot(node, root) {
|
||
while (node) {
|
||
if (node === root) {
|
||
return true;
|
||
}
|
||
node = node.parentNode;
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
var DropdownStateMixin = {
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
open: false
|
||
};
|
||
},
|
||
|
||
setDropdownState: function setDropdownState(newState, onStateChangeComplete) {
|
||
if (newState) {
|
||
this.bindRootCloseHandlers();
|
||
} else {
|
||
this.unbindRootCloseHandlers();
|
||
}
|
||
|
||
this.setState({
|
||
open: newState
|
||
}, onStateChangeComplete);
|
||
},
|
||
|
||
handleDocumentKeyUp: function handleDocumentKeyUp(e) {
|
||
if (e.keyCode === 27) {
|
||
this.setDropdownState(false);
|
||
}
|
||
},
|
||
|
||
handleDocumentClick: function handleDocumentClick(e) {
|
||
// If the click originated from within this component
|
||
// don't do anything.
|
||
if (isNodeInRoot(e.target, React.findDOMNode(this))) {
|
||
return;
|
||
}
|
||
|
||
this.setDropdownState(false);
|
||
},
|
||
|
||
bindRootCloseHandlers: function bindRootCloseHandlers() {
|
||
var doc = domUtils.ownerDocument(this);
|
||
|
||
this._onDocumentClickListener = EventListener.listen(doc, "click", this.handleDocumentClick);
|
||
this._onDocumentKeyupListener = EventListener.listen(doc, "keyup", this.handleDocumentKeyUp);
|
||
},
|
||
|
||
unbindRootCloseHandlers: function unbindRootCloseHandlers() {
|
||
if (this._onDocumentClickListener) {
|
||
this._onDocumentClickListener.remove();
|
||
}
|
||
|
||
if (this._onDocumentKeyupListener) {
|
||
this._onDocumentKeyupListener.remove();
|
||
}
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
this.unbindRootCloseHandlers();
|
||
}
|
||
};
|
||
|
||
module.exports = DropdownStateMixin;
|
||
|
||
/***/ },
|
||
/* 18 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
// TODO: listen for onTransitionEnd to remove el
|
||
function getElementsAndSelf(root, classes) {
|
||
var els = root.querySelectorAll("." + classes.join("."));
|
||
|
||
els = [].map.call(els, function (e) {
|
||
return e;
|
||
});
|
||
|
||
for (var i = 0; i < classes.length; i++) {
|
||
if (!root.className.match(new RegExp("\\b" + classes[i] + "\\b"))) {
|
||
return els;
|
||
}
|
||
}
|
||
els.unshift(root);
|
||
return els;
|
||
}
|
||
|
||
module.exports = {
|
||
_fadeIn: function _fadeIn() {
|
||
var els = undefined;
|
||
|
||
if (this.isMounted()) {
|
||
els = getElementsAndSelf(React.findDOMNode(this), ["fade"]);
|
||
|
||
if (els.length) {
|
||
els.forEach(function (el) {
|
||
el.className += " in";
|
||
});
|
||
}
|
||
}
|
||
},
|
||
|
||
_fadeOut: function _fadeOut() {
|
||
var els = getElementsAndSelf(this._fadeOutEl, ["fade", "in"]);
|
||
|
||
if (els.length) {
|
||
els.forEach(function (el) {
|
||
el.className = el.className.replace(/\bin\b/, "");
|
||
});
|
||
}
|
||
|
||
setTimeout(this._handleFadeOutEnd, 300);
|
||
},
|
||
|
||
_handleFadeOutEnd: function _handleFadeOutEnd() {
|
||
if (this._fadeOutEl && this._fadeOutEl.parentNode) {
|
||
this._fadeOutEl.parentNode.removeChild(this._fadeOutEl);
|
||
}
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
if (document.querySelectorAll) {
|
||
// Firefox needs delay for transition to be triggered
|
||
setTimeout(this._fadeIn, 20);
|
||
}
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
var els = getElementsAndSelf(React.findDOMNode(this), ["fade"]),
|
||
container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body;
|
||
|
||
if (els.length) {
|
||
this._fadeOutEl = document.createElement("div");
|
||
container.appendChild(this._fadeOutEl);
|
||
this._fadeOutEl.appendChild(React.findDOMNode(this).cloneNode(true));
|
||
// Firefox needs delay for transition to be triggered
|
||
setTimeout(this._fadeOut, 20);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ },
|
||
/* 19 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var constants = _interopRequire(__webpack_require__(50));
|
||
|
||
var Glyphicon = React.createClass({
|
||
displayName: "Glyphicon",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
glyph: React.PropTypes.oneOf(constants.GLYPHS).isRequired
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "glyphicon"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
classes["glyphicon-" + this.props.glyph] = true;
|
||
|
||
return React.createElement(
|
||
"span",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Glyphicon;
|
||
|
||
/***/ },
|
||
/* 20 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var Grid = React.createClass({
|
||
displayName: "Grid",
|
||
|
||
propTypes: {
|
||
fluid: React.PropTypes.bool,
|
||
componentClass: React.PropTypes.node.isRequired
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
componentClass: "div"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var ComponentClass = this.props.componentClass;
|
||
var className = this.props.fluid ? "container-fluid" : "container";
|
||
|
||
return React.createElement(
|
||
ComponentClass,
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, className) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Grid;
|
||
|
||
/***/ },
|
||
/* 21 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var Button = _interopRequire(__webpack_require__(7));
|
||
|
||
var FormGroup = _interopRequire(__webpack_require__(57));
|
||
|
||
var Input = React.createClass({
|
||
displayName: "Input",
|
||
|
||
propTypes: {
|
||
type: React.PropTypes.string,
|
||
label: React.PropTypes.node,
|
||
help: React.PropTypes.node,
|
||
addonBefore: React.PropTypes.node,
|
||
addonAfter: React.PropTypes.node,
|
||
buttonBefore: React.PropTypes.node,
|
||
buttonAfter: React.PropTypes.node,
|
||
bsSize: React.PropTypes.oneOf(["small", "medium", "large"]),
|
||
bsStyle: function bsStyle(props) {
|
||
if (props.type === "submit") {
|
||
// Return early if `type=submit` as the `Button` component
|
||
// it transfers these props to has its own propType checks.
|
||
return null;
|
||
}
|
||
|
||
return React.PropTypes.oneOf(["success", "warning", "error"]).apply(null, arguments);
|
||
},
|
||
hasFeedback: React.PropTypes.bool,
|
||
id: React.PropTypes.string,
|
||
groupClassName: React.PropTypes.string,
|
||
wrapperClassName: React.PropTypes.string,
|
||
labelClassName: React.PropTypes.string,
|
||
multiple: React.PropTypes.bool,
|
||
disabled: React.PropTypes.bool,
|
||
value: React.PropTypes.any
|
||
},
|
||
|
||
getInputDOMNode: function getInputDOMNode() {
|
||
return React.findDOMNode(this.refs.input);
|
||
},
|
||
|
||
getValue: function getValue() {
|
||
if (this.props.type === "static") {
|
||
return this.props.value;
|
||
} else if (this.props.type) {
|
||
if (this.props.type === "select" && this.props.multiple) {
|
||
return this.getSelectedOptions();
|
||
} else {
|
||
return this.getInputDOMNode().value;
|
||
}
|
||
} else {
|
||
throw "Cannot use getValue without specifying input type.";
|
||
}
|
||
},
|
||
|
||
getChecked: function getChecked() {
|
||
return this.getInputDOMNode().checked;
|
||
},
|
||
|
||
getSelectedOptions: function getSelectedOptions() {
|
||
var values = [];
|
||
|
||
Array.prototype.forEach.call(this.getInputDOMNode().getElementsByTagName("option"), function (option) {
|
||
if (option.selected) {
|
||
var value = option.getAttribute("value") || option.innerHTML;
|
||
|
||
values.push(value);
|
||
}
|
||
});
|
||
|
||
return values;
|
||
},
|
||
|
||
isCheckboxOrRadio: function isCheckboxOrRadio() {
|
||
return this.props.type === "radio" || this.props.type === "checkbox";
|
||
},
|
||
|
||
isFile: function isFile() {
|
||
return this.props.type === "file";
|
||
},
|
||
|
||
renderInput: function renderInput() {
|
||
var input = null;
|
||
|
||
if (!this.props.type) {
|
||
return this.props.children;
|
||
}
|
||
|
||
switch (this.props.type) {
|
||
case "select":
|
||
input = React.createElement(
|
||
"select",
|
||
_extends({}, this.props, { className: classNames(this.props.className, "form-control"), ref: "input", key: "input" }),
|
||
this.props.children
|
||
);
|
||
break;
|
||
case "textarea":
|
||
input = React.createElement("textarea", _extends({}, this.props, { className: classNames(this.props.className, "form-control"), ref: "input", key: "input" }));
|
||
break;
|
||
case "static":
|
||
input = React.createElement(
|
||
"p",
|
||
_extends({}, this.props, { className: classNames(this.props.className, "form-control-static"), ref: "input", key: "input" }),
|
||
this.props.value
|
||
);
|
||
break;
|
||
case "submit":
|
||
input = React.createElement(Button, _extends({}, this.props, { componentClass: "input", ref: "input", key: "input" }));
|
||
break;
|
||
default:
|
||
var className = this.isCheckboxOrRadio() || this.isFile() ? "" : "form-control";
|
||
input = React.createElement("input", _extends({}, this.props, { className: classNames(this.props.className, className), ref: "input", key: "input" }));
|
||
}
|
||
|
||
return input;
|
||
},
|
||
|
||
renderInputGroup: function renderInputGroup(children) {
|
||
var addonBefore = this.props.addonBefore ? React.createElement(
|
||
"span",
|
||
{ className: "input-group-addon", key: "addonBefore" },
|
||
this.props.addonBefore
|
||
) : null;
|
||
|
||
var addonAfter = this.props.addonAfter ? React.createElement(
|
||
"span",
|
||
{ className: "input-group-addon", key: "addonAfter" },
|
||
this.props.addonAfter
|
||
) : null;
|
||
|
||
var buttonBefore = this.props.buttonBefore ? React.createElement(
|
||
"span",
|
||
{ className: "input-group-btn" },
|
||
this.props.buttonBefore
|
||
) : null;
|
||
|
||
var buttonAfter = this.props.buttonAfter ? React.createElement(
|
||
"span",
|
||
{ className: "input-group-btn" },
|
||
this.props.buttonAfter
|
||
) : null;
|
||
|
||
var inputGroupClassName = undefined;
|
||
switch (this.props.bsSize) {
|
||
case "small":
|
||
inputGroupClassName = "input-group-sm";break;
|
||
case "large":
|
||
inputGroupClassName = "input-group-lg";break;
|
||
}
|
||
|
||
return addonBefore || addonAfter || buttonBefore || buttonAfter ? React.createElement(
|
||
"div",
|
||
{ className: classNames(inputGroupClassName, "input-group"), key: "input-group" },
|
||
addonBefore,
|
||
buttonBefore,
|
||
children,
|
||
addonAfter,
|
||
buttonAfter
|
||
) : children;
|
||
},
|
||
|
||
renderIcon: function renderIcon() {
|
||
var classes = {
|
||
glyphicon: true,
|
||
"form-control-feedback": true,
|
||
"glyphicon-ok": this.props.bsStyle === "success",
|
||
"glyphicon-warning-sign": this.props.bsStyle === "warning",
|
||
"glyphicon-remove": this.props.bsStyle === "error"
|
||
};
|
||
|
||
return this.props.hasFeedback ? React.createElement("span", { className: classNames(classes), key: "icon" }) : null;
|
||
},
|
||
|
||
renderHelp: function renderHelp() {
|
||
return this.props.help ? React.createElement(
|
||
"span",
|
||
{ className: "help-block", key: "help" },
|
||
this.props.help
|
||
) : null;
|
||
},
|
||
|
||
renderCheckboxandRadioWrapper: function renderCheckboxandRadioWrapper(children) {
|
||
var classes = {
|
||
checkbox: this.props.type === "checkbox",
|
||
radio: this.props.type === "radio"
|
||
};
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: classNames(classes), key: "checkboxRadioWrapper" },
|
||
children
|
||
);
|
||
},
|
||
|
||
renderWrapper: function renderWrapper(children) {
|
||
return this.props.wrapperClassName ? React.createElement(
|
||
"div",
|
||
{ className: this.props.wrapperClassName, key: "wrapper" },
|
||
children
|
||
) : children;
|
||
},
|
||
|
||
renderLabel: function renderLabel(children) {
|
||
var classes = {
|
||
"control-label": !this.isCheckboxOrRadio()
|
||
};
|
||
classes[this.props.labelClassName] = this.props.labelClassName;
|
||
|
||
return this.props.label ? React.createElement(
|
||
"label",
|
||
{ htmlFor: this.props.id, className: classNames(classes), key: "label" },
|
||
children,
|
||
this.props.label
|
||
) : children;
|
||
},
|
||
|
||
render: function render() {
|
||
var children = undefined;
|
||
|
||
if (this.isCheckboxOrRadio()) {
|
||
children = this.renderWrapper([this.renderCheckboxandRadioWrapper(this.renderLabel(this.renderInput())), this.renderHelp()]);
|
||
} else {
|
||
children = [this.renderLabel(), this.renderWrapper([this.renderInputGroup(this.renderInput()), this.renderIcon(), this.renderHelp()])];
|
||
}
|
||
|
||
return React.createElement(
|
||
FormGroup,
|
||
this.props,
|
||
children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Input;
|
||
|
||
/***/ },
|
||
/* 22 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
// https://www.npmjs.org/package/react-interpolate-component
|
||
// TODO: Drop this in favor of es6 string interpolation
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var assign = _interopRequire(__webpack_require__(58));
|
||
|
||
var REGEXP = /\%\((.+?)\)s/;
|
||
|
||
var Interpolate = React.createClass({
|
||
displayName: "Interpolate",
|
||
|
||
propTypes: {
|
||
format: React.PropTypes.string
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return { component: "span" };
|
||
},
|
||
|
||
render: function render() {
|
||
var format = ValidComponentChildren.hasValidComponent(this.props.children) || typeof this.props.children === "string" ? this.props.children : this.props.format;
|
||
var parent = this.props.component;
|
||
var unsafe = this.props.unsafe === true;
|
||
var props = assign({}, this.props);
|
||
|
||
delete props.children;
|
||
delete props.format;
|
||
delete props.component;
|
||
delete props.unsafe;
|
||
|
||
if (unsafe) {
|
||
var content = format.split(REGEXP).reduce(function (memo, match, index) {
|
||
var html = undefined;
|
||
|
||
if (index % 2 === 0) {
|
||
html = match;
|
||
} else {
|
||
html = props[match];
|
||
delete props[match];
|
||
}
|
||
|
||
if (React.isValidElement(html)) {
|
||
throw new Error("cannot interpolate a React component into unsafe text");
|
||
}
|
||
|
||
memo += html;
|
||
|
||
return memo;
|
||
}, "");
|
||
|
||
props.dangerouslySetInnerHTML = { __html: content };
|
||
|
||
return React.createElement(parent, props);
|
||
} else {
|
||
var kids = format.split(REGEXP).reduce(function (memo, match, index) {
|
||
var child = undefined;
|
||
|
||
if (index % 2 === 0) {
|
||
if (match.length === 0) {
|
||
return memo;
|
||
}
|
||
|
||
child = match;
|
||
} else {
|
||
child = props[match];
|
||
delete props[match];
|
||
}
|
||
|
||
memo.push(child);
|
||
|
||
return memo;
|
||
}, []);
|
||
|
||
return React.createElement(parent, props, kids);
|
||
}
|
||
}
|
||
});
|
||
|
||
module.exports = Interpolate;
|
||
|
||
/***/ },
|
||
/* 23 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var Jumbotron = React.createClass({
|
||
displayName: "Jumbotron",
|
||
|
||
render: function render() {
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, "jumbotron") }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Jumbotron;
|
||
|
||
/***/ },
|
||
/* 24 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Label = React.createClass({
|
||
displayName: "Label",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "label",
|
||
bsStyle: "default"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
return React.createElement(
|
||
"span",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Label;
|
||
|
||
/***/ },
|
||
/* 25 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||
|
||
var _inherits = function (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) subClass.__proto__ = superClass; };
|
||
|
||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
||
|
||
var _react = __webpack_require__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var ListGroup = (function (_React$Component) {
|
||
function ListGroup() {
|
||
_classCallCheck(this, ListGroup);
|
||
|
||
if (_React$Component != null) {
|
||
_React$Component.apply(this, arguments);
|
||
}
|
||
}
|
||
|
||
_inherits(ListGroup, _React$Component);
|
||
|
||
_createClass(ListGroup, {
|
||
render: {
|
||
value: function render() {
|
||
var items = ValidComponentChildren.map(this.props.children, function (item, index) {
|
||
return cloneElement(item, { key: item.key ? item.key : index });
|
||
});
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: classNames(this.props.className, "list-group") },
|
||
items
|
||
);
|
||
}
|
||
}
|
||
});
|
||
|
||
return ListGroup;
|
||
})(React.Component);
|
||
|
||
ListGroup.propTypes = {
|
||
className: React.PropTypes.string
|
||
};
|
||
|
||
module.exports = ListGroup;
|
||
|
||
/***/ },
|
||
/* 26 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var ListGroupItem = React.createClass({
|
||
displayName: "ListGroupItem",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
bsStyle: React.PropTypes.oneOf(["danger", "info", "success", "warning"]),
|
||
active: React.PropTypes.any,
|
||
disabled: React.PropTypes.any,
|
||
header: React.PropTypes.node,
|
||
onClick: React.PropTypes.func,
|
||
eventKey: React.PropTypes.any,
|
||
href: React.PropTypes.string,
|
||
target: React.PropTypes.string
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "list-group-item"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
classes.active = this.props.active;
|
||
classes.disabled = this.props.disabled;
|
||
|
||
if (this.props.href || this.props.target || this.props.onClick) {
|
||
return this.renderAnchor(classes);
|
||
} else {
|
||
return this.renderSpan(classes);
|
||
}
|
||
},
|
||
|
||
renderSpan: function renderSpan(classes) {
|
||
return React.createElement(
|
||
"span",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.header ? this.renderStructuredContent() : this.props.children
|
||
);
|
||
},
|
||
|
||
renderAnchor: function renderAnchor(classes) {
|
||
return React.createElement(
|
||
"a",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes)
|
||
}),
|
||
this.props.header ? this.renderStructuredContent() : this.props.children
|
||
);
|
||
},
|
||
|
||
renderStructuredContent: function renderStructuredContent() {
|
||
var header = undefined;
|
||
if (React.isValidElement(this.props.header)) {
|
||
header = cloneElement(this.props.header, {
|
||
key: "header",
|
||
className: classNames(this.props.header.props.className, "list-group-item-heading")
|
||
});
|
||
} else {
|
||
header = React.createElement(
|
||
"h4",
|
||
{ key: "header", className: "list-group-item-heading" },
|
||
this.props.header
|
||
);
|
||
}
|
||
|
||
var content = React.createElement(
|
||
"p",
|
||
{ key: "content", className: "list-group-item-text" },
|
||
this.props.children
|
||
);
|
||
|
||
return [header, content];
|
||
}
|
||
});
|
||
|
||
module.exports = ListGroupItem;
|
||
|
||
/***/ },
|
||
/* 27 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var MenuItem = React.createClass({
|
||
displayName: "MenuItem",
|
||
|
||
propTypes: {
|
||
header: React.PropTypes.bool,
|
||
divider: React.PropTypes.bool,
|
||
href: React.PropTypes.string,
|
||
title: React.PropTypes.string,
|
||
target: React.PropTypes.string,
|
||
onSelect: React.PropTypes.func,
|
||
eventKey: React.PropTypes.any
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
href: "#"
|
||
};
|
||
},
|
||
|
||
handleClick: function handleClick(e) {
|
||
if (this.props.onSelect) {
|
||
e.preventDefault();
|
||
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
|
||
}
|
||
},
|
||
|
||
renderAnchor: function renderAnchor() {
|
||
return React.createElement(
|
||
"a",
|
||
{ onClick: this.handleClick, href: this.props.href, target: this.props.target, title: this.props.title, tabIndex: "-1" },
|
||
this.props.children
|
||
);
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
"dropdown-header": this.props.header,
|
||
divider: this.props.divider
|
||
};
|
||
|
||
var children = null;
|
||
if (this.props.header) {
|
||
children = this.props.children;
|
||
} else if (!this.props.divider) {
|
||
children = this.renderAnchor();
|
||
}
|
||
|
||
return React.createElement(
|
||
"li",
|
||
_extends({}, this.props, { role: "presentation", title: null, href: null,
|
||
className: classNames(this.props.className, classes) }),
|
||
children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = MenuItem;
|
||
|
||
/***/ },
|
||
/* 28 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var FadeMixin = _interopRequire(__webpack_require__(18));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var EventListener = _interopRequire(__webpack_require__(53));
|
||
|
||
// TODO:
|
||
// - aria-labelledby
|
||
// - Add `modal-body` div if only one child passed in that doesn't already have it
|
||
// - Tests
|
||
|
||
var Modal = React.createClass({
|
||
displayName: "Modal",
|
||
|
||
mixins: [BootstrapMixin, FadeMixin],
|
||
|
||
propTypes: {
|
||
title: React.PropTypes.node,
|
||
backdrop: React.PropTypes.oneOf(["static", true, false]),
|
||
keyboard: React.PropTypes.bool,
|
||
closeButton: React.PropTypes.bool,
|
||
animation: React.PropTypes.bool,
|
||
onRequestHide: React.PropTypes.func.isRequired
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "modal",
|
||
backdrop: true,
|
||
keyboard: true,
|
||
animation: true,
|
||
closeButton: true
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var modalStyle = { display: "block" };
|
||
var dialogClasses = this.getBsClassSet();
|
||
delete dialogClasses.modal;
|
||
dialogClasses["modal-dialog"] = true;
|
||
|
||
var classes = {
|
||
modal: true,
|
||
fade: this.props.animation,
|
||
"in": !this.props.animation || !document.querySelectorAll
|
||
};
|
||
|
||
var modal = React.createElement(
|
||
"div",
|
||
_extends({}, this.props, {
|
||
title: null,
|
||
tabIndex: "-1",
|
||
role: "dialog",
|
||
style: modalStyle,
|
||
className: classNames(this.props.className, classes),
|
||
onClick: this.props.backdrop === true ? this.handleBackdropClick : null,
|
||
ref: "modal" }),
|
||
React.createElement(
|
||
"div",
|
||
{ className: classNames(dialogClasses) },
|
||
React.createElement(
|
||
"div",
|
||
{ className: "modal-content", style: { overflow: "hidden" } },
|
||
this.props.title ? this.renderHeader() : null,
|
||
this.props.children
|
||
)
|
||
)
|
||
);
|
||
|
||
return this.props.backdrop ? this.renderBackdrop(modal) : modal;
|
||
},
|
||
|
||
renderBackdrop: function renderBackdrop(modal) {
|
||
var classes = {
|
||
"modal-backdrop": true,
|
||
fade: this.props.animation
|
||
};
|
||
|
||
classes["in"] = !this.props.animation || !document.querySelectorAll;
|
||
|
||
var onClick = this.props.backdrop === true ? this.handleBackdropClick : null;
|
||
|
||
return React.createElement(
|
||
"div",
|
||
null,
|
||
React.createElement("div", { className: classNames(classes), ref: "backdrop", onClick: onClick }),
|
||
modal
|
||
);
|
||
},
|
||
|
||
renderHeader: function renderHeader() {
|
||
var closeButton = undefined;
|
||
if (this.props.closeButton) {
|
||
closeButton = React.createElement(
|
||
"button",
|
||
{ type: "button", className: "close", "aria-hidden": "true", onClick: this.props.onRequestHide },
|
||
"×"
|
||
);
|
||
}
|
||
|
||
var style = this.props.bsStyle;
|
||
var classes = {
|
||
"modal-header": true
|
||
};
|
||
classes["bg-" + style] = style;
|
||
classes["text-" + style] = style;
|
||
|
||
var className = classNames(classes);
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: className },
|
||
closeButton,
|
||
this.renderTitle()
|
||
);
|
||
},
|
||
|
||
renderTitle: function renderTitle() {
|
||
return React.isValidElement(this.props.title) ? this.props.title : React.createElement(
|
||
"h4",
|
||
{ className: "modal-title" },
|
||
this.props.title
|
||
);
|
||
},
|
||
|
||
iosClickHack: function iosClickHack() {
|
||
// IOS only allows click events to be delegated to the document on elements
|
||
// it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the
|
||
// DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169
|
||
React.findDOMNode(this.refs.modal).onclick = function () {};
|
||
React.findDOMNode(this.refs.backdrop).onclick = function () {};
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
this._onDocumentKeyupListener = EventListener.listen(domUtils.ownerDocument(this), "keyup", this.handleDocumentKeyUp);
|
||
|
||
var container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body;
|
||
container.className += container.className.length ? " modal-open" : "modal-open";
|
||
|
||
if (this.props.backdrop) {
|
||
this.iosClickHack();
|
||
}
|
||
},
|
||
|
||
componentDidUpdate: function componentDidUpdate(prevProps) {
|
||
if (this.props.backdrop && this.props.backdrop !== prevProps.backdrop) {
|
||
this.iosClickHack();
|
||
}
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
this._onDocumentKeyupListener.remove();
|
||
var container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body;
|
||
container.className = container.className.replace(/ ?modal-open/, "");
|
||
},
|
||
|
||
handleBackdropClick: function handleBackdropClick(e) {
|
||
if (e.target !== e.currentTarget) {
|
||
return;
|
||
}
|
||
|
||
this.props.onRequestHide();
|
||
},
|
||
|
||
handleDocumentKeyUp: function handleDocumentKeyUp(e) {
|
||
if (this.props.keyboard && e.keyCode === 27) {
|
||
this.props.onRequestHide();
|
||
}
|
||
}
|
||
});
|
||
|
||
module.exports = Modal;
|
||
|
||
/***/ },
|
||
/* 29 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var CollapsableMixin = _interopRequire(__webpack_require__(14));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var Nav = React.createClass({
|
||
displayName: "Nav",
|
||
|
||
mixins: [BootstrapMixin, CollapsableMixin],
|
||
|
||
propTypes: {
|
||
activeHref: React.PropTypes.string,
|
||
activeKey: React.PropTypes.any,
|
||
bsStyle: React.PropTypes.oneOf(["tabs", "pills"]),
|
||
stacked: React.PropTypes.bool,
|
||
justified: React.PropTypes.bool,
|
||
onSelect: React.PropTypes.func,
|
||
collapsable: React.PropTypes.bool,
|
||
expanded: React.PropTypes.bool,
|
||
navbar: React.PropTypes.bool,
|
||
eventKey: React.PropTypes.any,
|
||
pullRight: React.PropTypes.bool,
|
||
right: React.PropTypes.bool
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "nav"
|
||
};
|
||
},
|
||
|
||
getCollapsableDOMNode: function getCollapsableDOMNode() {
|
||
return React.findDOMNode(this);
|
||
},
|
||
|
||
getCollapsableDimensionValue: function getCollapsableDimensionValue() {
|
||
var node = React.findDOMNode(this.refs.ul),
|
||
height = node.offsetHeight,
|
||
computedStyles = domUtils.getComputedStyles(node);
|
||
|
||
return height + parseInt(computedStyles.marginTop, 10) + parseInt(computedStyles.marginBottom, 10);
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.props.collapsable ? this.getCollapsableClassSet() : {};
|
||
|
||
classes["navbar-collapse"] = this.props.collapsable;
|
||
|
||
if (this.props.navbar && !this.props.collapsable) {
|
||
return this.renderUl();
|
||
}
|
||
|
||
return React.createElement(
|
||
"nav",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.renderUl()
|
||
);
|
||
},
|
||
|
||
renderUl: function renderUl() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
classes["nav-stacked"] = this.props.stacked;
|
||
classes["nav-justified"] = this.props.justified;
|
||
classes["navbar-nav"] = this.props.navbar;
|
||
classes["pull-right"] = this.props.pullRight;
|
||
classes["navbar-right"] = this.props.right;
|
||
|
||
return React.createElement(
|
||
"ul",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes), ref: "ul" }),
|
||
ValidComponentChildren.map(this.props.children, this.renderNavItem)
|
||
);
|
||
},
|
||
|
||
getChildActiveProp: function getChildActiveProp(child) {
|
||
if (child.props.active) {
|
||
return true;
|
||
}
|
||
if (this.props.activeKey != null) {
|
||
if (child.props.eventKey === this.props.activeKey) {
|
||
return true;
|
||
}
|
||
}
|
||
if (this.props.activeHref != null) {
|
||
if (child.props.href === this.props.activeHref) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
return child.props.active;
|
||
},
|
||
|
||
renderNavItem: function renderNavItem(child, index) {
|
||
return cloneElement(child, {
|
||
active: this.getChildActiveProp(child),
|
||
activeKey: this.props.activeKey,
|
||
activeHref: this.props.activeHref,
|
||
onSelect: createChainedFunction(child.props.onSelect, this.props.onSelect),
|
||
key: child.key ? child.key : index,
|
||
navItem: true
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = Nav;
|
||
|
||
/***/ },
|
||
/* 30 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var Navbar = React.createClass({
|
||
displayName: "Navbar",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
fixedTop: React.PropTypes.bool,
|
||
fixedBottom: React.PropTypes.bool,
|
||
staticTop: React.PropTypes.bool,
|
||
inverse: React.PropTypes.bool,
|
||
fluid: React.PropTypes.bool,
|
||
role: React.PropTypes.string,
|
||
componentClass: React.PropTypes.node.isRequired,
|
||
brand: React.PropTypes.node,
|
||
toggleButton: React.PropTypes.node,
|
||
toggleNavKey: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]),
|
||
onToggle: React.PropTypes.func,
|
||
navExpanded: React.PropTypes.bool,
|
||
defaultNavExpanded: React.PropTypes.bool
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "navbar",
|
||
bsStyle: "default",
|
||
role: "navigation",
|
||
componentClass: "Nav"
|
||
};
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
navExpanded: this.props.defaultNavExpanded
|
||
};
|
||
},
|
||
|
||
shouldComponentUpdate: function shouldComponentUpdate() {
|
||
// Defer any updates to this component during the `onSelect` handler.
|
||
return !this._isChanging;
|
||
},
|
||
|
||
handleToggle: function handleToggle() {
|
||
if (this.props.onToggle) {
|
||
this._isChanging = true;
|
||
this.props.onToggle();
|
||
this._isChanging = false;
|
||
}
|
||
|
||
this.setState({
|
||
navExpanded: !this.state.navExpanded
|
||
});
|
||
},
|
||
|
||
isNavExpanded: function isNavExpanded() {
|
||
return this.props.navExpanded != null ? this.props.navExpanded : this.state.navExpanded;
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
var ComponentClass = this.props.componentClass;
|
||
|
||
classes["navbar-fixed-top"] = this.props.fixedTop;
|
||
classes["navbar-fixed-bottom"] = this.props.fixedBottom;
|
||
classes["navbar-static-top"] = this.props.staticTop;
|
||
classes["navbar-inverse"] = this.props.inverse;
|
||
|
||
return React.createElement(
|
||
ComponentClass,
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
React.createElement(
|
||
"div",
|
||
{ className: this.props.fluid ? "container-fluid" : "container" },
|
||
this.props.brand || this.props.toggleButton || this.props.toggleNavKey != null ? this.renderHeader() : null,
|
||
ValidComponentChildren.map(this.props.children, this.renderChild)
|
||
)
|
||
);
|
||
},
|
||
|
||
renderChild: function renderChild(child, index) {
|
||
return cloneElement(child, {
|
||
navbar: true,
|
||
collapsable: this.props.toggleNavKey != null && this.props.toggleNavKey === child.props.eventKey,
|
||
expanded: this.props.toggleNavKey != null && this.props.toggleNavKey === child.props.eventKey && this.isNavExpanded(),
|
||
key: child.key ? child.key : index
|
||
});
|
||
},
|
||
|
||
renderHeader: function renderHeader() {
|
||
var brand = undefined;
|
||
|
||
if (this.props.brand) {
|
||
if (React.isValidElement(this.props.brand)) {
|
||
brand = cloneElement(this.props.brand, {
|
||
className: classNames(this.props.brand.props.className, "navbar-brand")
|
||
});
|
||
} else {
|
||
brand = React.createElement(
|
||
"span",
|
||
{ className: "navbar-brand" },
|
||
this.props.brand
|
||
);
|
||
}
|
||
}
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: "navbar-header" },
|
||
brand,
|
||
this.props.toggleButton || this.props.toggleNavKey != null ? this.renderToggleButton() : null
|
||
);
|
||
},
|
||
|
||
renderToggleButton: function renderToggleButton() {
|
||
var children = undefined;
|
||
|
||
if (React.isValidElement(this.props.toggleButton)) {
|
||
|
||
return cloneElement(this.props.toggleButton, {
|
||
className: classNames(this.props.toggleButton.props.className, "navbar-toggle"),
|
||
onClick: createChainedFunction(this.handleToggle, this.props.toggleButton.props.onClick)
|
||
});
|
||
}
|
||
|
||
children = this.props.toggleButton != null ? this.props.toggleButton : [React.createElement(
|
||
"span",
|
||
{ className: "sr-only", key: 0 },
|
||
"Toggle navigation"
|
||
), React.createElement("span", { className: "icon-bar", key: 1 }), React.createElement("span", { className: "icon-bar", key: 2 }), React.createElement("span", { className: "icon-bar", key: 3 })];
|
||
|
||
return React.createElement(
|
||
"button",
|
||
{ className: "navbar-toggle", type: "button", onClick: this.handleToggle },
|
||
children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Navbar;
|
||
|
||
/***/ },
|
||
/* 31 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _objectWithoutProperties = function (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 _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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var NavItem = React.createClass({
|
||
displayName: "NavItem",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
onSelect: React.PropTypes.func,
|
||
active: React.PropTypes.bool,
|
||
disabled: React.PropTypes.bool,
|
||
href: React.PropTypes.string,
|
||
title: React.PropTypes.node,
|
||
eventKey: React.PropTypes.any,
|
||
target: React.PropTypes.string
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
href: "#"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var _props = this.props;
|
||
var disabled = _props.disabled;
|
||
var active = _props.active;
|
||
var href = _props.href;
|
||
var title = _props.title;
|
||
var target = _props.target;
|
||
var children = _props.children;
|
||
|
||
var props = _objectWithoutProperties(_props, ["disabled", "active", "href", "title", "target", "children"]);
|
||
|
||
var classes = {
|
||
active: active,
|
||
disabled: disabled
|
||
};
|
||
var linkProps = {
|
||
href: href,
|
||
title: title,
|
||
target: target,
|
||
onClick: this.handleClick,
|
||
ref: "anchor"
|
||
};
|
||
|
||
if (href === "#") {
|
||
linkProps.role = "button";
|
||
}
|
||
|
||
return React.createElement(
|
||
"li",
|
||
_extends({}, props, { className: classNames(props.className, classes) }),
|
||
React.createElement(
|
||
"a",
|
||
linkProps,
|
||
children
|
||
)
|
||
);
|
||
},
|
||
|
||
handleClick: function handleClick(e) {
|
||
if (this.props.onSelect) {
|
||
e.preventDefault();
|
||
|
||
if (!this.props.disabled) {
|
||
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
module.exports = NavItem;
|
||
|
||
/***/ },
|
||
/* 32 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _react = __webpack_require__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var OverlayMixin = _interopRequire(__webpack_require__(34));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var ModalTrigger = React.createClass({
|
||
displayName: "ModalTrigger",
|
||
|
||
mixins: [OverlayMixin],
|
||
|
||
propTypes: {
|
||
modal: React.PropTypes.node.isRequired
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
isOverlayShown: false
|
||
};
|
||
},
|
||
|
||
show: function show() {
|
||
this.setState({
|
||
isOverlayShown: true
|
||
});
|
||
},
|
||
|
||
hide: function hide() {
|
||
this.setState({
|
||
isOverlayShown: false
|
||
});
|
||
},
|
||
|
||
toggle: function toggle() {
|
||
this.setState({
|
||
isOverlayShown: !this.state.isOverlayShown
|
||
});
|
||
},
|
||
|
||
renderOverlay: function renderOverlay() {
|
||
if (!this.state.isOverlayShown) {
|
||
return React.createElement("span", null);
|
||
}
|
||
|
||
return cloneElement(this.props.modal, {
|
||
onRequestHide: this.hide
|
||
});
|
||
},
|
||
|
||
render: function render() {
|
||
var child = React.Children.only(this.props.children);
|
||
return cloneElement(child, {
|
||
onClick: createChainedFunction(child.props.onClick, this.toggle)
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = ModalTrigger;
|
||
|
||
/***/ },
|
||
/* 33 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _react = __webpack_require__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var OverlayMixin = _interopRequire(__webpack_require__(34));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var assign = _interopRequire(__webpack_require__(58));
|
||
|
||
/**
|
||
* Check if value one is inside or equal to the of value
|
||
*
|
||
* @param {string} one
|
||
* @param {string|array} of
|
||
* @returns {boolean}
|
||
*/
|
||
function isOneOf(one, of) {
|
||
if (Array.isArray(of)) {
|
||
return of.indexOf(one) >= 0;
|
||
}
|
||
return one === of;
|
||
}
|
||
|
||
var OverlayTrigger = React.createClass({
|
||
displayName: "OverlayTrigger",
|
||
|
||
mixins: [OverlayMixin],
|
||
|
||
propTypes: {
|
||
trigger: React.PropTypes.oneOfType([React.PropTypes.oneOf(["manual", "click", "hover", "focus"]), React.PropTypes.arrayOf(React.PropTypes.oneOf(["click", "hover", "focus"]))]),
|
||
placement: React.PropTypes.oneOf(["top", "right", "bottom", "left"]),
|
||
delay: React.PropTypes.number,
|
||
delayShow: React.PropTypes.number,
|
||
delayHide: React.PropTypes.number,
|
||
defaultOverlayShown: React.PropTypes.bool,
|
||
overlay: React.PropTypes.node.isRequired
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
placement: "right",
|
||
trigger: ["hover", "focus"]
|
||
};
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
isOverlayShown: this.props.defaultOverlayShown == null ? false : this.props.defaultOverlayShown,
|
||
overlayLeft: null,
|
||
overlayTop: null
|
||
};
|
||
},
|
||
|
||
show: function show() {
|
||
this.setState({
|
||
isOverlayShown: true
|
||
}, function () {
|
||
this.updateOverlayPosition();
|
||
});
|
||
},
|
||
|
||
hide: function hide() {
|
||
this.setState({
|
||
isOverlayShown: false
|
||
});
|
||
},
|
||
|
||
toggle: function toggle() {
|
||
if (this.state.isOverlayShown) {
|
||
this.hide();
|
||
} else {
|
||
this.show();
|
||
}
|
||
},
|
||
|
||
renderOverlay: function renderOverlay() {
|
||
if (!this.state.isOverlayShown) {
|
||
return React.createElement("span", null);
|
||
}
|
||
|
||
return cloneElement(this.props.overlay, {
|
||
onRequestHide: this.hide,
|
||
placement: this.props.placement,
|
||
positionLeft: this.state.overlayLeft,
|
||
positionTop: this.state.overlayTop
|
||
});
|
||
},
|
||
|
||
render: function render() {
|
||
if (this.props.trigger === "manual") {
|
||
return React.Children.only(this.props.children);
|
||
}
|
||
|
||
var props = {};
|
||
|
||
if (isOneOf("click", this.props.trigger)) {
|
||
props.onClick = createChainedFunction(this.toggle, this.props.onClick);
|
||
}
|
||
|
||
if (isOneOf("hover", this.props.trigger)) {
|
||
props.onMouseOver = createChainedFunction(this.handleDelayedShow, this.props.onMouseOver);
|
||
props.onMouseOut = createChainedFunction(this.handleDelayedHide, this.props.onMouseOut);
|
||
}
|
||
|
||
if (isOneOf("focus", this.props.trigger)) {
|
||
props.onFocus = createChainedFunction(this.handleDelayedShow, this.props.onFocus);
|
||
props.onBlur = createChainedFunction(this.handleDelayedHide, this.props.onBlur);
|
||
}
|
||
|
||
return cloneElement(React.Children.only(this.props.children), props);
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
clearTimeout(this._hoverDelay);
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
if (this.props.defaultOverlayShown) {
|
||
this.updateOverlayPosition();
|
||
}
|
||
},
|
||
|
||
handleDelayedShow: function handleDelayedShow() {
|
||
if (this._hoverDelay != null) {
|
||
clearTimeout(this._hoverDelay);
|
||
this._hoverDelay = null;
|
||
return;
|
||
}
|
||
|
||
var delay = this.props.delayShow != null ? this.props.delayShow : this.props.delay;
|
||
|
||
if (!delay) {
|
||
this.show();
|
||
return;
|
||
}
|
||
|
||
this._hoverDelay = setTimeout((function () {
|
||
this._hoverDelay = null;
|
||
this.show();
|
||
}).bind(this), delay);
|
||
},
|
||
|
||
handleDelayedHide: function handleDelayedHide() {
|
||
if (this._hoverDelay != null) {
|
||
clearTimeout(this._hoverDelay);
|
||
this._hoverDelay = null;
|
||
return;
|
||
}
|
||
|
||
var delay = this.props.delayHide != null ? this.props.delayHide : this.props.delay;
|
||
|
||
if (!delay) {
|
||
this.hide();
|
||
return;
|
||
}
|
||
|
||
this._hoverDelay = setTimeout((function () {
|
||
this._hoverDelay = null;
|
||
this.hide();
|
||
}).bind(this), delay);
|
||
},
|
||
|
||
updateOverlayPosition: function updateOverlayPosition() {
|
||
if (!this.isMounted()) {
|
||
return;
|
||
}
|
||
|
||
var pos = this.calcOverlayPosition();
|
||
|
||
this.setState({
|
||
overlayLeft: pos.left,
|
||
overlayTop: pos.top
|
||
});
|
||
},
|
||
|
||
calcOverlayPosition: function calcOverlayPosition() {
|
||
var childOffset = this.getPosition();
|
||
|
||
var overlayNode = this.getOverlayDOMNode();
|
||
var overlayHeight = overlayNode.offsetHeight;
|
||
var overlayWidth = overlayNode.offsetWidth;
|
||
|
||
switch (this.props.placement) {
|
||
case "right":
|
||
return {
|
||
top: childOffset.top + childOffset.height / 2 - overlayHeight / 2,
|
||
left: childOffset.left + childOffset.width
|
||
};
|
||
case "left":
|
||
return {
|
||
top: childOffset.top + childOffset.height / 2 - overlayHeight / 2,
|
||
left: childOffset.left - overlayWidth
|
||
};
|
||
case "top":
|
||
return {
|
||
top: childOffset.top - overlayHeight,
|
||
left: childOffset.left + childOffset.width / 2 - overlayWidth / 2
|
||
};
|
||
case "bottom":
|
||
return {
|
||
top: childOffset.top + childOffset.height,
|
||
left: childOffset.left + childOffset.width / 2 - overlayWidth / 2
|
||
};
|
||
default:
|
||
throw new Error("calcOverlayPosition(): No such placement of \"" + this.props.placement + "\" found.");
|
||
}
|
||
},
|
||
|
||
getPosition: function getPosition() {
|
||
var node = React.findDOMNode(this);
|
||
var container = this.getContainerDOMNode();
|
||
|
||
var offset = container.tagName === "BODY" ? domUtils.getOffset(node) : domUtils.getPosition(node, container);
|
||
|
||
return assign({}, offset, {
|
||
height: node.offsetHeight,
|
||
width: node.offsetWidth
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = OverlayTrigger;
|
||
|
||
/***/ },
|
||
/* 34 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var CustomPropTypes = _interopRequire(__webpack_require__(59));
|
||
|
||
var domUtils = _interopRequire(__webpack_require__(52));
|
||
|
||
module.exports = {
|
||
propTypes: {
|
||
container: CustomPropTypes.mountable
|
||
},
|
||
|
||
componentWillUnmount: function componentWillUnmount() {
|
||
this._unrenderOverlay();
|
||
if (this._overlayTarget) {
|
||
this.getContainerDOMNode().removeChild(this._overlayTarget);
|
||
this._overlayTarget = null;
|
||
}
|
||
},
|
||
|
||
componentDidUpdate: function componentDidUpdate() {
|
||
this._renderOverlay();
|
||
},
|
||
|
||
componentDidMount: function componentDidMount() {
|
||
this._renderOverlay();
|
||
},
|
||
|
||
_mountOverlayTarget: function _mountOverlayTarget() {
|
||
this._overlayTarget = document.createElement("div");
|
||
this.getContainerDOMNode().appendChild(this._overlayTarget);
|
||
},
|
||
|
||
_renderOverlay: function _renderOverlay() {
|
||
if (!this._overlayTarget) {
|
||
this._mountOverlayTarget();
|
||
}
|
||
|
||
var overlay = this.renderOverlay();
|
||
|
||
// Save reference to help testing
|
||
if (overlay !== null) {
|
||
this._overlayInstance = React.render(overlay, this._overlayTarget);
|
||
} else {
|
||
// Unrender if the component is null for transitions to null
|
||
this._unrenderOverlay();
|
||
}
|
||
},
|
||
|
||
_unrenderOverlay: function _unrenderOverlay() {
|
||
React.unmountComponentAtNode(this._overlayTarget);
|
||
this._overlayInstance = null;
|
||
},
|
||
|
||
getOverlayDOMNode: function getOverlayDOMNode() {
|
||
if (!this.isMounted()) {
|
||
throw new Error("getOverlayDOMNode(): A component must be mounted to have a DOM node.");
|
||
}
|
||
|
||
if (this._overlayInstance) {
|
||
return React.findDOMNode(this._overlayInstance);
|
||
}
|
||
|
||
return null;
|
||
},
|
||
|
||
getContainerDOMNode: function getContainerDOMNode() {
|
||
return React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body;
|
||
}
|
||
};
|
||
|
||
/***/ },
|
||
/* 35 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var PageHeader = React.createClass({
|
||
displayName: "PageHeader",
|
||
|
||
render: function render() {
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, "page-header") }),
|
||
React.createElement(
|
||
"h1",
|
||
null,
|
||
this.props.children
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = PageHeader;
|
||
|
||
/***/ },
|
||
/* 36 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var CollapsableMixin = _interopRequire(__webpack_require__(14));
|
||
|
||
var Panel = React.createClass({
|
||
displayName: "Panel",
|
||
|
||
mixins: [BootstrapMixin, CollapsableMixin],
|
||
|
||
propTypes: {
|
||
collapsable: React.PropTypes.bool,
|
||
onSelect: React.PropTypes.func,
|
||
header: React.PropTypes.node,
|
||
id: React.PropTypes.string,
|
||
footer: React.PropTypes.node,
|
||
eventKey: React.PropTypes.any
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "panel",
|
||
bsStyle: "default"
|
||
};
|
||
},
|
||
|
||
handleSelect: function handleSelect(e) {
|
||
e.selected = true;
|
||
|
||
if (this.props.onSelect) {
|
||
this.props.onSelect(e, this.props.eventKey);
|
||
} else {
|
||
e.preventDefault();
|
||
}
|
||
|
||
if (e.selected) {
|
||
this.handleToggle();
|
||
}
|
||
},
|
||
|
||
handleToggle: function handleToggle() {
|
||
this.setState({ expanded: !this.state.expanded });
|
||
},
|
||
|
||
getCollapsableDimensionValue: function getCollapsableDimensionValue() {
|
||
return React.findDOMNode(this.refs.panel).scrollHeight;
|
||
},
|
||
|
||
getCollapsableDOMNode: function getCollapsableDOMNode() {
|
||
if (!this.isMounted() || !this.refs || !this.refs.panel) {
|
||
return null;
|
||
}
|
||
|
||
return React.findDOMNode(this.refs.panel);
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes),
|
||
id: this.props.collapsable ? null : this.props.id, onSelect: null }),
|
||
this.renderHeading(),
|
||
this.props.collapsable ? this.renderCollapsableBody() : this.renderBody(),
|
||
this.renderFooter()
|
||
);
|
||
},
|
||
|
||
renderCollapsableBody: function renderCollapsableBody() {
|
||
var collapseClass = this.prefixClass("collapse");
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{
|
||
className: classNames(this.getCollapsableClassSet(collapseClass)),
|
||
id: this.props.id,
|
||
ref: "panel",
|
||
"aria-expanded": this.isExpanded() ? "true" : "false" },
|
||
this.renderBody()
|
||
);
|
||
},
|
||
|
||
renderBody: function renderBody() {
|
||
var allChildren = this.props.children;
|
||
var bodyElements = [];
|
||
var panelBodyChildren = [];
|
||
var bodyClass = this.prefixClass("body");
|
||
|
||
function getProps() {
|
||
return { key: bodyElements.length };
|
||
}
|
||
|
||
function addPanelChild(child) {
|
||
bodyElements.push(cloneElement(child, getProps()));
|
||
}
|
||
|
||
function addPanelBody(children) {
|
||
bodyElements.push(React.createElement(
|
||
"div",
|
||
_extends({ className: bodyClass }, getProps()),
|
||
children
|
||
));
|
||
}
|
||
|
||
function maybeRenderPanelBody() {
|
||
if (panelBodyChildren.length === 0) {
|
||
return;
|
||
}
|
||
|
||
addPanelBody(panelBodyChildren);
|
||
panelBodyChildren = [];
|
||
}
|
||
|
||
// Handle edge cases where we should not iterate through children.
|
||
if (!Array.isArray(allChildren) || allChildren.length === 0) {
|
||
if (this.shouldRenderFill(allChildren)) {
|
||
addPanelChild(allChildren);
|
||
} else {
|
||
addPanelBody(allChildren);
|
||
}
|
||
} else {
|
||
|
||
allChildren.forEach((function (child) {
|
||
if (this.shouldRenderFill(child)) {
|
||
maybeRenderPanelBody();
|
||
|
||
// Separately add the filled element.
|
||
addPanelChild(child);
|
||
} else {
|
||
panelBodyChildren.push(child);
|
||
}
|
||
}).bind(this));
|
||
|
||
maybeRenderPanelBody();
|
||
}
|
||
|
||
return bodyElements;
|
||
},
|
||
|
||
shouldRenderFill: function shouldRenderFill(child) {
|
||
return React.isValidElement(child) && child.props.fill != null;
|
||
},
|
||
|
||
renderHeading: function renderHeading() {
|
||
var header = this.props.header;
|
||
|
||
if (!header) {
|
||
return null;
|
||
}
|
||
|
||
if (!React.isValidElement(header) || Array.isArray(header)) {
|
||
header = this.props.collapsable ? this.renderCollapsableTitle(header) : header;
|
||
} else if (this.props.collapsable) {
|
||
|
||
header = cloneElement(header, {
|
||
className: classNames(this.prefixClass("title")),
|
||
children: this.renderAnchor(header.props.children)
|
||
});
|
||
} else {
|
||
|
||
header = cloneElement(header, {
|
||
className: classNames(this.prefixClass("title"))
|
||
});
|
||
}
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: this.prefixClass("heading") },
|
||
header
|
||
);
|
||
},
|
||
|
||
renderAnchor: function renderAnchor(header) {
|
||
return React.createElement(
|
||
"a",
|
||
{
|
||
href: "#" + (this.props.id || ""),
|
||
className: this.isExpanded() ? null : "collapsed",
|
||
"aria-expanded": this.isExpanded() ? "true" : "false",
|
||
onClick: this.handleSelect },
|
||
header
|
||
);
|
||
},
|
||
|
||
renderCollapsableTitle: function renderCollapsableTitle(header) {
|
||
return React.createElement(
|
||
"h4",
|
||
{ className: this.prefixClass("title") },
|
||
this.renderAnchor(header)
|
||
);
|
||
},
|
||
|
||
renderFooter: function renderFooter() {
|
||
if (!this.props.footer) {
|
||
return null;
|
||
}
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: this.prefixClass("footer") },
|
||
this.props.footer
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Panel;
|
||
|
||
/***/ },
|
||
/* 37 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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; };
|
||
|
||
/* eslint react/prop-types: [1, {ignore: ["children", "className", "bsStyle"]}]*/
|
||
/* BootstrapMixin contains `bsStyle` type validation */
|
||
|
||
var _react = __webpack_require__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var PanelGroup = React.createClass({
|
||
displayName: "PanelGroup",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
collapsable: React.PropTypes.bool,
|
||
accordion: React.PropTypes.bool,
|
||
activeKey: React.PropTypes.any,
|
||
defaultActiveKey: React.PropTypes.any,
|
||
onSelect: React.PropTypes.func
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "panel-group"
|
||
};
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
var defaultActiveKey = this.props.defaultActiveKey;
|
||
|
||
return {
|
||
activeKey: defaultActiveKey
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes), onSelect: null }),
|
||
ValidComponentChildren.map(this.props.children, this.renderPanel)
|
||
);
|
||
},
|
||
|
||
renderPanel: function renderPanel(child, index) {
|
||
var activeKey = this.props.activeKey != null ? this.props.activeKey : this.state.activeKey;
|
||
|
||
var props = {
|
||
bsStyle: child.props.bsStyle || this.props.bsStyle,
|
||
key: child.key ? child.key : index,
|
||
ref: child.ref
|
||
};
|
||
|
||
if (this.props.accordion) {
|
||
props.collapsable = true;
|
||
props.expanded = child.props.eventKey === activeKey;
|
||
props.onSelect = this.handleSelect;
|
||
}
|
||
|
||
return cloneElement(child, props);
|
||
},
|
||
|
||
shouldComponentUpdate: function shouldComponentUpdate() {
|
||
// Defer any updates to this component during the `onSelect` handler.
|
||
return !this._isChanging;
|
||
},
|
||
|
||
handleSelect: function handleSelect(e, key) {
|
||
e.preventDefault();
|
||
|
||
if (this.props.onSelect) {
|
||
this._isChanging = true;
|
||
this.props.onSelect(key);
|
||
this._isChanging = false;
|
||
}
|
||
|
||
if (this.state.activeKey === key) {
|
||
key = null;
|
||
}
|
||
|
||
this.setState({
|
||
activeKey: key
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = PanelGroup;
|
||
|
||
/***/ },
|
||
/* 38 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var PageItem = React.createClass({
|
||
displayName: "PageItem",
|
||
|
||
propTypes: {
|
||
href: React.PropTypes.string,
|
||
target: React.PropTypes.string,
|
||
title: React.PropTypes.string,
|
||
disabled: React.PropTypes.bool,
|
||
previous: React.PropTypes.bool,
|
||
next: React.PropTypes.bool,
|
||
onSelect: React.PropTypes.func,
|
||
eventKey: React.PropTypes.any
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
href: "#"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
disabled: this.props.disabled,
|
||
previous: this.props.previous,
|
||
next: this.props.next
|
||
};
|
||
|
||
return React.createElement(
|
||
"li",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, classes) }),
|
||
React.createElement(
|
||
"a",
|
||
{
|
||
href: this.props.href,
|
||
title: this.props.title,
|
||
target: this.props.target,
|
||
onClick: this.handleSelect,
|
||
ref: "anchor" },
|
||
this.props.children
|
||
)
|
||
);
|
||
},
|
||
|
||
handleSelect: function handleSelect(e) {
|
||
if (this.props.onSelect) {
|
||
e.preventDefault();
|
||
|
||
if (!this.props.disabled) {
|
||
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
module.exports = PageItem;
|
||
|
||
/***/ },
|
||
/* 39 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var Pager = React.createClass({
|
||
displayName: "Pager",
|
||
|
||
propTypes: {
|
||
onSelect: React.PropTypes.func
|
||
},
|
||
|
||
render: function render() {
|
||
return React.createElement(
|
||
"ul",
|
||
_extends({}, this.props, {
|
||
className: classNames(this.props.className, "pager") }),
|
||
ValidComponentChildren.map(this.props.children, this.renderPageItem)
|
||
);
|
||
},
|
||
|
||
renderPageItem: function renderPageItem(child, index) {
|
||
return cloneElement(child, {
|
||
onSelect: createChainedFunction(child.props.onSelect, this.props.onSelect),
|
||
key: child.key ? child.key : index
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = Pager;
|
||
|
||
/***/ },
|
||
/* 40 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: 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; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Popover = React.createClass({
|
||
displayName: "Popover",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
placement: React.PropTypes.oneOf(["top", "right", "bottom", "left"]),
|
||
positionLeft: React.PropTypes.number,
|
||
positionTop: React.PropTypes.number,
|
||
arrowOffsetLeft: React.PropTypes.number,
|
||
arrowOffsetTop: React.PropTypes.number,
|
||
title: React.PropTypes.node
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
placement: "right"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var _this = this;
|
||
|
||
var classes = (function () {
|
||
var _classes = {
|
||
popover: true };
|
||
|
||
_defineProperty(_classes, _this.props.placement, true);
|
||
|
||
_defineProperty(_classes, "in", _this.props.positionLeft != null || _this.props.positionTop != null);
|
||
|
||
return _classes;
|
||
})();
|
||
|
||
var style = {
|
||
left: this.props.positionLeft,
|
||
top: this.props.positionTop,
|
||
display: "block"
|
||
};
|
||
|
||
var arrowStyle = {
|
||
left: this.props.arrowOffsetLeft,
|
||
top: this.props.arrowOffsetTop
|
||
};
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes), style: style, title: null }),
|
||
React.createElement("div", { className: "arrow", style: arrowStyle }),
|
||
this.props.title ? this.renderTitle() : null,
|
||
React.createElement(
|
||
"div",
|
||
{ className: "popover-content" },
|
||
this.props.children
|
||
)
|
||
);
|
||
},
|
||
|
||
renderTitle: function renderTitle() {
|
||
return React.createElement(
|
||
"h3",
|
||
{ className: "popover-title" },
|
||
this.props.title
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Popover;
|
||
|
||
/***/ },
|
||
/* 41 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var Interpolate = _interopRequire(__webpack_require__(22));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var ProgressBar = React.createClass({
|
||
displayName: "ProgressBar",
|
||
|
||
propTypes: {
|
||
min: React.PropTypes.number,
|
||
now: React.PropTypes.number,
|
||
max: React.PropTypes.number,
|
||
label: React.PropTypes.node,
|
||
srOnly: React.PropTypes.bool,
|
||
striped: React.PropTypes.bool,
|
||
active: React.PropTypes.bool
|
||
},
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "progress-bar",
|
||
min: 0,
|
||
max: 100
|
||
};
|
||
},
|
||
|
||
getPercentage: function getPercentage(now, min, max) {
|
||
return Math.ceil((now - min) / (max - min) * 100);
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
progress: true
|
||
};
|
||
|
||
if (this.props.active) {
|
||
classes["progress-striped"] = true;
|
||
classes.active = true;
|
||
} else if (this.props.striped) {
|
||
classes["progress-striped"] = true;
|
||
}
|
||
|
||
if (!ValidComponentChildren.hasValidComponent(this.props.children)) {
|
||
if (!this.props.isChild) {
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.renderProgressBar()
|
||
);
|
||
} else {
|
||
return this.renderProgressBar();
|
||
}
|
||
} else {
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
ValidComponentChildren.map(this.props.children, this.renderChildBar)
|
||
);
|
||
}
|
||
},
|
||
|
||
renderChildBar: function renderChildBar(child, index) {
|
||
return cloneElement(child, {
|
||
isChild: true,
|
||
key: child.key ? child.key : index
|
||
});
|
||
},
|
||
|
||
renderProgressBar: function renderProgressBar() {
|
||
var percentage = this.getPercentage(this.props.now, this.props.min, this.props.max);
|
||
|
||
var label = undefined;
|
||
|
||
if (typeof this.props.label === "string") {
|
||
label = this.renderLabel(percentage);
|
||
} else if (this.props.label) {
|
||
label = this.props.label;
|
||
}
|
||
|
||
if (this.props.srOnly) {
|
||
label = this.renderScreenReaderOnlyLabel(label);
|
||
}
|
||
|
||
var classes = this.getBsClassSet();
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes), role: "progressbar",
|
||
style: { width: percentage + "%" },
|
||
"aria-valuenow": this.props.now,
|
||
"aria-valuemin": this.props.min,
|
||
"aria-valuemax": this.props.max }),
|
||
label
|
||
);
|
||
},
|
||
|
||
renderLabel: function renderLabel(percentage) {
|
||
var InterpolateClass = this.props.interpolateClass || Interpolate;
|
||
|
||
return React.createElement(
|
||
InterpolateClass,
|
||
{
|
||
now: this.props.now,
|
||
min: this.props.min,
|
||
max: this.props.max,
|
||
percent: percentage,
|
||
bsStyle: this.props.bsStyle },
|
||
this.props.label
|
||
);
|
||
},
|
||
|
||
renderScreenReaderOnlyLabel: function renderScreenReaderOnlyLabel(label) {
|
||
return React.createElement(
|
||
"span",
|
||
{ className: "sr-only" },
|
||
label
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = ProgressBar;
|
||
|
||
/***/ },
|
||
/* 42 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var Row = React.createClass({
|
||
displayName: "Row",
|
||
|
||
propTypes: {
|
||
componentClass: React.PropTypes.node.isRequired
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
componentClass: "div"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var ComponentClass = this.props.componentClass;
|
||
|
||
return React.createElement(
|
||
ComponentClass,
|
||
_extends({}, this.props, { className: classNames(this.props.className, "row") }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Row;
|
||
|
||
/***/ },
|
||
/* 43 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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; };
|
||
|
||
/* eslint react/prop-types: [1, {ignore: ["children", "className", "bsSize"]}]*/
|
||
/* BootstrapMixin contains `bsSize` type validation */
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var DropdownStateMixin = _interopRequire(__webpack_require__(17));
|
||
|
||
var Button = _interopRequire(__webpack_require__(7));
|
||
|
||
var ButtonGroup = _interopRequire(__webpack_require__(8));
|
||
|
||
var DropdownMenu = _interopRequire(__webpack_require__(16));
|
||
|
||
var SplitButton = React.createClass({
|
||
displayName: "SplitButton",
|
||
|
||
mixins: [BootstrapMixin, DropdownStateMixin],
|
||
|
||
propTypes: {
|
||
pullRight: React.PropTypes.bool,
|
||
title: React.PropTypes.node,
|
||
href: React.PropTypes.string,
|
||
id: React.PropTypes.string,
|
||
target: React.PropTypes.string,
|
||
dropdownTitle: React.PropTypes.node,
|
||
dropup: React.PropTypes.bool,
|
||
onClick: React.PropTypes.func,
|
||
onSelect: React.PropTypes.func,
|
||
disabled: React.PropTypes.bool
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
dropdownTitle: "Toggle dropdown"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var groupClasses = {
|
||
open: this.state.open,
|
||
dropup: this.props.dropup
|
||
};
|
||
|
||
var button = React.createElement(
|
||
Button,
|
||
_extends({}, this.props, {
|
||
ref: "button",
|
||
onClick: this.handleButtonClick,
|
||
title: null,
|
||
id: null }),
|
||
this.props.title
|
||
);
|
||
|
||
var dropdownButton = React.createElement(
|
||
Button,
|
||
_extends({}, this.props, {
|
||
ref: "dropdownButton",
|
||
className: classNames(this.props.className, "dropdown-toggle"),
|
||
onClick: this.handleDropdownClick,
|
||
title: null,
|
||
href: null,
|
||
target: null,
|
||
id: null }),
|
||
React.createElement(
|
||
"span",
|
||
{ className: "sr-only" },
|
||
this.props.dropdownTitle
|
||
),
|
||
React.createElement("span", { className: "caret" }),
|
||
React.createElement(
|
||
"span",
|
||
{ style: { letterSpacing: "-.3em" } },
|
||
" "
|
||
)
|
||
);
|
||
|
||
return React.createElement(
|
||
ButtonGroup,
|
||
{
|
||
bsSize: this.props.bsSize,
|
||
className: classNames(groupClasses),
|
||
id: this.props.id },
|
||
button,
|
||
dropdownButton,
|
||
React.createElement(
|
||
DropdownMenu,
|
||
{
|
||
ref: "menu",
|
||
onSelect: this.handleOptionSelect,
|
||
"aria-labelledby": this.props.id,
|
||
pullRight: this.props.pullRight },
|
||
this.props.children
|
||
)
|
||
);
|
||
},
|
||
|
||
handleButtonClick: function handleButtonClick(e) {
|
||
if (this.state.open) {
|
||
this.setDropdownState(false);
|
||
}
|
||
|
||
if (this.props.onClick) {
|
||
this.props.onClick(e, this.props.href, this.props.target);
|
||
}
|
||
},
|
||
|
||
handleDropdownClick: function handleDropdownClick(e) {
|
||
e.preventDefault();
|
||
|
||
this.setDropdownState(!this.state.open);
|
||
},
|
||
|
||
handleOptionSelect: function handleOptionSelect(key) {
|
||
if (this.props.onSelect) {
|
||
this.props.onSelect(key);
|
||
}
|
||
|
||
this.setDropdownState(false);
|
||
}
|
||
});
|
||
|
||
module.exports = SplitButton;
|
||
|
||
/***/ },
|
||
/* 44 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var createChainedFunction = _interopRequire(__webpack_require__(55));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var SubNav = React.createClass({
|
||
displayName: "SubNav",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
onSelect: React.PropTypes.func,
|
||
active: React.PropTypes.bool,
|
||
activeHref: React.PropTypes.string,
|
||
activeKey: React.PropTypes.any,
|
||
disabled: React.PropTypes.bool,
|
||
eventKey: React.PropTypes.any,
|
||
href: React.PropTypes.string,
|
||
title: React.PropTypes.string,
|
||
text: React.PropTypes.node,
|
||
target: React.PropTypes.string
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "nav"
|
||
};
|
||
},
|
||
|
||
handleClick: function handleClick(e) {
|
||
if (this.props.onSelect) {
|
||
e.preventDefault();
|
||
|
||
if (!this.props.disabled) {
|
||
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
|
||
}
|
||
}
|
||
},
|
||
|
||
isActive: function isActive() {
|
||
return this.isChildActive(this);
|
||
},
|
||
|
||
isChildActive: function isChildActive(child) {
|
||
var _this = this;
|
||
|
||
if (child.props.active) {
|
||
return true;
|
||
}
|
||
|
||
if (this.props.activeKey != null && this.props.activeKey === child.props.eventKey) {
|
||
return true;
|
||
}
|
||
|
||
if (this.props.activeHref != null && this.props.activeHref === child.props.href) {
|
||
return true;
|
||
}
|
||
|
||
if (child.props.children) {
|
||
var _ret = (function () {
|
||
var isActive = false;
|
||
|
||
ValidComponentChildren.forEach(child.props.children, function (grandchild) {
|
||
if (this.isChildActive(grandchild)) {
|
||
isActive = true;
|
||
}
|
||
}, _this);
|
||
|
||
return {
|
||
v: isActive
|
||
};
|
||
})();
|
||
|
||
if (typeof _ret === "object") {
|
||
return _ret.v;
|
||
}
|
||
}
|
||
|
||
return false;
|
||
},
|
||
|
||
getChildActiveProp: function getChildActiveProp(child) {
|
||
if (child.props.active) {
|
||
return true;
|
||
}
|
||
if (this.props.activeKey != null) {
|
||
if (child.props.eventKey === this.props.activeKey) {
|
||
return true;
|
||
}
|
||
}
|
||
if (this.props.activeHref != null) {
|
||
if (child.props.href === this.props.activeHref) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
return child.props.active;
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
active: this.isActive(),
|
||
disabled: this.props.disabled
|
||
};
|
||
|
||
return React.createElement(
|
||
"li",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
React.createElement(
|
||
"a",
|
||
{
|
||
href: this.props.href,
|
||
title: this.props.title,
|
||
target: this.props.target,
|
||
onClick: this.handleClick,
|
||
ref: "anchor" },
|
||
this.props.text
|
||
),
|
||
React.createElement(
|
||
"ul",
|
||
{ className: "nav" },
|
||
ValidComponentChildren.map(this.props.children, this.renderNavItem)
|
||
)
|
||
);
|
||
},
|
||
|
||
renderNavItem: function renderNavItem(child, index) {
|
||
return cloneElement(child, {
|
||
active: this.getChildActiveProp(child),
|
||
onSelect: createChainedFunction(child.props.onSelect, this.props.onSelect),
|
||
key: child.key ? child.key : index
|
||
});
|
||
}
|
||
});
|
||
|
||
module.exports = SubNav;
|
||
|
||
/***/ },
|
||
/* 45 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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__(51);
|
||
|
||
var React = _interopRequire(_react);
|
||
|
||
var cloneElement = _react.cloneElement;
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var ValidComponentChildren = _interopRequire(__webpack_require__(54));
|
||
|
||
var Nav = _interopRequire(__webpack_require__(29));
|
||
|
||
var NavItem = _interopRequire(__webpack_require__(31));
|
||
|
||
function getDefaultActiveKeyFromChildren(children) {
|
||
var defaultActiveKey = undefined;
|
||
|
||
ValidComponentChildren.forEach(children, function (child) {
|
||
if (defaultActiveKey == null) {
|
||
defaultActiveKey = child.props.eventKey;
|
||
}
|
||
});
|
||
|
||
return defaultActiveKey;
|
||
}
|
||
|
||
var TabbedArea = React.createClass({
|
||
displayName: "TabbedArea",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
activeKey: React.PropTypes.any,
|
||
defaultActiveKey: React.PropTypes.any,
|
||
bsStyle: React.PropTypes.oneOf(["tabs", "pills"]),
|
||
animation: React.PropTypes.bool,
|
||
id: React.PropTypes.string,
|
||
onSelect: React.PropTypes.func
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsStyle: "tabs",
|
||
animation: true
|
||
};
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
var defaultActiveKey = this.props.defaultActiveKey != null ? this.props.defaultActiveKey : getDefaultActiveKeyFromChildren(this.props.children);
|
||
|
||
// TODO: In __DEV__ mode warn via `console.warn` if no `defaultActiveKey` has
|
||
// been set by this point, invalid children or missing key properties are likely the cause.
|
||
|
||
return {
|
||
activeKey: defaultActiveKey,
|
||
previousActiveKey: null
|
||
};
|
||
},
|
||
|
||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
|
||
if (nextProps.activeKey != null && nextProps.activeKey !== this.props.activeKey) {
|
||
this.setState({
|
||
previousActiveKey: this.props.activeKey
|
||
});
|
||
}
|
||
},
|
||
|
||
handlePaneAnimateOutEnd: function handlePaneAnimateOutEnd() {
|
||
this.setState({
|
||
previousActiveKey: null
|
||
});
|
||
},
|
||
|
||
render: function render() {
|
||
var activeKey = this.props.activeKey != null ? this.props.activeKey : this.state.activeKey;
|
||
|
||
function renderTabIfSet(child) {
|
||
return child.props.tab != null ? this.renderTab(child) : null;
|
||
}
|
||
|
||
var nav = React.createElement(
|
||
Nav,
|
||
_extends({}, this.props, { activeKey: activeKey, onSelect: this.handleSelect, ref: "tabs" }),
|
||
ValidComponentChildren.map(this.props.children, renderTabIfSet, this)
|
||
);
|
||
|
||
return React.createElement(
|
||
"div",
|
||
null,
|
||
nav,
|
||
React.createElement(
|
||
"div",
|
||
{ id: this.props.id, className: "tab-content", ref: "panes" },
|
||
ValidComponentChildren.map(this.props.children, this.renderPane)
|
||
)
|
||
);
|
||
},
|
||
|
||
getActiveKey: function getActiveKey() {
|
||
return this.props.activeKey != null ? this.props.activeKey : this.state.activeKey;
|
||
},
|
||
|
||
renderPane: function renderPane(child, index) {
|
||
var activeKey = this.getActiveKey();
|
||
|
||
return cloneElement(child, {
|
||
active: child.props.eventKey === activeKey && (this.state.previousActiveKey == null || !this.props.animation),
|
||
key: child.key ? child.key : index,
|
||
animation: this.props.animation,
|
||
onAnimateOutEnd: this.state.previousActiveKey != null && child.props.eventKey === this.state.previousActiveKey ? this.handlePaneAnimateOutEnd : null
|
||
});
|
||
},
|
||
|
||
renderTab: function renderTab(child) {
|
||
var key = child.props.eventKey;
|
||
return React.createElement(
|
||
NavItem,
|
||
{
|
||
ref: "tab" + key,
|
||
eventKey: key },
|
||
child.props.tab
|
||
);
|
||
},
|
||
|
||
shouldComponentUpdate: function shouldComponentUpdate() {
|
||
// Defer any updates to this component during the `onSelect` handler.
|
||
return !this._isChanging;
|
||
},
|
||
|
||
handleSelect: function handleSelect(key) {
|
||
if (this.props.onSelect) {
|
||
this._isChanging = true;
|
||
this.props.onSelect(key);
|
||
this._isChanging = false;
|
||
} else if (key !== this.getActiveKey()) {
|
||
this.setState({
|
||
activeKey: key,
|
||
previousActiveKey: this.getActiveKey()
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
module.exports = TabbedArea;
|
||
|
||
/***/ },
|
||
/* 46 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var Table = React.createClass({
|
||
displayName: "Table",
|
||
|
||
propTypes: {
|
||
striped: React.PropTypes.bool,
|
||
bordered: React.PropTypes.bool,
|
||
condensed: React.PropTypes.bool,
|
||
hover: React.PropTypes.bool,
|
||
responsive: React.PropTypes.bool
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
table: true,
|
||
"table-striped": this.props.striped,
|
||
"table-bordered": this.props.bordered,
|
||
"table-condensed": this.props.condensed,
|
||
"table-hover": this.props.hover
|
||
};
|
||
var table = React.createElement(
|
||
"table",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
|
||
return this.props.responsive ? React.createElement(
|
||
"div",
|
||
{ className: "table-responsive" },
|
||
table
|
||
) : table;
|
||
}
|
||
});
|
||
|
||
module.exports = Table;
|
||
|
||
/***/ },
|
||
/* 47 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var TransitionEvents = _interopRequire(__webpack_require__(56));
|
||
|
||
var TabPane = React.createClass({
|
||
displayName: "TabPane",
|
||
|
||
propTypes: {
|
||
active: React.PropTypes.bool,
|
||
animation: React.PropTypes.bool,
|
||
onAnimateOutEnd: React.PropTypes.func
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
animation: true
|
||
};
|
||
},
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
animateIn: false,
|
||
animateOut: false
|
||
};
|
||
},
|
||
|
||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
|
||
if (this.props.animation) {
|
||
if (!this.state.animateIn && nextProps.active && !this.props.active) {
|
||
this.setState({
|
||
animateIn: true
|
||
});
|
||
} else if (!this.state.animateOut && !nextProps.active && this.props.active) {
|
||
this.setState({
|
||
animateOut: true
|
||
});
|
||
}
|
||
}
|
||
},
|
||
|
||
componentDidUpdate: function componentDidUpdate() {
|
||
if (this.state.animateIn) {
|
||
setTimeout(this.startAnimateIn, 0);
|
||
}
|
||
if (this.state.animateOut) {
|
||
TransitionEvents.addEndEventListener(React.findDOMNode(this), this.stopAnimateOut);
|
||
}
|
||
},
|
||
|
||
startAnimateIn: function startAnimateIn() {
|
||
if (this.isMounted()) {
|
||
this.setState({
|
||
animateIn: false
|
||
});
|
||
}
|
||
},
|
||
|
||
stopAnimateOut: function stopAnimateOut() {
|
||
if (this.isMounted()) {
|
||
this.setState({
|
||
animateOut: false
|
||
});
|
||
|
||
if (this.props.onAnimateOutEnd) {
|
||
this.props.onAnimateOutEnd();
|
||
}
|
||
}
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = {
|
||
"tab-pane": true,
|
||
fade: true,
|
||
active: this.props.active || this.state.animateOut,
|
||
"in": this.props.active && !this.state.animateIn
|
||
};
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = TabPane;
|
||
|
||
/***/ },
|
||
/* 48 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: 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; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Tooltip = React.createClass({
|
||
displayName: "Tooltip",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
propTypes: {
|
||
placement: React.PropTypes.oneOf(["top", "right", "bottom", "left"]),
|
||
positionLeft: React.PropTypes.number,
|
||
positionTop: React.PropTypes.number,
|
||
arrowOffsetLeft: React.PropTypes.number,
|
||
arrowOffsetTop: React.PropTypes.number
|
||
},
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
placement: "right"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var _this = this;
|
||
|
||
var classes = (function () {
|
||
var _classes = {
|
||
tooltip: true };
|
||
|
||
_defineProperty(_classes, _this.props.placement, true);
|
||
|
||
_defineProperty(_classes, "in", _this.props.positionLeft != null || _this.props.positionTop != null);
|
||
|
||
return _classes;
|
||
})();
|
||
|
||
var style = {
|
||
left: this.props.positionLeft,
|
||
top: this.props.positionTop
|
||
};
|
||
|
||
var arrowStyle = {
|
||
left: this.props.arrowOffsetLeft,
|
||
top: this.props.arrowOffsetTop
|
||
};
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes), style: style }),
|
||
React.createElement("div", { className: "tooltip-arrow", style: arrowStyle }),
|
||
React.createElement(
|
||
"div",
|
||
{ className: "tooltip-inner" },
|
||
this.props.children
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Tooltip;
|
||
|
||
/***/ },
|
||
/* 49 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
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 = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var BootstrapMixin = _interopRequire(__webpack_require__(5));
|
||
|
||
var Well = React.createClass({
|
||
displayName: "Well",
|
||
|
||
mixins: [BootstrapMixin],
|
||
|
||
getDefaultProps: function getDefaultProps() {
|
||
return {
|
||
bsClass: "well"
|
||
};
|
||
},
|
||
|
||
render: function render() {
|
||
var classes = this.getBsClassSet();
|
||
|
||
return React.createElement(
|
||
"div",
|
||
_extends({}, this.props, { className: classNames(this.props.className, classes) }),
|
||
this.props.children
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Well;
|
||
|
||
/***/ },
|
||
/* 50 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
module.exports = {
|
||
CLASSES: {
|
||
alert: "alert",
|
||
button: "btn",
|
||
"button-group": "btn-group",
|
||
"button-toolbar": "btn-toolbar",
|
||
column: "col",
|
||
"input-group": "input-group",
|
||
form: "form",
|
||
glyphicon: "glyphicon",
|
||
label: "label",
|
||
"list-group-item": "list-group-item",
|
||
panel: "panel",
|
||
"panel-group": "panel-group",
|
||
"progress-bar": "progress-bar",
|
||
nav: "nav",
|
||
navbar: "navbar",
|
||
modal: "modal",
|
||
row: "row",
|
||
well: "well"
|
||
},
|
||
STYLES: {
|
||
"default": "default",
|
||
primary: "primary",
|
||
success: "success",
|
||
info: "info",
|
||
warning: "warning",
|
||
danger: "danger",
|
||
link: "link",
|
||
inline: "inline",
|
||
tabs: "tabs",
|
||
pills: "pills"
|
||
},
|
||
SIZES: {
|
||
large: "lg",
|
||
medium: "md",
|
||
small: "sm",
|
||
xsmall: "xs"
|
||
},
|
||
GLYPHS: ["asterisk", "plus", "euro", "eur", "minus", "cloud", "envelope", "pencil", "glass", "music", "search", "heart", "star", "star-empty", "user", "film", "th-large", "th", "th-list", "ok", "remove", "zoom-in", "zoom-out", "off", "signal", "cog", "trash", "home", "file", "time", "road", "download-alt", "download", "upload", "inbox", "play-circle", "repeat", "refresh", "list-alt", "lock", "flag", "headphones", "volume-off", "volume-down", "volume-up", "qrcode", "barcode", "tag", "tags", "book", "bookmark", "print", "camera", "font", "bold", "italic", "text-height", "text-width", "align-left", "align-center", "align-right", "align-justify", "list", "indent-left", "indent-right", "facetime-video", "picture", "map-marker", "adjust", "tint", "edit", "share", "check", "move", "step-backward", "fast-backward", "backward", "play", "pause", "stop", "forward", "fast-forward", "step-forward", "eject", "chevron-left", "chevron-right", "plus-sign", "minus-sign", "remove-sign", "ok-sign", "question-sign", "info-sign", "screenshot", "remove-circle", "ok-circle", "ban-circle", "arrow-left", "arrow-right", "arrow-up", "arrow-down", "share-alt", "resize-full", "resize-small", "exclamation-sign", "gift", "leaf", "fire", "eye-open", "eye-close", "warning-sign", "plane", "calendar", "random", "comment", "magnet", "chevron-up", "chevron-down", "retweet", "shopping-cart", "folder-close", "folder-open", "resize-vertical", "resize-horizontal", "hdd", "bullhorn", "bell", "certificate", "thumbs-up", "thumbs-down", "hand-right", "hand-left", "hand-up", "hand-down", "circle-arrow-right", "circle-arrow-left", "circle-arrow-up", "circle-arrow-down", "globe", "wrench", "tasks", "filter", "briefcase", "fullscreen", "dashboard", "paperclip", "heart-empty", "link", "phone", "pushpin", "usd", "gbp", "sort", "sort-by-alphabet", "sort-by-alphabet-alt", "sort-by-order", "sort-by-order-alt", "sort-by-attributes", "sort-by-attributes-alt", "unchecked", "expand", "collapse-down", "collapse-up", "log-in", "flash", "log-out", "new-window", "record", "save", "open", "saved", "import", "export", "send", "floppy-disk", "floppy-saved", "floppy-remove", "floppy-save", "floppy-open", "credit-card", "transfer", "cutlery", "header", "compressed", "earphone", "phone-alt", "tower", "stats", "sd-video", "hd-video", "subtitles", "sound-stereo", "sound-dolby", "sound-5-1", "sound-6-1", "sound-7-1", "copyright-mark", "registration-mark", "cloud-download", "cloud-upload", "tree-conifer", "tree-deciduous", "cd", "save-file", "open-file", "level-up", "copy", "paste", "alert", "equalizer", "king", "queen", "pawn", "bishop", "knight", "baby-formula", "tent", "blackboard", "bed", "apple", "erase", "hourglass", "lamp", "duplicate", "piggy-bank", "scissors", "bitcoin", "yen", "ruble", "scale", "ice-lolly", "ice-lolly-tasted", "education", "option-horizontal", "option-vertical", "menu-hamburger", "modal-window", "oil", "grain", "sunglasses", "text-size", "text-color", "text-background", "object-align-top", "object-align-bottom", "object-align-horizontal", "object-align-left", "object-align-vertical", "object-align-right", "triangle-right", "triangle-left", "triangle-bottom", "triangle-top", "console", "superscript", "subscript", "menu-left", "menu-right", "menu-down", "menu-up"]
|
||
};
|
||
|
||
/***/ },
|
||
/* 51 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = __WEBPACK_EXTERNAL_MODULE_51__;
|
||
|
||
/***/ },
|
||
/* 52 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
/**
|
||
* Get elements owner document
|
||
*
|
||
* @param {ReactComponent|HTMLElement} componentOrElement
|
||
* @returns {HTMLElement}
|
||
*/
|
||
function ownerDocument(componentOrElement) {
|
||
var elem = React.findDOMNode(componentOrElement);
|
||
return elem && elem.ownerDocument || document;
|
||
}
|
||
|
||
/**
|
||
* Shortcut to compute element style
|
||
*
|
||
* @param {HTMLElement} elem
|
||
* @returns {CssStyle}
|
||
*/
|
||
function getComputedStyles(elem) {
|
||
return ownerDocument(elem).defaultView.getComputedStyle(elem, null);
|
||
}
|
||
|
||
/**
|
||
* Get elements offset
|
||
*
|
||
* TODO: REMOVE JQUERY!
|
||
*
|
||
* @param {HTMLElement} DOMNode
|
||
* @returns {{top: number, left: number}}
|
||
*/
|
||
function getOffset(DOMNode) {
|
||
if (window.jQuery) {
|
||
return window.jQuery(DOMNode).offset();
|
||
}
|
||
|
||
var docElem = ownerDocument(DOMNode).documentElement;
|
||
var box = { top: 0, left: 0 };
|
||
|
||
// If we don't have gBCR, just use 0,0 rather than error
|
||
// BlackBerry 5, iOS 3 (original iPhone)
|
||
if (typeof DOMNode.getBoundingClientRect !== "undefined") {
|
||
box = DOMNode.getBoundingClientRect();
|
||
}
|
||
|
||
return {
|
||
top: box.top + window.pageYOffset - docElem.clientTop,
|
||
left: box.left + window.pageXOffset - docElem.clientLeft
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Get elements position
|
||
*
|
||
* TODO: REMOVE JQUERY!
|
||
*
|
||
* @param {HTMLElement} elem
|
||
* @param {HTMLElement?} offsetParent
|
||
* @returns {{top: number, left: number}}
|
||
*/
|
||
function getPosition(elem, offsetParent) {
|
||
if (window.jQuery) {
|
||
return window.jQuery(elem).position();
|
||
}
|
||
|
||
var offset = undefined,
|
||
parentOffset = { top: 0, left: 0 };
|
||
|
||
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
|
||
if (getComputedStyles(elem).position === "fixed") {
|
||
// We assume that getBoundingClientRect is available when computed position is fixed
|
||
offset = elem.getBoundingClientRect();
|
||
} else {
|
||
if (!offsetParent) {
|
||
// Get *real* offsetParent
|
||
offsetParent = offsetParentFunc(elem);
|
||
}
|
||
|
||
// Get correct offsets
|
||
offset = getOffset(elem);
|
||
if (offsetParent.nodeName !== "HTML") {
|
||
parentOffset = getOffset(offsetParent);
|
||
}
|
||
|
||
// Add offsetParent borders
|
||
parentOffset.top += parseInt(getComputedStyles(offsetParent).borderTopWidth, 10);
|
||
parentOffset.left += parseInt(getComputedStyles(offsetParent).borderLeftWidth, 10);
|
||
}
|
||
|
||
// Subtract parent offsets and element margins
|
||
return {
|
||
top: offset.top - parentOffset.top - parseInt(getComputedStyles(elem).marginTop, 10),
|
||
left: offset.left - parentOffset.left - parseInt(getComputedStyles(elem).marginLeft, 10)
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Get parent element
|
||
*
|
||
* @param {HTMLElement?} elem
|
||
* @returns {HTMLElement}
|
||
*/
|
||
function offsetParentFunc(elem) {
|
||
var docElem = ownerDocument(elem).documentElement;
|
||
var offsetParent = elem.offsetParent || docElem;
|
||
|
||
while (offsetParent && (offsetParent.nodeName !== "HTML" && getComputedStyles(offsetParent).position === "static")) {
|
||
offsetParent = offsetParent.offsetParent;
|
||
}
|
||
|
||
return offsetParent || docElem;
|
||
}
|
||
|
||
module.exports = {
|
||
ownerDocument: ownerDocument,
|
||
getComputedStyles: getComputedStyles,
|
||
getOffset: getOffset,
|
||
getPosition: getPosition,
|
||
offsetParent: offsetParentFunc
|
||
};
|
||
|
||
/***/ },
|
||
/* 53 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* Copyright 2013-2014 Facebook, Inc.
|
||
*
|
||
* This file contains a modified version of:
|
||
* https://github.com/facebook/react/blob/v0.12.0/src/vendor/stubs/EventListener.js
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*
|
||
* TODO: remove in favour of solution provided by:
|
||
* https://github.com/facebook/react/issues/285
|
||
*/
|
||
|
||
/**
|
||
* Does not take into account specific nature of platform.
|
||
*/
|
||
"use strict";
|
||
|
||
var EventListener = {
|
||
/**
|
||
* Listen to DOM events during the bubble phase.
|
||
*
|
||
* @param {DOMEventTarget} target DOM element to register listener on.
|
||
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
||
* @param {function} callback Callback function.
|
||
* @return {object} Object with a `remove` method.
|
||
*/
|
||
listen: function listen(target, eventType, callback) {
|
||
if (target.addEventListener) {
|
||
target.addEventListener(eventType, callback, false);
|
||
return {
|
||
remove: function remove() {
|
||
target.removeEventListener(eventType, callback, false);
|
||
}
|
||
};
|
||
} else if (target.attachEvent) {
|
||
target.attachEvent("on" + eventType, callback);
|
||
return {
|
||
remove: function remove() {
|
||
target.detachEvent("on" + eventType, callback);
|
||
}
|
||
};
|
||
}
|
||
}
|
||
};
|
||
|
||
module.exports = EventListener;
|
||
|
||
/***/ },
|
||
/* 54 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
/**
|
||
* Maps children that are typically specified as `props.children`,
|
||
* but only iterates over children that are "valid components".
|
||
*
|
||
* The mapFunction provided index will be normalised to the components mapped,
|
||
* so an invalid component would not increase the index.
|
||
*
|
||
* @param {?*} children Children tree container.
|
||
* @param {function(*, int)} mapFunction.
|
||
* @param {*} mapContext Context for mapFunction.
|
||
* @return {object} Object containing the ordered map of results.
|
||
*/
|
||
function mapValidComponents(children, func, context) {
|
||
var index = 0;
|
||
|
||
return React.Children.map(children, function (child) {
|
||
if (React.isValidElement(child)) {
|
||
var lastIndex = index;
|
||
index++;
|
||
return func.call(context, child, lastIndex);
|
||
}
|
||
|
||
return child;
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Iterates through children that are typically specified as `props.children`,
|
||
* but only iterates over children that are "valid components".
|
||
*
|
||
* The provided forEachFunc(child, index) will be called for each
|
||
* leaf child with the index reflecting the position relative to "valid components".
|
||
*
|
||
* @param {?*} children Children tree container.
|
||
* @param {function(*, int)} forEachFunc.
|
||
* @param {*} forEachContext Context for forEachContext.
|
||
*/
|
||
function forEachValidComponents(children, func, context) {
|
||
var index = 0;
|
||
|
||
return React.Children.forEach(children, function (child) {
|
||
if (React.isValidElement(child)) {
|
||
func.call(context, child, index);
|
||
index++;
|
||
}
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Count the number of "valid components" in the Children container.
|
||
*
|
||
* @param {?*} children Children tree container.
|
||
* @returns {number}
|
||
*/
|
||
function numberOfValidComponents(children) {
|
||
var count = 0;
|
||
|
||
React.Children.forEach(children, function (child) {
|
||
if (React.isValidElement(child)) {
|
||
count++;
|
||
}
|
||
});
|
||
|
||
return count;
|
||
}
|
||
|
||
/**
|
||
* Determine if the Child container has one or more "valid components".
|
||
*
|
||
* @param {?*} children Children tree container.
|
||
* @returns {boolean}
|
||
*/
|
||
function hasValidComponent(children) {
|
||
var hasValid = false;
|
||
|
||
React.Children.forEach(children, function (child) {
|
||
if (!hasValid && React.isValidElement(child)) {
|
||
hasValid = true;
|
||
}
|
||
});
|
||
|
||
return hasValid;
|
||
}
|
||
|
||
module.exports = {
|
||
map: mapValidComponents,
|
||
forEach: forEachValidComponents,
|
||
numberOf: numberOfValidComponents,
|
||
hasValidComponent: hasValidComponent
|
||
};
|
||
|
||
/***/ },
|
||
/* 55 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* Safe chained function
|
||
*
|
||
* Will only create a new function if needed,
|
||
* otherwise will pass back existing functions or null.
|
||
*
|
||
* @param {function} one
|
||
* @param {function} two
|
||
* @returns {function|null}
|
||
*/
|
||
"use strict";
|
||
|
||
function createChainedFunction(one, two) {
|
||
var hasOne = typeof one === "function";
|
||
var hasTwo = typeof two === "function";
|
||
|
||
if (!hasOne && !hasTwo) {
|
||
return null;
|
||
}
|
||
if (!hasOne) {
|
||
return two;
|
||
}
|
||
if (!hasTwo) {
|
||
return one;
|
||
}
|
||
|
||
return function chainedFunction() {
|
||
one.apply(this, arguments);
|
||
two.apply(this, arguments);
|
||
};
|
||
}
|
||
|
||
module.exports = createChainedFunction;
|
||
|
||
/***/ },
|
||
/* 56 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* Copyright 2013-2014, Facebook, Inc.
|
||
* All rights reserved.
|
||
*
|
||
* This file contains a modified version of:
|
||
* https://github.com/facebook/react/blob/v0.12.0/src/addons/transitions/ReactTransitionEvents.js
|
||
*
|
||
* This source code is licensed under the BSD-style license found here:
|
||
* https://github.com/facebook/react/blob/v0.12.0/LICENSE
|
||
* An additional grant of patent rights can be found here:
|
||
* https://github.com/facebook/react/blob/v0.12.0/PATENTS
|
||
*/
|
||
|
||
"use strict";
|
||
|
||
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
||
|
||
/**
|
||
* EVENT_NAME_MAP is used to determine which event fired when a
|
||
* transition/animation ends, based on the style property used to
|
||
* define that event.
|
||
*/
|
||
var EVENT_NAME_MAP = {
|
||
transitionend: {
|
||
transition: "transitionend",
|
||
WebkitTransition: "webkitTransitionEnd",
|
||
MozTransition: "mozTransitionEnd",
|
||
OTransition: "oTransitionEnd",
|
||
msTransition: "MSTransitionEnd"
|
||
},
|
||
|
||
animationend: {
|
||
animation: "animationend",
|
||
WebkitAnimation: "webkitAnimationEnd",
|
||
MozAnimation: "mozAnimationEnd",
|
||
OAnimation: "oAnimationEnd",
|
||
msAnimation: "MSAnimationEnd"
|
||
}
|
||
};
|
||
|
||
var endEvents = [];
|
||
|
||
function detectEvents() {
|
||
var testEl = document.createElement("div");
|
||
var style = testEl.style;
|
||
|
||
// On some platforms, in particular some releases of Android 4.x,
|
||
// the un-prefixed "animation" and "transition" properties are defined on the
|
||
// style object but the events that fire will still be prefixed, so we need
|
||
// to check if the un-prefixed events are useable, and if not remove them
|
||
// from the map
|
||
if (!("AnimationEvent" in window)) {
|
||
delete EVENT_NAME_MAP.animationend.animation;
|
||
}
|
||
|
||
if (!("TransitionEvent" in window)) {
|
||
delete EVENT_NAME_MAP.transitionend.transition;
|
||
}
|
||
|
||
for (var baseEventName in EVENT_NAME_MAP) {
|
||
var baseEvents = EVENT_NAME_MAP[baseEventName];
|
||
for (var styleName in baseEvents) {
|
||
if (styleName in style) {
|
||
endEvents.push(baseEvents[styleName]);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if (canUseDOM) {
|
||
detectEvents();
|
||
}
|
||
|
||
// We use the raw {add|remove}EventListener() call because EventListener
|
||
// does not know how to remove event listeners and we really should
|
||
// clean up. Also, these events are not triggered in older browsers
|
||
// so we should be A-OK here.
|
||
|
||
function addEventListener(node, eventName, eventListener) {
|
||
node.addEventListener(eventName, eventListener, false);
|
||
}
|
||
|
||
function removeEventListener(node, eventName, eventListener) {
|
||
node.removeEventListener(eventName, eventListener, false);
|
||
}
|
||
|
||
var ReactTransitionEvents = {
|
||
addEndEventListener: function addEndEventListener(node, eventListener) {
|
||
if (endEvents.length === 0) {
|
||
// If CSS transitions are not supported, trigger an "end animation"
|
||
// event immediately.
|
||
window.setTimeout(eventListener, 0);
|
||
return;
|
||
}
|
||
endEvents.forEach(function (endEvent) {
|
||
addEventListener(node, endEvent, eventListener);
|
||
});
|
||
},
|
||
|
||
removeEndEventListener: function removeEndEventListener(node, eventListener) {
|
||
if (endEvents.length === 0) {
|
||
return;
|
||
}
|
||
endEvents.forEach(function (endEvent) {
|
||
removeEventListener(node, endEvent, eventListener);
|
||
});
|
||
}
|
||
};
|
||
|
||
module.exports = ReactTransitionEvents;
|
||
|
||
/***/ },
|
||
/* 57 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||
|
||
var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||
|
||
var _inherits = function (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) subClass.__proto__ = superClass; };
|
||
|
||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
||
|
||
var React = _interopRequire(__webpack_require__(51));
|
||
|
||
var classNames = _interopRequire(__webpack_require__(60));
|
||
|
||
var FormGroup = (function (_React$Component) {
|
||
function FormGroup() {
|
||
_classCallCheck(this, FormGroup);
|
||
|
||
if (_React$Component != null) {
|
||
_React$Component.apply(this, arguments);
|
||
}
|
||
}
|
||
|
||
_inherits(FormGroup, _React$Component);
|
||
|
||
_createClass(FormGroup, {
|
||
render: {
|
||
value: function render() {
|
||
var classes = {
|
||
"form-group": !this.props.standalone,
|
||
"has-feedback": this.props.hasFeedback,
|
||
"has-success": this.props.bsStyle === "success",
|
||
"has-warning": this.props.bsStyle === "warning",
|
||
"has-error": this.props.bsStyle === "error"
|
||
};
|
||
|
||
return React.createElement(
|
||
"div",
|
||
{ className: classNames(classes, this.props.groupClassName) },
|
||
this.props.children
|
||
);
|
||
}
|
||
}
|
||
});
|
||
|
||
return FormGroup;
|
||
})(React.Component);
|
||
|
||
FormGroup.defaultProps = {
|
||
standalone: false
|
||
};
|
||
|
||
FormGroup.propTypes = {
|
||
standalone: React.PropTypes.bool,
|
||
hasFeedback: React.PropTypes.bool,
|
||
bsStyle: React.PropTypes.oneOf(["success", "warning", "error"]),
|
||
groupClassName: React.PropTypes.string
|
||
};
|
||
|
||
module.exports = FormGroup;
|
||
|
||
/***/ },
|
||
/* 58 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* Copyright 2014, Facebook, Inc.
|
||
* All rights reserved.
|
||
*
|
||
* This file contains an unmodified version of:
|
||
* https://github.com/facebook/react/blob/v0.12.0/src/vendor/stubs/Object.assign.js
|
||
*
|
||
* This source code is licensed under the BSD-style license found here:
|
||
* https://github.com/facebook/react/blob/v0.12.0/LICENSE
|
||
* An additional grant of patent rights can be found here:
|
||
* https://github.com/facebook/react/blob/v0.12.0/PATENTS
|
||
*/
|
||
|
||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
|
||
|
||
"use strict";
|
||
|
||
function assign(target, sources) {
|
||
if (target == null) {
|
||
throw new TypeError("Object.assign target cannot be null or undefined");
|
||
}
|
||
|
||
var to = Object(target);
|
||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||
|
||
for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
|
||
var nextSource = arguments[nextIndex];
|
||
if (nextSource == null) {
|
||
continue;
|
||
}
|
||
|
||
var from = Object(nextSource);
|
||
|
||
// We don't currently support accessors nor proxies. Therefore this
|
||
// copy cannot throw. If we ever supported this then we must handle
|
||
// exceptions and side-effects. We don't support symbols so they won't
|
||
// be transferred.
|
||
|
||
for (var key in from) {
|
||
if (hasOwnProperty.call(from, key)) {
|
||
to[key] = from[key];
|
||
}
|
||
}
|
||
}
|
||
|
||
return to;
|
||
}
|
||
|
||
module.exports = assign;
|
||
|
||
/***/ },
|
||
/* 59 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var ANONYMOUS = "<<anonymous>>";
|
||
|
||
var CustomPropTypes = {
|
||
/**
|
||
* Checks whether a prop provides a DOM element
|
||
*
|
||
* The element can be provided in two forms:
|
||
* - Directly passed
|
||
* - Or passed an object which has a `getDOMNode` method which will return the required DOM element
|
||
*
|
||
* @param props
|
||
* @param propName
|
||
* @param componentName
|
||
* @returns {Error|undefined}
|
||
*/
|
||
mountable: createMountableChecker()
|
||
};
|
||
|
||
/**
|
||
* Create chain-able isRequired validator
|
||
*
|
||
* Largely copied directly from:
|
||
* https://github.com/facebook/react/blob/0.11-stable/src/core/ReactPropTypes.js#L94
|
||
*/
|
||
function createChainableTypeChecker(validate) {
|
||
function checkType(isRequired, props, propName, componentName) {
|
||
componentName = componentName || ANONYMOUS;
|
||
if (props[propName] == null) {
|
||
if (isRequired) {
|
||
return new Error("Required prop `" + propName + "` was not specified in " + "`" + componentName + "`.");
|
||
}
|
||
} else {
|
||
return validate(props, propName, componentName);
|
||
}
|
||
}
|
||
|
||
var chainedCheckType = checkType.bind(null, false);
|
||
chainedCheckType.isRequired = checkType.bind(null, true);
|
||
|
||
return chainedCheckType;
|
||
}
|
||
|
||
function createMountableChecker() {
|
||
function validate(props, propName, componentName) {
|
||
if (typeof props[propName] !== "object" || typeof props[propName].render !== "function" && props[propName].nodeType !== 1) {
|
||
return new Error("Invalid prop `" + propName + "` supplied to " + "`" + componentName + "`, expected a DOM element or an object that has a `render` method");
|
||
}
|
||
}
|
||
|
||
return createChainableTypeChecker(validate);
|
||
}
|
||
|
||
module.exports = CustomPropTypes;
|
||
|
||
/***/ },
|
||
/* 60 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
function classNames() {
|
||
var classes = '';
|
||
var arg;
|
||
|
||
for (var i = 0; i < arguments.length; i++) {
|
||
arg = arguments[i];
|
||
if (!arg) {
|
||
continue;
|
||
}
|
||
|
||
if ('string' === typeof arg || 'number' === typeof arg) {
|
||
classes += ' ' + arg;
|
||
} else if (Object.prototype.toString.call(arg) === '[object Array]') {
|
||
classes += ' ' + classNames.apply(null, arg);
|
||
} else if ('object' === typeof arg) {
|
||
for (var key in arg) {
|
||
if (!arg.hasOwnProperty(key) || !arg[key]) {
|
||
continue;
|
||
}
|
||
classes += ' ' + key;
|
||
}
|
||
}
|
||
}
|
||
return classes.substr(1);
|
||
}
|
||
|
||
// safely export classNames in case the script is included directly on a page
|
||
if (typeof module !== 'undefined' && module.exports) {
|
||
module.exports = classNames;
|
||
}
|
||
|
||
|
||
/***/ },
|
||
/* 61 */
|
||
/***/ 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 ReactTransitionEvents
|
||
*/
|
||
|
||
'use strict';
|
||
|
||
var ExecutionEnvironment = __webpack_require__(62);
|
||
|
||
/**
|
||
* EVENT_NAME_MAP is used to determine which event fired when a
|
||
* transition/animation ends, based on the style property used to
|
||
* define that event.
|
||
*/
|
||
var EVENT_NAME_MAP = {
|
||
transitionend: {
|
||
'transition': 'transitionend',
|
||
'WebkitTransition': 'webkitTransitionEnd',
|
||
'MozTransition': 'mozTransitionEnd',
|
||
'OTransition': 'oTransitionEnd',
|
||
'msTransition': 'MSTransitionEnd'
|
||
},
|
||
|
||
animationend: {
|
||
'animation': 'animationend',
|
||
'WebkitAnimation': 'webkitAnimationEnd',
|
||
'MozAnimation': 'mozAnimationEnd',
|
||
'OAnimation': 'oAnimationEnd',
|
||
'msAnimation': 'MSAnimationEnd'
|
||
}
|
||
};
|
||
|
||
var endEvents = [];
|
||
|
||
function detectEvents() {
|
||
var testEl = document.createElement('div');
|
||
var style = testEl.style;
|
||
|
||
// On some platforms, in particular some releases of Android 4.x,
|
||
// the un-prefixed "animation" and "transition" properties are defined on the
|
||
// style object but the events that fire will still be prefixed, so we need
|
||
// to check if the un-prefixed events are useable, and if not remove them
|
||
// from the map
|
||
if (!('AnimationEvent' in window)) {
|
||
delete EVENT_NAME_MAP.animationend.animation;
|
||
}
|
||
|
||
if (!('TransitionEvent' in window)) {
|
||
delete EVENT_NAME_MAP.transitionend.transition;
|
||
}
|
||
|
||
for (var baseEventName in EVENT_NAME_MAP) {
|
||
var baseEvents = EVENT_NAME_MAP[baseEventName];
|
||
for (var styleName in baseEvents) {
|
||
if (styleName in style) {
|
||
endEvents.push(baseEvents[styleName]);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if (ExecutionEnvironment.canUseDOM) {
|
||
detectEvents();
|
||
}
|
||
|
||
// We use the raw {add|remove}EventListener() call because EventListener
|
||
// does not know how to remove event listeners and we really should
|
||
// clean up. Also, these events are not triggered in older browsers
|
||
// so we should be A-OK here.
|
||
|
||
function addEventListener(node, eventName, eventListener) {
|
||
node.addEventListener(eventName, eventListener, false);
|
||
}
|
||
|
||
function removeEventListener(node, eventName, eventListener) {
|
||
node.removeEventListener(eventName, eventListener, false);
|
||
}
|
||
|
||
var ReactTransitionEvents = {
|
||
addEndEventListener: function(node, eventListener) {
|
||
if (endEvents.length === 0) {
|
||
// If CSS transitions are not supported, trigger an "end animation"
|
||
// event immediately.
|
||
window.setTimeout(eventListener, 0);
|
||
return;
|
||
}
|
||
endEvents.forEach(function(endEvent) {
|
||
addEventListener(node, endEvent, eventListener);
|
||
});
|
||
},
|
||
|
||
removeEndEventListener: function(node, eventListener) {
|
||
if (endEvents.length === 0) {
|
||
return;
|
||
}
|
||
endEvents.forEach(function(endEvent) {
|
||
removeEventListener(node, endEvent, eventListener);
|
||
});
|
||
}
|
||
};
|
||
|
||
module.exports = ReactTransitionEvents;
|
||
|
||
|
||
/***/ },
|
||
/* 62 */
|
||
/***/ 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 ExecutionEnvironment
|
||
*/
|
||
|
||
/*jslint evil: true */
|
||
|
||
"use strict";
|
||
|
||
var canUseDOM = !!(
|
||
(typeof window !== 'undefined' &&
|
||
window.document && window.document.createElement)
|
||
);
|
||
|
||
/**
|
||
* Simple, lightweight module assisting with the detection and context of
|
||
* Worker. Helps avoid circular dependencies and allows code to reason about
|
||
* whether or not they are in a Worker, even if they never include the main
|
||
* `ReactWorker` dependency.
|
||
*/
|
||
var ExecutionEnvironment = {
|
||
|
||
canUseDOM: canUseDOM,
|
||
|
||
canUseWorkers: typeof Worker !== 'undefined',
|
||
|
||
canUseEventListeners:
|
||
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
||
|
||
canUseViewport: canUseDOM && !!window.screen,
|
||
|
||
isInWorker: !canUseDOM // For now, this is true - might change in the future.
|
||
|
||
};
|
||
|
||
module.exports = ExecutionEnvironment;
|
||
|
||
|
||
/***/ }
|
||
/******/ ])
|
||
});
|
||
; |