|
|
|
|
webpackJsonp([15],{
|
|
|
|
|
|
|
|
|
|
/***/ 1002:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var PropTypes = _interopRequireWildcard(__webpack_require__(1));
|
|
|
|
|
|
|
|
|
|
var _rcMenu = __webpack_require__(172);
|
|
|
|
|
|
|
|
|
|
var _classnames = _interopRequireDefault(__webpack_require__(3));
|
|
|
|
|
|
|
|
|
|
var _MenuContext = _interopRequireDefault(__webpack_require__(893));
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var SubMenu =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(SubMenu, _React$Component);
|
|
|
|
|
|
|
|
|
|
function SubMenu() {
|
|
|
|
|
var _this;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, SubMenu);
|
|
|
|
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(SubMenu).apply(this, arguments));
|
|
|
|
|
|
|
|
|
|
_this.onKeyDown = function (e) {
|
|
|
|
|
_this.subMenu.onKeyDown(e);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.saveSubMenu = function (subMenu) {
|
|
|
|
|
_this.subMenu = subMenu;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(SubMenu, [{
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
var _this$props = this.props,
|
|
|
|
|
rootPrefixCls = _this$props.rootPrefixCls,
|
|
|
|
|
popupClassName = _this$props.popupClassName;
|
|
|
|
|
return React.createElement(_MenuContext["default"].Consumer, null, function (_ref) {
|
|
|
|
|
var antdMenuTheme = _ref.antdMenuTheme;
|
|
|
|
|
return React.createElement(_rcMenu.SubMenu, _extends({}, _this2.props, {
|
|
|
|
|
ref: _this2.saveSubMenu,
|
|
|
|
|
popupClassName: (0, _classnames["default"])("".concat(rootPrefixCls, "-").concat(antdMenuTheme), popupClassName)
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return SubMenu;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
SubMenu.contextTypes = {
|
|
|
|
|
antdMenuTheme: PropTypes.string
|
|
|
|
|
}; // fix issue:https://github.com/ant-design/ant-design/issues/8666
|
|
|
|
|
|
|
|
|
|
SubMenu.isSubMenu = 1;
|
|
|
|
|
var _default = SubMenu;
|
|
|
|
|
exports["default"] = _default;
|
|
|
|
|
//# sourceMappingURL=SubMenu.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1003:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var _rcMenu = __webpack_require__(172);
|
|
|
|
|
|
|
|
|
|
var _MenuContext = _interopRequireDefault(__webpack_require__(893));
|
|
|
|
|
|
|
|
|
|
var _tooltip = _interopRequireDefault(__webpack_require__(168));
|
|
|
|
|
|
|
|
|
|
var _Sider = __webpack_require__(908);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
|
|
var t = {};
|
|
|
|
|
|
|
|
|
|
for (var p in s) {
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
|
|
}
|
|
|
|
|
return t;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var MenuItem =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(MenuItem, _React$Component);
|
|
|
|
|
|
|
|
|
|
function MenuItem() {
|
|
|
|
|
var _this;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, MenuItem);
|
|
|
|
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(MenuItem).apply(this, arguments));
|
|
|
|
|
|
|
|
|
|
_this.onKeyDown = function (e) {
|
|
|
|
|
_this.menuItem.onKeyDown(e);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.saveMenuItem = function (menuItem) {
|
|
|
|
|
_this.menuItem = menuItem;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.renderItem = function (_ref) {
|
|
|
|
|
var siderCollapsed = _ref.siderCollapsed;
|
|
|
|
|
var _this$props = _this.props,
|
|
|
|
|
level = _this$props.level,
|
|
|
|
|
children = _this$props.children,
|
|
|
|
|
rootPrefixCls = _this$props.rootPrefixCls;
|
|
|
|
|
|
|
|
|
|
var _a = _this.props,
|
|
|
|
|
title = _a.title,
|
|
|
|
|
rest = __rest(_a, ["title"]);
|
|
|
|
|
|
|
|
|
|
return React.createElement(_MenuContext["default"].Consumer, null, function (_ref2) {
|
|
|
|
|
var inlineCollapsed = _ref2.inlineCollapsed;
|
|
|
|
|
var tooltipProps = {
|
|
|
|
|
title: title || (level === 1 ? children : '')
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (!siderCollapsed && !inlineCollapsed) {
|
|
|
|
|
tooltipProps.title = null; // Reset `visible` to fix control mode tooltip display not correct
|
|
|
|
|
// ref: https://github.com/ant-design/ant-design/issues/16742
|
|
|
|
|
|
|
|
|
|
tooltipProps.visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return React.createElement(_tooltip["default"], _extends({}, tooltipProps, {
|
|
|
|
|
placement: "right",
|
|
|
|
|
overlayClassName: "".concat(rootPrefixCls, "-inline-collapsed-tooltip")
|
|
|
|
|
}), React.createElement(_rcMenu.Item, _extends({}, rest, {
|
|
|
|
|
title: title,
|
|
|
|
|
ref: _this.saveMenuItem
|
|
|
|
|
})));
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(MenuItem, [{
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
return React.createElement(_Sider.SiderContext.Consumer, null, this.renderItem);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return MenuItem;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
exports["default"] = MenuItem;
|
|
|
|
|
MenuItem.isMenuItem = true;
|
|
|
|
|
//# sourceMappingURL=MenuItem.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1120:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
|
|
|
|
|
|
|
|
// load the styles
|
|
|
|
|
var content = __webpack_require__(1121);
|
|
|
|
|
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
|
|
|
// Prepare cssTransformation
|
|
|
|
|
var transform;
|
|
|
|
|
|
|
|
|
|
var options = {"hmr":false}
|
|
|
|
|
options.transform = transform
|
|
|
|
|
// add the styles to the DOM
|
|
|
|
|
var update = __webpack_require__(313)(content, options);
|
|
|
|
|
if(content.locals) module.exports = content.locals;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1121:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
exports = module.exports = __webpack_require__(312)(true);
|
|
|
|
|
// imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// module
|
|
|
|
|
exports.push([module.i, ".ant-menu{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;font-size:14px;font-variant:tabular-nums;line-height:1.5;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";margin-bottom:0;padding-left:0;color:rgba(0,0,0,.65);line-height:0;list-style:none;background:#fff;outline:none;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15);-webkit-transition:background .3s,width .2s;-o-transition:background .3s,width .2s;transition:background .3s,width .2s;zoom:1}.ant-menu:after,.ant-menu:before{display:table;content:\"\"}.ant-menu:after{clear:both}.ant-menu ol,.ant-menu ul{margin:0;padding:0;list-style:none}.ant-menu-hidden{display:none}.ant-menu-item-group-title{padding:8px 16px;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-menu-submenu,.ant-menu-submenu-inline{-webkit-transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1);-o-transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1);transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-selected{color:#1890ff}.ant-menu-item:active,.ant-menu-submenu-title:active{background:#e6f7ff}.ant-menu-submenu .ant-menu-sub{cursor:auto;-webkit-transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);-o-transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item>a{display:block;color:rgba(0,0,0,.65)}.ant-menu-item>a:hover{color:#1890ff}.ant-menu-item>a:before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:\"\"}.ant-menu-item>.ant-badge>a{color:rgba(0,0,0,.65)}.ant-menu-item>.ant-badge>a:hover{color:#1890ff}.ant-menu-item-divider{height:1px;overflow:hidden;line-height:0;background-color:#e8e8e8}.ant-menu-item-active,.ant-menu-item:hover,.ant-menu-submenu-active,.ant-menu-submenu-title:hover,.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{color:#1890ff}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu{margin-top:-1px}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu .ant-menu-submenu-title:hover{background-color:transparent}.ant-menu-item-selected,.ant-menu-item-selected>a,.ant-menu-item-selected>a:hover{color:#1890ff}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#e6f7ff}.ant-menu-inline,.ant-menu-vertical,.ant-menu-vertical-left{border-right:1px solid #e8e8e8}.ant-menu-vertical-right{border-left:1px solid #e8e8e8}.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{min-width:160px;padding:0;border-right:0;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item,.ant-menu-vertical.ant-menu-sub .ant-menu-item{left:0;margin-left:0;border-right:0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical.ant-menu-sub .ant-menu-item:after{border-right:0}.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.ant-menu-horizontal.ant-menu-sub{min-width:114px}.ant-menu-item,.ant-menu-submenu-titl
|
|
|
|
|
|
|
|
|
|
// exports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1138:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _defineProperty2 = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
|
|
|
|
|
|
|
|
exports.toArray = toArray;
|
|
|
|
|
exports.getActiveIndex = getActiveIndex;
|
|
|
|
|
exports.getActiveKey = getActiveKey;
|
|
|
|
|
exports.setTransform = setTransform;
|
|
|
|
|
exports.isTransform3dSupported = isTransform3dSupported;
|
|
|
|
|
exports.setTransition = setTransition;
|
|
|
|
|
exports.getTransformPropValue = getTransformPropValue;
|
|
|
|
|
exports.isVertical = isVertical;
|
|
|
|
|
exports.getTransformByIndex = getTransformByIndex;
|
|
|
|
|
exports.getMarginStyle = getMarginStyle;
|
|
|
|
|
exports.getStyle = getStyle;
|
|
|
|
|
exports.setPxStyle = setPxStyle;
|
|
|
|
|
exports.getDataAttr = getDataAttr;
|
|
|
|
|
exports.getLeft = getLeft;
|
|
|
|
|
exports.getTop = getTop;
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
function toArray(children) {
|
|
|
|
|
// allow [c,[a,b]]
|
|
|
|
|
var c = [];
|
|
|
|
|
_react2['default'].Children.forEach(children, function (child) {
|
|
|
|
|
if (child) {
|
|
|
|
|
c.push(child);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getActiveIndex(children, activeKey) {
|
|
|
|
|
var c = toArray(children);
|
|
|
|
|
for (var i = 0; i < c.length; i++) {
|
|
|
|
|
if (c[i].key === activeKey) {
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getActiveKey(children, index) {
|
|
|
|
|
var c = toArray(children);
|
|
|
|
|
return c[index].key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setTransform(style, v) {
|
|
|
|
|
style.transform = v;
|
|
|
|
|
style.webkitTransform = v;
|
|
|
|
|
style.mozTransform = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isTransform3dSupported(style) {
|
|
|
|
|
return ('transform' in style || 'webkitTransform' in style || 'MozTransform' in style) && window.atob;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setTransition(style, v) {
|
|
|
|
|
style.transition = v;
|
|
|
|
|
style.webkitTransition = v;
|
|
|
|
|
style.MozTransition = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTransformPropValue(v) {
|
|
|
|
|
return {
|
|
|
|
|
transform: v,
|
|
|
|
|
WebkitTransform: v,
|
|
|
|
|
MozTransform: v
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isVertical(tabBarPosition) {
|
|
|
|
|
return tabBarPosition === 'left' || tabBarPosition === 'right';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTransformByIndex(index, tabBarPosition) {
|
|
|
|
|
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';
|
|
|
|
|
|
|
|
|
|
var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX';
|
|
|
|
|
|
|
|
|
|
if (!isVertical(tabBarPosition) && direction === 'rtl') {
|
|
|
|
|
return translate + '(' + index * 100 + '%) translateZ(0)';
|
|
|
|
|
}
|
|
|
|
|
return translate + '(' + -index * 100 + '%) translateZ(0)';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getMarginStyle(index, tabBarPosition) {
|
|
|
|
|
var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft';
|
|
|
|
|
return (0, _defineProperty3['default'])({}, marginDirection, -index * 100 + '%');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getStyle(el, property) {
|
|
|
|
|
return +window.getComputedStyle(el).getPropertyValue(property).replace('px', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setPxStyle(el, value, vertical) {
|
|
|
|
|
value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px';
|
|
|
|
|
setTransform(el.style, 'translate3d(' + value + ')');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getDataAttr(props) {
|
|
|
|
|
return Object.keys(props).reduce(function (prev, key) {
|
|
|
|
|
if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {
|
|
|
|
|
prev[key] = props[key];
|
|
|
|
|
}
|
|
|
|
|
return prev;
|
|
|
|
|
}, {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toNum(style, property) {
|
|
|
|
|
return +style.getPropertyValue(property).replace('px', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTypeValue(start, current, end, tabNode, wrapperNode) {
|
|
|
|
|
var total = getStyle(wrapperNode, 'padding-' + start);
|
|
|
|
|
if (!tabNode || !tabNode.parentNode) {
|
|
|
|
|
return total;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var childNodes = tabNode.parentNode.childNodes;
|
|
|
|
|
|
|
|
|
|
Array.prototype.some.call(childNodes, function (node) {
|
|
|
|
|
var style = window.getComputedStyle(node);
|
|
|
|
|
|
|
|
|
|
if (node !== tabNode) {
|
|
|
|
|
total += toNum(style, 'margin-' + start);
|
|
|
|
|
total += node[current];
|
|
|
|
|
total += toNum(style, 'margin-' + end);
|
|
|
|
|
|
|
|
|
|
if (style.boxSizing === 'content-box') {
|
|
|
|
|
total += toNum(style, 'border-' + start + '-width') + toNum(style, 'border-' + end + '-width');
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We need count current node margin
|
|
|
|
|
// ref: https://github.com/react-component/tabs/pull/139#issuecomment-431005262
|
|
|
|
|
total += toNum(style, 'margin-' + start);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return total;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getLeft(tabNode, wrapperNode) {
|
|
|
|
|
return getTypeValue('left', 'offsetWidth', 'right', tabNode, wrapperNode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTop(tabNode, wrapperNode) {
|
|
|
|
|
return getTypeValue('top', 'offsetHeight', 'bottom', tabNode, wrapperNode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1408:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* unused harmony export toArray */
|
|
|
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = getActiveIndex;
|
|
|
|
|
/* unused harmony export getActiveKey */
|
|
|
|
|
/* unused harmony export setTransform */
|
|
|
|
|
/* unused harmony export isTransform3dSupported */
|
|
|
|
|
/* unused harmony export setTransition */
|
|
|
|
|
/* harmony export (immutable) */ __webpack_exports__["e"] = getTransformPropValue;
|
|
|
|
|
/* unused harmony export isVertical */
|
|
|
|
|
/* harmony export (immutable) */ __webpack_exports__["d"] = getTransformByIndex;
|
|
|
|
|
/* harmony export (immutable) */ __webpack_exports__["c"] = getMarginStyle;
|
|
|
|
|
/* unused harmony export getStyle */
|
|
|
|
|
/* unused harmony export setPxStyle */
|
|
|
|
|
/* harmony export (immutable) */ __webpack_exports__["b"] = getDataAttr;
|
|
|
|
|
/* unused harmony export getLeft */
|
|
|
|
|
/* unused harmony export getTop */
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__ = __webpack_require__(59);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toArray(children) {
|
|
|
|
|
// allow [c,[a,b]]
|
|
|
|
|
var c = [];
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.forEach(children, function (child) {
|
|
|
|
|
if (child) {
|
|
|
|
|
c.push(child);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getActiveIndex(children, activeKey) {
|
|
|
|
|
var c = toArray(children);
|
|
|
|
|
for (var i = 0; i < c.length; i++) {
|
|
|
|
|
if (c[i].key === activeKey) {
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getActiveKey(children, index) {
|
|
|
|
|
var c = toArray(children);
|
|
|
|
|
return c[index].key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setTransform(style, v) {
|
|
|
|
|
style.transform = v;
|
|
|
|
|
style.webkitTransform = v;
|
|
|
|
|
style.mozTransform = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isTransform3dSupported(style) {
|
|
|
|
|
return ('transform' in style || 'webkitTransform' in style || 'MozTransform' in style) && window.atob;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setTransition(style, v) {
|
|
|
|
|
style.transition = v;
|
|
|
|
|
style.webkitTransition = v;
|
|
|
|
|
style.MozTransition = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTransformPropValue(v) {
|
|
|
|
|
return {
|
|
|
|
|
transform: v,
|
|
|
|
|
WebkitTransform: v,
|
|
|
|
|
MozTransform: v
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isVertical(tabBarPosition) {
|
|
|
|
|
return tabBarPosition === 'left' || tabBarPosition === 'right';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTransformByIndex(index, tabBarPosition) {
|
|
|
|
|
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';
|
|
|
|
|
|
|
|
|
|
var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX';
|
|
|
|
|
|
|
|
|
|
if (!isVertical(tabBarPosition) && direction === 'rtl') {
|
|
|
|
|
return translate + '(' + index * 100 + '%) translateZ(0)';
|
|
|
|
|
}
|
|
|
|
|
return translate + '(' + -index * 100 + '%) translateZ(0)';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getMarginStyle(index, tabBarPosition) {
|
|
|
|
|
var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft';
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()({}, marginDirection, -index * 100 + '%');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getStyle(el, property) {
|
|
|
|
|
return +window.getComputedStyle(el).getPropertyValue(property).replace('px', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setPxStyle(el, value, vertical) {
|
|
|
|
|
value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px';
|
|
|
|
|
setTransform(el.style, 'translate3d(' + value + ')');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getDataAttr(props) {
|
|
|
|
|
return Object.keys(props).reduce(function (prev, key) {
|
|
|
|
|
if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {
|
|
|
|
|
prev[key] = props[key];
|
|
|
|
|
}
|
|
|
|
|
return prev;
|
|
|
|
|
}, {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toNum(style, property) {
|
|
|
|
|
return +style.getPropertyValue(property).replace('px', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTypeValue(start, current, end, tabNode, wrapperNode) {
|
|
|
|
|
var total = getStyle(wrapperNode, 'padding-' + start);
|
|
|
|
|
if (!tabNode || !tabNode.parentNode) {
|
|
|
|
|
return total;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var childNodes = tabNode.parentNode.childNodes;
|
|
|
|
|
|
|
|
|
|
Array.prototype.some.call(childNodes, function (node) {
|
|
|
|
|
var style = window.getComputedStyle(node);
|
|
|
|
|
|
|
|
|
|
if (node !== tabNode) {
|
|
|
|
|
total += toNum(style, 'margin-' + start);
|
|
|
|
|
total += node[current];
|
|
|
|
|
total += toNum(style, 'margin-' + end);
|
|
|
|
|
|
|
|
|
|
if (style.boxSizing === 'content-box') {
|
|
|
|
|
total += toNum(style, 'border-' + start + '-width') + toNum(style, 'border-' + end + '-width');
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We need count current node margin
|
|
|
|
|
// ref: https://github.com/react-component/tabs/pull/139#issuecomment-431005262
|
|
|
|
|
total += toNum(style, 'margin-' + start);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return total;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getLeft(tabNode, wrapperNode) {
|
|
|
|
|
return getTypeValue('left', 'offsetWidth', 'right', tabNode, wrapperNode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTop(tabNode, wrapperNode) {
|
|
|
|
|
return getTypeValue('top', 'offsetHeight', 'bottom', tabNode, wrapperNode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1445:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(18);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(59);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(75);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(9);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(31);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(10);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__ = __webpack_require__(11);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(1);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(3);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils__ = __webpack_require__(1408);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__Sentinel__ = __webpack_require__(1446);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabPane = function (_React$Component) {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default()(TabPane, _React$Component);
|
|
|
|
|
|
|
|
|
|
function TabPane() {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, TabPane);
|
|
|
|
|
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(this, (TabPane.__proto__ || Object.getPrototypeOf(TabPane)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(TabPane, [{
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classnames;
|
|
|
|
|
|
|
|
|
|
var _props = this.props,
|
|
|
|
|
id = _props.id,
|
|
|
|
|
className = _props.className,
|
|
|
|
|
destroyInactiveTabPane = _props.destroyInactiveTabPane,
|
|
|
|
|
active = _props.active,
|
|
|
|
|
forceRender = _props.forceRender,
|
|
|
|
|
rootPrefixCls = _props.rootPrefixCls,
|
|
|
|
|
style = _props.style,
|
|
|
|
|
children = _props.children,
|
|
|
|
|
placeholder = _props.placeholder,
|
|
|
|
|
restProps = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['id', 'className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']);
|
|
|
|
|
|
|
|
|
|
this._isActived = this._isActived || active;
|
|
|
|
|
var prefixCls = rootPrefixCls + '-tabpane';
|
|
|
|
|
var cls = __WEBPACK_IMPORTED_MODULE_9_classnames___default()((_classnames = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls, 1), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-inactive', !active), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-active', active), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, className, className), _classnames));
|
|
|
|
|
var isRender = destroyInactiveTabPane ? active : this._isActived;
|
|
|
|
|
var shouldRender = isRender || forceRender;
|
|
|
|
|
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_11__Sentinel__["a" /* SentinelConsumer */],
|
|
|
|
|
null,
|
|
|
|
|
function (_ref) {
|
|
|
|
|
var sentinelStart = _ref.sentinelStart,
|
|
|
|
|
sentinelEnd = _ref.sentinelEnd,
|
|
|
|
|
setPanelSentinelStart = _ref.setPanelSentinelStart,
|
|
|
|
|
setPanelSentinelEnd = _ref.setPanelSentinelEnd;
|
|
|
|
|
|
|
|
|
|
// Create sentinel
|
|
|
|
|
var panelSentinelStart = void 0;
|
|
|
|
|
var panelSentinelEnd = void 0;
|
|
|
|
|
if (active && shouldRender) {
|
|
|
|
|
panelSentinelStart = __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__Sentinel__["c" /* default */], {
|
|
|
|
|
setRef: setPanelSentinelStart,
|
|
|
|
|
prevElement: sentinelStart
|
|
|
|
|
});
|
|
|
|
|
panelSentinelEnd = __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__Sentinel__["c" /* default */], {
|
|
|
|
|
setRef: setPanelSentinelEnd,
|
|
|
|
|
nextElement: sentinelEnd
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
|
|
|
|
|
'div',
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
|
|
|
|
|
style: style,
|
|
|
|
|
role: 'tabpanel',
|
|
|
|
|
'aria-hidden': active ? 'false' : 'true',
|
|
|
|
|
className: cls,
|
|
|
|
|
id: id
|
|
|
|
|
}, Object(__WEBPACK_IMPORTED_MODULE_10__utils__["b" /* getDataAttr */])(restProps)),
|
|
|
|
|
panelSentinelStart,
|
|
|
|
|
shouldRender ? children : placeholder,
|
|
|
|
|
panelSentinelEnd
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return TabPane;
|
|
|
|
|
}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (TabPane);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabPane.propTypes = {
|
|
|
|
|
className: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
active: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
|
|
|
|
|
style: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.any,
|
|
|
|
|
destroyInactiveTabPane: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
|
|
|
|
|
forceRender: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
|
|
|
|
|
placeholder: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node,
|
|
|
|
|
rootPrefixCls: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
children: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node,
|
|
|
|
|
id: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TabPane.defaultProps = {
|
|
|
|
|
placeholder: null
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1446:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SentinelProvider; });
|
|
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SentinelConsumer; });
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(9);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(31);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(10);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(11);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(1);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rc_util_es_KeyCode__ = __webpack_require__(178);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ant_design_create_react_context__ = __webpack_require__(316);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ant_design_create_react_context___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__ant_design_create_react_context__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SentinelContext = __WEBPACK_IMPORTED_MODULE_7__ant_design_create_react_context___default()({});
|
|
|
|
|
var SentinelProvider = SentinelContext.Provider;
|
|
|
|
|
var SentinelConsumer = SentinelContext.Consumer;
|
|
|
|
|
|
|
|
|
|
var sentinelStyle = { width: 0, height: 0, overflow: 'hidden', position: 'absolute' };
|
|
|
|
|
|
|
|
|
|
var Sentinel = function (_React$Component) {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Sentinel, _React$Component);
|
|
|
|
|
|
|
|
|
|
function Sentinel() {
|
|
|
|
|
var _ref;
|
|
|
|
|
|
|
|
|
|
var _temp, _this, _ret;
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, Sentinel);
|
|
|
|
|
|
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
|
|
args[_key] = arguments[_key];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, (_ref = Sentinel.__proto__ || Object.getPrototypeOf(Sentinel)).call.apply(_ref, [this].concat(args))), _this), _this.onKeyDown = function (_ref2) {
|
|
|
|
|
var target = _ref2.target,
|
|
|
|
|
which = _ref2.which,
|
|
|
|
|
shiftKey = _ref2.shiftKey;
|
|
|
|
|
var _this$props = _this.props,
|
|
|
|
|
nextElement = _this$props.nextElement,
|
|
|
|
|
prevElement = _this$props.prevElement;
|
|
|
|
|
|
|
|
|
|
if (which !== __WEBPACK_IMPORTED_MODULE_6_rc_util_es_KeyCode__["a" /* default */].TAB || document.activeElement !== target) return;
|
|
|
|
|
|
|
|
|
|
// Tab next
|
|
|
|
|
if (!shiftKey && nextElement) {
|
|
|
|
|
nextElement.focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tab prev
|
|
|
|
|
if (shiftKey && prevElement) {
|
|
|
|
|
prevElement.focus();
|
|
|
|
|
}
|
|
|
|
|
}, _temp), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(Sentinel, [{
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var setRef = this.props.setRef;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div', {
|
|
|
|
|
tabIndex: 0,
|
|
|
|
|
ref: setRef,
|
|
|
|
|
style: sentinelStyle,
|
|
|
|
|
onKeyDown: this.onKeyDown,
|
|
|
|
|
role: 'presentation'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Sentinel;
|
|
|
|
|
}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
|
|
|
|
|
|
|
|
|
|
Sentinel.propTypes = {
|
|
|
|
|
setRef: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
|
|
|
|
|
prevElement: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
|
|
|
|
|
nextElement: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ __webpack_exports__["c"] = (Sentinel);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1499:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__webpack_require__(28);
|
|
|
|
|
|
|
|
|
|
__webpack_require__(1541);
|
|
|
|
|
//# sourceMappingURL=css.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1500:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var ReactDOM = _interopRequireWildcard(__webpack_require__(4));
|
|
|
|
|
|
|
|
|
|
var _rcTabs = _interopRequireWildcard(__webpack_require__(1543));
|
|
|
|
|
|
|
|
|
|
var _TabContent = _interopRequireDefault(__webpack_require__(1548));
|
|
|
|
|
|
|
|
|
|
var _classnames = _interopRequireDefault(__webpack_require__(3));
|
|
|
|
|
|
|
|
|
|
var _omit = _interopRequireDefault(__webpack_require__(43));
|
|
|
|
|
|
|
|
|
|
var _TabBar = _interopRequireDefault(__webpack_require__(1549));
|
|
|
|
|
|
|
|
|
|
var _icon = _interopRequireDefault(__webpack_require__(26));
|
|
|
|
|
|
|
|
|
|
var _configProvider = __webpack_require__(12);
|
|
|
|
|
|
|
|
|
|
var _warning = _interopRequireDefault(__webpack_require__(40));
|
|
|
|
|
|
|
|
|
|
var _styleChecker = __webpack_require__(1512);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
|
|
var t = {};
|
|
|
|
|
|
|
|
|
|
for (var p in s) {
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
|
|
}
|
|
|
|
|
return t;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var Tabs =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(Tabs, _React$Component);
|
|
|
|
|
|
|
|
|
|
function Tabs() {
|
|
|
|
|
var _this;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, Tabs);
|
|
|
|
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(Tabs).apply(this, arguments));
|
|
|
|
|
|
|
|
|
|
_this.removeTab = function (targetKey, e) {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
|
|
if (!targetKey) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var onEdit = _this.props.onEdit;
|
|
|
|
|
|
|
|
|
|
if (onEdit) {
|
|
|
|
|
onEdit(targetKey, 'remove');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.handleChange = function (activeKey) {
|
|
|
|
|
var onChange = _this.props.onChange;
|
|
|
|
|
|
|
|
|
|
if (onChange) {
|
|
|
|
|
onChange(activeKey);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.createNewTab = function (targetKey) {
|
|
|
|
|
var onEdit = _this.props.onEdit;
|
|
|
|
|
|
|
|
|
|
if (onEdit) {
|
|
|
|
|
onEdit(targetKey, 'add');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.renderTabs = function (_ref) {
|
|
|
|
|
var _classNames;
|
|
|
|
|
|
|
|
|
|
var getPrefixCls = _ref.getPrefixCls;
|
|
|
|
|
var _this$props = _this.props,
|
|
|
|
|
customizePrefixCls = _this$props.prefixCls,
|
|
|
|
|
_this$props$className = _this$props.className,
|
|
|
|
|
className = _this$props$className === void 0 ? '' : _this$props$className,
|
|
|
|
|
size = _this$props.size,
|
|
|
|
|
_this$props$type = _this$props.type,
|
|
|
|
|
type = _this$props$type === void 0 ? 'line' : _this$props$type,
|
|
|
|
|
tabPosition = _this$props.tabPosition,
|
|
|
|
|
children = _this$props.children,
|
|
|
|
|
_this$props$animated = _this$props.animated,
|
|
|
|
|
animated = _this$props$animated === void 0 ? true : _this$props$animated,
|
|
|
|
|
hideAdd = _this$props.hideAdd;
|
|
|
|
|
var tabBarExtraContent = _this.props.tabBarExtraContent;
|
|
|
|
|
var tabPaneAnimated = _typeof(animated) === 'object' ? animated.tabPane : animated; // card tabs should not have animation
|
|
|
|
|
|
|
|
|
|
if (type !== 'line') {
|
|
|
|
|
tabPaneAnimated = 'animated' in _this.props ? tabPaneAnimated : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _warning["default"])(!(type.indexOf('card') >= 0 && (size === 'small' || size === 'large')), 'Tabs', "`type=card|editable-card` doesn't have small or large size, it's by design.");
|
|
|
|
|
var prefixCls = getPrefixCls('tabs', customizePrefixCls);
|
|
|
|
|
var cls = (0, _classnames["default"])(className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-vertical"), tabPosition === 'left' || tabPosition === 'right'), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), !!size), _defineProperty(_classNames, "".concat(prefixCls, "-card"), type.indexOf('card') >= 0), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(type), true), _defineProperty(_classNames, "".concat(prefixCls, "-no-animation"), !tabPaneAnimated), _classNames)); // only card type tabs can be added and closed
|
|
|
|
|
|
|
|
|
|
var childrenWithClose = [];
|
|
|
|
|
|
|
|
|
|
if (type === 'editable-card') {
|
|
|
|
|
childrenWithClose = [];
|
|
|
|
|
React.Children.forEach(children, function (child, index) {
|
|
|
|
|
if (!React.isValidElement(child)) return child;
|
|
|
|
|
var closable = child.props.closable;
|
|
|
|
|
closable = typeof closable === 'undefined' ? true : closable;
|
|
|
|
|
var closeIcon = closable ? React.createElement(_icon["default"], {
|
|
|
|
|
type: "close",
|
|
|
|
|
className: "".concat(prefixCls, "-close-x"),
|
|
|
|
|
onClick: function onClick(e) {
|
|
|
|
|
return _this.removeTab(child.key, e);
|
|
|
|
|
}
|
|
|
|
|
}) : null;
|
|
|
|
|
childrenWithClose.push(React.cloneElement(child, {
|
|
|
|
|
tab: React.createElement("div", {
|
|
|
|
|
className: closable ? undefined : "".concat(prefixCls, "-tab-unclosable")
|
|
|
|
|
}, child.props.tab, closeIcon),
|
|
|
|
|
key: child.key || index
|
|
|
|
|
}));
|
|
|
|
|
}); // Add new tab handler
|
|
|
|
|
|
|
|
|
|
if (!hideAdd) {
|
|
|
|
|
tabBarExtraContent = React.createElement("span", null, React.createElement(_icon["default"], {
|
|
|
|
|
type: "plus",
|
|
|
|
|
className: "".concat(prefixCls, "-new-tab"),
|
|
|
|
|
onClick: _this.createNewTab
|
|
|
|
|
}), tabBarExtraContent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tabBarExtraContent = tabBarExtraContent ? React.createElement("div", {
|
|
|
|
|
className: "".concat(prefixCls, "-extra-content")
|
|
|
|
|
}, tabBarExtraContent) : null;
|
|
|
|
|
|
|
|
|
|
var tabBarProps = __rest(_this.props, []);
|
|
|
|
|
|
|
|
|
|
var contentCls = (0, _classnames["default"])("".concat(prefixCls, "-").concat(tabPosition, "-content"), type.indexOf('card') >= 0 && "".concat(prefixCls, "-card-content"));
|
|
|
|
|
return React.createElement(_rcTabs["default"], _extends({}, _this.props, {
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
className: cls,
|
|
|
|
|
tabBarPosition: tabPosition,
|
|
|
|
|
renderTabBar: function renderTabBar() {
|
|
|
|
|
return React.createElement(_TabBar["default"], _extends({}, (0, _omit["default"])(tabBarProps, ['className']), {
|
|
|
|
|
tabBarExtraContent: tabBarExtraContent
|
|
|
|
|
}));
|
|
|
|
|
},
|
|
|
|
|
renderTabContent: function renderTabContent() {
|
|
|
|
|
return React.createElement(_TabContent["default"], {
|
|
|
|
|
className: contentCls,
|
|
|
|
|
animated: tabPaneAnimated,
|
|
|
|
|
animatedWithMargin: true
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onChange: _this.handleChange
|
|
|
|
|
}), childrenWithClose.length > 0 ? childrenWithClose : children);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Tabs, [{
|
|
|
|
|
key: "componentDidMount",
|
|
|
|
|
value: function componentDidMount() {
|
|
|
|
|
var NO_FLEX = ' no-flex';
|
|
|
|
|
var tabNode = ReactDOM.findDOMNode(this);
|
|
|
|
|
|
|
|
|
|
if (tabNode && !_styleChecker.isFlexSupported && tabNode.className.indexOf(NO_FLEX) === -1) {
|
|
|
|
|
tabNode.className += NO_FLEX;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
return React.createElement(_configProvider.ConfigConsumer, null, this.renderTabs);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Tabs;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
exports["default"] = Tabs;
|
|
|
|
|
Tabs.TabPane = _rcTabs.TabPane;
|
|
|
|
|
Tabs.defaultProps = {
|
|
|
|
|
hideAdd: false,
|
|
|
|
|
tabPosition: 'top'
|
|
|
|
|
};
|
|
|
|
|
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1512:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = exports.isFlexSupported = void 0;
|
|
|
|
|
|
|
|
|
|
var isStyleSupport = function isStyleSupport(styleName) {
|
|
|
|
|
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
|
|
|
|
|
var styleNameList = Array.isArray(styleName) ? styleName : [styleName];
|
|
|
|
|
var documentElement = window.document.documentElement;
|
|
|
|
|
return styleNameList.some(function (name) {
|
|
|
|
|
return name in documentElement.style;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']);
|
|
|
|
|
exports.isFlexSupported = isFlexSupported;
|
|
|
|
|
var _default = isStyleSupport;
|
|
|
|
|
exports["default"] = _default;
|
|
|
|
|
//# sourceMappingURL=styleChecker.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1541:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
|
|
|
|
|
|
|
|
// load the styles
|
|
|
|
|
var content = __webpack_require__(1542);
|
|
|
|
|
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
|
|
|
// Prepare cssTransformation
|
|
|
|
|
var transform;
|
|
|
|
|
|
|
|
|
|
var options = {"hmr":false}
|
|
|
|
|
options.transform = transform
|
|
|
|
|
// add the styles to the DOM
|
|
|
|
|
var update = __webpack_require__(313)(content, options);
|
|
|
|
|
if(content.locals) module.exports = content.locals;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1542:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
exports = module.exports = __webpack_require__(312)(true);
|
|
|
|
|
// imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// module
|
|
|
|
|
exports.push([module.i, ".ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{height:40px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-ink-bar{visibility:hidden}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{height:40px;margin:0;margin-right:2px;padding:0 16px;line-height:38px;background:#fafafa;border:1px solid #e8e8e8;border-radius:4px 4px 0 0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);-o-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{height:40px;color:#1890ff;background:#fff;border-color:#e8e8e8;border-bottom:1px solid #fff}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active:before{border-top:2px solid transparent}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-disabled{color:#1890ff;color:rgba(0,0,0,.25)}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-inactive{padding:0}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-wrap{margin-bottom:0}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x{width:16px;height:16px;height:14px;margin-right:-5px;margin-left:3px;overflow:hidden;color:rgba(0,0,0,.45);font-size:12px;vertical-align:middle;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x:hover{color:rgba(0,0,0,.85)}.ant-tabs.ant-tabs-card .ant-tabs-card-content>.ant-tabs-tabpane,.ant-tabs.ant-tabs-editable-card .ant-tabs-card-content>.ant-tabs-tabpane{-webkit-transition:none!important;-o-transition:none!important;transition:none!important}.ant-tabs.ant-tabs-card .ant-tabs-card-content>.ant-tabs-tabpane-inactive,.ant-tabs.ant-tabs-editable-card .ant-tabs-card-content>.ant-tabs-tabpane-inactive{overflow:hidden}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab:hover .anticon-close{opacity:1}.ant-tabs-extra-content{line-height:45px}.ant-tabs-extra-content .ant-tabs-new-tab{position:relative;width:20px;height:20px;color:rgba(0,0,0,.65);font-size:12px;line-height:20px;text-align:center;border:1px solid #e8e8e8;border-radius:2px;cursor:pointer;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-tabs-extra-content .ant-tabs-new-tab:hover{color:#1890ff;border-color:#1890ff}.ant-tabs-extra-content .ant-tabs-new-tab svg{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto}.ant-tabs.ant-tabs-large .ant-tabs-extra-content{line-height:56px}.ant-tabs.ant-tabs-small .ant-tabs-extra-content{line-height:37px}.ant-tabs.ant-tabs-card .ant-tabs-extra-content{line-height:40px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-nav-container{height:100%}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab{margin-bottom:8px;border-bottom:1px solid #e8e8e8}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab-active,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab-active{padding-bottom:4px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab:last-child,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab:last-child{margin-bottom:8px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-new-tab,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-new-tab{width:90%}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-nav-wrap{margin-right:0}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab{margin-right:1px;border-right:0;border-radius:4px 0 0 4px}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab-active{margin-right:-1px;padding-right:18px}.ant-tabs-vertica
|
|
|
|
|
|
|
|
|
|
// exports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1543:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Tabs__ = __webpack_require__(1544);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__TabPane__ = __webpack_require__(1445);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__TabContent__ = __webpack_require__(1547);
|
|
|
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TabPane", function() { return __WEBPACK_IMPORTED_MODULE_1__TabPane__["a"]; });
|
|
|
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TabContent", function() { return __WEBPACK_IMPORTED_MODULE_2__TabContent__["a"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__Tabs__["a" /* default */]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1544:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(18);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(59);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(75);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(9);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(31);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(10);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__ = __webpack_require__(11);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(1);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(3);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_raf__ = __webpack_require__(1545);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_raf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_raf__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_react_lifecycles_compat__ = __webpack_require__(7);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__KeyCode__ = __webpack_require__(1546);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__TabPane__ = __webpack_require__(1445);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__utils__ = __webpack_require__(1408);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__Sentinel__ = __webpack_require__(1446);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function noop() {}
|
|
|
|
|
|
|
|
|
|
function getDefaultActiveKey(props) {
|
|
|
|
|
var activeKey = void 0;
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_7_react___default.a.Children.forEach(props.children, function (child) {
|
|
|
|
|
if (child && !activeKey && !child.props.disabled) {
|
|
|
|
|
activeKey = child.key;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return activeKey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function activeKeyIsValid(props, key) {
|
|
|
|
|
var keys = __WEBPACK_IMPORTED_MODULE_7_react___default.a.Children.map(props.children, function (child) {
|
|
|
|
|
return child && child.key;
|
|
|
|
|
});
|
|
|
|
|
return keys.indexOf(key) >= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var Tabs = function (_React$Component) {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default()(Tabs, _React$Component);
|
|
|
|
|
|
|
|
|
|
function Tabs(props) {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, Tabs);
|
|
|
|
|
|
|
|
|
|
var _this = __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props));
|
|
|
|
|
|
|
|
|
|
_initialiseProps.call(_this);
|
|
|
|
|
|
|
|
|
|
var activeKey = void 0;
|
|
|
|
|
if ('activeKey' in props) {
|
|
|
|
|
activeKey = props.activeKey;
|
|
|
|
|
} else if ('defaultActiveKey' in props) {
|
|
|
|
|
activeKey = props.defaultActiveKey;
|
|
|
|
|
} else {
|
|
|
|
|
activeKey = getDefaultActiveKey(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_this.state = {
|
|
|
|
|
activeKey: activeKey
|
|
|
|
|
};
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(Tabs, [{
|
|
|
|
|
key: 'componentWillUnmount',
|
|
|
|
|
value: function componentWillUnmount() {
|
|
|
|
|
this.destroy = true;
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_10_raf___default.a.cancel(this.sentinelId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Sentinel for tab index
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: 'updateSentinelContext',
|
|
|
|
|
value: function updateSentinelContext() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
if (this.destroy) return;
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_10_raf___default.a.cancel(this.sentinelId);
|
|
|
|
|
this.sentinelId = __WEBPACK_IMPORTED_MODULE_10_raf___default()(function () {
|
|
|
|
|
if (_this2.destroy) return;
|
|
|
|
|
_this2.forceUpdate();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classnames;
|
|
|
|
|
|
|
|
|
|
var props = this.props;
|
|
|
|
|
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
|
|
navWrapper = props.navWrapper,
|
|
|
|
|
tabBarPosition = props.tabBarPosition,
|
|
|
|
|
className = props.className,
|
|
|
|
|
renderTabContent = props.renderTabContent,
|
|
|
|
|
renderTabBar = props.renderTabBar,
|
|
|
|
|
destroyInactiveTabPane = props.destroyInactiveTabPane,
|
|
|
|
|
direction = props.direction,
|
|
|
|
|
restProps = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default()(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane', 'direction']);
|
|
|
|
|
|
|
|
|
|
var cls = __WEBPACK_IMPORTED_MODULE_9_classnames___default()((_classnames = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls, 1), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-' + tabBarPosition, 1), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, className, !!className), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-rtl', direction === 'rtl'), _classnames));
|
|
|
|
|
|
|
|
|
|
this.tabBar = renderTabBar();
|
|
|
|
|
|
|
|
|
|
var tabBar = __WEBPACK_IMPORTED_MODULE_7_react___default.a.cloneElement(this.tabBar, {
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
navWrapper: navWrapper,
|
|
|
|
|
key: 'tabBar',
|
|
|
|
|
onKeyDown: this.onNavKeyDown,
|
|
|
|
|
tabBarPosition: tabBarPosition,
|
|
|
|
|
onTabClick: this.onTabClick,
|
|
|
|
|
panels: props.children,
|
|
|
|
|
activeKey: this.state.activeKey,
|
|
|
|
|
direction: this.props.direction
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var tabContent = __WEBPACK_IMPORTED_MODULE_7_react___default.a.cloneElement(renderTabContent(), {
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
tabBarPosition: tabBarPosition,
|
|
|
|
|
activeKey: this.state.activeKey,
|
|
|
|
|
destroyInactiveTabPane: destroyInactiveTabPane,
|
|
|
|
|
children: props.children,
|
|
|
|
|
onChange: this.setActiveKey,
|
|
|
|
|
key: 'tabContent',
|
|
|
|
|
direction: this.props.direction
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var sentinelStart = __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_15__Sentinel__["c" /* default */], {
|
|
|
|
|
key: 'sentinelStart',
|
|
|
|
|
setRef: this.setSentinelStart,
|
|
|
|
|
nextElement: this.panelSentinelStart
|
|
|
|
|
});
|
|
|
|
|
var sentinelEnd = __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_15__Sentinel__["c" /* default */], {
|
|
|
|
|
key: 'sentinelEnd',
|
|
|
|
|
setRef: this.setSentinelEnd,
|
|
|
|
|
prevElement: this.panelSentinelEnd
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var contents = [];
|
|
|
|
|
if (tabBarPosition === 'bottom') {
|
|
|
|
|
contents.push(sentinelStart, tabContent, sentinelEnd, tabBar);
|
|
|
|
|
} else {
|
|
|
|
|
contents.push(tabBar, sentinelStart, tabContent, sentinelEnd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_15__Sentinel__["b" /* SentinelProvider */],
|
|
|
|
|
{
|
|
|
|
|
value: {
|
|
|
|
|
sentinelStart: this.sentinelStart,
|
|
|
|
|
sentinelEnd: this.sentinelEnd,
|
|
|
|
|
setPanelSentinelStart: this.setPanelSentinelStart,
|
|
|
|
|
setPanelSentinelEnd: this.setPanelSentinelEnd
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
|
|
|
|
|
'div',
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
|
|
|
|
|
className: cls,
|
|
|
|
|
style: props.style
|
|
|
|
|
}, Object(__WEBPACK_IMPORTED_MODULE_14__utils__["b" /* getDataAttr */])(restProps), {
|
|
|
|
|
onScroll: this.onScroll
|
|
|
|
|
}),
|
|
|
|
|
contents
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}], [{
|
|
|
|
|
key: 'getDerivedStateFromProps',
|
|
|
|
|
value: function getDerivedStateFromProps(props, state) {
|
|
|
|
|
var newState = {};
|
|
|
|
|
if ('activeKey' in props) {
|
|
|
|
|
newState.activeKey = props.activeKey;
|
|
|
|
|
} else if (!activeKeyIsValid(props, state.activeKey)) {
|
|
|
|
|
newState.activeKey = getDefaultActiveKey(props);
|
|
|
|
|
}
|
|
|
|
|
if (Object.keys(newState).length > 0) {
|
|
|
|
|
return newState;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Tabs;
|
|
|
|
|
}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
|
|
|
|
|
|
|
|
|
|
var _initialiseProps = function _initialiseProps() {
|
|
|
|
|
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
this.onTabClick = function (activeKey, e) {
|
|
|
|
|
if (_this3.tabBar.props.onTabClick) {
|
|
|
|
|
_this3.tabBar.props.onTabClick(activeKey, e);
|
|
|
|
|
}
|
|
|
|
|
_this3.setActiveKey(activeKey);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.onNavKeyDown = function (e) {
|
|
|
|
|
var eventKeyCode = e.keyCode;
|
|
|
|
|
if (eventKeyCode === __WEBPACK_IMPORTED_MODULE_12__KeyCode__["a" /* default */].RIGHT || eventKeyCode === __WEBPACK_IMPORTED_MODULE_12__KeyCode__["a" /* default */].DOWN) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var nextKey = _this3.getNextActiveKey(true);
|
|
|
|
|
_this3.onTabClick(nextKey);
|
|
|
|
|
} else if (eventKeyCode === __WEBPACK_IMPORTED_MODULE_12__KeyCode__["a" /* default */].LEFT || eventKeyCode === __WEBPACK_IMPORTED_MODULE_12__KeyCode__["a" /* default */].UP) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var previousKey = _this3.getNextActiveKey(false);
|
|
|
|
|
_this3.onTabClick(previousKey);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.onScroll = function (_ref) {
|
|
|
|
|
var target = _ref.target,
|
|
|
|
|
currentTarget = _ref.currentTarget;
|
|
|
|
|
|
|
|
|
|
if (target === currentTarget && target.scrollLeft > 0) {
|
|
|
|
|
target.scrollLeft = 0;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.setSentinelStart = function (node) {
|
|
|
|
|
_this3.sentinelStart = node;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.setSentinelEnd = function (node) {
|
|
|
|
|
_this3.sentinelEnd = node;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.setPanelSentinelStart = function (node) {
|
|
|
|
|
if (node !== _this3.panelSentinelStart) {
|
|
|
|
|
_this3.updateSentinelContext();
|
|
|
|
|
}
|
|
|
|
|
_this3.panelSentinelStart = node;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.setPanelSentinelEnd = function (node) {
|
|
|
|
|
if (node !== _this3.panelSentinelEnd) {
|
|
|
|
|
_this3.updateSentinelContext();
|
|
|
|
|
}
|
|
|
|
|
_this3.panelSentinelEnd = node;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.setActiveKey = function (activeKey) {
|
|
|
|
|
if (_this3.state.activeKey !== activeKey) {
|
|
|
|
|
if (!('activeKey' in _this3.props)) {
|
|
|
|
|
_this3.setState({
|
|
|
|
|
activeKey: activeKey
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
_this3.props.onChange(activeKey);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.getNextActiveKey = function (next) {
|
|
|
|
|
var activeKey = _this3.state.activeKey;
|
|
|
|
|
var children = [];
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_7_react___default.a.Children.forEach(_this3.props.children, function (c) {
|
|
|
|
|
if (c && !c.props.disabled) {
|
|
|
|
|
if (next) {
|
|
|
|
|
children.push(c);
|
|
|
|
|
} else {
|
|
|
|
|
children.unshift(c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var length = children.length;
|
|
|
|
|
var ret = length && children[0].key;
|
|
|
|
|
children.forEach(function (child, i) {
|
|
|
|
|
if (child.key === activeKey) {
|
|
|
|
|
if (i === length - 1) {
|
|
|
|
|
ret = children[0].key;
|
|
|
|
|
} else {
|
|
|
|
|
ret = children[i + 1].key;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return ret;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Tabs.propTypes = {
|
|
|
|
|
destroyInactiveTabPane: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
|
|
|
|
|
renderTabBar: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func.isRequired,
|
|
|
|
|
renderTabContent: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func.isRequired,
|
|
|
|
|
navWrapper: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
|
|
|
|
|
onChange: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
|
|
|
|
|
children: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node,
|
|
|
|
|
prefixCls: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
className: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
tabBarPosition: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
style: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object,
|
|
|
|
|
activeKey: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
defaultActiveKey: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
|
|
|
|
|
direction: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Tabs.defaultProps = {
|
|
|
|
|
prefixCls: 'rc-tabs',
|
|
|
|
|
destroyInactiveTabPane: false,
|
|
|
|
|
onChange: noop,
|
|
|
|
|
navWrapper: function navWrapper(arg) {
|
|
|
|
|
return arg;
|
|
|
|
|
},
|
|
|
|
|
tabBarPosition: 'top',
|
|
|
|
|
children: null,
|
|
|
|
|
style: {},
|
|
|
|
|
direction: 'ltr'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Tabs.TabPane = __WEBPACK_IMPORTED_MODULE_13__TabPane__["a" /* default */];
|
|
|
|
|
|
|
|
|
|
Object(__WEBPACK_IMPORTED_MODULE_11_react_lifecycles_compat__["polyfill"])(Tabs);
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (Tabs);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1545:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
/* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(336)
|
|
|
|
|
, root = typeof window === 'undefined' ? global : window
|
|
|
|
|
, vendors = ['moz', 'webkit']
|
|
|
|
|
, suffix = 'AnimationFrame'
|
|
|
|
|
, raf = root['request' + suffix]
|
|
|
|
|
, caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
|
|
|
|
|
|
|
|
|
|
for(var i = 0; !raf && i < vendors.length; i++) {
|
|
|
|
|
raf = root[vendors[i] + 'Request' + suffix]
|
|
|
|
|
caf = root[vendors[i] + 'Cancel' + suffix]
|
|
|
|
|
|| root[vendors[i] + 'CancelRequest' + suffix]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Some versions of FF have rAF but not cAF
|
|
|
|
|
if(!raf || !caf) {
|
|
|
|
|
var last = 0
|
|
|
|
|
, id = 0
|
|
|
|
|
, queue = []
|
|
|
|
|
, frameDuration = 1000 / 60
|
|
|
|
|
|
|
|
|
|
raf = function(callback) {
|
|
|
|
|
if(queue.length === 0) {
|
|
|
|
|
var _now = now()
|
|
|
|
|
, next = Math.max(0, frameDuration - (_now - last))
|
|
|
|
|
last = next + _now
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
var cp = queue.slice(0)
|
|
|
|
|
// Clear queue here to prevent
|
|
|
|
|
// callbacks from appending listeners
|
|
|
|
|
// to the current frame's queue
|
|
|
|
|
queue.length = 0
|
|
|
|
|
for(var i = 0; i < cp.length; i++) {
|
|
|
|
|
if(!cp[i].cancelled) {
|
|
|
|
|
try{
|
|
|
|
|
cp[i].callback(last)
|
|
|
|
|
} catch(e) {
|
|
|
|
|
setTimeout(function() { throw e }, 0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, Math.round(next))
|
|
|
|
|
}
|
|
|
|
|
queue.push({
|
|
|
|
|
handle: ++id,
|
|
|
|
|
callback: callback,
|
|
|
|
|
cancelled: false
|
|
|
|
|
})
|
|
|
|
|
return id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
caf = function(handle) {
|
|
|
|
|
for(var i = 0; i < queue.length; i++) {
|
|
|
|
|
if(queue[i].handle === handle) {
|
|
|
|
|
queue[i].cancelled = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = function(fn) {
|
|
|
|
|
// Wrap in a new function to prevent
|
|
|
|
|
// `cancel` potentially being assigned
|
|
|
|
|
// to the native rAF function
|
|
|
|
|
return raf.call(root, fn)
|
|
|
|
|
}
|
|
|
|
|
module.exports.cancel = function() {
|
|
|
|
|
caf.apply(root, arguments)
|
|
|
|
|
}
|
|
|
|
|
module.exports.polyfill = function(object) {
|
|
|
|
|
if (!object) {
|
|
|
|
|
object = root;
|
|
|
|
|
}
|
|
|
|
|
object.requestAnimationFrame = raf
|
|
|
|
|
object.cancelAnimationFrame = caf
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(34)))
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1546:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
|
|
|
/**
|
|
|
|
|
* LEFT
|
|
|
|
|
*/
|
|
|
|
|
LEFT: 37, // also NUM_WEST
|
|
|
|
|
/**
|
|
|
|
|
* UP
|
|
|
|
|
*/
|
|
|
|
|
UP: 38, // also NUM_NORTH
|
|
|
|
|
/**
|
|
|
|
|
* RIGHT
|
|
|
|
|
*/
|
|
|
|
|
RIGHT: 39, // also NUM_EAST
|
|
|
|
|
/**
|
|
|
|
|
* DOWN
|
|
|
|
|
*/
|
|
|
|
|
DOWN: 40 // also NUM_SOUTH
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1547:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(18);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(59);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(9);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__ = __webpack_require__(31);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(10);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__ = __webpack_require__(11);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(1);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(3);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils__ = __webpack_require__(1408);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabContent = function (_React$Component) {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default()(TabContent, _React$Component);
|
|
|
|
|
|
|
|
|
|
function TabContent() {
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, TabContent);
|
|
|
|
|
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default()(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass___default()(TabContent, [{
|
|
|
|
|
key: 'getTabPanes',
|
|
|
|
|
value: function getTabPanes() {
|
|
|
|
|
var props = this.props;
|
|
|
|
|
var activeKey = props.activeKey;
|
|
|
|
|
var children = props.children;
|
|
|
|
|
var newChildren = [];
|
|
|
|
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_6_react___default.a.Children.forEach(children, function (child) {
|
|
|
|
|
if (!child) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var key = child.key;
|
|
|
|
|
var active = activeKey === key;
|
|
|
|
|
newChildren.push(__WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(child, {
|
|
|
|
|
active: active,
|
|
|
|
|
destroyInactiveTabPane: props.destroyInactiveTabPane,
|
|
|
|
|
rootPrefixCls: props.prefixCls
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return newChildren;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classnames;
|
|
|
|
|
|
|
|
|
|
var props = this.props;
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
|
|
children = props.children,
|
|
|
|
|
activeKey = props.activeKey,
|
|
|
|
|
className = props.className,
|
|
|
|
|
tabBarPosition = props.tabBarPosition,
|
|
|
|
|
animated = props.animated,
|
|
|
|
|
animatedWithMargin = props.animatedWithMargin,
|
|
|
|
|
direction = props.direction;
|
|
|
|
|
var style = props.style;
|
|
|
|
|
|
|
|
|
|
var classes = __WEBPACK_IMPORTED_MODULE_8_classnames___default()((_classnames = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-content', true), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames), className);
|
|
|
|
|
if (animated) {
|
|
|
|
|
var activeIndex = Object(__WEBPACK_IMPORTED_MODULE_9__utils__["a" /* getActiveIndex */])(children, activeKey);
|
|
|
|
|
if (activeIndex !== -1) {
|
|
|
|
|
var animatedStyle = animatedWithMargin ? Object(__WEBPACK_IMPORTED_MODULE_9__utils__["c" /* getMarginStyle */])(activeIndex, tabBarPosition) : Object(__WEBPACK_IMPORTED_MODULE_9__utils__["e" /* getTransformPropValue */])(Object(__WEBPACK_IMPORTED_MODULE_9__utils__["d" /* getTransformByIndex */])(activeIndex, tabBarPosition, direction));
|
|
|
|
|
style = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, animatedStyle);
|
|
|
|
|
} else {
|
|
|
|
|
style = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, {
|
|
|
|
|
display: 'none'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{
|
|
|
|
|
className: classes,
|
|
|
|
|
style: style
|
|
|
|
|
},
|
|
|
|
|
this.getTabPanes()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return TabContent;
|
|
|
|
|
}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (TabContent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabContent.propTypes = {
|
|
|
|
|
animated: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
|
|
|
|
|
animatedWithMargin: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
|
|
|
|
|
prefixCls: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
|
|
|
|
|
children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node,
|
|
|
|
|
activeKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
|
|
|
|
|
style: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any,
|
|
|
|
|
tabBarPosition: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
|
|
|
|
|
className: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
|
|
|
|
|
destroyInactiveTabPane: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
|
|
|
|
|
direction: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TabContent.defaultProps = {
|
|
|
|
|
animated: true
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1548:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _extends2 = __webpack_require__(18);
|
|
|
|
|
|
|
|
|
|
var _extends3 = _interopRequireDefault(_extends2);
|
|
|
|
|
|
|
|
|
|
var _defineProperty2 = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
var _classnames2 = __webpack_require__(3);
|
|
|
|
|
|
|
|
|
|
var _classnames3 = _interopRequireDefault(_classnames2);
|
|
|
|
|
|
|
|
|
|
var _utils = __webpack_require__(1138);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
var TabContent = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(TabContent, _React$Component);
|
|
|
|
|
|
|
|
|
|
function TabContent() {
|
|
|
|
|
(0, _classCallCheck3['default'])(this, TabContent);
|
|
|
|
|
return (0, _possibleConstructorReturn3['default'])(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(TabContent, [{
|
|
|
|
|
key: 'getTabPanes',
|
|
|
|
|
value: function getTabPanes() {
|
|
|
|
|
var props = this.props;
|
|
|
|
|
var activeKey = props.activeKey;
|
|
|
|
|
var children = props.children;
|
|
|
|
|
var newChildren = [];
|
|
|
|
|
|
|
|
|
|
_react2['default'].Children.forEach(children, function (child) {
|
|
|
|
|
if (!child) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var key = child.key;
|
|
|
|
|
var active = activeKey === key;
|
|
|
|
|
newChildren.push(_react2['default'].cloneElement(child, {
|
|
|
|
|
active: active,
|
|
|
|
|
destroyInactiveTabPane: props.destroyInactiveTabPane,
|
|
|
|
|
rootPrefixCls: props.prefixCls
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return newChildren;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classnames;
|
|
|
|
|
|
|
|
|
|
var props = this.props;
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
|
|
children = props.children,
|
|
|
|
|
activeKey = props.activeKey,
|
|
|
|
|
className = props.className,
|
|
|
|
|
tabBarPosition = props.tabBarPosition,
|
|
|
|
|
animated = props.animated,
|
|
|
|
|
animatedWithMargin = props.animatedWithMargin,
|
|
|
|
|
direction = props.direction;
|
|
|
|
|
var style = props.style;
|
|
|
|
|
|
|
|
|
|
var classes = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-content', true), (0, _defineProperty3['default'])(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames), className);
|
|
|
|
|
if (animated) {
|
|
|
|
|
var activeIndex = (0, _utils.getActiveIndex)(children, activeKey);
|
|
|
|
|
if (activeIndex !== -1) {
|
|
|
|
|
var animatedStyle = animatedWithMargin ? (0, _utils.getMarginStyle)(activeIndex, tabBarPosition) : (0, _utils.getTransformPropValue)((0, _utils.getTransformByIndex)(activeIndex, tabBarPosition, direction));
|
|
|
|
|
style = (0, _extends3['default'])({}, style, animatedStyle);
|
|
|
|
|
} else {
|
|
|
|
|
style = (0, _extends3['default'])({}, style, {
|
|
|
|
|
display: 'none'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{
|
|
|
|
|
className: classes,
|
|
|
|
|
style: style
|
|
|
|
|
},
|
|
|
|
|
this.getTabPanes()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return TabContent;
|
|
|
|
|
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
exports['default'] = TabContent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabContent.propTypes = {
|
|
|
|
|
animated: _propTypes2['default'].bool,
|
|
|
|
|
animatedWithMargin: _propTypes2['default'].bool,
|
|
|
|
|
prefixCls: _propTypes2['default'].string,
|
|
|
|
|
children: _propTypes2['default'].node,
|
|
|
|
|
activeKey: _propTypes2['default'].string,
|
|
|
|
|
style: _propTypes2['default'].any,
|
|
|
|
|
tabBarPosition: _propTypes2['default'].string,
|
|
|
|
|
className: _propTypes2['default'].string,
|
|
|
|
|
destroyInactiveTabPane: _propTypes2['default'].bool,
|
|
|
|
|
direction: _propTypes2['default'].string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TabContent.defaultProps = {
|
|
|
|
|
animated: true
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1549:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var _ScrollableInkTabBar = _interopRequireDefault(__webpack_require__(1550));
|
|
|
|
|
|
|
|
|
|
var _classnames = _interopRequireDefault(__webpack_require__(3));
|
|
|
|
|
|
|
|
|
|
var _icon = _interopRequireDefault(__webpack_require__(26));
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var TabBar =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(TabBar, _React$Component);
|
|
|
|
|
|
|
|
|
|
function TabBar() {
|
|
|
|
|
_classCallCheck(this, TabBar);
|
|
|
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, _getPrototypeOf(TabBar).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(TabBar, [{
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classNames;
|
|
|
|
|
|
|
|
|
|
var _this$props = this.props,
|
|
|
|
|
tabBarStyle = _this$props.tabBarStyle,
|
|
|
|
|
animated = _this$props.animated,
|
|
|
|
|
renderTabBar = _this$props.renderTabBar,
|
|
|
|
|
tabBarExtraContent = _this$props.tabBarExtraContent,
|
|
|
|
|
tabPosition = _this$props.tabPosition,
|
|
|
|
|
prefixCls = _this$props.prefixCls,
|
|
|
|
|
className = _this$props.className,
|
|
|
|
|
size = _this$props.size,
|
|
|
|
|
type = _this$props.type;
|
|
|
|
|
var inkBarAnimated = _typeof(animated) === 'object' ? animated.inkBar : animated;
|
|
|
|
|
var isVertical = tabPosition === 'left' || tabPosition === 'right';
|
|
|
|
|
var prevIconType = isVertical ? 'up' : 'left';
|
|
|
|
|
var nextIconType = isVertical ? 'down' : 'right';
|
|
|
|
|
var prevIcon = React.createElement("span", {
|
|
|
|
|
className: "".concat(prefixCls, "-tab-prev-icon")
|
|
|
|
|
}, React.createElement(_icon["default"], {
|
|
|
|
|
type: prevIconType,
|
|
|
|
|
className: "".concat(prefixCls, "-tab-prev-icon-target")
|
|
|
|
|
}));
|
|
|
|
|
var nextIcon = React.createElement("span", {
|
|
|
|
|
className: "".concat(prefixCls, "-tab-next-icon")
|
|
|
|
|
}, React.createElement(_icon["default"], {
|
|
|
|
|
type: nextIconType,
|
|
|
|
|
className: "".concat(prefixCls, "-tab-next-icon-target")
|
|
|
|
|
})); // Additional className for style usage
|
|
|
|
|
|
|
|
|
|
var cls = (0, _classnames["default"])("".concat(prefixCls, "-").concat(tabPosition, "-bar"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size, "-bar"), !!size), _defineProperty(_classNames, "".concat(prefixCls, "-card-bar"), type && type.indexOf('card') >= 0), _classNames), className);
|
|
|
|
|
|
|
|
|
|
var renderProps = _extends(_extends({}, this.props), {
|
|
|
|
|
children: null,
|
|
|
|
|
inkBarAnimated: inkBarAnimated,
|
|
|
|
|
extraContent: tabBarExtraContent,
|
|
|
|
|
style: tabBarStyle,
|
|
|
|
|
prevIcon: prevIcon,
|
|
|
|
|
nextIcon: nextIcon,
|
|
|
|
|
className: cls
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var RenderTabBar;
|
|
|
|
|
|
|
|
|
|
if (renderTabBar) {
|
|
|
|
|
RenderTabBar = renderTabBar(renderProps, _ScrollableInkTabBar["default"]);
|
|
|
|
|
} else {
|
|
|
|
|
RenderTabBar = React.createElement(_ScrollableInkTabBar["default"], renderProps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return React.cloneElement(RenderTabBar);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return TabBar;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
exports["default"] = TabBar;
|
|
|
|
|
TabBar.defaultProps = {
|
|
|
|
|
animated: true,
|
|
|
|
|
type: 'line'
|
|
|
|
|
};
|
|
|
|
|
//# sourceMappingURL=TabBar.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1550:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _extends2 = __webpack_require__(18);
|
|
|
|
|
|
|
|
|
|
var _extends3 = _interopRequireDefault(_extends2);
|
|
|
|
|
|
|
|
|
|
var _objectWithoutProperties2 = __webpack_require__(75);
|
|
|
|
|
|
|
|
|
|
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
var _InkTabBarNode = __webpack_require__(1551);
|
|
|
|
|
|
|
|
|
|
var _InkTabBarNode2 = _interopRequireDefault(_InkTabBarNode);
|
|
|
|
|
|
|
|
|
|
var _TabBarTabsNode = __webpack_require__(1552);
|
|
|
|
|
|
|
|
|
|
var _TabBarTabsNode2 = _interopRequireDefault(_TabBarTabsNode);
|
|
|
|
|
|
|
|
|
|
var _TabBarRootNode = __webpack_require__(1554);
|
|
|
|
|
|
|
|
|
|
var _TabBarRootNode2 = _interopRequireDefault(_TabBarRootNode);
|
|
|
|
|
|
|
|
|
|
var _ScrollableTabBarNode = __webpack_require__(1555);
|
|
|
|
|
|
|
|
|
|
var _ScrollableTabBarNode2 = _interopRequireDefault(_ScrollableTabBarNode);
|
|
|
|
|
|
|
|
|
|
var _SaveRef = __webpack_require__(1556);
|
|
|
|
|
|
|
|
|
|
var _SaveRef2 = _interopRequireDefault(_SaveRef);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
var ScrollableInkTabBar = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(ScrollableInkTabBar, _React$Component);
|
|
|
|
|
|
|
|
|
|
function ScrollableInkTabBar() {
|
|
|
|
|
(0, _classCallCheck3['default'])(this, ScrollableInkTabBar);
|
|
|
|
|
return (0, _possibleConstructorReturn3['default'])(this, (ScrollableInkTabBar.__proto__ || Object.getPrototypeOf(ScrollableInkTabBar)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(ScrollableInkTabBar, [{
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _props = this.props,
|
|
|
|
|
renderTabBarNode = _props.children,
|
|
|
|
|
restProps = (0, _objectWithoutProperties3['default'])(_props, ['children']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _react2['default'].createElement(
|
|
|
|
|
_SaveRef2['default'],
|
|
|
|
|
null,
|
|
|
|
|
function (saveRef, getRef) {
|
|
|
|
|
return _react2['default'].createElement(
|
|
|
|
|
_TabBarRootNode2['default'],
|
|
|
|
|
(0, _extends3['default'])({ saveRef: saveRef }, restProps),
|
|
|
|
|
_react2['default'].createElement(
|
|
|
|
|
_ScrollableTabBarNode2['default'],
|
|
|
|
|
(0, _extends3['default'])({ saveRef: saveRef, getRef: getRef }, restProps),
|
|
|
|
|
_react2['default'].createElement(_TabBarTabsNode2['default'], (0, _extends3['default'])({ saveRef: saveRef, renderTabBarNode: renderTabBarNode }, restProps)),
|
|
|
|
|
_react2['default'].createElement(_InkTabBarNode2['default'], (0, _extends3['default'])({ saveRef: saveRef, getRef: getRef }, restProps))
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return ScrollableInkTabBar;
|
|
|
|
|
}(_react2['default'].Component); /* eslint-disable react/prefer-stateless-function */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports['default'] = ScrollableInkTabBar;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScrollableInkTabBar.propTypes = {
|
|
|
|
|
children: _propTypes2['default'].func
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1551:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _defineProperty2 = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
var _classnames2 = __webpack_require__(3);
|
|
|
|
|
|
|
|
|
|
var _classnames3 = _interopRequireDefault(_classnames2);
|
|
|
|
|
|
|
|
|
|
var _utils = __webpack_require__(1138);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
function _componentDidUpdate(component, init) {
|
|
|
|
|
var _component$props = component.props,
|
|
|
|
|
styles = _component$props.styles,
|
|
|
|
|
panels = _component$props.panels,
|
|
|
|
|
activeKey = _component$props.activeKey,
|
|
|
|
|
direction = _component$props.direction;
|
|
|
|
|
|
|
|
|
|
var rootNode = component.props.getRef('root');
|
|
|
|
|
var wrapNode = component.props.getRef('nav') || rootNode;
|
|
|
|
|
var inkBarNode = component.props.getRef('inkBar');
|
|
|
|
|
var activeTab = component.props.getRef('activeTab');
|
|
|
|
|
var inkBarNodeStyle = inkBarNode.style;
|
|
|
|
|
var tabBarPosition = component.props.tabBarPosition;
|
|
|
|
|
var activeIndex = (0, _utils.getActiveIndex)(panels, activeKey);
|
|
|
|
|
if (init) {
|
|
|
|
|
// prevent mount animation
|
|
|
|
|
inkBarNodeStyle.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
if (activeTab) {
|
|
|
|
|
var tabNode = activeTab;
|
|
|
|
|
var transformSupported = (0, _utils.isTransform3dSupported)(inkBarNodeStyle);
|
|
|
|
|
|
|
|
|
|
// Reset current style
|
|
|
|
|
(0, _utils.setTransform)(inkBarNodeStyle, '');
|
|
|
|
|
inkBarNodeStyle.width = '';
|
|
|
|
|
inkBarNodeStyle.height = '';
|
|
|
|
|
inkBarNodeStyle.left = '';
|
|
|
|
|
inkBarNodeStyle.top = '';
|
|
|
|
|
inkBarNodeStyle.bottom = '';
|
|
|
|
|
inkBarNodeStyle.right = '';
|
|
|
|
|
|
|
|
|
|
if (tabBarPosition === 'top' || tabBarPosition === 'bottom') {
|
|
|
|
|
var left = (0, _utils.getLeft)(tabNode, wrapNode);
|
|
|
|
|
var width = tabNode.offsetWidth;
|
|
|
|
|
|
|
|
|
|
// If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom
|
|
|
|
|
// It means no css working, then ink bar should not have width until css is loaded
|
|
|
|
|
// Fix https://github.com/ant-design/ant-design/issues/7564
|
|
|
|
|
if (width === rootNode.offsetWidth) {
|
|
|
|
|
width = 0;
|
|
|
|
|
} else if (styles.inkBar && styles.inkBar.width !== undefined) {
|
|
|
|
|
width = parseFloat(styles.inkBar.width, 10);
|
|
|
|
|
if (width) {
|
|
|
|
|
left += (tabNode.offsetWidth - width) / 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (direction === 'rtl') {
|
|
|
|
|
left = (0, _utils.getStyle)(tabNode, 'margin-left') - left;
|
|
|
|
|
}
|
|
|
|
|
// use 3d gpu to optimize render
|
|
|
|
|
if (transformSupported) {
|
|
|
|
|
(0, _utils.setTransform)(inkBarNodeStyle, 'translate3d(' + left + 'px,0,0)');
|
|
|
|
|
} else {
|
|
|
|
|
inkBarNodeStyle.left = left + 'px';
|
|
|
|
|
}
|
|
|
|
|
inkBarNodeStyle.width = width + 'px';
|
|
|
|
|
} else {
|
|
|
|
|
var top = (0, _utils.getTop)(tabNode, wrapNode, true);
|
|
|
|
|
var height = tabNode.offsetHeight;
|
|
|
|
|
if (styles.inkBar && styles.inkBar.height !== undefined) {
|
|
|
|
|
height = parseFloat(styles.inkBar.height, 10);
|
|
|
|
|
if (height) {
|
|
|
|
|
top += (tabNode.offsetHeight - height) / 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (transformSupported) {
|
|
|
|
|
(0, _utils.setTransform)(inkBarNodeStyle, 'translate3d(0,' + top + 'px,0)');
|
|
|
|
|
inkBarNodeStyle.top = '0';
|
|
|
|
|
} else {
|
|
|
|
|
inkBarNodeStyle.top = top + 'px';
|
|
|
|
|
}
|
|
|
|
|
inkBarNodeStyle.height = height + 'px';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
inkBarNodeStyle.display = activeIndex !== -1 ? 'block' : 'none';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var InkTabBarNode = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(InkTabBarNode, _React$Component);
|
|
|
|
|
|
|
|
|
|
function InkTabBarNode() {
|
|
|
|
|
(0, _classCallCheck3['default'])(this, InkTabBarNode);
|
|
|
|
|
return (0, _possibleConstructorReturn3['default'])(this, (InkTabBarNode.__proto__ || Object.getPrototypeOf(InkTabBarNode)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(InkTabBarNode, [{
|
|
|
|
|
key: 'componentDidMount',
|
|
|
|
|
value: function componentDidMount() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
// ref https://github.com/ant-design/ant-design/issues/8678
|
|
|
|
|
// ref https://github.com/react-component/tabs/issues/135
|
|
|
|
|
// InkTabBarNode need parent/root ref for calculating position
|
|
|
|
|
// since parent componentDidMount triggered after child componentDidMount
|
|
|
|
|
// we're doing a quick fix here to use setTimeout to calculate position
|
|
|
|
|
// after parent/root component mounted
|
|
|
|
|
this.timeout = setTimeout(function () {
|
|
|
|
|
_componentDidUpdate(_this2, true);
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'componentDidUpdate',
|
|
|
|
|
value: function componentDidUpdate() {
|
|
|
|
|
_componentDidUpdate(this);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'componentWillUnmount',
|
|
|
|
|
value: function componentWillUnmount() {
|
|
|
|
|
clearTimeout(this.timeout);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classnames;
|
|
|
|
|
|
|
|
|
|
var _props = this.props,
|
|
|
|
|
prefixCls = _props.prefixCls,
|
|
|
|
|
styles = _props.styles,
|
|
|
|
|
inkBarAnimated = _props.inkBarAnimated;
|
|
|
|
|
|
|
|
|
|
var className = prefixCls + '-ink-bar';
|
|
|
|
|
var classes = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, className, true), (0, _defineProperty3['default'])(_classnames, inkBarAnimated ? className + '-animated' : className + '-no-animated', true), _classnames));
|
|
|
|
|
return _react2['default'].createElement('div', {
|
|
|
|
|
style: styles.inkBar,
|
|
|
|
|
className: classes,
|
|
|
|
|
key: 'inkBar',
|
|
|
|
|
ref: this.props.saveRef('inkBar')
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return InkTabBarNode;
|
|
|
|
|
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
exports['default'] = InkTabBarNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InkTabBarNode.propTypes = {
|
|
|
|
|
prefixCls: _propTypes2['default'].string,
|
|
|
|
|
styles: _propTypes2['default'].object,
|
|
|
|
|
inkBarAnimated: _propTypes2['default'].bool,
|
|
|
|
|
saveRef: _propTypes2['default'].func,
|
|
|
|
|
direction: _propTypes2['default'].string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
InkTabBarNode.defaultProps = {
|
|
|
|
|
prefixCls: '',
|
|
|
|
|
inkBarAnimated: true,
|
|
|
|
|
styles: {},
|
|
|
|
|
saveRef: function saveRef() {}
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1552:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _extends2 = __webpack_require__(18);
|
|
|
|
|
|
|
|
|
|
var _extends3 = _interopRequireDefault(_extends2);
|
|
|
|
|
|
|
|
|
|
var _defineProperty2 = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _warning = __webpack_require__(1553);
|
|
|
|
|
|
|
|
|
|
var _warning2 = _interopRequireDefault(_warning);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
var _utils = __webpack_require__(1138);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
var TabBarTabsNode = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(TabBarTabsNode, _React$Component);
|
|
|
|
|
|
|
|
|
|
function TabBarTabsNode() {
|
|
|
|
|
(0, _classCallCheck3['default'])(this, TabBarTabsNode);
|
|
|
|
|
return (0, _possibleConstructorReturn3['default'])(this, (TabBarTabsNode.__proto__ || Object.getPrototypeOf(TabBarTabsNode)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(TabBarTabsNode, [{
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
var _props = this.props,
|
|
|
|
|
children = _props.panels,
|
|
|
|
|
activeKey = _props.activeKey,
|
|
|
|
|
prefixCls = _props.prefixCls,
|
|
|
|
|
tabBarGutter = _props.tabBarGutter,
|
|
|
|
|
saveRef = _props.saveRef,
|
|
|
|
|
tabBarPosition = _props.tabBarPosition,
|
|
|
|
|
renderTabBarNode = _props.renderTabBarNode,
|
|
|
|
|
direction = _props.direction;
|
|
|
|
|
|
|
|
|
|
var rst = [];
|
|
|
|
|
|
|
|
|
|
_react2['default'].Children.forEach(children, function (child, index) {
|
|
|
|
|
if (!child) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var key = child.key;
|
|
|
|
|
var cls = activeKey === key ? prefixCls + '-tab-active' : '';
|
|
|
|
|
cls += ' ' + prefixCls + '-tab';
|
|
|
|
|
var events = {};
|
|
|
|
|
if (child.props.disabled) {
|
|
|
|
|
cls += ' ' + prefixCls + '-tab-disabled';
|
|
|
|
|
} else {
|
|
|
|
|
events = {
|
|
|
|
|
onClick: _this2.props.onTabClick.bind(_this2, key)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
var ref = {};
|
|
|
|
|
if (activeKey === key) {
|
|
|
|
|
ref.ref = saveRef('activeTab');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var gutter = tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter;
|
|
|
|
|
|
|
|
|
|
var marginProperty = direction === 'rtl' ? 'marginLeft' : 'marginRight';
|
|
|
|
|
var style = (0, _defineProperty3['default'])({}, (0, _utils.isVertical)(tabBarPosition) ? 'marginBottom' : marginProperty, gutter);
|
|
|
|
|
(0, _warning2['default'])('tab' in child.props, 'There must be `tab` property on children of Tabs.');
|
|
|
|
|
|
|
|
|
|
var node = _react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
(0, _extends3['default'])({
|
|
|
|
|
role: 'tab',
|
|
|
|
|
'aria-disabled': child.props.disabled ? 'true' : 'false',
|
|
|
|
|
'aria-selected': activeKey === key ? 'true' : 'false'
|
|
|
|
|
}, events, {
|
|
|
|
|
className: cls,
|
|
|
|
|
key: key,
|
|
|
|
|
style: style
|
|
|
|
|
}, ref),
|
|
|
|
|
child.props.tab
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (renderTabBarNode) {
|
|
|
|
|
node = renderTabBarNode(node);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rst.push(node);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return _react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{ ref: saveRef('navTabsContainer') },
|
|
|
|
|
rst
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return TabBarTabsNode;
|
|
|
|
|
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
exports['default'] = TabBarTabsNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabBarTabsNode.propTypes = {
|
|
|
|
|
activeKey: _propTypes2['default'].string,
|
|
|
|
|
panels: _propTypes2['default'].node,
|
|
|
|
|
prefixCls: _propTypes2['default'].string,
|
|
|
|
|
tabBarGutter: _propTypes2['default'].number,
|
|
|
|
|
onTabClick: _propTypes2['default'].func,
|
|
|
|
|
saveRef: _propTypes2['default'].func,
|
|
|
|
|
renderTabBarNode: _propTypes2['default'].func,
|
|
|
|
|
tabBarPosition: _propTypes2['default'].string,
|
|
|
|
|
direction: _propTypes2['default'].string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TabBarTabsNode.defaultProps = {
|
|
|
|
|
panels: [],
|
|
|
|
|
prefixCls: [],
|
|
|
|
|
tabBarGutter: null,
|
|
|
|
|
onTabClick: function onTabClick() {},
|
|
|
|
|
saveRef: function saveRef() {}
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1553:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
|
|
|
* This can be used to log issues in development environments in critical
|
|
|
|
|
* paths. Removing the logging code for production environments will keep the
|
|
|
|
|
* same logic and follow the same code paths.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
var __DEV__ = "production" !== 'production';
|
|
|
|
|
|
|
|
|
|
var warning = function() {};
|
|
|
|
|
|
|
|
|
|
if (__DEV__) {
|
|
|
|
|
var printWarning = function printWarning(format, args) {
|
|
|
|
|
var len = arguments.length;
|
|
|
|
|
args = new Array(len > 1 ? len - 1 : 0);
|
|
|
|
|
for (var key = 1; key < len; key++) {
|
|
|
|
|
args[key - 1] = arguments[key];
|
|
|
|
|
}
|
|
|
|
|
var argIndex = 0;
|
|
|
|
|
var message = 'Warning: ' +
|
|
|
|
|
format.replace(/%s/g, function() {
|
|
|
|
|
return args[argIndex++];
|
|
|
|
|
});
|
|
|
|
|
if (typeof console !== 'undefined') {
|
|
|
|
|
console.error(message);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
// --- Welcome to debugging React ---
|
|
|
|
|
// This error was thrown as a convenience so that you can use this stack
|
|
|
|
|
// to find the callsite that caused this warning to fire.
|
|
|
|
|
throw new Error(message);
|
|
|
|
|
} catch (x) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
warning = function(condition, format, args) {
|
|
|
|
|
var len = arguments.length;
|
|
|
|
|
args = new Array(len > 2 ? len - 2 : 0);
|
|
|
|
|
for (var key = 2; key < len; key++) {
|
|
|
|
|
args[key - 2] = arguments[key];
|
|
|
|
|
}
|
|
|
|
|
if (format === undefined) {
|
|
|
|
|
throw new Error(
|
|
|
|
|
'`warning(condition, format, ...args)` requires a warning ' +
|
|
|
|
|
'message argument'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if (!condition) {
|
|
|
|
|
printWarning.apply(null, [format].concat(args));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = warning;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1554:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _extends2 = __webpack_require__(18);
|
|
|
|
|
|
|
|
|
|
var _extends3 = _interopRequireDefault(_extends2);
|
|
|
|
|
|
|
|
|
|
var _defineProperty2 = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
|
|
|
|
|
|
|
|
var _objectWithoutProperties2 = __webpack_require__(75);
|
|
|
|
|
|
|
|
|
|
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
var _classnames2 = __webpack_require__(3);
|
|
|
|
|
|
|
|
|
|
var _classnames3 = _interopRequireDefault(_classnames2);
|
|
|
|
|
|
|
|
|
|
var _utils = __webpack_require__(1138);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
var TabBarRootNode = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(TabBarRootNode, _React$Component);
|
|
|
|
|
|
|
|
|
|
function TabBarRootNode() {
|
|
|
|
|
(0, _classCallCheck3['default'])(this, TabBarRootNode);
|
|
|
|
|
return (0, _possibleConstructorReturn3['default'])(this, (TabBarRootNode.__proto__ || Object.getPrototypeOf(TabBarRootNode)).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(TabBarRootNode, [{
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _props = this.props,
|
|
|
|
|
prefixCls = _props.prefixCls,
|
|
|
|
|
onKeyDown = _props.onKeyDown,
|
|
|
|
|
className = _props.className,
|
|
|
|
|
extraContent = _props.extraContent,
|
|
|
|
|
style = _props.style,
|
|
|
|
|
tabBarPosition = _props.tabBarPosition,
|
|
|
|
|
children = _props.children,
|
|
|
|
|
restProps = (0, _objectWithoutProperties3['default'])(_props, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition', 'children']);
|
|
|
|
|
|
|
|
|
|
var cls = (0, _classnames3['default'])(prefixCls + '-bar', (0, _defineProperty3['default'])({}, className, !!className));
|
|
|
|
|
var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom';
|
|
|
|
|
var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {};
|
|
|
|
|
var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {};
|
|
|
|
|
var newChildren = children;
|
|
|
|
|
if (extraContent) {
|
|
|
|
|
newChildren = [(0, _react.cloneElement)(extraContent, {
|
|
|
|
|
key: 'extra',
|
|
|
|
|
style: (0, _extends3['default'])({}, tabBarExtraContentStyle, extraContentStyle)
|
|
|
|
|
}), (0, _react.cloneElement)(children, { key: 'content' })];
|
|
|
|
|
newChildren = topOrBottom ? newChildren : newChildren.reverse();
|
|
|
|
|
}
|
|
|
|
|
return _react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
(0, _extends3['default'])({
|
|
|
|
|
role: 'tablist',
|
|
|
|
|
className: cls,
|
|
|
|
|
tabIndex: '0',
|
|
|
|
|
ref: this.props.saveRef('root'),
|
|
|
|
|
onKeyDown: onKeyDown,
|
|
|
|
|
style: style
|
|
|
|
|
}, (0, _utils.getDataAttr)(restProps)),
|
|
|
|
|
newChildren
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return TabBarRootNode;
|
|
|
|
|
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
exports['default'] = TabBarRootNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabBarRootNode.propTypes = {
|
|
|
|
|
prefixCls: _propTypes2['default'].string,
|
|
|
|
|
className: _propTypes2['default'].string,
|
|
|
|
|
style: _propTypes2['default'].object,
|
|
|
|
|
tabBarPosition: _propTypes2['default'].oneOf(['left', 'right', 'top', 'bottom']),
|
|
|
|
|
children: _propTypes2['default'].node,
|
|
|
|
|
extraContent: _propTypes2['default'].node,
|
|
|
|
|
onKeyDown: _propTypes2['default'].func,
|
|
|
|
|
saveRef: _propTypes2['default'].func
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TabBarRootNode.defaultProps = {
|
|
|
|
|
prefixCls: '',
|
|
|
|
|
className: '',
|
|
|
|
|
style: {},
|
|
|
|
|
tabBarPosition: 'top',
|
|
|
|
|
extraContent: null,
|
|
|
|
|
children: null,
|
|
|
|
|
onKeyDown: function onKeyDown() {},
|
|
|
|
|
saveRef: function saveRef() {}
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1555:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _defineProperty2 = __webpack_require__(59);
|
|
|
|
|
|
|
|
|
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
var _classnames5 = __webpack_require__(3);
|
|
|
|
|
|
|
|
|
|
var _classnames6 = _interopRequireDefault(_classnames5);
|
|
|
|
|
|
|
|
|
|
var _debounce = __webpack_require__(187);
|
|
|
|
|
|
|
|
|
|
var _debounce2 = _interopRequireDefault(_debounce);
|
|
|
|
|
|
|
|
|
|
var _resizeObserverPolyfill = __webpack_require__(194);
|
|
|
|
|
|
|
|
|
|
var _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill);
|
|
|
|
|
|
|
|
|
|
var _utils = __webpack_require__(1138);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
var ScrollableTabBarNode = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(ScrollableTabBarNode, _React$Component);
|
|
|
|
|
|
|
|
|
|
function ScrollableTabBarNode(props) {
|
|
|
|
|
(0, _classCallCheck3['default'])(this, ScrollableTabBarNode);
|
|
|
|
|
|
|
|
|
|
var _this = (0, _possibleConstructorReturn3['default'])(this, (ScrollableTabBarNode.__proto__ || Object.getPrototypeOf(ScrollableTabBarNode)).call(this, props));
|
|
|
|
|
|
|
|
|
|
_this.prevTransitionEnd = function (e) {
|
|
|
|
|
if (e.propertyName !== 'opacity') {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var container = _this.props.getRef('container');
|
|
|
|
|
_this.scrollToActiveTab({
|
|
|
|
|
target: container,
|
|
|
|
|
currentTarget: container
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.scrollToActiveTab = function (e) {
|
|
|
|
|
var activeTab = _this.props.getRef('activeTab');
|
|
|
|
|
var navWrap = _this.props.getRef('navWrap');
|
|
|
|
|
if (e && e.target !== e.currentTarget || !activeTab) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// when not scrollable or enter scrollable first time, don't emit scrolling
|
|
|
|
|
var needToSroll = _this.isNextPrevShown() && _this.lastNextPrevShown;
|
|
|
|
|
_this.lastNextPrevShown = _this.isNextPrevShown();
|
|
|
|
|
if (!needToSroll) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var activeTabWH = _this.getScrollWH(activeTab);
|
|
|
|
|
var navWrapNodeWH = _this.getOffsetWH(navWrap);
|
|
|
|
|
var offset = _this.offset;
|
|
|
|
|
|
|
|
|
|
var wrapOffset = _this.getOffsetLT(navWrap);
|
|
|
|
|
var activeTabOffset = _this.getOffsetLT(activeTab);
|
|
|
|
|
if (wrapOffset > activeTabOffset) {
|
|
|
|
|
offset += wrapOffset - activeTabOffset;
|
|
|
|
|
_this.setOffset(offset);
|
|
|
|
|
} else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) {
|
|
|
|
|
offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH);
|
|
|
|
|
_this.setOffset(offset);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.prev = function (e) {
|
|
|
|
|
_this.props.onPrevClick(e);
|
|
|
|
|
var navWrapNode = _this.props.getRef('navWrap');
|
|
|
|
|
var navWrapNodeWH = _this.getOffsetWH(navWrapNode);
|
|
|
|
|
var offset = _this.offset;
|
|
|
|
|
|
|
|
|
|
_this.setOffset(offset + navWrapNodeWH);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.next = function (e) {
|
|
|
|
|
_this.props.onNextClick(e);
|
|
|
|
|
var navWrapNode = _this.props.getRef('navWrap');
|
|
|
|
|
var navWrapNodeWH = _this.getOffsetWH(navWrapNode);
|
|
|
|
|
var offset = _this.offset;
|
|
|
|
|
|
|
|
|
|
_this.setOffset(offset - navWrapNodeWH);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.offset = 0;
|
|
|
|
|
|
|
|
|
|
_this.state = {
|
|
|
|
|
next: false,
|
|
|
|
|
prev: false
|
|
|
|
|
};
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(ScrollableTabBarNode, [{
|
|
|
|
|
key: 'componentDidMount',
|
|
|
|
|
value: function componentDidMount() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
this.componentDidUpdate();
|
|
|
|
|
this.debouncedResize = (0, _debounce2['default'])(function () {
|
|
|
|
|
_this2.setNextPrev();
|
|
|
|
|
_this2.scrollToActiveTab();
|
|
|
|
|
}, 200);
|
|
|
|
|
this.resizeObserver = new _resizeObserverPolyfill2['default'](this.debouncedResize);
|
|
|
|
|
this.resizeObserver.observe(this.props.getRef('container'));
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'componentDidUpdate',
|
|
|
|
|
value: function componentDidUpdate(prevProps) {
|
|
|
|
|
var props = this.props;
|
|
|
|
|
if (prevProps && prevProps.tabBarPosition !== props.tabBarPosition) {
|
|
|
|
|
this.setOffset(0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var nextPrev = this.setNextPrev();
|
|
|
|
|
// wait next, prev show hide
|
|
|
|
|
/* eslint react/no-did-update-set-state:0 */
|
|
|
|
|
if (this.isNextPrevShown(this.state) !== this.isNextPrevShown(nextPrev)) {
|
|
|
|
|
this.setState({}, this.scrollToActiveTab);
|
|
|
|
|
} else if (!prevProps || props.activeKey !== prevProps.activeKey) {
|
|
|
|
|
// can not use props.activeKey
|
|
|
|
|
this.scrollToActiveTab();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'componentWillUnmount',
|
|
|
|
|
value: function componentWillUnmount() {
|
|
|
|
|
if (this.resizeObserver) {
|
|
|
|
|
this.resizeObserver.disconnect();
|
|
|
|
|
}
|
|
|
|
|
if (this.debouncedResize && this.debouncedResize.cancel) {
|
|
|
|
|
this.debouncedResize.cancel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'setNextPrev',
|
|
|
|
|
value: function setNextPrev() {
|
|
|
|
|
var navNode = this.props.getRef('nav');
|
|
|
|
|
var navTabsContainer = this.props.getRef('navTabsContainer');
|
|
|
|
|
var navNodeWH = this.getScrollWH(navTabsContainer || navNode);
|
|
|
|
|
// Add 1px to fix `offsetWidth` with decimal in Chrome not correct handle
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/13423
|
|
|
|
|
var containerWH = this.getOffsetWH(this.props.getRef('container')) + 1;
|
|
|
|
|
var navWrapNodeWH = this.getOffsetWH(this.props.getRef('navWrap'));
|
|
|
|
|
var offset = this.offset;
|
|
|
|
|
|
|
|
|
|
var minOffset = containerWH - navNodeWH;
|
|
|
|
|
var _state = this.state,
|
|
|
|
|
next = _state.next,
|
|
|
|
|
prev = _state.prev;
|
|
|
|
|
|
|
|
|
|
if (minOffset >= 0) {
|
|
|
|
|
next = false;
|
|
|
|
|
this.setOffset(0, false);
|
|
|
|
|
offset = 0;
|
|
|
|
|
} else if (minOffset < offset) {
|
|
|
|
|
next = true;
|
|
|
|
|
} else {
|
|
|
|
|
next = false;
|
|
|
|
|
// Fix https://github.com/ant-design/ant-design/issues/8861
|
|
|
|
|
// Test with container offset which is stable
|
|
|
|
|
// and set the offset of the nav wrap node
|
|
|
|
|
var realOffset = navWrapNodeWH - navNodeWH;
|
|
|
|
|
this.setOffset(realOffset, false);
|
|
|
|
|
offset = realOffset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (offset < 0) {
|
|
|
|
|
prev = true;
|
|
|
|
|
} else {
|
|
|
|
|
prev = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setNext(next);
|
|
|
|
|
this.setPrev(prev);
|
|
|
|
|
return {
|
|
|
|
|
next: next,
|
|
|
|
|
prev: prev
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'getOffsetWH',
|
|
|
|
|
value: function getOffsetWH(node) {
|
|
|
|
|
var tabBarPosition = this.props.tabBarPosition;
|
|
|
|
|
var prop = 'offsetWidth';
|
|
|
|
|
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
|
|
|
|
|
prop = 'offsetHeight';
|
|
|
|
|
}
|
|
|
|
|
return node[prop];
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'getScrollWH',
|
|
|
|
|
value: function getScrollWH(node) {
|
|
|
|
|
var tabBarPosition = this.props.tabBarPosition;
|
|
|
|
|
var prop = 'scrollWidth';
|
|
|
|
|
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
|
|
|
|
|
prop = 'scrollHeight';
|
|
|
|
|
}
|
|
|
|
|
return node[prop];
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'getOffsetLT',
|
|
|
|
|
value: function getOffsetLT(node) {
|
|
|
|
|
var tabBarPosition = this.props.tabBarPosition;
|
|
|
|
|
var prop = 'left';
|
|
|
|
|
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
|
|
|
|
|
prop = 'top';
|
|
|
|
|
}
|
|
|
|
|
return node.getBoundingClientRect()[prop];
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'setOffset',
|
|
|
|
|
value: function setOffset(offset) {
|
|
|
|
|
var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
|
|
|
|
|
|
|
|
var target = Math.min(0, offset);
|
|
|
|
|
if (this.offset !== target) {
|
|
|
|
|
this.offset = target;
|
|
|
|
|
var navOffset = {};
|
|
|
|
|
var tabBarPosition = this.props.tabBarPosition;
|
|
|
|
|
var navStyle = this.props.getRef('nav').style;
|
|
|
|
|
var transformSupported = (0, _utils.isTransform3dSupported)(navStyle);
|
|
|
|
|
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
|
|
|
|
|
if (transformSupported) {
|
|
|
|
|
navOffset = {
|
|
|
|
|
value: 'translate3d(0,' + target + 'px,0)'
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
navOffset = {
|
|
|
|
|
name: 'top',
|
|
|
|
|
value: target + 'px'
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
} else if (transformSupported) {
|
|
|
|
|
if (this.props.direction === 'rtl') {
|
|
|
|
|
target = -target;
|
|
|
|
|
}
|
|
|
|
|
navOffset = {
|
|
|
|
|
value: 'translate3d(' + target + 'px,0,0)'
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
navOffset = {
|
|
|
|
|
name: 'left',
|
|
|
|
|
value: target + 'px'
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (transformSupported) {
|
|
|
|
|
(0, _utils.setTransform)(navStyle, navOffset.value);
|
|
|
|
|
} else {
|
|
|
|
|
navStyle[navOffset.name] = navOffset.value;
|
|
|
|
|
}
|
|
|
|
|
if (checkNextPrev) {
|
|
|
|
|
this.setNextPrev();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'setPrev',
|
|
|
|
|
value: function setPrev(v) {
|
|
|
|
|
if (this.state.prev !== v) {
|
|
|
|
|
this.setState({
|
|
|
|
|
prev: v
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'setNext',
|
|
|
|
|
value: function setNext(v) {
|
|
|
|
|
if (this.state.next !== v) {
|
|
|
|
|
this.setState({
|
|
|
|
|
next: v
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'isNextPrevShown',
|
|
|
|
|
value: function isNextPrevShown(state) {
|
|
|
|
|
if (state) {
|
|
|
|
|
return state.next || state.prev;
|
|
|
|
|
}
|
|
|
|
|
return this.state.next || this.state.prev;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _classnames, _classnames2, _classnames3, _classnames4;
|
|
|
|
|
|
|
|
|
|
var _state2 = this.state,
|
|
|
|
|
next = _state2.next,
|
|
|
|
|
prev = _state2.prev;
|
|
|
|
|
var _props = this.props,
|
|
|
|
|
prefixCls = _props.prefixCls,
|
|
|
|
|
scrollAnimated = _props.scrollAnimated,
|
|
|
|
|
navWrapper = _props.navWrapper,
|
|
|
|
|
prevIcon = _props.prevIcon,
|
|
|
|
|
nextIcon = _props.nextIcon;
|
|
|
|
|
|
|
|
|
|
var showNextPrev = prev || next;
|
|
|
|
|
|
|
|
|
|
var prevButton = _react2['default'].createElement(
|
|
|
|
|
'span',
|
|
|
|
|
{
|
|
|
|
|
onClick: prev ? this.prev : null,
|
|
|
|
|
unselectable: 'unselectable',
|
|
|
|
|
className: (0, _classnames6['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-prev', 1), (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-btn-disabled', !prev), (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-arrow-show', showNextPrev), _classnames)),
|
|
|
|
|
onTransitionEnd: this.prevTransitionEnd
|
|
|
|
|
},
|
|
|
|
|
prevIcon || _react2['default'].createElement('span', { className: prefixCls + '-tab-prev-icon' })
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
var nextButton = _react2['default'].createElement(
|
|
|
|
|
'span',
|
|
|
|
|
{
|
|
|
|
|
onClick: next ? this.next : null,
|
|
|
|
|
unselectable: 'unselectable',
|
|
|
|
|
className: (0, _classnames6['default'])((_classnames2 = {}, (0, _defineProperty3['default'])(_classnames2, prefixCls + '-tab-next', 1), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-tab-btn-disabled', !next), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-tab-arrow-show', showNextPrev), _classnames2))
|
|
|
|
|
},
|
|
|
|
|
nextIcon || _react2['default'].createElement('span', { className: prefixCls + '-tab-next-icon' })
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
var navClassName = prefixCls + '-nav';
|
|
|
|
|
var navClasses = (0, _classnames6['default'])((_classnames3 = {}, (0, _defineProperty3['default'])(_classnames3, navClassName, true), (0, _defineProperty3['default'])(_classnames3, scrollAnimated ? navClassName + '-animated' : navClassName + '-no-animated', true), _classnames3));
|
|
|
|
|
|
|
|
|
|
return _react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{
|
|
|
|
|
className: (0, _classnames6['default'])((_classnames4 = {}, (0, _defineProperty3['default'])(_classnames4, prefixCls + '-nav-container', 1), (0, _defineProperty3['default'])(_classnames4, prefixCls + '-nav-container-scrolling', showNextPrev), _classnames4)),
|
|
|
|
|
key: 'container',
|
|
|
|
|
ref: this.props.saveRef('container')
|
|
|
|
|
},
|
|
|
|
|
prevButton,
|
|
|
|
|
nextButton,
|
|
|
|
|
_react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{ className: prefixCls + '-nav-wrap', ref: this.props.saveRef('navWrap') },
|
|
|
|
|
_react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{ className: prefixCls + '-nav-scroll' },
|
|
|
|
|
_react2['default'].createElement(
|
|
|
|
|
'div',
|
|
|
|
|
{ className: navClasses, ref: this.props.saveRef('nav') },
|
|
|
|
|
navWrapper(this.props.children)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return ScrollableTabBarNode;
|
|
|
|
|
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
exports['default'] = ScrollableTabBarNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScrollableTabBarNode.propTypes = {
|
|
|
|
|
activeKey: _propTypes2['default'].string,
|
|
|
|
|
getRef: _propTypes2['default'].func.isRequired,
|
|
|
|
|
saveRef: _propTypes2['default'].func.isRequired,
|
|
|
|
|
tabBarPosition: _propTypes2['default'].oneOf(['left', 'right', 'top', 'bottom']),
|
|
|
|
|
prefixCls: _propTypes2['default'].string,
|
|
|
|
|
scrollAnimated: _propTypes2['default'].bool,
|
|
|
|
|
onPrevClick: _propTypes2['default'].func,
|
|
|
|
|
onNextClick: _propTypes2['default'].func,
|
|
|
|
|
navWrapper: _propTypes2['default'].func,
|
|
|
|
|
children: _propTypes2['default'].node,
|
|
|
|
|
prevIcon: _propTypes2['default'].node,
|
|
|
|
|
nextIcon: _propTypes2['default'].node,
|
|
|
|
|
direction: _propTypes2['default'].node
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScrollableTabBarNode.defaultProps = {
|
|
|
|
|
tabBarPosition: 'left',
|
|
|
|
|
prefixCls: '',
|
|
|
|
|
scrollAnimated: true,
|
|
|
|
|
onPrevClick: function onPrevClick() {},
|
|
|
|
|
onNextClick: function onNextClick() {},
|
|
|
|
|
navWrapper: function navWrapper(ele) {
|
|
|
|
|
return ele;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1556:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var _classCallCheck2 = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
|
|
|
|
|
|
|
|
var _createClass2 = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn2 = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
|
|
|
|
|
|
|
|
var _inherits2 = __webpack_require__(11);
|
|
|
|
|
|
|
|
|
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
|
|
|
|
|
|
|
|
var _react = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
|
|
|
|
var _propTypes = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
|
|
|
|
|
|
var SaveRef = function (_React$Component) {
|
|
|
|
|
(0, _inherits3['default'])(SaveRef, _React$Component);
|
|
|
|
|
|
|
|
|
|
function SaveRef() {
|
|
|
|
|
var _ref;
|
|
|
|
|
|
|
|
|
|
var _temp, _this, _ret;
|
|
|
|
|
|
|
|
|
|
(0, _classCallCheck3['default'])(this, SaveRef);
|
|
|
|
|
|
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
|
|
args[_key] = arguments[_key];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, (_ref = SaveRef.__proto__ || Object.getPrototypeOf(SaveRef)).call.apply(_ref, [this].concat(args))), _this), _this.getRef = function (name) {
|
|
|
|
|
return _this[name];
|
|
|
|
|
}, _this.saveRef = function (name) {
|
|
|
|
|
return function (node) {
|
|
|
|
|
if (node) {
|
|
|
|
|
_this[name] = node;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(0, _createClass3['default'])(SaveRef, [{
|
|
|
|
|
key: 'render',
|
|
|
|
|
value: function render() {
|
|
|
|
|
return this.props.children(this.saveRef, this.getRef);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
return SaveRef;
|
|
|
|
|
}(_react2['default'].Component);
|
|
|
|
|
|
|
|
|
|
exports['default'] = SaveRef;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SaveRef.propTypes = {
|
|
|
|
|
children: _propTypes2['default'].func
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SaveRef.defaultProps = {
|
|
|
|
|
children: function children() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1983:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__secureCode_css__ = __webpack_require__(3126);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__secureCode_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__secureCode_css__);
|
|
|
|
|
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}/**
|
|
|
|
|
* An TextInput with Icon and check
|
|
|
|
|
* 带图标检查的输入框
|
|
|
|
|
*/var CheckInputysl=function(_Component){_inherits(CheckInputysl,_Component);function CheckInputysl(){_classCallCheck(this,CheckInputysl);var _this=_possibleConstructorReturn(this,(CheckInputysl.__proto__||Object.getPrototypeOf(CheckInputysl)).call(this));_this.state={isMove:false,start:0,moveLength:0,clear:false,move:0,width:0};_this.onMouseUp=_this.onMouseUp.bind(_this);_this.onMouseDown=_this.onMouseDown.bind(_this);_this.onMouseMove=_this.onMouseMove.bind(_this);return _this;}_createClass(CheckInputysl,[{key:"componentDidMount",value:function componentDidMount(){var dragHandler=document.getElementById("dragHandler");dragHandler.addEventListener("mousedown",this.onMouseDown);}},{key:"onMouseDown",value:function onMouseDown(e){console.log("28");document.addEventListener("mousemove",this.onMouseMove);document.addEventListener("mouseup",this.onMouseUp);var event=e||window.event;this.setState({isMove:true,start:event.pageX});}},{key:"onMouseUp",value:function onMouseUp(e){console.log("38");var event=e||window.event;this.setState({isMove:false});var drag=window.getComputedStyle(this.verifyDOM);var handler=window.getComputedStyle(this.handlerDOM);var moveLength=event.clientX-this.verifyDOM.offsetLeft-Number.parseInt(handler.width)/2;// console.log(drag.width);
|
|
|
|
|
var maxWidth=Number.parseInt(drag.width)-Number.parseInt(handler.width);console.log("moveLength="+moveLength);console.log("maxWidth="+maxWidth);if(moveLength<=maxWidth){//鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置
|
|
|
|
|
this.setState({move:0,width:0});document.removeEventListener("mousemove",this.onMouseMove);document.removeEventListener("mouseup",this.onMouseUp);}if(this.props.onDrag){this.props.onDrag(this.state.clear);}}},{key:"onMouseMove",value:function onMouseMove(e){console.log("63");var event=e||window.event;var drag=window.getComputedStyle(this.verifyDOM);var handler=window.getComputedStyle(this.handlerDOM);var moveLength=event.clientX-this.verifyDOM.offsetLeft-Number.parseInt(handler.width)/2;var maxWidth=Number.parseInt(drag.width)-Number.parseInt(handler.width);if(this.state.isMove){if(moveLength<0){moveLength=0;}else if(moveLength>=maxWidth){moveLength=maxWidth;this.removeMouseMove();}this.setState({move:moveLength,width:moveLength});}}//清空事件
|
|
|
|
|
},{key:"removeMouseMove",value:function removeMouseMove(){this.setState({clear:true});var dragHandler=document.getElementById("dragHandler");dragHandler.removeEventListener("mousedown",this.onMouseDown);document.removeEventListener("mousemove",this.onMouseMove);document.removeEventListener("mouseup",this.onMouseUp);this.props.dragOkCallback();}},{key:"render",value:function render(){var _this2=this;return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{id:"drag",className:"nl-drag-verify",ref:function ref(dom){_this2.verifyDOM=dom;},style:{"color":this.state.clear?"#fff":"#252535"}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"drag_bg",ref:function ref(dom){_this2.bgDOM=dom;},style:{"width":this.state.width}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"drag_text"},this.state.clear?"验证通过":"拖动滑块验证"),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{id:"dragHandler",className:this.state.clear?"handler handler_ok_bg":"handler handler_bg",style:{"left":this.state.move},ref:function ref(dom){_this2.handlerDOM=dom;}}));}}]);return CheckInputysl;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (CheckInputysl);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 1984:
|
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAKVUlEQVRoQ9WZa4xcZRnHf897zpyZ2Wm3tKVAS4OlAZStBAtWSMULoQJGQZG2ojGIkhSERL+AJEjSNjHxgn4xSAL1ghKIaWswaQjVFK8EQgCXWxtKa1kEu/Syt+7Ozsy5vK95z5kze+bszO4W8QPz5cycmXnP/3ne//N/Lq/wHr2MMTKXpUTEzOV3s/1mTg/rtEgW6NatyN69CBvg2D7iNccPJ9f5y4iBLunDsANWrcJs3pzcs693a8hJA08Bx2D7EAv0KCh/ERLOR8IRRFcS0OlLVTHuQow7jvGGMaeBtoas2jdlxMkaMGfgecCHRlBjDdTkMM6ZKzi7LHodmLVK5INKWK5gvgjWgnHgbcHsx8jTfqT27B/gjZ5FRAuK6JUL0e/GgFmBdwI8NIjjLsJbPC+63lVqk4i5RBkjIoKlsF20CRrVfIK9JvfFiJhnI8OD/zru/D4cxl+8lOhkDZgReAp640bUsduQt1/BmSziLHNZ52DuVWLOswBb4GJg7cDT77PGxPcSgr8ehebOlyedPT0NouUXEC25H7N9O3o2/ncF3gK9A2VpMeTheD7zel39YyVyk8QeTr2YXg3Kep0UvKDs+6zXM/+x4EWJ0ZqHjoyr7w55TCz2E+9v3zAz+I7A86CPVHEXllhaKLBDRF8UP9ACSEE0P7fup55PPZt+n/t96vl4N5T658ikbBgYZfD0CuFs4KcBz4MehEKlwBmV0OwWzLndtj5rRMLnxNPW/5Y+07k+tVupwSAHRrW6+tAE7yyFYCbwHYFbTh9ah7KeLpaZX1HsFtGrO/E0T5d2gE3wTU+3AjS/Y82daRra/2agrh4+znjs+T1oy/m8XLYBt962+vzXT6EGBnDdcbxiUf9MkK+nXM0rRt4Y+3lKQbJ0Soxo+y6jPq3/CUSG3xw47nw7nI+/YgXhp/+GtkkrC34a8I07UP3v4I45FE6BKz2XnWKswfanmeDLgsgCEJjnwekVmPBhuJalTRN4LkCtTqYOSAO2Hqn1L43ypwURweozCG2wdgSeenvXUhzLa6CnV5unFZxrpSn2VJa76fbHupXI2/JeuONS4dLl9veJTwZGDdv6DU+9ZZWmyfecoW2gm+sicqD/hFoLTFq+XzNIlPV6y+MWuPX2c/so2OQiLjcozANTmpuA66bTZ/XCr68VFhSnC5UxhnufMTx+cErj2xWoXVZTOgXGueXQEL+zSWpNH0HW6/FTst5++wSeW6bUI+YJEdZMC8jU60kWbOn0ts8LF53RPZ81QsNXHzMM1eInJnzv4PlsDBjhuZeHnM+GNerLe/GzXm8BT7kNFLWDrTeezSeZbjrdtwQe+WKcC2d8PfyyZlt/smtz8bhNTqN1dcnRcfYDjSzXW8Av34rzOnjuaRSVZpOD+eG0zNiWSKZ0+lsXw60Xz1r2cHDY8I1dKV1S8M1Mmw/Q5udQnLv2j7ItPErjPPD/spkornesi7ZsMWo7uEMrKTg1yl7Ag4K5rttWtoK1ueU/XSd8ZuXswANtuOJhgzFp5p3B800qaaMee7Uqm6IytcWHCDZCuGWLaImDciOq/xO4liYnNOWywx7BfLib5ubv/+oaWLNsduDW4Kse1VT9bPVoewpBdSnOjMirLx5V63oVNjoaq/9BGCeklppUKSifYgQ9pmH2irCwGw/ztcqO6+H8U+cGfMNOzeGJfLqfXlFmEtLIaxPOKgcmtUdjTaWpLha45ffBXgqqREnX6VEuh8B4LSnM6ngufVvt3v2VKd2eLUDve07z6Kud6vUu4JX4+46olarEpK5TP+cEQczzFPjrS/FUlZI2VJTLQRHjdUoM2QbBfv+dj80tMFODBicMX9oxvdmYKsoyZUKcncXfe0Sdo4SqrlA/b7AZoBb4R2/BHbyYQgpcXF4SzMKsTrdnz2SrLdd3fRnOXTQ3mqTgb/yD5sBIvpZPSoN8naOQkX1H1YUp8KUvEDz/AGHs8Txw47JbQV+6UNKNTE8YNls++bWTA23X+kW/5hexnnfImG0JLn7yvv3H1NUdgccanqGKdrhPYa5tq6djHzc90nzghj74weUnD/yFQcNtT3TmdFK7T3VRxrDrwJBze0eq5IMzVNwssDXPu7zK3L0WPvkBWFCE0ypzM+DptwznnwpXPpqjxbTkloD3I9n81qj6ZcfgjIurjBw26nxIDE8212qrCrPgb70I/jwA3/wIbOybHfiEb7jyEcPdlwlb/t49+WR4bsbq6opReK2jHOYTEB4Vx2cnsDqpWm16TzwQb2MmWVhDzj4FHr9B8JyZxfD+55MSN69MWa5nHWNE+g9Mynp8qtMSUKeUbwIqJmS9wE9SKC3w+QKpuS3f+7j1fHevWxn8wnbwoxnmLrl6pa7VHYdr7JQC1WkpPy1rs0WWFnqiOr0Ij1uHToGfqsezsnXPZXDzDKDT/785Zli/0xDozvV31vMIb7w5qj7nlDihDJMdi6w07duWLa1XxKGHkCuU4sHmmCR+ftrBJ+8T+lQ8WD4fik7cL+JHSdtWLkClQEwhW1gN1wzD9dlB2+qvFsimIz5PmojJFk0yLVzXRgJN2WgqRvg+hvVZ9ibJZ4qrrWYj1fpuc5cWFdo7obT1S2c1WsvOwarcI4oqilrXRiKlS7Z1s1Wi9boKWYjwW2BVO/hUzprB2qWezs8QkyYiG+Bp0CerC7L3eENurBtGUm93bd1S4HY0kTbLbkTRRJTrAT2Oy5mieQhY0RF8fhSXn1zljWrtSC4JIQMjodxUrfOfUoFJcaiFDo0Zm+Ws19PxRKFGCaEsRcpRwDIRfg70ZcEnw0tbDmSo05wItCWsDH2mtYBx/8++MV9uD4TDpkENQy0oU591PJH1enYgNEHcypWBslYsEM1dCNelARvzO6Pz2Zlip0ZkWo0vYuP2sbEGP9KaMaCmFbV50JjzQKjl9cwIzqvgVTVFp0FJXEpBSEnBZQJ3ZqmTdDBT3M2O4qbUKF+Hy0CgufdEwFMFl7oJqUdF6hVFw6/iz3kElwK3Vxuodrxsh0MlKEw28FRAKZBY9ez0pIzDVcawUeCCmB1tw852kFPKYxtd80pkZPuk5o8moBZBo2Bo6AL1niJ+HYKTHnp2Am+HnyWXwqSP5xTxfCvZEV4kFByhgOEsrVkrDheKYYUSTleYSrIDVBGOCAwIvBjAM5Hm35EhcAxB5OB70Iga+D0efj0keFdj5jTwOg32q5O4ZaFQ9/EKikJogUd4WuO6CkcrHGPVLkKM1TzLf43BsQNLtNJEoSZSitACdg1BoAlKHn7NEFR6CP+nwf408LmjlJ4Gbk1RCEJcr4gbRbiRwvECHG1QFrxxmsCjJmhB+wUiRxM5DqHfICy4hGVNMFkkfM+OUvLg0+PB+FhlEKdWwZlfxPFdnNDBCWs45TIqqqIseErNFepxmaCdCrpWQ7tlIjci8kKi8QZRuUr0nh9eZfV6puPCYAlqQYTSRSS013runLOEcR20amDGHHThGPr/flyYr7Dfdwe03Qyw998XR+J5A/Kx0O379P7JHn13W++/QpxXZquwQhQAAAAASUVORK5CYII="
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 2391:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
|
|
|
|
|
|
|
|
// load the styles
|
|
|
|
|
var content = __webpack_require__(2515);
|
|
|
|
|
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
|
|
|
// Prepare cssTransformation
|
|
|
|
|
var transform;
|
|
|
|
|
|
|
|
|
|
var options = {"hmr":false}
|
|
|
|
|
options.transform = transform
|
|
|
|
|
// add the styles to the DOM
|
|
|
|
|
var update = __webpack_require__(313)(content, options);
|
|
|
|
|
if(content.locals) module.exports = content.locals;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 2515:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
exports = module.exports = __webpack_require__(312)(true);
|
|
|
|
|
// imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// module
|
|
|
|
|
exports.push([module.i, "/* !*display: flex;*!*/.login_register_content .ant-input{background:#f4f4f4}.login_register_content .loginInputzhucheyslass,.login_register_content .loginInputzhucheyslass:hover{border:1px solid red!important}.login_register_content{width:434px;-webkit-box-shadow:3px 10px 21px 0 rgba(76,76,76,.15);box-shadow:3px 10px 21px 0 rgba(76,76,76,.15);border-radius:6px;background:#fff}.login_register_content .ant-tabs-ink-bar{width:21px!important;left:19px}.login_register_content .ant-tabs{width:354px}.login_section{-ms-flex-pack:center;justify-content:center}.login_section,.login_sectionysl{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}.loginInput{width:100%;margin-bottom:16px;height:45px}.educouddiv{-ms-flex-direction:column;flex-direction:column}.educouddiv,.left_right{display:-ms-flexbox;display:flex}.left_right{width:100%;-ms-flex-pack:justify;justify-content:space-between}.login_btn{width:100%;margin-top:26px;margin-bottom:20px}.dragValidator{margin-bottom:16px}.ysldivhome12{-ms-flex-direction:row;flex-direction:row;margin-left:100px;margin-right:129px;margin-top:10px}.ysldivhome12,.ysldivhome22{display:-ms-flexbox;display:flex}.ysldivhome22{width:800px;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-line-pack:stretch;align-content:stretch}.ysldivhomediv222{width:101px;height:130px}.ysldivhomediv12{margin-top:5px}.ysldivhomediv12,.ysldivhomediv22{width:110px;height:110px;border-radius:50%;-webkit-box-shadow:3px 10px 21px 0 rgba(76,76,76,.15);box-shadow:3px 10px 21px 0 rgba(76,76,76,.15);background:#fff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:73px}.ysldivhomediv22{margin-top:15px}.ysldivhomedivtxt2{width:101px;height:27px;margin-bottom:5px;font-size:14px;text-align:center}.ysldivhomedivimg2{width:90px;height:90px}.ysllogin_register_contents2{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-webkit-box-shadow:3px 10px 21px 0 rgba(76,76,76,.15);box-shadow:3px 10px 21px 0 rgba(76,76,76,.15);border-radius:6px;background:#fff}.ysllogin_section2{width:800px;height:600px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}.yslspans12{text-align:center;font-size:16px;color:#111c24}.yslspans22{text-align:center;font-size:15px;color:#05101a}.yslspans32{text-align:center;font-size:13px;color:#656565}.yslbutton2{width:255px;height:36px;margin-top:20px}.mt22{margin-top:22px}.gouxuanimg2{margin-right:10px;margin-bottom:2px}.textall2{text-align:center;font-size:13px;color:#4b4b4b}.div1img2{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;width:60px;margin-left:26px}.div1img2xx{width:20px;margin-left:26px}.yslgouxuanimg2x,.yslgouxuanimg22x{width:20px;height:20px;margin-left:75px}.yslbutondls{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.loginInputzhuche,.loginInputzhucheyslass{width:100%;background-color:#fff!important;height:45px!important;padding:5px}.loginInputzhucheyslass .ant-input{width:100%;background-color:#fff!important;height:45px!important;padding:5px;position:relative;right:5px;width:103%;border:1px solid red!important;border-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.loginInputzhucheyslass .ant-input:hover{border:1px solid red!important}.loginInputzhuche .ant-input{width:100%;background-color:#fff!important;height:45px!important;padding:5px;position:relative;right:5px;width:103%}.loginInputzhucheysl{width:100%;border-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.loginInputzhucheysl,.loginInputzhucheysl .ant-input{background-color:#fff!important;height:45px!important;padding:5px}.loginInputzhucheysl .ant-input{width:100%;position:relative;right:5px;width:103%;border:1px solid red!important;border-radius:4px;border-top-left-radius:4px;border-top
|
|
|
|
|
|
|
|
|
|
// exports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 2516:
|
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAK40lEQVRoQ9Wae4xU1R3HP+fcxzz2AYsgLKw8RFRAtJYaRZLWVDSiNrXBNcbER0yDjY+Y/kHtH03VpEkf/qPV2mpTo9EmDSuNhiakvgoGLagUE4WisLgLyLIs7mt2Z+Y+T3Puzh3uzt7ZXaxt4iZkMnfuzP38fuf7e5zfQfAV/SmFmM5PCYGazn1T3TOth6X9SBL0URArOhC0w/7tiONNiNWVL+0B5hdQK65C0QH721EPcxr+yxpyxuAxcAQLYmAPsieLmJVBNJmIBhMx0Dve+y1zUaM+quCj+h1UaxnVsppwP6eNOFMDpg2eBGY7srUJ0VPAaG1CzshzbibH1SiulIILELQJaJICpKCg4BjwCYJ3HYc3+wY53FMgbG0i6CmguIowXoXpGjAleBqwXcAotGGfLdlgKjYKweWAEILI1fpVQ+u/+DW6pj+TKAG7/ZBnOx22NB3Ddb+EAZOCx9C3dCDvbUd8dAjDKWLOy3O1BY8JOD8GTULra+OA6xvxqRuw6d8DvJnJ4686j+DpDtTmdkJt9GTerwseQ3eA1DoedTHNLI2zG/m1gLvGebji5QhYu1W/r8BHD6hZifhaRUpKwfPHijw02MdIg42v9d/O5PCp4Elo9mEMlDGtZubZoc4LfDNNElUvVyShYTVY/IBYPtUVio09bdS/hnzav+jjREsWn5UEk8FPAE+DJkNr1mSbgGW1kojfTymNypOqWk+sQmwMgoOjAetPnqRnKvhUcK3pdedGsWTJDE2WwTbg0vihFf1FQVir8aQBVbnUQMZBm/Z9BHtPOawv9FMAvDcOE2rN1+p9HLj2ts7P3wG5959YDTa2kecJqbizXhCmrUAskfizWOPR9RRP18pHSV7oOs6Doy7upWvwdjCWLpPwE8G3Y8xqwyj1Ys+awTWG5GVt0DhJVB4+DjCROSbouKLnVE9P1LqODeWE3Lyvm9dzc3H7jxE8fBVBKnjs7dY9GMMWdiYgn7V5RyqWJbNCraZjaczMLGdGZjmWbMYLBxhyPqQUdI8FZ5zDp/L4+NU4eOAkax2DYrOH27OaIOn1qscj8O0Yi8DsbSIzw+ZWCX9IFpOkJ8dSmcEFLfeyvOXHNNpLJrQ0A85ePhn4FZ8XN5+OhUqqjBwwmWwE+PCjj07wl7kFnG7wk16PwGu9nbPJGl6URS6rXfbYw1nzLNa1bWVOfs1UjRxHRzbzwck7UZSnpfFqloH3D42wvuRSrvV6FVwXmv3bsWa1YVujXIhgV+SUlDQmhckNS3YyJ6crPbjBEFJYmDJfNcINBjBEDkNmo2vdhZf44OTtqZkoLbtUVloNuVxxIuBA/zHcFVfh6dyutV4Ff3YPpk5/ozmyGY+NwC/rFZqVs+5jzfynIqBQ+bx8aAGN1hKuX7wruuaHRV49vICW7Gq+2/ZG1Zgdx6/mVOmtMfgpZBJ7PQj56acj/LGhRFmnx42r8avgjygk+zDngB245ITgWSG4qVbT8fvvL32PObnLIiClFG9/fisN1kK+NfexijEBO49voCVzCatmP1pdlcPDz/Bx/0Pj9V5rRI1BCl7pPMVGw6bUBy4r8R8RhELru6MDeeLSyOMZwyEf+ryO4qJqyU72GsBdKwpYRuOU2i64h+kafhFESMZowRQNlIMe+so7OFX+B3ozVPV8Mi0mngd83DXMNUGGIuDM24vfrgtSBA5ytAtrcJCsmSOvSnyMoqW2YMR5+PblveTMsycFPzz0IuWgl/Nn3ocpcxPuHXL3safvbgad9+rKJkoEgoHDRS7ySxRnzqTcsLii8zgNrjgP69hRcmYDeRXQKcBORPdYw1T5d92irSxqvrEueNew7sUCFjffOqlxQVhi54n1fFHeMQE+0c+7nYMs9Ucptp1Daf8hvCgtavB79mCuBssLyPkGDUpyUCrsetHe1ngNNyz5++mUk8ALQocPTm7i8nm/ja5+MvA0nUN/4rpFu9HZ6Eihg339P2fdObujYjXqdfPa0WUovHHwUXc85ii3s49lZsCoZVDaA94zOkA1uM4ow19g5xaS9QMacPhQUZFKpWBU29SK/q5sfZyL5zw4waPHCtsQwmBB47XRZ0cLr3JkZAtXznshMvRkcQcHh57kirkvVVPlzp7r6S3q703cgAgY6BzhG6bBaOkI5eazcKPMkgYeOmwTihXj0lZKT7F2/uOsmj0e/kD/75nfeC3N9tIpgze+YW/f/XQO/27crinR3+//bIT1qeC1UgkVTyH4Xm2fEQdnLKFlLbexbuGfGSgfiAKwyV7EZ0NbyFvzmJtfO23wd3s2cLz41+j+autc6W8UbO3u5/5UqegeJRmcfsDdKuDRehqPg3bV7Adwg0EODb0UpTbLaMASOZbOvI01rU9MC1x/f2vXOQRq5DR0YnV9wcMnhnkuNThr0yEOFzoub8Qlf5LtVmoxMYTFjUve5uz8FZPC6+K168QddI9ow09nrWgaMBaYaiRk3ZDPgdR0WFuAHIfGMGRztOtJ0Xa9fjt5b8aYybcXPMfi5h/UhX+/9z4ODT1dha6VIpK9Rwa4JZNhZEIB0jfXlnxL0FD0uDnUI4iU7dl0+wxtyNz8GpbMuIVZ2YuxZAMlvwddUZfOuIPdvT/k85FX6/brfsimwVFe9hSjE0r+WL8xlhLjJsv0yWPQ7BT5G7AkFfQMDKrdh+rfyxotZM3ZFLyD44ZHcUIQ8NmAw41uwLBvUkxtsuKyH7e1ul8JyjR4gu+GIc9ELUVaN5dyLQ2ytlmrZo/xPUk1j1e2bvcMFnjLyDKqZVK3rdWb5HjbpjcSwicfKhrKDr9Qig1fRuu1TVq9zXIyDWoHKcWWfpefScGoMinW3UjEcklu3WSWnBmSt3xmlQKeR7FyUvgpdu+1c5e0PigKTsm+gsNdRUW/LymGZUp1t25V8ITXDZNMziPn2uT9Im1ByHPA4qnGC6lSSU4FJpkGIOgqlLnbtzlmuxRLFqXAx5l0s5z0ejyeyOXJhiE5Q8Mr5nsOT0KlFUjMC+vpP87HlX6pquHa+ytzuv1lxQN+wPHApSglpVKR8pTjiaTXkwOh0CITWOSUT04pZjoeP0FxUxyw9SZX1ZycMHDcmCIu71JLmldGPH4jBIPCpGR4lKSHM+2BUAyfHMEVDWxhkjENshreD8iGsDZ02YRg0YSZYcqwKM2Iite7leCxEY93TIOyhvYDysrHyQe40x7BxeD6VbcB8aRWw2cltuORFXky0ierQnJ+yLVhSLuAVfGwKm1gFE8KKllFj9I+UoIO1+c1ISmFJmVVxMlYlMshroY+46FnPXhdnGjCCktkSpKM8MgIG8tWWF7IwiBAD1guEYLFumAKRb4CWhSCXgFdUvJhINglFUdcgadcPGXh5EIcmcOhgKe9PBV0HDOpvUTaYN8LMa0WLF9h22VsCZaG91ysjIHhGxgqQEqBCMVYyEmFChVKGIRmQOAEBJY9Bh2C52ZxTYHrDeBZEv+/GuzHltQ7Sgk8zMYGTBFgBQGmFWKWQkw7j/SKGEYGIf0x8NBEBQ7KyhO4RcKcxPckvmHgKwNvZBTfsPC/sqOUWnhdWePTNn14dWoWRiaP4esjFgfDsDFCE6kcZOghfTkGboYoaRGKDKH0CQOXwM8QmDa+UySY3U/wlR9eJTU02XGhn0UGGWQwglQlpG0gaK58e1iP6FAiR2g0EhoOoVkm/J8fF9YGwNfugLaeAfr61+JIvN525v/9nxD+A2viLnAOie98AAAAAElFTkSuQmCC"
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3077:
|
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjRGMjZDRTBBODFGMjExRTk5RThCQTk5RkJFOTAxMDY1IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjRGMjZDRTBCODFGMjExRTk5RThCQTk5RkJFOTAxMDY1Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEYyNkNFMDg4MUYyMTFFOTlFOEJBOTlGQkU5MDEwNjUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NEYyNkNFMDk4MUYyMTFFOTlFOEJBOTlGQkU5MDEwNjUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7b5AIeAAAAsklEQVR42mL8//8/AzUAEwOVwKhBhAELMmfWrFm7gFQmEN8lQu/stLS0VFwuugnEx4FYi4AhS4HYCp/XcoH4NRBfBOJOINYBYgkgFgRiOSBOBOKrQBwFxNr4DHKH0g5ALAvEp4F4DRBvgBpeCMTNQHwIain2MAKCn0DcAsRHgVgc6kWQ7axA3AHEjEC8Aoi5gFgFn0EHkNjKQLwKiB9B+dOBOAbKnoceaIyjeW0IGgQQYABDsCGs3eczVAAAAABJRU5ErkJggg=="
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3124:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css__ = __webpack_require__(87);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_button__ = __webpack_require__(74);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_checkbox_style_css__ = __webpack_require__(317);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_checkbox_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_checkbox_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox__ = __webpack_require__(314);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_input_style_css__ = __webpack_require__(68);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_input_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_input_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_input__ = __webpack_require__(69);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_input__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_menu_style_css__ = __webpack_require__(989);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_menu_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_menu_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_menu__ = __webpack_require__(924);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_notification_style_css__ = __webpack_require__(45);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_notification_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_antd_lib_notification_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_notification__ = __webpack_require__(46);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_notification___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_antd_lib_notification__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_tabs_style_css__ = __webpack_require__(1499);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_tabs_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_antd_lib_tabs_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_tabs__ = __webpack_require__(1500);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_tabs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_antd_lib_tabs__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_react_router_dom__ = __webpack_require__(44);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_educoder__ = __webpack_require__(5);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__src_images_login_passopen_png__ = __webpack_require__(3077);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__src_images_login_passopen_png___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15__src_images_login_passopen_png__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__src_images_login_passoff_png__ = __webpack_require__(3125);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__src_images_login_passoff_png___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16__src_images_login_passoff_png__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_axios__ = __webpack_require__(15);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_axios__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__CheckInputysl__ = __webpack_require__(1983);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__Notcompletedysl__ = __webpack_require__(206);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__common_css__ = __webpack_require__(200);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__common_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_20__common_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__commontwo_css__ = __webpack_require__(2391);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__commontwo_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_21__commontwo_css__);
|
|
|
|
|
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var TabPane=__WEBPACK_IMPORTED_MODULE_11_antd_lib_tabs___default.a.TabPane;var loginInputsyl={"width":"434px","height":"462px","-webkit-box-shadow":"3px 10px 21px 0px rgba(76,76,76,0.15)","box-shadow":"3px 10px 21px 0px rgba(76,76,76,0.15)","border-radius":"6px","background":"#fff"//父组件EducoderLogin.js
|
|
|
|
|
};var LoginRegisterComponent=function(_Component){_inherits(LoginRegisterComponent,_Component);function LoginRegisterComponent(props){_classCallCheck(this,LoginRegisterComponent);//
|
|
|
|
|
// console.log("LoginRegisterComponent");
|
|
|
|
|
// console.log("29");
|
|
|
|
|
// console.log(props.loginstatus);
|
|
|
|
|
var _this=_possibleConstructorReturn(this,(LoginRegisterComponent.__proto__||Object.getPrototypeOf(LoginRegisterComponent)).call(this,props));_this.IsPC=function(){var userAgentInfo=navigator.userAgent;var Agents=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];var flag=true;//这个意思是说自己的是pc 端
|
|
|
|
|
for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0){flag=false;break;}}return flag;};_this.changeType=function(){_this.setState({classpass:'password'});};_this.IsPC=function(){var userAgentInfo=navigator.userAgent;var Agents=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];var flag=true;for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0){flag=false;break;}}return flag;};_this.componentDidMount=function(){var flag=_this.IsPC();//true为PC端,false为手机端
|
|
|
|
|
_this.setState({isphone:flag});// console.log("componentDidUpdate");
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
var pcipns=_this.IsPC();if(_this.props.match.url==="/login"){// this.state = {
|
|
|
|
|
// tab:["0"],
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
_this.setState({tab:["0"]});}else if(_this.props.match.url==="/register"){// this.state = {
|
|
|
|
|
// tab:["1"],
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
_this.setState({tab:["1"]});}_this.setState({pciphone:pcipns});};_this.openNotification=function(messge,type){// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_9_antd_lib_notification___default.a.open({message:"提示",description:messge,onClick:function onClick(){console.log('Notification Clicked12312313123!');}});};_this.openNotifications=function(btn){// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_9_antd_lib_notification___default.a.open({message:"提示",description:btn,onClick:function onClick(){}});};_this.StudyMakeMoney=function(){// 调用父组件方法
|
|
|
|
|
// this.props.Setlogins(3);
|
|
|
|
|
_this.setState({login:"",password:"",logins:"",passwords:"",codes:""});try{_this.props.Setshowbool(3);}catch(e){}};_this.onTabChange=function(activeKey){console.log("onTabChange");};_this.onAutoLoginChange=function(e){_this.setState({autoLogin:e.target.checked});};_this.isCorrectname=function(value,id){if(id===1){console.log(value.length);if(value.length===0){_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:false});return;}}else if(id===2){if(value.length===0){_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false});return;}}_this.Emailphonenumberverification(value,id);};_this.onReadAgreementChange=function(e){_this.setState({readAgreement:e.target.checked});};_this.dragOkCallback=function(){_this.setState({Phonenumberisnotcosytdhk:undefined});if(_this.state.logins.length===0){_this.setState({Phonenumberisnotcos:"账号不能为空",Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});console.log("s0");return;}// var telephone = $("#telephoneAdd.tianjia_phone").val();
|
|
|
|
|
var regph=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;// var email = $("#add_email.tianjia_email").val();
|
|
|
|
|
var regemail=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
|
|
|
|
|
var stringdata=undefined;if(!regph.test(_this.state.logins)){stringdata="手机号格式不正确";_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false,dragOk:true});console.log("s1");}else{_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false,dragOk:true});_this.Emailphonenumberverification(_this.state.logins,2);return;}if(!regemail.test(_this.state.logins)){if(_this.state.logins.indexOf("@")!=-1===true){stringdata="邮箱格式不正确";}else{stringdata="手机号格式不正确";}_this.setState({Phonenumberisnotcos:stringdata,Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});console.log("s2");return;}else{console.log("s222222");_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false,dragOk:true});_this.Emailphonenumberverification(_this.state.logins,2);return;}_this.setState({Phonenumberisnotcosytdhk:undefined});_this.Emailphonenumberverification(_this.state.logins,2);};_this.onChange=function(e){_this.setState({Agreetotheterms:e.target.checked});};_this.postLogin=function(){if(_this.state.login===undefined||_this.state.login==""){_this.setState({Phonenumberisnotco:"账号不能为空"});return;}else if(_this.state.password===undefined||_this.state.password==""){_this.setState({Phonenumberisnotcodmm:"密码不能为空"});return;}var url="/accounts/login.json";__WEBPACK_IMPORTED_MODULE_17_axios___default.a.post(url,{login:_this.state.login,password:_this.state.password}).then(function(response){debugger;if(response===undefined){return;}if(response.data.status===-2){if(response.data.message==="该手机号尚未注册"||response.data.message==="该邮箱尚未注册"){_this.setState({Phonenumberisnotco:response.data.message});return;}else if(response.data.message==="错误的账号或密码"){_this.setState({Phonenumberisnotcodmms:response.data.message});return;}else if(response.data.message==="违反平台使用规范,账号已被锁定"){_this.setState({Phonenumberisnotco:response.data.message});return;}else if(response.data.message==="登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码"){var messge=__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',null,'\u767B\u5F55\u5BC6\u7801\u51FA\u9519\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u8D26\u53F7\u5DF2\u88AB\u9501\u5B9A\uFF1B'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'mt10'},'\u8BF710\u5206\u949F\u540E\u91CD\u65B0\u767B\u5F55\u6216',__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:'/changepassword',style:{textDecoration:"underline",color:"#4CACFF"}},'\u627E\u56DE\u5BC6\u7801')));_this.openNotifications(messge);return;}else{_this.openNotification(response.data.message);return;}}// if(response.data.profile_completed !== null || response.data.profile_completed === false){
|
|
|
|
|
// this.setMyEduCoderModals();
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if(response.status===200){if(response.data.status===402){window.location.href=response.data.url;}else{Object(__WEBPACK_IMPORTED_MODULE_14_educoder__["E" /* broadcastChannelPostMessage */])('refreshPage');_this.setState({isRender:false});var weekArray=JSON.parse(window.sessionStorage.getItem('yslgeturls'));if(weekArray===undefined){weekArray="/";}if(weekArray===null){weekArray="/";}if(weekArray==="null"){weekArray="/";}window.location.href=weekArray;}}}).catch(function(error){});};_this.postregistered=function(){// if (this.state.logins === undefined || this.state.logins === "") {
|
|
|
|
|
// this.openNotification(`请输入登录手机号码或邮箱`,2);
|
|
|
|
|
//
|
|
|
|
|
// return
|
|
|
|
|
// } else if (this.state.dragOk === false) {
|
|
|
|
|
// this.openNotification(`请拖动滑块验证`,2);
|
|
|
|
|
// return
|
|
|
|
|
// } else if (this.state.codes === undefined || this.state.codes == "") {
|
|
|
|
|
// this.openNotification(`请输入验证码`,2);
|
|
|
|
|
// return
|
|
|
|
|
// } else if (this.state.passwords === undefined || this.state.passwords == "") {
|
|
|
|
|
// this.openNotification(`请输入密码`,2);
|
|
|
|
|
// return
|
|
|
|
|
// } else if (this.state.Agreetotheterms === false) {
|
|
|
|
|
// this.openNotification(`请同意服务协议条款`,2);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if(_this.state.logins===undefined||_this.state.logins===""||_this.state.logins.length===0){_this.setState({Phonenumberisnotcos:"账号不能为空",Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}if(_this.state.pciphone===true){if(_this.state.dragOk===false){// this.openNotification(`请拖动滑块完成验证`,2);
|
|
|
|
|
_this.setState({Phonenumberisnotcosytdhk:"请拖动滑块完成验证",dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}}if(_this.state.codes===undefined||_this.state.codes==""||_this.state.codes.length===0){// this.openNotification(`请输入验证码`,2);
|
|
|
|
|
_this.setState({Phonenumberisnotcosyzm:"验证码不能为空"});return;}else if(_this.state.passwords===undefined||_this.state.passwords==""||_this.state.passwords.length===0){_this.setState({Phonenumberisnotcosymmm:"密码不能为空"});return;}else if(_this.state.passwords!==undefined&&_this.state.passwords.length>0&&_this.state.passwords.length<8){_this.setState({Phonenumberisnotcosymmm:"密码不能少于8位"});return;}else if(_this.state.passwords!==undefined&&_this.state.passwords.length>0&&_this.state.passwords.length>16){_this.setState({Phonenumberisnotcosymmm:"密码不能超过16位"});return;}else if(_this.state.Agreetotheterms===false){_this.openNotification('\u8BF7\u540C\u610F\u670D\u52A1\u534F\u8BAE\u6761\u6B3E',2);return;}var url="/accounts/register.json";__WEBPACK_IMPORTED_MODULE_17_axios___default.a.post(url,{login:_this.state.logins,password:_this.state.passwords,code:_this.state.codes}).then(function(result){if(result){if(result.data.status===-2){if(result.data.message==="验证码不正确"){_this.setState({Phonenumberisnotcosyzm:"验证码不正确"});return;}else if(result.data.message==="验证码已失效"){_this.setState({Phonenumberisnotcosyzm:"验证码不正确"});return;}else{_this.openNotification(result.data.message);return;}}else{// this.setState({
|
|
|
|
|
// logins: "",
|
|
|
|
|
// dragOk: false,
|
|
|
|
|
// codes: "",
|
|
|
|
|
// passwords: "",
|
|
|
|
|
// Agreetotheterms: "",
|
|
|
|
|
// })
|
|
|
|
|
_this.setMyEduCoderModals();}}}).catch(function(error){});};_this.Emailphonenumberverification=function(value,id){var url='/accounts/valid_email_and_phone.json';__WEBPACK_IMPORTED_MODULE_17_axios___default.a.get(url,{params:{login:value,type:1}}).then(function(result){//验证有问题{"status":1,"message":"success"}
|
|
|
|
|
// console.log(result);
|
|
|
|
|
// this.setState({dragOk: true})
|
|
|
|
|
if(result){if(result.data.status===-2){if(id===1){if(result.data.message==="该手机号码或邮箱已被注册"){_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:false,dragOk:true});}else{_this.setState({Phonenumberisnotco:result.data.message,Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});console.log("s5");}return;}else if(id===2){_this.setState({Phonenumberisnotcos:result.data.message,Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});console.log("s6");return;}}else{if(id===1){_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:false,dragOk:true});return;}else if(id===2){_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false,dragOk:true});return;}}}}).catch(function(error){});};_this.SMSverification=function(){var url='/accounts/get_verification_code.json';__WEBPACK_IMPORTED_MODULE_17_axios___default.a.get(url,{params:{login:_this.state.logins,type:1}}).then(function(result){//验证有问题{"status":1,"message":"success"}
|
|
|
|
|
// console.log(result);
|
|
|
|
|
_this.openNotification("验证码已发送,请注意查收!",2);}).catch(function(error){console.log(error);});};_this.Showandhide=function(e){console.log("显示于隐藏");if(_this.state.classpassbool===true){_this.setState({passopens:__WEBPACK_IMPORTED_MODULE_16__src_images_login_passoff_png___default.a,classpass:"text",classpassbool:false});}else{_this.setState({passopens:__WEBPACK_IMPORTED_MODULE_15__src_images_login_passopen_png___default.a,classpass:"password",classpassbool:true});}};_this.getverificationcode=function(){debugger;// console.log(this.state.Phonenumberisnotcobool);
|
|
|
|
|
// console.log(this.state.dragOk);
|
|
|
|
|
if(_this.state.logins===undefined||_this.state.logins.length===0){_this.openNotification("请输入手机号或邮箱");return;}//这是判断是否手机正确
|
|
|
|
|
if(_this.state.Phonenumberisnotcobool===true){_this.openNotification(_this.state.Phonenumberisnotcos);_this.setState({Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}if(_this.state.pciphone===true){if(_this.state.dragOk===false){_this.openNotification("拖动滑块验证");return;}}if(_this.state.getverificationcodes===true){_this.setState({getverificationcodes:undefined});var timer=setInterval(function(){_this.setState(function(preState){return{seconds:preState.seconds-1};},function(){if(_this.state.seconds==0){clearInterval(timer);_this.setState({getverificationcodes:false,seconds:60});}});},1000);_this.SMSverification();}else{_this.setState({getverificationcodes:undefined});var _timer=setInterval(function(){_this.setState(function(preState){return{seconds:preState.seconds-1};},function(){if(_this.state.seconds==0){clearInterval(_timer);_this.setState({getverificationcodes:false,seconds:60});}});},1000);_this.SMSverification();}};_this.loginInputonChange=function(e){// console.log(e.target.value);
|
|
|
|
|
var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}if(e.target.value.length===0){_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:false,Phonenumberisnotcodmms:undefined,login:stirngt});}else{_this.setState({login:stirngt,Phonenumberisnotco:undefined,Phonenumberisnotcodmms:undefined});}};_this.inputOnBlur=function(e,id){_this.Emailphonenumberverification(e.target.value,1);};_this.inputOnBlurzhuche=function(e,id){if(e.target.value.length===0){_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false});return;}// var telephone = $("#telephoneAdd.tianjia_phone").val();
|
|
|
|
|
var regph=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;// var email = $("#add_email.tianjia_email").val();
|
|
|
|
|
var regemail=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
|
|
|
|
|
var stringdata=undefined;if(!regph.test(e.target.value)){stringdata="手机号格式不正确";_this.setState({Phonenumberisnotcos:stringdata,Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});}else{_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false});return;}if(!regemail.test(e.target.value)){if(e.target.value.indexOf("@")!=-1===true){stringdata="邮箱格式不正确";}else{stringdata="手机号格式不正确";}_this.setState({Phonenumberisnotcos:stringdata,Phonenumberisnotcobool:true,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}else{_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false});_this.Emailphonenumberverification(e.target.value,id);return;}_this.Emailphonenumberverification(e.target.value,id);};_this.passwordonChange=function(e){// console.log(e.target.value);
|
|
|
|
|
var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}_this.setState({password:stirngt,Phonenumberisnotcodmm:undefined,Phonenumberisnotcodmms:undefined});// this.setState({
|
|
|
|
|
// password: e.target.value
|
|
|
|
|
// })
|
|
|
|
|
};_this.loginInputonChanges=function(e){console.log(e.target.value);var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}if(e.target.value.length===0){_this.setState({Phonenumberisnotcos:undefined,Phonenumberisnotcobool:false,logins:stirngt,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});}else{_this.setState({logins:stirngt,Phonenumberisnotcos:undefined,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});}};_this.passwordonChanges=function(e){// console.log(e.target.value);
|
|
|
|
|
var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}_this.setState({passwords:stirngt,Phonenumberisnotcosymmm:undefined});};_this.codesonChange=function(e){_this.setState({codes:e.target.value,Phonenumberisnotcosyzm:undefined});};_this.changeTab=function(e){_this.setState({tab:e.key});console.log(e.key);if(e.key===0){_this.setState({Phonenumberisnotcos:undefined});}else{_this.setState({Phonenumberisnotco:undefined});}// this.props.history.push(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key)
|
|
|
|
|
};_this.loginonkeyup=function(e){if(e.keyCode==32){return false;}};_this.setNotcompleteds=function(){_this.setState({Notcompleteds:true,MyEduCoderModals:false,registered:undefined});};_this.setMyEduCoderModals=function(){_this.setState({MyEduCoderModals:true,registered:"注册成功"});};_this.openweixinlogin=function(){_this.setState({weixinlogin:true});};_this.hideweixinlogin=function(){_this.setState({weixinlogin:false,qqlogin:false,tab:["0"]});};_this.openqqlogin=function(){_this.setState({qqlogin:true});//window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code`
|
|
|
|
|
window.location.href='https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,'+window.location.host+'&response_type=code';// window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code`
|
|
|
|
|
};_this.openphoneqqlogin=function(){window.open('https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,'+window.location.host+'&response_type=code');};if(props.loginstatus===true){// console.log(props.loginstatus);
|
|
|
|
|
_this.state={tab:["0"],classpass:"text",// 登录
|
|
|
|
|
passopens:__WEBPACK_IMPORTED_MODULE_16__src_images_login_passoff_png___default.a,seconds:60,discodeBtn:false,clearInterval:false,autoLogin:true,classpassbool:false,// 注册
|
|
|
|
|
readAgreement:false,getverificationcodes:true,dragOk:false,Agreetotheterms:true,login:"",password:"",logins:"",passwords:"",codes:"",Phonenumberisnotco:undefined,Phonenumberisnotcos:undefined,Phonenumberisnotcosyzm:undefined,Phonenumberisnotcosymmm:undefined,Phonenumberisnotcosytdhk:undefined,Phonenumberisnotcosyfwtk:undefined,Phonenumberisnotcodmm:undefined,Phonenumberisnotcobool:false,Whethertoverify:false,pciphone:true,MyEduCoderModals:false,registered:undefined,Phonenumberisnotcodmms:undefined,weixinlogin:false,qqlogin:false};}if(props.loginstatus===false){// console.log(props.loginstatus);
|
|
|
|
|
_this.state={tab:["1"],classpass:"text",// 登录
|
|
|
|
|
passopens:__WEBPACK_IMPORTED_MODULE_16__src_images_login_passoff_png___default.a,seconds:60,discodeBtn:false,clearInterval:false,autoLogin:true,classpassbool:false,// 注册
|
|
|
|
|
readAgreement:false,getverificationcodes:true,dragOk:false,Agreetotheterms:true,login:"",password:"",logins:"",passwords:"",codes:"",Phonenumberisnotco:undefined,Phonenumberisnotcos:undefined,Phonenumberisnotcosyzm:undefined,Phonenumberisnotcosymmm:undefined,Phonenumberisnotcosytdhk:undefined,Phonenumberisnotcosyfwtk:undefined,Phonenumberisnotcobool:false,Phonenumberisnotcodmm:undefined,Whethertoverify:false,pciphone:true,MyEduCoderModals:false,registered:undefined,Phonenumberisnotcodmms:undefined,weixinlogin:false,qqlogin:false};}return _this;}//判断是否是手机端
|
|
|
|
|
// 点击表单后,改变type
|
|
|
|
|
// -------------------- LOGIN START
|
|
|
|
|
//下次自动登入
|
|
|
|
|
// -------------------- LOGIN END
|
|
|
|
|
// -------------------- REGISTER START
|
|
|
|
|
//是否验证通过
|
|
|
|
|
// -------------------- REGISTER END
|
|
|
|
|
//是否同意
|
|
|
|
|
//登入接口
|
|
|
|
|
//注册接口
|
|
|
|
|
//邮箱手机号验证
|
|
|
|
|
//短信验证
|
|
|
|
|
//显示和不显示密码
|
|
|
|
|
//倒计时
|
|
|
|
|
//滑动验证手机号
|
|
|
|
|
//获取登入
|
|
|
|
|
//失去焦点判断
|
|
|
|
|
//获取登入密码
|
|
|
|
|
//获取注册登入
|
|
|
|
|
//获取注册密码
|
|
|
|
|
//获取code
|
|
|
|
|
//切换tab
|
|
|
|
|
_createClass(LoginRegisterComponent,[{key:'render',value:function render(){var _this2=this;var _state=this.state,autoLogin=_state.autoLogin,classpass=_state.classpass,passopens=_state.passopens,seconds=_state.seconds,getverificationcodes=_state.getverificationcodes,Agreetotheterms=_state.Agreetotheterms,Phonenumberisnotco=_state.Phonenumberisnotco,Phonenumberisnotcos=_state.Phonenumberisnotcos,codes=_state.codes,tab=_state.tab,dragOk=_state.dragOk,Whethertoverify=_state.Whethertoverify,classpassbool=_state.classpassbool,Phonenumberisnotcosytdhk=_state.Phonenumberisnotcosytdhk,Phonenumberisnotcosyzm=_state.Phonenumberisnotcosyzm,Phonenumberisnotcosymmm=_state.Phonenumberisnotcosymmm,Phonenumberisnotcodmm=_state.Phonenumberisnotcodmm,readAgreement=_state.readAgreement,pciphone=_state.pciphone,Phonenumberisnotcodmms=_state.Phonenumberisnotcodmms,weixinlogin=_state.weixinlogin;// height: 346px;
|
|
|
|
|
if(this.state.seconds===0){// window.location.href='http://www.cnblogs.com/a-cat/';
|
|
|
|
|
}return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'login_register_content login_register_contents'// style={ parseInt(tab[0])==0?{height: "366px"} :{height: "510px"}}
|
|
|
|
|
},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('style',null,'\n .login_register_contents, .login_register_contents .ant-tabs-tabpane {\n display: flex;\n justify-content: center;\n }\n '),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',null,weixinlogin===false?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a,{mode:'horizontal',selectedKeys:tab,onClick:this.changeTab,className:'mt20'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a.Item,{key:'0',className:tab===0?"active font-18":"font-18"},' \u767B\u5F55'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a.Item,{key:'1',className:tab===1?"active font-18 ":"font-18 ",style:{marginLeft:"10px"}},'\u6CE8\u518C')):"",weixinlogin===false&&parseInt(tab[0])==0&&__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{style:{width:'340px'}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.ant-input {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-webkit-box-sizing: border-box;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlist-style: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 4px 11px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 38px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tline-height: 1.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: rgba(0, 0, 0, 0.65);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground-color: #fff;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground-image: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborder: 1px solid #d9d9d9;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-webkit-transition: all .3s;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-o-transition: all .3s;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: all .3s;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .loginInputzhuche{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground-color: #fff!important;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 45px !important;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 5px;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n '),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a,{placeholder:'\u8BF7\u8F93\u5165\u767B\u5F55\u624B\u673A\u53F7\u7801\u6216\u90AE\u7BB1',value:this.state.login,onChange:this.loginInputonChange,name:'username',className:Phonenumberisnotco&&Phonenumberisnotco!==""?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche",onBlur:function onBlur(e){return _this2.inputOnBlur(e,1);},style:{marginTop:'30px',height:'38px'},onPressEnter:function onPressEnter(){return _this2.postLogin();}}),Phonenumberisnotco&&Phonenumberisnotco!=""?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-red mt5 mb5',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotco)):__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{style:{height:"25px"}}),__WEBPACK_IMPORTED_MODULE_12_react___defaul
|
|
|
|
|
,style:{marginTop:'30px',height:'38px',color:'#999999',fontSize:"14px"}}),Phonenumberisnotcos&&Phonenumberisnotcos!==""?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-red mt5 mb5 ',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotcos)):__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{style:{height:"25px"}}),this.state.MyEduCoderModals===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19__Notcompletedysl__["a" /* default */],{modalsType:this.state.MyEduCoderModals,registered:this.state.registered,setNotcompleteds:function setNotcompleteds(){_this2.setNotcompleteds();}}):"",Whethertoverify===false&&pciphone===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_18__CheckInputysl__["a" /* default */],{dragOkCallback:this.dragOkCallback}):"",Whethertoverify===true&&pciphone===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_18__CheckInputysl__["a" /* default */],{dragOkCallback:this.dragOkCallback}):"",__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',null,pciphone===true?Phonenumberisnotcosytdhk&&Phonenumberisnotcosytdhk!==""?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-red mt5 mb5 ',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotcosytdhk)):__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{style:{height:"25px"}}):""),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'yslbutondls'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a,{className:Phonenumberisnotcosyzm&&Phonenumberisnotcosyzm!==""?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche",name:'codes',type:'text',autoComplete:'off',readonly:true,onfocus:'this.removeAttribute(\'readonly\')',style:{width:'210px',height:'38px'},placeholder:'\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801',onChange:this.codesonChange,value:codes}),getverificationcodes===undefined?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{className:' ml5 font-14',disabled:true,style:{"width":"120px","text-align":"center","height":"45px"},size:"large"},'\u91CD\u65B0\u53D1\u9001',seconds,'s'):getverificationcodes===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{className:' ml5 font-14',type:'primary',style:{"width":"120px","text-align":"center","height":"45px"},onClick:function onClick(){return _this2.getverificationcode();},size:"large"},'\u83B7\u53D6\u9A8C\u8BC1\u7801'):__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{className:' ml5 font-14 ',type:'primary',style:{"width":"120px","text-align":"center","height":"45px"},onClick:function onClick(){return _this2.getverificationcode();},size:"large"},'\u91CD\u65B0\u53D1\u9001')),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',null,Phonenumberisnotcosyzm&&Phonenumberisnotcosyzm!==""?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-red mt5 mb5 ',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotcosyzm)):__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{style:{height:"25px"}})),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('style',null,'\n .ant-input-affix-wrapper .ant-input-suffix {\n right: 12px;\n
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3125:
|
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQ3MTE0ODA1ODFGMzExRTk5M0M5OUNFNjQ2MEU5RjQzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQ3MTE0ODA2ODFGMzExRTk5M0M5OUNFNjQ2MEU5RjQzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDcxMTQ4MDM4MUYzMTFFOTkzQzk5Q0U2NDYwRTlGNDMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDcxMTQ4MDQ4MUYzMTFFOTkzQzk5Q0U2NDYwRTlGNDMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6SCWHBAAABG0lEQVR42tzUvUoDQRSG4V0RbZJISsGrEPyBWNikSWdh1kK8CNlKW4OIVkII7BaCEBKIEO/AThQRryCpBGtJJLFa34FvYLMMVmsKDzwMzM/hzBl2/SRJvDxiwcspcku0GMfxn1W0jCP0MMREhpo71J5fEx1ggH3co4qyVDUXKGkwczWNPq5Qwx5eHJUOpI1t3GATIRJb0Qkq2HIkaWCk0caTku3orOdHUWTGT+zizVHJN5YwRjGzto4HrNiKLtEyE45E5spfuM7Ml9DERbrZpuxHlbyROXCKgkYbpjfPOnOebrb5To7Vn76u2FXid+1ZU18CXSnUnplXs9FRorpe7wyrWvvAK+60PnU9fzrMhluZ/7fm/9/fyI8AAwADGEB8vIPBrQAAAABJRU5ErkJggg=="
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3126:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
|
|
|
|
|
|
|
|
// load the styles
|
|
|
|
|
var content = __webpack_require__(3127);
|
|
|
|
|
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
|
|
|
// Prepare cssTransformation
|
|
|
|
|
var transform;
|
|
|
|
|
|
|
|
|
|
var options = {"hmr":false}
|
|
|
|
|
options.transform = transform
|
|
|
|
|
// add the styles to the DOM
|
|
|
|
|
var update = __webpack_require__(313)(content, options);
|
|
|
|
|
if(content.locals) module.exports = content.locals;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3127:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
exports = module.exports = __webpack_require__(312)(true);
|
|
|
|
|
// imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// module
|
|
|
|
|
exports.push([module.i, "#drag{position:relative;background-color:#e8e8e8;min-width:300px;height:38px;line-height:38px;text-align:center}#drag .handler{position:absolute;top:0;left:0;width:40px;height:38px;border:1px solid #ccc;cursor:move}.handler_bg{background:#fff url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==\") no-repeat 50%}.handler_ok_bg{background:#fff url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==\") no-repeat 50%}#drag .drag_bg{background-color:#7ac23c;height:38px;width:0}#drag .drag_text{position:absolute;top:0;font-size:14px;width:100%;-moz-user-select:none;-webkit-user-select:none;color:#fff;user-select:none;-o-user-select:none;-ms-user-select:none}", "", {"version":3,"sources":["/Users/hs/edu/educoder/public/react/src/modules/user/secureCode.css"],"names":[],"mappings":"AAAA,MACI,kBAAmB,AACnB,yBAA0B,AAC1B,gBAAiB,AACjB,YAA
|
|
|
|
|
|
|
|
|
|
// exports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3128:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css__ = __webpack_require__(87);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_button__ = __webpack_require__(74);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_input_style_css__ = __webpack_require__(68);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_input_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_input_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_input__ = __webpack_require__(69);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_notification_style_css__ = __webpack_require__(45);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_notification_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_notification_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_notification__ = __webpack_require__(46);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_notification___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_notification__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_tabs_style_css__ = __webpack_require__(1499);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_tabs_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_tabs_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_tabs__ = __webpack_require__(1500);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_tabs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_tabs__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_router_dom__ = __webpack_require__(44);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_educoder__ = __webpack_require__(5);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__CheckInputysl__ = __webpack_require__(1983);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__ReadPassword__ = __webpack_require__(3129);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_axios__ = __webpack_require__(15);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_axios__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__common_css__ = __webpack_require__(200);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__common_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14__common_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__commontwo_css__ = __webpack_require__(2391);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__commontwo_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15__commontwo_css__);
|
|
|
|
|
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var TabPane=__WEBPACK_IMPORTED_MODULE_7_antd_lib_tabs___default.a.TabPane;var loginInputsyl={"width":" 100%","height":"40px"//父组件 EducoderLogin.js
|
|
|
|
|
};var LoginRegisterComponent=function(_Component){_inherits(LoginRegisterComponent,_Component);function LoginRegisterComponent(props){_classCallCheck(this,LoginRegisterComponent);var _this=_possibleConstructorReturn(this,(LoginRegisterComponent.__proto__||Object.getPrototypeOf(LoginRegisterComponent)).call(this,props));_this.IsPC=function(){var userAgentInfo=navigator.userAgent;var Agents=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];var flag=true;//这个意思是说自己的是pc 端
|
|
|
|
|
for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0){flag=false;break;}}return flag;};_this.componentDidMount=function(){var pcipns=_this.IsPC();_this.setState({pciphone:pcipns});};_this.openNotification=function(messge){__WEBPACK_IMPORTED_MODULE_5_antd_lib_notification___default.a.open({message:"提示",description:messge,onClick:function onClick(){console.log('Notification Clicked!');}});};_this.StudyMakeMoney=function(){// 调用父组件方法
|
|
|
|
|
_this.props.Setshowbool(1);};_this.changeType=function(){_this.setState({classpass:'password'});};_this.changeTypey=function(){};_this.getverificationcode=function(){debugger;if(_this.state.login===undefined||_this.state.login.length===0){_this.openNotification("请输入手机号或邮箱");return;}//这是判断是否手机正确
|
|
|
|
|
if(_this.state.Phonenumberisnotcobool===false){_this.openNotification(_this.state.Phonenumberisnotco);_this.setState({Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}//拖动滑动验证
|
|
|
|
|
if(_this.state.pciphone===true){if(_this.state.dragOk===false){_this.openNotification("拖动滑块验证");return;}}if(_this.state.getverificationcodes===true){_this.setState({getverificationcodes:undefined});var timer=setInterval(function(){_this.setState(function(preState){return{seconds:preState.seconds-1};},function(){if(_this.state.seconds==0){clearInterval(timer);_this.setState({getverificationcodes:false,seconds:60});}});},1000);_this.SMSverification();}else{_this.setState({getverificationcodes:undefined});var _timer=setInterval(function(){_this.setState(function(preState){return{seconds:preState.seconds-1};},function(){if(_this.state.seconds==0){clearInterval(_timer);_this.setState({getverificationcodes:false,seconds:60});}});},1000);_this.SMSverification();}};_this.SMSverification=function(){var url='/accounts/get_verification_code.json';__WEBPACK_IMPORTED_MODULE_13_axios___default.a.get(url,{params:{login:_this.state.login,type:2}}).then(function(result){//验证有问题{"status":1,"message":"success"}
|
|
|
|
|
_this.openNotification("验证码已发送,请注意查收!",2);}).catch(function(error){console.log(error);});};_this.cancelReadOnly=function(){_this.setState({readonlyInput:false});};_this.Retrievepassword=function(){if(_this.state.Phonenumberisnotcobool===false&&_this.state.Phonenumberisnotco!==undefined){_this.openNotification(_this.state.Phonenumberisnotco);_this.setState({Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}if(_this.state.login===undefined||_this.state.login.length===0||_this.state.login===""){_this.setState({Phonenumberisnotco:"账号不能为空",Phonenumberisnotcobool:false,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}if(_this.state.pciphone===true){if(_this.state.dragOk===false){// this.openNotification(`请拖动滑块完成验证`,2);
|
|
|
|
|
_this.setState({Phonenumberisnotcosytdhk:"请拖动滑块完成验证",dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}}if(_this.state.password===undefined||_this.state.password.length===0||_this.state.password===""){_this.setState({Phonenumberisnotcosmmm:"密码不能为空"});return;}if(_this.state.passwords===undefined||_this.state.passwords.length===0||_this.state.passwords===""){_this.setState({Phonenumberisnotcosymmmm:"二次密码不能为空"});return;}if(_this.state.password!==_this.state.passwords===""){_this.openNotification('\u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u4E00\u81F4');return;}else if(_this.state.password!==undefined&&_this.state.password.length>0&&_this.state.password.length<8){_this.setState({Phonenumberisnotcosmmm:"密码不能少于8位"});return;}else if(_this.state.password!==undefined&&_this.state.password.length>0&&_this.state.password.length>16){_this.setState({Phonenumberisnotcosmmm:"密码不能超过16位"});return;}else if(_this.state.passwords!==undefined&&_this.state.passwords.length>0&&_this.state.passwords.length<8){_this.setState({Phonenumberisnotcosymmmm:"二次密码不能少于8位"});return;}else if(_this.state.passwords!==undefined&&_this.state.passwords.length>0&&_this.state.passwords.length>16){_this.setState({Phonenumberisnotcosymmmm:"二次密码不能超过16位"});return;}if(_this.state.codes===undefined||_this.state.codes.length===0||_this.state.codes===""){_this.setState({Phonenumberisnotcosyzm:"验证码不能为空"});return;}var url="/accounts/reset_password.json";__WEBPACK_IMPORTED_MODULE_13_axios___default.a.post(url,{login:_this.state.login,code:_this.state.codes,new_password:_this.state.password,new_password_confirmation:_this.state.passwords}).then(function(result){// console.log(result);
|
|
|
|
|
//登录成功,会生成session
|
|
|
|
|
if(result){if(result.data.status===-2){if(result.data.message==="验证码不正确"){_this.setState({Phonenumberisnotcosyzm:"验证码不正确"});return;}else if(result.data.message==="验证码已失效"){_this.setState({Phonenumberisnotcosyzm:"验证码不正确"});return;}else if(result.data.message==="1小时内同一手机号发送次数超过限制"){_this.setState({boolyzm:true});_this.openNotification(result.data.message);return;}else{_this.openNotification(result.data.message);return;}}else{_this.setState({modalsType:true});}}}).catch(function(error){});};_this.openNotification=function(messge){__WEBPACK_IMPORTED_MODULE_5_antd_lib_notification___default.a.open({message:"提示",description:messge,onClick:function onClick(){console.log('Notification Clicked!');}});};_this.loginInputonChange=function(e){// console.log(e.target.value);
|
|
|
|
|
var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}_this.setState({login:stirngt,Phonenumberisnotco:undefined,dragOk:false,boolyzm:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});};_this.loginInputonChanges=function(e){// console.log(e.target.value);
|
|
|
|
|
var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}_this.setState({password:stirngt,Phonenumberisnotcosmmm:undefined});};_this.loginInputonChangess=function(e){// console.log(e.target.value);
|
|
|
|
|
var stirngt;if(e.target.value.length>0){var str=e.target.value.replace(/\s*/g,"");stirngt=str;}else{stirngt=e.target.value;}_this.setState({passwords:stirngt,Phonenumberisnotcosymmmm:undefined});};_this.codesonChange=function(e){_this.setState({codes:e.target.value,Phonenumberisnotcosyzm:undefined});};_this.inputOnBlur=function(e){_this.isCorrectname(e.target.value);// this.Emailphonenumberverification(e.target.value, id);
|
|
|
|
|
};_this.isCorrectname=function(value){console.log(value.length);if(value.length===0){_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true});return;}// var telephone = $("#telephoneAdd.tianjia_phone").val();
|
|
|
|
|
var regph=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;// var email = $("#add_email.tianjia_email").val();
|
|
|
|
|
var regemail=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
|
|
|
|
|
var stringdata=undefined;if(!regph.test(value)){stringdata="手机号格式不正确";_this.setState({Phonenumberisnotco:stringdata,Phonenumberisnotcobool:false});}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true});return;}if(!regemail.test(value)){if(value.indexOf("@")!=-1===true){stringdata="邮箱格式不正确";}else{stringdata="手机号格式不正确";}_this.setState({Phonenumberisnotco:stringdata,Phonenumberisnotcobool:false});_this.Emailphonenumberverification(value);return;}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true});return;}};_this.inputOnBlurzhuche=function(e){if(_this.state.pciphone===false){if(_this.state.login===""||_this.state.login.length===0){_this.setState({Phonenumberisnotco:"账号不能为空",Phonenumberisnotcobool:false,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}// console.log(e.target.value.length);
|
|
|
|
|
// if (e.target.value.length === 0) {
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Phonenumberisnotco: undefined,
|
|
|
|
|
// Phonenumberisnotcobool: false,
|
|
|
|
|
// })
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// var telephone = $("#telephoneAdd.tianjia_phone").val();
|
|
|
|
|
var regph=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;// var email = $("#add_email.tianjia_email").val();
|
|
|
|
|
var regemail=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
|
|
|
|
|
var stringdata=undefined;if(!regph.test(e.target.value)){stringdata="手机号格式不正确";_this.setState({Phonenumberisnotco:stringdata,Phonenumberisnotcobool:false});}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true});return;}if(!regemail.test(e.target.value)){if(e.target.value.indexOf("@")!=-1===true){stringdata="邮箱格式不正确";}else{stringdata="手机号格式不正确";}_this.setState({Phonenumberisnotco:stringdata,Phonenumberisnotcobool:false});return;}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true});_this.Emailphonenumberverification(e.target.value);return;}_this.Emailphonenumberverification(e.target.value);}};_this.dragOkCallback=function(){console.log(_this.state.login);_this.setState({Phonenumberisnotcosytdhk:undefined});if(_this.state.login===""||_this.state.login.length===0){_this.setState({Phonenumberisnotco:"账号不能为空",Phonenumberisnotcobool:false,Phonenumberisnotcosytdhk:undefined,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}// var telephone = $("#telephoneAdd.tianjia_phone").val();
|
|
|
|
|
var regph=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;// var email = $("#add_email.tianjia_email").val();
|
|
|
|
|
var regemail=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
|
|
|
|
|
var stringdata=undefined;if(!regph.test(_this.state.login)){stringdata="手机号格式不正确";_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true,Phonenumberisnotcosytdhk:undefined,dragOk:true});}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true,Phonenumberisnotcosytdhk:undefined,dragOk:true});_this.Emailphonenumberverification(_this.state.login);return;}if(!regemail.test(_this.state.login)){if(_this.state.login.indexOf("@")!=-1===true){stringdata="邮箱格式不正确";}else{stringdata="手机号格式不正确";}_this.setState({Phonenumberisnotco:stringdata,Phonenumberisnotcobool:false,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true,dragOk:true});_this.Emailphonenumberverification(_this.state.login);return;}_this.setState({Phonenumberisnotcosytdhk:undefined});_this.Emailphonenumberverification(_this.state.login);};_this.Emailphonenumberverification=function(value){var url='/accounts/valid_email_and_phone.json';__WEBPACK_IMPORTED_MODULE_13_axios___default.a.get(url,{params:{login:value,type:2}}).then(function(result){// console.log(result);
|
|
|
|
|
if(result){if(result.data.status===-2){console.log(value.length);_this.setState({Phonenumberisnotco:result.data.message,Phonenumberisnotcobool:false,dragOk:false,Whethertoverify:_this.state.Whethertoverify===true?false:true});return;}else{_this.setState({Phonenumberisnotco:undefined,Phonenumberisnotcobool:true,dragOk:true});return;}}}).catch(function(error){console.log(error);});};_this.gobackshowbool=function(){_this.props.history.push("/login");_this.props.Setshowbool(1);};_this.state={login:"",password:"",passwords:"",seconds:60,codes:"",getverificationcodes:true,Phonenumberisnotcobool:true,Phonenumberisnotco:undefined,Phonenumberisnotcosytdhk:undefined,Phonenumberisnotcosmmm:undefined,Phonenumberisnotcosymmmm:undefined,Phonenumberisnotcosyzm:undefined,s:'text',classpass:"text",readonlyInput:true,dragOk:false,Whethertoverify:false,modalsType:false,pciphone:true,boolyzm:false};return _this;}//判断是否是手机端
|
|
|
|
|
// 点击表单后,改变type
|
|
|
|
|
//倒计时
|
|
|
|
|
//短信验证
|
|
|
|
|
//找回密码
|
|
|
|
|
//获取code
|
|
|
|
|
//是否验证通过
|
|
|
|
|
//邮箱手机号验证
|
|
|
|
|
_createClass(LoginRegisterComponent,[{key:'render',value:function render(){var _this2=this;var _state=this.state,autoLogin=_state.autoLogin,readAgreement=_state.readAgreement,dragOk=_state.dragOk,login=_state.login,password=_state.password,passwords=_state.passwords,classpass=_state.classpass,seconds=_state.seconds,getverificationcodes=_state.getverificationcodes,Phonenumberisnotco=_state.Phonenumberisnotco,Phonenumberisnotcosytdhk=_state.Phonenumberisnotcosytdhk,Phonenumberisnotcosmmm=_state.Phonenumberisnotcosmmm,Phonenumberisnotcosymmmm=_state.Phonenumberisnotcosymmmm,Phonenumberisnotcosyzm=_state.Phonenumberisnotcosyzm,readonlyInput=_state.readonlyInput,codes=_state.codes,Whethertoverify=_state.Whethertoverify,pciphone=_state.pciphone,boolyzm=_state.boolyzm;// height: 346px;
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'login_register_content'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_12__ReadPassword__["a" /* default */],{modalsType:this.state.modalsType,StudyMakeMoney:function StudyMakeMoney(){return _this2.StudyMakeMoney();}}),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,{type:'text',name:'username',value:"namename",style:{height:'0',width:'0',border:'none',display:"none"}}),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,{type:'password',name:'password',id:'password',value:"123123123",style:{height:'0',width:'0',border:'none',display:"none"}}),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('style',null,'\n\n .login_section .section_header {\n margin-bottom: 16px;\n font-size: 18px;\n width: 100%;\n text-align: center;\n border-bottom: 1px solid rgb(234, 234, 234);\n height: 69px;\n color: #05101A;\n line-height: 69px;\n }\n\t\t\t\t\t\t\t\t.loginInputzhuche{\n\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\tbackground-color: #fff!important;\n\t\t\t\t\t\t\t\t\theight: 45px !important;\n\t\t\t\t\t\t\t\t\tpadding: 5px;\n\n\t\t\t\t\t\t\t\t}\n '),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'login_sectionysl'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'section_header font-18',style:{color:"#05101A",marginTop:"10px"}},'\u627E\u56DE\u5BC6\u7801'),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{style:{width:'340px'}},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('style',null,'\n .ant-input {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-webkit-box-sizing: border-box;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlist-style: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 4px 11px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 38px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tline-height: 1.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: rgba(0, 0, 0, 0.65);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground-color: #fff;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground-image: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborder: 1px solid #d9d9d9;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-webkit-transition: all .3s;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-o-transition: all .3s;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: all .3s;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,_defineProperty({style:loginInputsyl,type:'text',autoComplete:'off',onClick:this.changeTypey,className:Phonenumberisnotco&&Phonenumberisnotco!==""?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche",placeholder:'\u8F93\u5165\u6CE8\u518C\u624B\u673A\u53F7\u6216\u90AE\u7BB1',value:this.state.login// onBlur={(e) => this.inputOnBlurzhuche(e)}
|
|
|
|
|
,onChange:this.loginInputonChange},'style',{marginTop:'10px',height:"38px"})),Phonenumberisnotco&&Phonenumberisnotco!==""?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('p',{className:'color-red mt5 mb5',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotco)):__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{style:{height:"25px"}}),Whethertoverify===false&&pciphone===true?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__CheckInputysl__["a" /* default */],{dragOkCallback:this.dragOkCallback}):"",Whethertoverify===true&&pciphone===true?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__CheckInputysl__["a" /* default */],{dragOkCallback:this.dragOkCallback}):"",__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',null,pciphone===true?Phonenumberisnotcosytdhk&&Phonenumberisnotcosytdhk!==""?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('p',{className:'color-red mt5 mb5',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotcosytdhk)):__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{style:{height:"25px"}}):""),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,{type:classpass,className:Phonenumberisnotcosmmm&&Phonenumberisnotcosmmm!==""?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche",onClick:this.changeType,autoComplete:'new-password',onChange:this.loginInputonChanges,value:this.state.password,style:{width:"100%",height:"38px"},placeholder:'\u8F93\u51658~16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199'}),Phonenumberisnotcosmmm&&Phonenumberisnotcosmmm!==""?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('p',{className:'color-red mt5 mb5',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotcosmmm)):__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{style:{height:"25px"}}),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,{type:classpass,className:Phonenumberisnotcosymmmm&&Phonenumberisnotcosymmmm!==""?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche",onClick:this.changeType,autoComplete:'new-password',onChange:this.loginInputonChangess,value:this.state.passwords,style:{height:"38px",width:"100%"},placeholder:'\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801'}),Phonenumberisnotcosymmmm&&Phonenumberisnotcosymmmm!==""?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('p',{className:'color-red mt5 mb5',style:{width:" 100%",height:"20px"}},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('span',{className:'fl',style:{textAlign:"left",width:" 100%"}},Phonenumberisnotcosymmmm)):__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{style:{height:"25px"}}),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'yslbutondls'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,{className:Phonenumberisnotcosyzm&&Phonenumberisnotcosyzm!==""?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche",type:'text',autoComplete:'off',style:{width:"210px",height:"38px"},placeholder:'\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801',onChange:this.codesonChange,value:codes}),getverificationcodes===undefined?__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{className:' ml5 ',disabled:true,style:{"width":"120px","text-align":"center","height":"45px"},size:"large"},'\u91CD\u65B0\u53D1\u9001',sec
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 3129:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_modal_style_css__ = __webpack_require__(32);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_modal_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_modal_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_modal__ = __webpack_require__(33);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_modal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_modal__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_educoder__ = __webpack_require__(5);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_axios__ = __webpack_require__(15);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_axios__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_css__ = __webpack_require__(200);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__common_css__);
|
|
|
|
|
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}//密码已重置,请重新登录
|
|
|
|
|
var ReadPassword=function(_Component){_inherits(ReadPassword,_Component);function ReadPassword(props){_classCallCheck(this,ReadPassword);var _this=_possibleConstructorReturn(this,(ReadPassword.__proto__||Object.getPrototypeOf(ReadPassword)).call(this,props));_this.setDownload=function(){//立即联系
|
|
|
|
|
window.location.href="/login";};return _this;}_createClass(ReadPassword,[{key:'render',value:function render(){var _this2=this;return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_modal___default.a,{keyboard:false,closable:false,footer:null,destroyOnClose:true,title:'\u63D0\u793A',centered:true,visible:this.props.modalsType===undefined?false:this.props.modalsType,width:'530px'},__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('div',{className:'educouddiv tabeltext-alignleft'},__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('div',{className:"tabeltext-alignleft mb20"},__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('p',null,'\u5BC6\u7801\u5DF2\u91CD\u7F6E\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55')),__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('a',{className:'task-btn task-btn-orange bth100',onClick:function onClick(){return _this2.setDownload();}},'\u77E5\u9053\u5566')));}}]);return ReadPassword;}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (ReadPassword);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 856:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_router_dom__ = __webpack_require__(44);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Loading__ = __webpack_require__(338);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_loadable__ = __webpack_require__(339);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_loadable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react_loadable__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_educoder__ = __webpack_require__(5);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__LoginRegisterComponent__ = __webpack_require__(3124);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__FindPasswordComponent__ = __webpack_require__(3128);
|
|
|
|
|
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
|
|
|
|
var LoginRegisterPage=function(_Component){_inherits(LoginRegisterPage,_Component);function LoginRegisterPage(){_classCallCheck(this,LoginRegisterPage);return _possibleConstructorReturn(this,(LoginRegisterPage.__proto__||Object.getPrototypeOf(LoginRegisterPage)).apply(this,arguments));}_createClass(LoginRegisterPage,[{key:'render',value:function render(){// newMain clearfix
|
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:''},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__LoginRegisterComponent__["a" /* default */],Object.assign({},this.props,this.state)),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br',null),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br',null),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__FindPasswordComponent__["a" /* default */],Object.assign({},this.props,this.state)));}}]);return LoginRegisterPage;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);/* harmony default export */ __webpack_exports__["default"] = (Object(__WEBPACK_IMPORTED_MODULE_4_educoder__["w" /* SnackbarHOC */])()(LoginRegisterPage));
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 893:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var _createReactContext = _interopRequireDefault(__webpack_require__(316));
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
var MenuContext = (0, _createReactContext["default"])({
|
|
|
|
|
inlineCollapsed: false
|
|
|
|
|
});
|
|
|
|
|
var _default = MenuContext;
|
|
|
|
|
exports["default"] = _default;
|
|
|
|
|
//# sourceMappingURL=MenuContext.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 908:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = exports.SiderContext = void 0;
|
|
|
|
|
|
|
|
|
|
var _createReactContext = _interopRequireDefault(__webpack_require__(316));
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var _reactLifecyclesCompat = __webpack_require__(7);
|
|
|
|
|
|
|
|
|
|
var _classnames = _interopRequireDefault(__webpack_require__(3));
|
|
|
|
|
|
|
|
|
|
var _omit = _interopRequireDefault(__webpack_require__(43));
|
|
|
|
|
|
|
|
|
|
var _layout = __webpack_require__(997);
|
|
|
|
|
|
|
|
|
|
var _configProvider = __webpack_require__(12);
|
|
|
|
|
|
|
|
|
|
var _icon = _interopRequireDefault(__webpack_require__(26));
|
|
|
|
|
|
|
|
|
|
var _isNumeric = _interopRequireDefault(__webpack_require__(998));
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
|
|
var t = {};
|
|
|
|
|
|
|
|
|
|
for (var p in s) {
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
|
|
}
|
|
|
|
|
return t;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// matchMedia polyfill for
|
|
|
|
|
// https://github.com/WickyNilliams/enquire.js/issues/82
|
|
|
|
|
// TODO: Will be removed in antd 4.0 because we will no longer support ie9
|
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
|
var matchMediaPolyfill = function matchMediaPolyfill(mediaQuery) {
|
|
|
|
|
return {
|
|
|
|
|
media: mediaQuery,
|
|
|
|
|
matches: false,
|
|
|
|
|
addListener: function addListener() {},
|
|
|
|
|
removeListener: function removeListener() {}
|
|
|
|
|
};
|
|
|
|
|
}; // ref: https://github.com/ant-design/ant-design/issues/18774
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!window.matchMedia) window.matchMedia = matchMediaPolyfill;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var dimensionMaxMap = {
|
|
|
|
|
xs: '479.98px',
|
|
|
|
|
sm: '575.98px',
|
|
|
|
|
md: '767.98px',
|
|
|
|
|
lg: '991.98px',
|
|
|
|
|
xl: '1199.98px',
|
|
|
|
|
xxl: '1599.98px'
|
|
|
|
|
};
|
|
|
|
|
var SiderContext = (0, _createReactContext["default"])({});
|
|
|
|
|
exports.SiderContext = SiderContext;
|
|
|
|
|
|
|
|
|
|
var generateId = function () {
|
|
|
|
|
var i = 0;
|
|
|
|
|
return function () {
|
|
|
|
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
|
|
|
i += 1;
|
|
|
|
|
return "".concat(prefix).concat(i);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
var InternalSider =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(InternalSider, _React$Component);
|
|
|
|
|
|
|
|
|
|
function InternalSider(props) {
|
|
|
|
|
var _this;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, InternalSider);
|
|
|
|
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(InternalSider).call(this, props));
|
|
|
|
|
|
|
|
|
|
_this.responsiveHandler = function (mql) {
|
|
|
|
|
_this.setState({
|
|
|
|
|
below: mql.matches
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var onBreakpoint = _this.props.onBreakpoint;
|
|
|
|
|
|
|
|
|
|
if (onBreakpoint) {
|
|
|
|
|
onBreakpoint(mql.matches);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_this.state.collapsed !== mql.matches) {
|
|
|
|
|
_this.setCollapsed(mql.matches, 'responsive');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.setCollapsed = function (collapsed, type) {
|
|
|
|
|
if (!('collapsed' in _this.props)) {
|
|
|
|
|
_this.setState({
|
|
|
|
|
collapsed: collapsed
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var onCollapse = _this.props.onCollapse;
|
|
|
|
|
|
|
|
|
|
if (onCollapse) {
|
|
|
|
|
onCollapse(collapsed, type);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.toggle = function () {
|
|
|
|
|
var collapsed = !_this.state.collapsed;
|
|
|
|
|
|
|
|
|
|
_this.setCollapsed(collapsed, 'clickTrigger');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.belowShowChange = function () {
|
|
|
|
|
_this.setState(function (_ref) {
|
|
|
|
|
var belowShow = _ref.belowShow;
|
|
|
|
|
return {
|
|
|
|
|
belowShow: !belowShow
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.renderSider = function (_ref2) {
|
|
|
|
|
var _classNames;
|
|
|
|
|
|
|
|
|
|
var getPrefixCls = _ref2.getPrefixCls;
|
|
|
|
|
|
|
|
|
|
var _a = _this.props,
|
|
|
|
|
customizePrefixCls = _a.prefixCls,
|
|
|
|
|
className = _a.className,
|
|
|
|
|
theme = _a.theme,
|
|
|
|
|
collapsible = _a.collapsible,
|
|
|
|
|
reverseArrow = _a.reverseArrow,
|
|
|
|
|
trigger = _a.trigger,
|
|
|
|
|
style = _a.style,
|
|
|
|
|
width = _a.width,
|
|
|
|
|
collapsedWidth = _a.collapsedWidth,
|
|
|
|
|
zeroWidthTriggerStyle = _a.zeroWidthTriggerStyle,
|
|
|
|
|
others = __rest(_a, ["prefixCls", "className", "theme", "collapsible", "reverseArrow", "trigger", "style", "width", "collapsedWidth", "zeroWidthTriggerStyle"]);
|
|
|
|
|
|
|
|
|
|
var prefixCls = getPrefixCls('layout-sider', customizePrefixCls);
|
|
|
|
|
var divProps = (0, _omit["default"])(others, ['collapsed', 'defaultCollapsed', 'onCollapse', 'breakpoint', 'onBreakpoint', 'siderHook', 'zeroWidthTriggerStyle']);
|
|
|
|
|
var rawWidth = _this.state.collapsed ? collapsedWidth : width; // use "px" as fallback unit for width
|
|
|
|
|
|
|
|
|
|
var siderWidth = (0, _isNumeric["default"])(rawWidth) ? "".concat(rawWidth, "px") : String(rawWidth); // special trigger when collapsedWidth == 0
|
|
|
|
|
|
|
|
|
|
var zeroWidthTrigger = parseFloat(String(collapsedWidth || 0)) === 0 ? React.createElement("span", {
|
|
|
|
|
onClick: _this.toggle,
|
|
|
|
|
className: "".concat(prefixCls, "-zero-width-trigger ").concat(prefixCls, "-zero-width-trigger-").concat(reverseArrow ? 'right' : 'left'),
|
|
|
|
|
style: zeroWidthTriggerStyle
|
|
|
|
|
}, React.createElement(_icon["default"], {
|
|
|
|
|
type: "bars"
|
|
|
|
|
})) : null;
|
|
|
|
|
var iconObj = {
|
|
|
|
|
expanded: reverseArrow ? React.createElement(_icon["default"], {
|
|
|
|
|
type: "right"
|
|
|
|
|
}) : React.createElement(_icon["default"], {
|
|
|
|
|
type: "left"
|
|
|
|
|
}),
|
|
|
|
|
collapsed: reverseArrow ? React.createElement(_icon["default"], {
|
|
|
|
|
type: "left"
|
|
|
|
|
}) : React.createElement(_icon["default"], {
|
|
|
|
|
type: "right"
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
var status = _this.state.collapsed ? 'collapsed' : 'expanded';
|
|
|
|
|
var defaultTrigger = iconObj[status];
|
|
|
|
|
var triggerDom = trigger !== null ? zeroWidthTrigger || React.createElement("div", {
|
|
|
|
|
className: "".concat(prefixCls, "-trigger"),
|
|
|
|
|
onClick: _this.toggle,
|
|
|
|
|
style: {
|
|
|
|
|
width: siderWidth
|
|
|
|
|
}
|
|
|
|
|
}, trigger || defaultTrigger) : null;
|
|
|
|
|
|
|
|
|
|
var divStyle = _extends(_extends({}, style), {
|
|
|
|
|
flex: "0 0 ".concat(siderWidth),
|
|
|
|
|
maxWidth: siderWidth,
|
|
|
|
|
minWidth: siderWidth,
|
|
|
|
|
width: siderWidth
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var siderCls = (0, _classnames["default"])(className, prefixCls, "".concat(prefixCls, "-").concat(theme), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-collapsed"), !!_this.state.collapsed), _defineProperty(_classNames, "".concat(prefixCls, "-has-trigger"), collapsible && trigger !== null && !zeroWidthTrigger), _defineProperty(_classNames, "".concat(prefixCls, "-below"), !!_this.state.below), _defineProperty(_classNames, "".concat(prefixCls, "-zero-width"), parseFloat(siderWidth) === 0), _classNames));
|
|
|
|
|
return React.createElement("aside", _extends({
|
|
|
|
|
className: siderCls
|
|
|
|
|
}, divProps, {
|
|
|
|
|
style: divStyle
|
|
|
|
|
}), React.createElement("div", {
|
|
|
|
|
className: "".concat(prefixCls, "-children")
|
|
|
|
|
}, _this.props.children), collapsible || _this.state.below && zeroWidthTrigger ? triggerDom : null);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.uniqueId = generateId('ant-sider-');
|
|
|
|
|
var matchMedia;
|
|
|
|
|
|
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
|
matchMedia = window.matchMedia;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (matchMedia && props.breakpoint && props.breakpoint in dimensionMaxMap) {
|
|
|
|
|
_this.mql = matchMedia("(max-width: ".concat(dimensionMaxMap[props.breakpoint], ")"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var collapsed;
|
|
|
|
|
|
|
|
|
|
if ('collapsed' in props) {
|
|
|
|
|
collapsed = props.collapsed;
|
|
|
|
|
} else {
|
|
|
|
|
collapsed = props.defaultCollapsed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_this.state = {
|
|
|
|
|
collapsed: collapsed,
|
|
|
|
|
below: false
|
|
|
|
|
};
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(InternalSider, [{
|
|
|
|
|
key: "componentDidMount",
|
|
|
|
|
value: function componentDidMount() {
|
|
|
|
|
if (this.mql) {
|
|
|
|
|
this.mql.addListener(this.responsiveHandler);
|
|
|
|
|
this.responsiveHandler(this.mql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.props.siderHook) {
|
|
|
|
|
this.props.siderHook.addSider(this.uniqueId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "componentWillUnmount",
|
|
|
|
|
value: function componentWillUnmount() {
|
|
|
|
|
if (this.mql) {
|
|
|
|
|
this.mql.removeListener(this.responsiveHandler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.props.siderHook) {
|
|
|
|
|
this.props.siderHook.removeSider(this.uniqueId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
var collapsed = this.state.collapsed;
|
|
|
|
|
var collapsedWidth = this.props.collapsedWidth;
|
|
|
|
|
return React.createElement(SiderContext.Provider, {
|
|
|
|
|
value: {
|
|
|
|
|
siderCollapsed: collapsed,
|
|
|
|
|
collapsedWidth: collapsedWidth
|
|
|
|
|
}
|
|
|
|
|
}, React.createElement(_configProvider.ConfigConsumer, null, this.renderSider));
|
|
|
|
|
}
|
|
|
|
|
}], [{
|
|
|
|
|
key: "getDerivedStateFromProps",
|
|
|
|
|
value: function getDerivedStateFromProps(nextProps) {
|
|
|
|
|
if ('collapsed' in nextProps) {
|
|
|
|
|
return {
|
|
|
|
|
collapsed: nextProps.collapsed
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return InternalSider;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
InternalSider.defaultProps = {
|
|
|
|
|
collapsible: false,
|
|
|
|
|
defaultCollapsed: false,
|
|
|
|
|
reverseArrow: false,
|
|
|
|
|
width: 200,
|
|
|
|
|
collapsedWidth: 80,
|
|
|
|
|
style: {},
|
|
|
|
|
theme: 'dark'
|
|
|
|
|
};
|
|
|
|
|
(0, _reactLifecyclesCompat.polyfill)(InternalSider); // eslint-disable-next-line react/prefer-stateless-function
|
|
|
|
|
|
|
|
|
|
var Sider =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component2) {
|
|
|
|
|
_inherits(Sider, _React$Component2);
|
|
|
|
|
|
|
|
|
|
function Sider() {
|
|
|
|
|
_classCallCheck(this, Sider);
|
|
|
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, _getPrototypeOf(Sider).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Sider, [{
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
return React.createElement(_layout.LayoutContext.Consumer, null, function (context) {
|
|
|
|
|
return React.createElement(InternalSider, _extends({}, context, _this2.props));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Sider;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
exports["default"] = Sider;
|
|
|
|
|
//# sourceMappingURL=Sider.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 924:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var _rcMenu = _interopRequireWildcard(__webpack_require__(172));
|
|
|
|
|
|
|
|
|
|
var _classnames = _interopRequireDefault(__webpack_require__(3));
|
|
|
|
|
|
|
|
|
|
var _omit = _interopRequireDefault(__webpack_require__(43));
|
|
|
|
|
|
|
|
|
|
var _reactLifecyclesCompat = __webpack_require__(7);
|
|
|
|
|
|
|
|
|
|
var _SubMenu = _interopRequireDefault(__webpack_require__(1002));
|
|
|
|
|
|
|
|
|
|
var _MenuItem = _interopRequireDefault(__webpack_require__(1003));
|
|
|
|
|
|
|
|
|
|
var _configProvider = __webpack_require__(12);
|
|
|
|
|
|
|
|
|
|
var _warning = _interopRequireDefault(__webpack_require__(40));
|
|
|
|
|
|
|
|
|
|
var _Sider = __webpack_require__(908);
|
|
|
|
|
|
|
|
|
|
var _raf = _interopRequireDefault(__webpack_require__(182));
|
|
|
|
|
|
|
|
|
|
var _motion = _interopRequireDefault(__webpack_require__(988));
|
|
|
|
|
|
|
|
|
|
var _MenuContext = _interopRequireDefault(__webpack_require__(893));
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var InternalMenu =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(InternalMenu, _React$Component);
|
|
|
|
|
|
|
|
|
|
function InternalMenu(props) {
|
|
|
|
|
var _this;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, InternalMenu);
|
|
|
|
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(InternalMenu).call(this, props)); // Restore vertical mode when menu is collapsed responsively when mounted
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/13104
|
|
|
|
|
// TODO: not a perfect solution, looking a new way to avoid setting switchingModeFromInline in this situation
|
|
|
|
|
|
|
|
|
|
_this.handleMouseEnter = function (e) {
|
|
|
|
|
_this.restoreModeVerticalFromInline();
|
|
|
|
|
|
|
|
|
|
var onMouseEnter = _this.props.onMouseEnter;
|
|
|
|
|
|
|
|
|
|
if (onMouseEnter) {
|
|
|
|
|
onMouseEnter(e);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.handleTransitionEnd = function (e) {
|
|
|
|
|
// when inlineCollapsed menu width animation finished
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/12864
|
|
|
|
|
var widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; // Fix SVGElement e.target.className.indexOf is not a function
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/15699
|
|
|
|
|
|
|
|
|
|
var className = e.target.className; // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during an animation.
|
|
|
|
|
|
|
|
|
|
var classNameValue = Object.prototype.toString.call(className) === '[object SVGAnimatedString]' ? className.animVal : className; // Fix for <Menu style={{ width: '100%' }} />, the width transition won't trigger when menu is collapsed
|
|
|
|
|
// https://github.com/ant-design/ant-design-pro/issues/2783
|
|
|
|
|
|
|
|
|
|
var iconScaled = e.propertyName === 'font-size' && classNameValue.indexOf('anticon') >= 0;
|
|
|
|
|
|
|
|
|
|
if (widthCollapsed || iconScaled) {
|
|
|
|
|
_this.restoreModeVerticalFromInline();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.handleClick = function (e) {
|
|
|
|
|
_this.handleOpenChange([]);
|
|
|
|
|
|
|
|
|
|
var onClick = _this.props.onClick;
|
|
|
|
|
|
|
|
|
|
if (onClick) {
|
|
|
|
|
onClick(e);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.handleOpenChange = function (openKeys) {
|
|
|
|
|
_this.setOpenKeys(openKeys);
|
|
|
|
|
|
|
|
|
|
var onOpenChange = _this.props.onOpenChange;
|
|
|
|
|
|
|
|
|
|
if (onOpenChange) {
|
|
|
|
|
onOpenChange(openKeys);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_this.renderMenu = function (_ref) {
|
|
|
|
|
var getPopupContainer = _ref.getPopupContainer,
|
|
|
|
|
getPrefixCls = _ref.getPrefixCls;
|
|
|
|
|
var _this$props = _this.props,
|
|
|
|
|
customizePrefixCls = _this$props.prefixCls,
|
|
|
|
|
className = _this$props.className,
|
|
|
|
|
theme = _this$props.theme,
|
|
|
|
|
collapsedWidth = _this$props.collapsedWidth;
|
|
|
|
|
var passProps = (0, _omit["default"])(_this.props, ['collapsedWidth', 'siderCollapsed']);
|
|
|
|
|
|
|
|
|
|
var menuMode = _this.getRealMenuMode();
|
|
|
|
|
|
|
|
|
|
var menuOpenMotion = _this.getOpenMotionProps(menuMode);
|
|
|
|
|
|
|
|
|
|
var prefixCls = getPrefixCls('menu', customizePrefixCls);
|
|
|
|
|
var menuClassName = (0, _classnames["default"])(className, "".concat(prefixCls, "-").concat(theme), _defineProperty({}, "".concat(prefixCls, "-inline-collapsed"), _this.getInlineCollapsed()));
|
|
|
|
|
|
|
|
|
|
var menuProps = _extends({
|
|
|
|
|
openKeys: _this.state.openKeys,
|
|
|
|
|
onOpenChange: _this.handleOpenChange,
|
|
|
|
|
className: menuClassName,
|
|
|
|
|
mode: menuMode
|
|
|
|
|
}, menuOpenMotion);
|
|
|
|
|
|
|
|
|
|
if (menuMode !== 'inline') {
|
|
|
|
|
// closing vertical popup submenu after click it
|
|
|
|
|
menuProps.onClick = _this.handleClick;
|
|
|
|
|
} // https://github.com/ant-design/ant-design/issues/8587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var hideMenu = _this.getInlineCollapsed() && (collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px');
|
|
|
|
|
|
|
|
|
|
if (hideMenu) {
|
|
|
|
|
menuProps.openKeys = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return React.createElement(_rcMenu["default"], _extends({
|
|
|
|
|
getPopupContainer: getPopupContainer
|
|
|
|
|
}, passProps, menuProps, {
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
onTransitionEnd: _this.handleTransitionEnd,
|
|
|
|
|
onMouseEnter: _this.handleMouseEnter
|
|
|
|
|
}));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
(0, _warning["default"])(!('onOpen' in props || 'onClose' in props), 'Menu', '`onOpen` and `onClose` are removed, please use `onOpenChange` instead, ' + 'see: https://u.ant.design/menu-on-open-change.');
|
|
|
|
|
(0, _warning["default"])(!('inlineCollapsed' in props && props.mode !== 'inline'), 'Menu', '`inlineCollapsed` should only be used when `mode` is inline.');
|
|
|
|
|
(0, _warning["default"])(!(props.siderCollapsed !== undefined && 'inlineCollapsed' in props), 'Menu', '`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.');
|
|
|
|
|
var openKeys;
|
|
|
|
|
|
|
|
|
|
if ('openKeys' in props) {
|
|
|
|
|
openKeys = props.openKeys;
|
|
|
|
|
} else if ('defaultOpenKeys' in props) {
|
|
|
|
|
openKeys = props.defaultOpenKeys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_this.state = {
|
|
|
|
|
openKeys: openKeys || [],
|
|
|
|
|
switchingModeFromInline: false,
|
|
|
|
|
inlineOpenKeys: [],
|
|
|
|
|
prevProps: props
|
|
|
|
|
};
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(InternalMenu, [{
|
|
|
|
|
key: "componentWillUnmount",
|
|
|
|
|
value: function componentWillUnmount() {
|
|
|
|
|
_raf["default"].cancel(this.mountRafId);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "setOpenKeys",
|
|
|
|
|
value: function setOpenKeys(openKeys) {
|
|
|
|
|
if (!('openKeys' in this.props)) {
|
|
|
|
|
this.setState({
|
|
|
|
|
openKeys: openKeys
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "getRealMenuMode",
|
|
|
|
|
value: function getRealMenuMode() {
|
|
|
|
|
var inlineCollapsed = this.getInlineCollapsed();
|
|
|
|
|
|
|
|
|
|
if (this.state.switchingModeFromInline && inlineCollapsed) {
|
|
|
|
|
return 'inline';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var mode = this.props.mode;
|
|
|
|
|
return inlineCollapsed ? 'vertical' : mode;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "getInlineCollapsed",
|
|
|
|
|
value: function getInlineCollapsed() {
|
|
|
|
|
var inlineCollapsed = this.props.inlineCollapsed;
|
|
|
|
|
|
|
|
|
|
if (this.props.siderCollapsed !== undefined) {
|
|
|
|
|
return this.props.siderCollapsed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return inlineCollapsed;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "getOpenMotionProps",
|
|
|
|
|
value: function getOpenMotionProps(menuMode) {
|
|
|
|
|
var _this$props2 = this.props,
|
|
|
|
|
openTransitionName = _this$props2.openTransitionName,
|
|
|
|
|
openAnimation = _this$props2.openAnimation,
|
|
|
|
|
motion = _this$props2.motion; // Provides by user
|
|
|
|
|
|
|
|
|
|
if (motion) {
|
|
|
|
|
return {
|
|
|
|
|
motion: motion
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (openAnimation) {
|
|
|
|
|
(0, _warning["default"])(typeof openAnimation === 'string', 'Menu', '`openAnimation` do not support object. Please use `motion` instead.');
|
|
|
|
|
return {
|
|
|
|
|
openAnimation: openAnimation
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (openTransitionName) {
|
|
|
|
|
return {
|
|
|
|
|
openTransitionName: openTransitionName
|
|
|
|
|
};
|
|
|
|
|
} // Default logic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (menuMode === 'horizontal') {
|
|
|
|
|
return {
|
|
|
|
|
motion: {
|
|
|
|
|
motionName: 'slide-up'
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (menuMode === 'inline') {
|
|
|
|
|
return {
|
|
|
|
|
motion: _motion["default"]
|
|
|
|
|
};
|
|
|
|
|
} // When mode switch from inline
|
|
|
|
|
// submenu should hide without animation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
motion: {
|
|
|
|
|
motionName: this.state.switchingModeFromInline ? '' : 'zoom-big'
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "restoreModeVerticalFromInline",
|
|
|
|
|
value: function restoreModeVerticalFromInline() {
|
|
|
|
|
var switchingModeFromInline = this.state.switchingModeFromInline;
|
|
|
|
|
|
|
|
|
|
if (switchingModeFromInline) {
|
|
|
|
|
this.setState({
|
|
|
|
|
switchingModeFromInline: false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
return React.createElement(_MenuContext["default"].Provider, {
|
|
|
|
|
value: {
|
|
|
|
|
inlineCollapsed: this.getInlineCollapsed() || false,
|
|
|
|
|
antdMenuTheme: this.props.theme
|
|
|
|
|
}
|
|
|
|
|
}, React.createElement(_configProvider.ConfigConsumer, null, this.renderMenu));
|
|
|
|
|
}
|
|
|
|
|
}], [{
|
|
|
|
|
key: "getDerivedStateFromProps",
|
|
|
|
|
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
|
|
|
var prevProps = prevState.prevProps;
|
|
|
|
|
var newState = {
|
|
|
|
|
prevProps: nextProps
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (prevProps.mode === 'inline' && nextProps.mode !== 'inline') {
|
|
|
|
|
newState.switchingModeFromInline = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ('openKeys' in nextProps) {
|
|
|
|
|
newState.openKeys = nextProps.openKeys;
|
|
|
|
|
} else {
|
|
|
|
|
// [Legacy] Old code will return after `openKeys` changed.
|
|
|
|
|
// Not sure the reason, we should keep this logic still.
|
|
|
|
|
if (nextProps.inlineCollapsed && !prevProps.inlineCollapsed || nextProps.siderCollapsed && !prevProps.siderCollapsed) {
|
|
|
|
|
newState.switchingModeFromInline = true;
|
|
|
|
|
newState.inlineOpenKeys = prevState.openKeys;
|
|
|
|
|
newState.openKeys = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!nextProps.inlineCollapsed && prevProps.inlineCollapsed || !nextProps.siderCollapsed && prevProps.siderCollapsed) {
|
|
|
|
|
newState.openKeys = prevState.inlineOpenKeys;
|
|
|
|
|
newState.inlineOpenKeys = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newState;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return InternalMenu;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
InternalMenu.defaultProps = {
|
|
|
|
|
className: '',
|
|
|
|
|
theme: 'light',
|
|
|
|
|
focusable: false
|
|
|
|
|
};
|
|
|
|
|
(0, _reactLifecyclesCompat.polyfill)(InternalMenu); // We should keep this as ref-able
|
|
|
|
|
|
|
|
|
|
var Menu =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component2) {
|
|
|
|
|
_inherits(Menu, _React$Component2);
|
|
|
|
|
|
|
|
|
|
function Menu() {
|
|
|
|
|
_classCallCheck(this, Menu);
|
|
|
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, _getPrototypeOf(Menu).apply(this, arguments));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Menu, [{
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
return React.createElement(_Sider.SiderContext.Consumer, null, function (context) {
|
|
|
|
|
return React.createElement(InternalMenu, _extends({}, _this2.props, context));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Menu;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
exports["default"] = Menu;
|
|
|
|
|
Menu.Divider = _rcMenu.Divider;
|
|
|
|
|
Menu.Item = _MenuItem["default"];
|
|
|
|
|
Menu.SubMenu = _SubMenu["default"];
|
|
|
|
|
Menu.ItemGroup = _rcMenu.ItemGroup;
|
|
|
|
|
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 988:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
// ================== Collapse Motion ==================
|
|
|
|
|
var getCollapsedHeight = function getCollapsedHeight() {
|
|
|
|
|
return {
|
|
|
|
|
height: 0,
|
|
|
|
|
opacity: 0
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var getRealHeight = function getRealHeight(node) {
|
|
|
|
|
return {
|
|
|
|
|
height: node.scrollHeight,
|
|
|
|
|
opacity: 1
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var getCurrentHeight = function getCurrentHeight(node) {
|
|
|
|
|
return {
|
|
|
|
|
height: node.offsetHeight
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var collapseMotion = {
|
|
|
|
|
motionName: 'ant-motion-collapse',
|
|
|
|
|
onAppearStart: getCollapsedHeight,
|
|
|
|
|
onEnterStart: getCollapsedHeight,
|
|
|
|
|
onAppearActive: getRealHeight,
|
|
|
|
|
onEnterActive: getRealHeight,
|
|
|
|
|
onLeaveStart: getCurrentHeight,
|
|
|
|
|
onLeaveActive: getCollapsedHeight
|
|
|
|
|
};
|
|
|
|
|
var _default = collapseMotion;
|
|
|
|
|
exports["default"] = _default;
|
|
|
|
|
//# sourceMappingURL=motion.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 989:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__webpack_require__(28);
|
|
|
|
|
|
|
|
|
|
__webpack_require__(1120);
|
|
|
|
|
|
|
|
|
|
__webpack_require__(169);
|
|
|
|
|
//# sourceMappingURL=css.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 997:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = exports.LayoutContext = void 0;
|
|
|
|
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(0));
|
|
|
|
|
|
|
|
|
|
var _classnames = _interopRequireDefault(__webpack_require__(3));
|
|
|
|
|
|
|
|
|
|
var _createReactContext = _interopRequireDefault(__webpack_require__(316));
|
|
|
|
|
|
|
|
|
|
var _configProvider = __webpack_require__(12);
|
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
|
|
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
|
|
|
|
|
|
|
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
|
|
|
|
|
|
|
|
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
|
|
|
|
|
|
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
|
|
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
|
|
var t = {};
|
|
|
|
|
|
|
|
|
|
for (var p in s) {
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
|
|
}
|
|
|
|
|
return t;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var LayoutContext = (0, _createReactContext["default"])({
|
|
|
|
|
siderHook: {
|
|
|
|
|
addSider: function addSider() {
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
removeSider: function removeSider() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
exports.LayoutContext = LayoutContext;
|
|
|
|
|
|
|
|
|
|
function generator(_ref) {
|
|
|
|
|
var suffixCls = _ref.suffixCls,
|
|
|
|
|
tagName = _ref.tagName,
|
|
|
|
|
displayName = _ref.displayName;
|
|
|
|
|
return function (BasicComponent) {
|
|
|
|
|
var _a;
|
|
|
|
|
|
|
|
|
|
return _a =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component) {
|
|
|
|
|
_inherits(Adapter, _React$Component);
|
|
|
|
|
|
|
|
|
|
function Adapter() {
|
|
|
|
|
var _this;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, Adapter);
|
|
|
|
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(Adapter).apply(this, arguments));
|
|
|
|
|
|
|
|
|
|
_this.renderComponent = function (_ref2) {
|
|
|
|
|
var getPrefixCls = _ref2.getPrefixCls;
|
|
|
|
|
var customizePrefixCls = _this.props.prefixCls;
|
|
|
|
|
var prefixCls = getPrefixCls(suffixCls, customizePrefixCls);
|
|
|
|
|
return React.createElement(BasicComponent, _extends({
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
tagName: tagName
|
|
|
|
|
}, _this.props));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return _this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Adapter, [{
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
return React.createElement(_configProvider.ConfigConsumer, null, this.renderComponent);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Adapter;
|
|
|
|
|
}(React.Component), _a.displayName = displayName, _a;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var Basic = function Basic(props) {
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
|
|
className = props.className,
|
|
|
|
|
children = props.children,
|
|
|
|
|
tagName = props.tagName,
|
|
|
|
|
others = __rest(props, ["prefixCls", "className", "children", "tagName"]);
|
|
|
|
|
|
|
|
|
|
var classString = (0, _classnames["default"])(className, prefixCls);
|
|
|
|
|
return React.createElement(tagName, _extends({
|
|
|
|
|
className: classString
|
|
|
|
|
}, others), children);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var BasicLayout =
|
|
|
|
|
/*#__PURE__*/
|
|
|
|
|
function (_React$Component2) {
|
|
|
|
|
_inherits(BasicLayout, _React$Component2);
|
|
|
|
|
|
|
|
|
|
function BasicLayout() {
|
|
|
|
|
var _this2;
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, BasicLayout);
|
|
|
|
|
|
|
|
|
|
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(BasicLayout).apply(this, arguments));
|
|
|
|
|
_this2.state = {
|
|
|
|
|
siders: []
|
|
|
|
|
};
|
|
|
|
|
return _this2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(BasicLayout, [{
|
|
|
|
|
key: "getSiderHook",
|
|
|
|
|
value: function getSiderHook() {
|
|
|
|
|
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
addSider: function addSider(id) {
|
|
|
|
|
_this3.setState(function (state) {
|
|
|
|
|
return {
|
|
|
|
|
siders: [].concat(_toConsumableArray(state.siders), [id])
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
removeSider: function removeSider(id) {
|
|
|
|
|
_this3.setState(function (state) {
|
|
|
|
|
return {
|
|
|
|
|
siders: state.siders.filter(function (currentId) {
|
|
|
|
|
return currentId !== id;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "render",
|
|
|
|
|
value: function render() {
|
|
|
|
|
var _a = this.props,
|
|
|
|
|
prefixCls = _a.prefixCls,
|
|
|
|
|
className = _a.className,
|
|
|
|
|
children = _a.children,
|
|
|
|
|
hasSider = _a.hasSider,
|
|
|
|
|
Tag = _a.tagName,
|
|
|
|
|
others = __rest(_a, ["prefixCls", "className", "children", "hasSider", "tagName"]);
|
|
|
|
|
|
|
|
|
|
var classString = (0, _classnames["default"])(className, prefixCls, _defineProperty({}, "".concat(prefixCls, "-has-sider"), typeof hasSider === 'boolean' ? hasSider : this.state.siders.length > 0));
|
|
|
|
|
return React.createElement(LayoutContext.Provider, {
|
|
|
|
|
value: {
|
|
|
|
|
siderHook: this.getSiderHook()
|
|
|
|
|
}
|
|
|
|
|
}, React.createElement(Tag, _extends({
|
|
|
|
|
className: classString
|
|
|
|
|
}, others), children));
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return BasicLayout;
|
|
|
|
|
}(React.Component);
|
|
|
|
|
|
|
|
|
|
var Layout = generator({
|
|
|
|
|
suffixCls: 'layout',
|
|
|
|
|
tagName: 'section',
|
|
|
|
|
displayName: 'Layout'
|
|
|
|
|
})(BasicLayout);
|
|
|
|
|
var Header = generator({
|
|
|
|
|
suffixCls: 'layout-header',
|
|
|
|
|
tagName: 'header',
|
|
|
|
|
displayName: 'Header'
|
|
|
|
|
})(Basic);
|
|
|
|
|
var Footer = generator({
|
|
|
|
|
suffixCls: 'layout-footer',
|
|
|
|
|
tagName: 'footer',
|
|
|
|
|
displayName: 'Footer'
|
|
|
|
|
})(Basic);
|
|
|
|
|
var Content = generator({
|
|
|
|
|
suffixCls: 'layout-content',
|
|
|
|
|
tagName: 'main',
|
|
|
|
|
displayName: 'Content'
|
|
|
|
|
})(Basic);
|
|
|
|
|
Layout.Header = Header;
|
|
|
|
|
Layout.Footer = Footer;
|
|
|
|
|
Layout.Content = Content;
|
|
|
|
|
var _default = Layout;
|
|
|
|
|
exports["default"] = _default;
|
|
|
|
|
//# sourceMappingURL=layout.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 998:
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
|
|
|
|
var isNumeric = function isNumeric(value) {
|
|
|
|
|
return !isNaN(parseFloat(value)) && isFinite(value);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var _default = isNumeric;
|
|
|
|
|
exports["default"] = _default;
|
|
|
|
|
//# sourceMappingURL=isNumeric.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
});
|