You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/public/react/build/static/js/80.b4ba172e.chunk.js

28676 lines
2.9 MiB

5 years ago
webpackJsonp([80],{
/***/ 1000:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-row{position:relative;height:auto;margin-right:0;margin-left:0;zoom:1;display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.ant-row:after,.ant-row:before{display:table;content:\"\"}.ant-row:after{clear:both}.ant-row-flex{-ms-flex-flow:row wrap;flex-flow:row wrap}.ant-row-flex,.ant-row-flex:after,.ant-row-flex:before{display:-ms-flexbox;display:flex}.ant-row-flex-start{-ms-flex-pack:start;justify-content:flex-start}.ant-row-flex-center{-ms-flex-pack:center;justify-content:center}.ant-row-flex-end{-ms-flex-pack:end;justify-content:flex-end}.ant-row-flex-space-between{-ms-flex-pack:justify;justify-content:space-between}.ant-row-flex-space-around{-ms-flex-pack:distribute;justify-content:space-around}.ant-row-flex-top{-ms-flex-align:start;align-items:flex-start}.ant-row-flex-middle{-ms-flex-align:center;align-items:center}.ant-row-flex-bottom{-ms-flex-align:end;align-items:flex-end}.ant-col{position:relative;min-height:1px}.ant-col-1,.ant-col-2,.ant-col-3,.ant-col-4,.ant-col-5,.ant-col-6,.ant-col-7,.ant-col-8,.ant-col-9,.ant-col-10,.ant-col-11,.ant-col-12,.ant-col-13,.ant-col-14,.ant-col-15,.ant-col-16,.ant-col-17,.ant-col-18,.ant-col-19,.ant-col-20,.ant-col-21,.ant-col-22,.ant-col-23,.ant-col-24,.ant-col-lg-1,.ant-col-lg-2,.ant-col-lg-3,.ant-col-lg-4,.ant-col-lg-5,.ant-col-lg-6,.ant-col-lg-7,.ant-col-lg-8,.ant-col-lg-9,.ant-col-lg-10,.ant-col-lg-11,.ant-col-lg-12,.ant-col-lg-13,.ant-col-lg-14,.ant-col-lg-15,.ant-col-lg-16,.ant-col-lg-17,.ant-col-lg-18,.ant-col-lg-19,.ant-col-lg-20,.ant-col-lg-21,.ant-col-lg-22,.ant-col-lg-23,.ant-col-lg-24,.ant-col-md-1,.ant-col-md-2,.ant-col-md-3,.ant-col-md-4,.ant-col-md-5,.ant-col-md-6,.ant-col-md-7,.ant-col-md-8,.ant-col-md-9,.ant-col-md-10,.ant-col-md-11,.ant-col-md-12,.ant-col-md-13,.ant-col-md-14,.ant-col-md-15,.ant-col-md-16,.ant-col-md-17,.ant-col-md-18,.ant-col-md-19,.ant-col-md-20,.ant-col-md-21,.ant-col-md-22,.ant-col-md-23,.ant-col-md-24,.ant-col-sm-1,.ant-col-sm-2,.ant-col-sm-3,.ant-col-sm-4,.ant-col-sm-5,.ant-col-sm-6,.ant-col-sm-7,.ant-col-sm-8,.ant-col-sm-9,.ant-col-sm-10,.ant-col-sm-11,.ant-col-sm-12,.ant-col-sm-13,.ant-col-sm-14,.ant-col-sm-15,.ant-col-sm-16,.ant-col-sm-17,.ant-col-sm-18,.ant-col-sm-19,.ant-col-sm-20,.ant-col-sm-21,.ant-col-sm-22,.ant-col-sm-23,.ant-col-sm-24,.ant-col-xs-1,.ant-col-xs-2,.ant-col-xs-3,.ant-col-xs-4,.ant-col-xs-5,.ant-col-xs-6,.ant-col-xs-7,.ant-col-xs-8,.ant-col-xs-9,.ant-col-xs-10,.ant-col-xs-11,.ant-col-xs-12,.ant-col-xs-13,.ant-col-xs-14,.ant-col-xs-15,.ant-col-xs-16,.ant-col-xs-17,.ant-col-xs-18,.ant-col-xs-19,.ant-col-xs-20,.ant-col-xs-21,.ant-col-xs-22,.ant-col-xs-23,.ant-col-xs-24{position:relative;padding-right:0;padding-left:0}.ant-col-1,.ant-col-2,.ant-col-3,.ant-col-4,.ant-col-5,.ant-col-6,.ant-col-7,.ant-col-8,.ant-col-9,.ant-col-10,.ant-col-11,.ant-col-12,.ant-col-13,.ant-col-14,.ant-col-15,.ant-col-16,.ant-col-17,.ant-col-18,.ant-col-19,.ant-col-20,.ant-col-21,.ant-col-22,.ant-col-23,.ant-col-24{-ms-flex:0 0 auto;flex:0 0 auto;float:left}.ant-col-24{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.ant-col-push-24{left:100%}.ant-col-pull-24{right:100%}.ant-col-offset-24{margin-left:100%}.ant-col-order-24{-ms-flex-order:24;order:24}.ant-col-23{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:95.83333333%}.ant-col-push-23{left:95.83333333%}.ant-col-pull-23{right:95.83333333%}.ant-col-offset-23{margin-left:95.83333333%}.ant-col-order-23{-ms-flex-order:23;order:23}.ant-col-22{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:91.66666667%}.ant-col-push-22{left:91.66666667%}.ant-col-pull-22{right:91.66666667%}.ant-col-offset-22{margin-left:91.66666667%}.ant-col-order-22{-ms-flex-order:22;order:22}.ant-col-21{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:87.5%}.ant-col-push-21{left:87.5%}.ant-col-pull-21{right:87.5%}.ant-col-offset-21{margin-left:87.5%}.ant-col-order-21{-ms-flex-order:21;order:21}.ant-col-20{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:83.33333333%}.
// exports
/***/ }),
/***/ 1001:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.responsiveMap = exports.responsiveArray = void 0;
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); }
// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
var enquire; // 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; // eslint-disable-next-line global-require
enquire = __webpack_require__(993);
}
var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
exports.responsiveArray = responsiveArray;
var responsiveMap = {
xs: '(max-width: 575px)',
sm: '(min-width: 576px)',
md: '(min-width: 768px)',
lg: '(min-width: 992px)',
xl: '(min-width: 1200px)',
xxl: '(min-width: 1600px)'
};
exports.responsiveMap = responsiveMap;
var subscribers = [];
var subUid = -1;
var screens = {};
var responsiveObserve = {
dispatch: function dispatch(pointMap) {
screens = pointMap;
if (subscribers.length < 1) {
return false;
}
subscribers.forEach(function (item) {
item.func(screens);
});
return true;
},
subscribe: function subscribe(func) {
if (subscribers.length === 0) {
this.register();
}
var token = (++subUid).toString();
subscribers.push({
token: token,
func: func
});
func(screens);
return token;
},
unsubscribe: function unsubscribe(token) {
subscribers = subscribers.filter(function (item) {
return item.token !== token;
});
if (subscribers.length === 0) {
this.unregister();
}
},
unregister: function unregister() {
Object.keys(responsiveMap).map(function (screen) {
return enquire.unregister(responsiveMap[screen]);
});
},
register: function register() {
var _this = this;
Object.keys(responsiveMap).map(function (screen) {
return enquire.register(responsiveMap[screen], {
match: function match() {
var pointMap = _extends(_extends({}, screens), _defineProperty({}, screen, true));
_this.dispatch(pointMap);
},
unmatch: function unmatch() {
var pointMap = _extends(_extends({}, screens), _defineProperty({}, screen, false));
_this.dispatch(pointMap);
},
// Keep a empty destory to avoid triggering unmatch when unregister
destroy: function destroy() {}
});
});
}
};
var _default = responsiveObserve;
exports["default"] = _default;
//# sourceMappingURL=responsiveObserve.js.map
/***/ }),
/***/ 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
/***/ }),
/***/ 1004:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (true) {
module.exports = __webpack_require__(1014);
} else {
module.exports = require('./cjs/react-is.development.js');
}
/***/ }),
/***/ 1007:
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(335), __esModule: true };
/***/ }),
/***/ 1008:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _from = __webpack_require__(1007);
var _from2 = _interopRequireDefault(_from);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return (0, _from2.default)(arr);
}
};
/***/ }),
/***/ 1009:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-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.
*
*/
var React = __webpack_require__(0);
var factory = __webpack_require__(1010);
if (typeof React === 'undefined') {
throw Error(
'create-react-class could not find the React object. If you are using script tags, ' +
'make sure that React is being loaded before create-react-class.'
);
}
// Hack to grab NoopUpdateQueue from isomorphic React
var ReactNoopUpdateQueue = new React.Component().updater;
module.exports = factory(
React.Component,
React.isValidElement,
ReactNoopUpdateQueue
);
/***/ }),
/***/ 1010:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-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.
*
*/
var _assign = __webpack_require__(76);
var emptyObject = __webpack_require__(1011);
var _invariant = __webpack_require__(1012);
if (false) {
var warning = require('fbjs/lib/warning');
}
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
var ReactPropTypeLocationNames;
if (false) {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
} else {
ReactPropTypeLocationNames = {};
}
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: 'DEFINE_MANY_MERGED',
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: 'DEFINE_MANY_MERGED',
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: 'DEFINE_MANY',
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
/**
* Replacement for (deprecated) `componentWillMount`.
*
* @optional
*/
UNSAFE_componentWillMount: 'DEFINE_MANY',
/**
* Replacement for (deprecated) `componentWillReceiveProps`.
*
* @optional
*/
UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',
/**
* Replacement for (deprecated) `componentWillUpdate`.
*
* @optional
*/
UNSAFE_componentWillUpdate: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Similar to ReactClassInterface but for static methods.
*/
var ReactClassStaticInterface = {
/**
* This method is invoked after a component is instantiated and when it
* receives new props. Return an object to update state in response to
* prop changes. Return null to indicate no change to state.
*
* If an object is returned, its keys will be merged into the existing state.
*
* @return {object || null}
* @optional
*/
getDerivedStateFromProps: 'DEFINE_MANY_MERGED'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function(Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function(Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function(Constructor, childContextTypes) {
if (false) {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign(
{},
Constructor.childContextTypes,
childContextTypes
);
},
contextTypes: function(Constructor, contextTypes) {
if (false) {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign(
{},
Constructor.contextTypes,
contextTypes
);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function(Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(
Constructor.getDefaultProps,
getDefaultProps
);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function(Constructor, propTypes) {
if (false) {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function(Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function() {}
};
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an _invariant so components
// don't show up in prod but only in __DEV__
if (false) {
warning(
typeof typeDef[propName] === 'function',
'%s: %s type `%s` is invalid; it must be a function, usually from ' +
'React.PropTypes.',
Constructor.displayName || 'ReactClass',
ReactPropTypeLocationNames[location],
propName
);
}
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name)
? ReactClassInterface[name]
: null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
_invariant(
specPolicy === 'OVERRIDE_BASE',
'ReactClassInterface: You are attempting to override ' +
'`%s` from your class specification. Ensure that your method names ' +
'do not overlap with React methods.',
name
);
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
_invariant(
specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
'ReactClassInterface: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be due ' +
'to a mixin.',
name
);
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if (false) {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
if (process.env.NODE_ENV !== 'production') {
warning(
isMixinValid,
"%s: You're attempting to include a mixin that is either null " +
'or not an object. Check the mixins included by the component, ' +
'as well as any mixins they include themselves. ' +
'Expected object but got %s.',
Constructor.displayName || 'ReactClass',
spec === null ? null : typeofSpec
);
}
}
return;
}
_invariant(
typeof spec !== 'function',
"ReactClass: You're attempting to " +
'use a component class or function as a mixin. Instead, just use a ' +
'regular object.'
);
_invariant(
!isValidElement(spec),
"ReactClass: You're attempting to " +
'use a component as a mixin. Instead, just use a regular object.'
);
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind =
isFunction &&
!isReactClassMethod &&
!isAlreadyDefined &&
spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
_invariant(
isReactClassMethod &&
(specPolicy === 'DEFINE_MANY_MERGED' ||
specPolicy === 'DEFINE_MANY'),
'ReactClass: Unexpected spec policy %s for key %s ' +
'when mixing in component specs.',
specPolicy,
name
);
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (false) {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
_invariant(
!isReserved,
'ReactClass: You are attempting to define a reserved ' +
'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
'as an instance property instead; it will still be accessible on the ' +
'constructor.',
name
);
var isAlreadyDefined = name in Constructor;
if (isAlreadyDefined) {
var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)
? ReactClassStaticInterface[name]
: null;
_invariant(
specPolicy === 'DEFINE_MANY_MERGED',
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);
Constructor[name] = createMergedResultFunction(Constructor[name], property);
return;
}
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
_invariant(
one && two && typeof one === 'object' && typeof two === 'object',
'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
);
for (var key in two) {
if (two.hasOwnProperty(key)) {
_invariant(
one[key] === undefined,
'mergeIntoWithNoDuplicateKeys(): ' +
'Tried to merge two objects with the same key: `%s`. This conflict ' +
'may be due to a mixin; in particular, this may be caused by two ' +
'getInitialState() or getDefaultProps() methods returning objects ' +
'with clashing keys.',
key
);
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if (false) {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function(newThis) {
for (
var _len = arguments.length,
args = Array(_len > 1 ? _len - 1 : 0),
_key = 1;
_key < _len;
_key++
) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
if (process.env.NODE_ENV !== 'production') {
warning(
false,
'bind(): React component methods may only be bound to the ' +
'component instance. See %s',
componentName
);
}
} else if (!args.length) {
if (process.env.NODE_ENV !== 'production') {
warning(
false,
'bind(): You are binding a component method to the component. ' +
'React does this for you automatically in a high-performance ' +
'way, so you can safely remove this call. See %s',
componentName
);
}
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
var IsMountedPreMixin = {
componentDidMount: function() {
this.__isMounted = true;
}
};
var IsMountedPostMixin = {
componentWillUnmount: function() {
this.__isMounted = false;
}
};
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function(newState, callback) {
this.updater.enqueueReplaceState(this, newState, callback);
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function() {
if (false) {
warning(
this.__didWarnIsMounted,
'%s: isMounted is deprecated. Instead, make sure to clean up ' +
'subscriptions and pending requests in componentWillUnmount to ' +
'prevent memory leaks.',
(this.constructor && this.constructor.displayName) ||
this.name ||
'Component'
);
this.__didWarnIsMounted = true;
}
return !!this.__isMounted;
}
};
var ReactClassComponent = function() {};
_assign(
ReactClassComponent.prototype,
ReactComponent.prototype,
ReactClassMixin
);
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
function createClass(spec) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(function(props, context, updater) {
// This constructor gets overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if (false) {
warning(
this instanceof Constructor,
'Something is calling a React component directly. Use a factory or ' +
'JSX instead. See: https://fb.me/react-legacyfactory'
);
}
// Wire up auto-binding
if (this.__reactAutoBindPairs.length) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (false) {
// We allow auto-mocks to proceed as if they're returning null.
if (
initialState === undefined &&
this.getInitialState._isMockFunction
) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
_invariant(
typeof initialState === 'object' && !Array.isArray(initialState),
'%s.getInitialState(): must return an object or null',
Constructor.displayName || 'ReactCompositeComponent'
);
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, IsMountedPreMixin);
mixSpecIntoComponent(Constructor, spec);
mixSpecIntoComponent(Constructor, IsMountedPostMixin);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (false) {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
_invariant(
Constructor.prototype.render,
'createClass(...): Class specification must implement a `render` method.'
);
if (false) {
warning(
!Constructor.prototype.componentShouldUpdate,
'%s has a method called ' +
'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
'The name is phrased as a question because the function is ' +
'expected to return a value.',
spec.displayName || 'A component'
);
warning(
!Constructor.prototype.componentWillRecieveProps,
'%s has a method called ' +
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
spec.displayName || 'A component'
);
warning(
!Constructor.prototype.UNSAFE_componentWillRecieveProps,
'%s has a method called UNSAFE_componentWillRecieveProps(). ' +
'Did you mean UNSAFE_componentWillReceiveProps()?',
spec.displayName || 'A component'
);
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
}
return createClass;
}
module.exports = factory;
/***/ }),
/***/ 1011:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-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.
*
*/
var emptyObject = {};
if (false) {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/***/ }),
/***/ 1012:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-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.
*
*/
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (false) {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
/***/ }),
/***/ 1013:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var ReactIs = __webpack_require__(1004);
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;
function getStatics(component) {
if (ReactIs.isMemo(component)) {
return MEMO_STATICS;
}
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
return targetComponent;
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
/***/ }),
/***/ 1014:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/** @license React v16.8.6
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports,"__esModule",{value:!0});
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):
60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
exports.isSuspense=function(a){return t(a)===p};
/***/ }),
/***/ 1032:
/***/ (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__(1033);
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;
/***/ }),
/***/ 1033:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-form{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\"}.ant-form legend{display:block;width:100%;margin-bottom:20px;padding:0;color:rgba(0,0,0,.45);font-size:16px;line-height:inherit;border:0;border-bottom:1px solid #d9d9d9}.ant-form label{font-size:14px}.ant-form input[type=search]{-webkit-box-sizing:border-box;box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{display:block;padding-top:15px;color:rgba(0,0,0,.65);font-size:14px;line-height:1.5}.ant-form-item-required:before{display:inline-block;margin-right:4px;color:#f5222d;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:\"*\"}.ant-form-hide-required-mark .ant-form-item-required:before{display:none}.ant-form-item-label>label{color:rgba(0,0,0,.85)}.ant-form-item-label>label:after{content:\":\";position:relative;top:-.5px;margin:0 8px 0 2px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:\" \"}.ant-form-item{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";margin-bottom:24px;vertical-align:top}.ant-form-item label{position:relative}.ant-form-item label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-control{position:relative;line-height:40px;zoom:1}.ant-form-item-control:after,.ant-form-item-control:before{display:table;content:\"\"}.ant-form-item-control:after{clear:both}.ant-form-item-children{position:relative}.ant-form-item-with-help{margin-bottom:5px}.ant-form-item-label{display:inline-block;overflow:hidden;line-height:39.9999px;white-space:nowrap;text-align:right;vertical-align:middle}.ant-form-item-label-left{text-align:left}.ant-form-item .ant-switch{margin:2px 0 4px}.ant-form-explain,.ant-form-extra{clear:both;min-height:22px;margin-top:-2px;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5;-webkit-transition:color .3s cubic-bezier(.215,.61,.355,1);-o-transition:color .3s cubic-bezier(.215,.61,.355,1);transition:color .3s cubic-bezier(.215,.61,.355,1)}.ant-form-explain{margin-bottom:-1px}.ant-form-extra{padding-top:4px}.ant-form-text{display:inline-block;padding-right:8px}.ant-form-split{display:block;text-align:center}form .has-feedback .ant-input{padding-right:30px}form .has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-right:18px}form .has-feedback .ant-input-affix-wrapper .ant-input{padding-right:49px}form .has-feedback .ant-input-affix-wrapper.ant-input-affix-wrapper-input-with-clear-btn .ant-input{padding-right:68px}form .has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,form .has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection__clear,form .has-feedback>.ant-select .ant-select-arrow,form .has-feedback>.ant-select .ant-select-selection__clear{right:28px}form .has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,form .has-feedback>.ant-select .ant-select-selection-selected-value{padding-right:42px}form .has-feedback .ant-cascader-picker-arrow{margin-right:17px}form .has-feedback .ant-calendar-picker-clear,form .has-feedback .ant-calendar-picker-icon,form .has-feedback .ant-cascader-picker-clear,form .has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix,form .has-feedback .ant-time-picker-clear,form .has-feedback .ant-time-picker-icon{right:28px}form .ant-mentions,form textarea.ant-input{
// exports
/***/ }),
/***/ 1034:
/***/ (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 _classnames = _interopRequireDefault(__webpack_require__(3));
var _createDOMForm = _interopRequireDefault(__webpack_require__(1035));
var _createFormField = _interopRequireDefault(__webpack_require__(929));
var _omit = _interopRequireDefault(__webpack_require__(43));
var _configProvider = __webpack_require__(12);
var _type = __webpack_require__(70);
var _warning = _interopRequireDefault(__webpack_require__(40));
var _FormItem = _interopRequireDefault(__webpack_require__(1067));
var _constants = __webpack_require__(930);
var _context = _interopRequireDefault(__webpack_require__(931));
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 FormLayouts = (0, _type.tuple)('horizontal', 'inline', 'vertical');
var Form =
/*#__PURE__*/
function (_React$Component) {
_inherits(Form, _React$Component);
function Form(props) {
var _this;
_classCallCheck(this, Form);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Form).call(this, props));
_this.renderForm = function (_ref) {
var _classNames;
var getPrefixCls = _ref.getPrefixCls;
var _this$props = _this.props,
customizePrefixCls = _this$props.prefixCls,
hideRequiredMark = _this$props.hideRequiredMark,
_this$props$className = _this$props.className,
className = _this$props$className === void 0 ? '' : _this$props$className,
layout = _this$props.layout;
var prefixCls = getPrefixCls('form', customizePrefixCls);
var formClassName = (0, _classnames["default"])(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-horizontal"), layout === 'horizontal'), _defineProperty(_classNames, "".concat(prefixCls, "-vertical"), layout === 'vertical'), _defineProperty(_classNames, "".concat(prefixCls, "-inline"), layout === 'inline'), _defineProperty(_classNames, "".concat(prefixCls, "-hide-required-mark"), hideRequiredMark), _classNames), className);
var formProps = (0, _omit["default"])(_this.props, ['prefixCls', 'className', 'layout', 'form', 'hideRequiredMark', 'wrapperCol', 'labelAlign', 'labelCol', 'colon']);
return React.createElement("form", _extends({}, formProps, {
className: formClassName
}));
};
(0, _warning["default"])(!props.form, 'Form', 'It is unnecessary to pass `form` to `Form` after antd@1.7.0.');
return _this;
}
_createClass(Form, [{
key: "render",
value: function render() {
var _this$props2 = this.props,
wrapperCol = _this$props2.wrapperCol,
labelAlign = _this$props2.labelAlign,
labelCol = _this$props2.labelCol,
layout = _this$props2.layout,
colon = _this$props2.colon;
return React.createElement(_context["default"].Provider, {
value: {
wrapperCol: wrapperCol,
labelAlign: labelAlign,
labelCol: labelCol,
vertical: layout === 'vertical',
colon: colon
}
}, React.createElement(_configProvider.ConfigConsumer, null, this.renderForm));
}
}]);
return Form;
}(React.Component);
exports["default"] = Form;
Form.defaultProps = {
colon: true,
layout: 'horizontal',
hideRequiredMark: false,
onSubmit: function onSubmit(e) {
e.preventDefault();
}
};
Form.propTypes = {
prefixCls: PropTypes.string,
layout: PropTypes.oneOf(FormLayouts),
children: PropTypes.any,
onSubmit: PropTypes.func,
hideRequiredMark: PropTypes.bool,
colon: PropTypes.bool
};
Form.Item = _FormItem["default"];
Form.createFormField = _createFormField["default"];
Form.create = function create() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return (0, _createDOMForm["default"])(_extends(_extends({
fieldNameProp: 'id'
}, options), {
fieldMetaProp: _constants.FIELD_META_PROP,
fieldDataProp: _constants.FIELD_DATA_PROP
}));
};
//# sourceMappingURL=Form.js.map
/***/ }),
/***/ 1035:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(18);
var _extends3 = _interopRequireDefault(_extends2);
var _reactDom = __webpack_require__(4);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _domScrollIntoView = __webpack_require__(183);
var _domScrollIntoView2 = _interopRequireDefault(_domScrollIntoView);
var _has = __webpack_require__(1036);
var _has2 = _interopRequireDefault(_has);
var _createBaseForm = __webpack_require__(926);
var _createBaseForm2 = _interopRequireDefault(_createBaseForm);
var _createForm = __webpack_require__(1066);
var _utils = __webpack_require__(896);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function computedStyle(el, prop) {
var getComputedStyle = window.getComputedStyle;
var style =
// If we have getComputedStyle
getComputedStyle ?
// Query it
// TODO: From CSS-Query notes, we might need (node, null) for FF
getComputedStyle(el) :
// Otherwise, we are in IE and use currentStyle
el.currentStyle;
if (style) {
return style[
// Switch to camelCase for CSSOM
// DEV: Grabbed from jQuery
// https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
// https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
prop.replace(/-(\w)/gi, function (word, letter) {
return letter.toUpperCase();
})];
}
return undefined;
}
function getScrollableContainer(n) {
var node = n;
var nodeName = void 0;
/* eslint no-cond-assign:0 */
while ((nodeName = node.nodeName.toLowerCase()) !== 'body') {
var overflowY = computedStyle(node, 'overflowY');
// https://stackoverflow.com/a/36900407/3040605
if (node !== n && (overflowY === 'auto' || overflowY === 'scroll') && node.scrollHeight > node.clientHeight) {
return node;
}
node = node.parentNode;
}
return nodeName === 'body' ? node.ownerDocument : node;
}
var mixin = {
getForm: function getForm() {
return (0, _extends3['default'])({}, _createForm.mixin.getForm.call(this), {
validateFieldsAndScroll: this.validateFieldsAndScroll
});
},
validateFieldsAndScroll: function validateFieldsAndScroll(ns, opt, cb) {
var _this = this;
var _getParams = (0, _utils.getParams)(ns, opt, cb),
names = _getParams.names,
callback = _getParams.callback,
options = _getParams.options;
var newCb = function newCb(error, values) {
if (error) {
var validNames = _this.fieldsStore.getValidFieldsName();
var firstNode = void 0;
var firstTop = void 0;
validNames.forEach(function (name) {
if ((0, _has2['default'])(error, name)) {
var instance = _this.getFieldInstance(name);
if (instance) {
var node = _reactDom2['default'].findDOMNode(instance);
var top = node.getBoundingClientRect().top;
if (node.type !== 'hidden' && (firstTop === undefined || firstTop > top)) {
firstTop = top;
firstNode = node;
}
}
}
});
if (firstNode) {
var c = options.container || getScrollableContainer(firstNode);
(0, _domScrollIntoView2['default'])(firstNode, c, (0, _extends3['default'])({
onlyScrollIfNeeded: true
}, options.scroll));
}
}
if (typeof callback === 'function') {
callback(error, values);
}
};
return this.validateFields(names, options, newCb);
}
};
function createDOMForm(option) {
return (0, _createBaseForm2['default'])((0, _extends3['default'])({}, option), [mixin]);
}
exports['default'] = createDOMForm;
module.exports = exports['default'];
/***/ }),
/***/ 1036:
/***/ (function(module, exports, __webpack_require__) {
var baseHas = __webpack_require__(1037),
hasPath = __webpack_require__(935);
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
module.exports = has;
/***/ }),
/***/ 1037:
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
module.exports = baseHas;
/***/ }),
/***/ 1038:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(__webpack_require__(0));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var unsafeLifecyclesPolyfill = function unsafeLifecyclesPolyfill(Component) {
var prototype = Component.prototype;
if (!prototype || !prototype.isReactComponent) {
throw new Error('Can only polyfill class components');
} // only handle componentWillReceiveProps
if (typeof prototype.componentWillReceiveProps !== 'function') {
return Component;
} // In React 16.9, React.Profiler was introduced together with UNSAFE_componentWillReceiveProps
// https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#performance-measurements-with-reactprofiler
if (!_react.default.Profiler) {
return Component;
} // Here polyfill get started
prototype.UNSAFE_componentWillReceiveProps = prototype.componentWillReceiveProps;
delete prototype.componentWillReceiveProps;
return Component;
};
var _default = unsafeLifecyclesPolyfill;
exports.default = _default;
/***/ }),
/***/ 1039:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _util = __webpack_require__(874);
var _validator = __webpack_require__(1040);
var _validator2 = _interopRequireDefault(_validator);
var _messages2 = __webpack_require__(1060);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Encapsulates a validation schema.
*
* @param descriptor An object declaring validation rules
* for this schema.
*/
function Schema(descriptor) {
this.rules = null;
this._messages = _messages2.messages;
this.define(descriptor);
}
Schema.prototype = {
messages: function messages(_messages) {
if (_messages) {
this._messages = (0, _util.deepMerge)((0, _messages2.newMessages)(), _messages);
}
return this._messages;
},
define: function define(rules) {
if (!rules) {
throw new Error('Cannot configure a schema with no rules');
}
if ((typeof rules === 'undefined' ? 'undefined' : _typeof(rules)) !== 'object' || Array.isArray(rules)) {
throw new Error('Rules must be an object');
}
this.rules = {};
var z = void 0;
var item = void 0;
for (z in rules) {
if (rules.hasOwnProperty(z)) {
item = rules[z];
this.rules[z] = Array.isArray(item) ? item : [item];
}
}
},
validate: function validate(source_) {
var _this = this;
var o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var oc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
var source = source_;
var options = o;
var callback = oc;
if (typeof options === 'function') {
callback = options;
options = {};
}
if (!this.rules || Object.keys(this.rules).length === 0) {
if (callback) {
callback();
}
return Promise.resolve();
}
function complete(results) {
var i = void 0;
var errors = [];
var fields = {};
function add(e) {
if (Array.isArray(e)) {
var _errors;
errors = (_errors = errors).concat.apply(_errors, e);
} else {
errors.push(e);
}
}
for (i = 0; i < results.length; i++) {
add(results[i]);
}
if (!errors.length) {
errors = null;
fields = null;
} else {
fields = (0, _util.convertFieldsError)(errors);
}
callback(errors, fields);
}
if (options.messages) {
var messages = this.messages();
if (messages === _messages2.messages) {
messages = (0, _messages2.newMessages)();
}
(0, _util.deepMerge)(messages, options.messages);
options.messages = messages;
} else {
options.messages = this.messages();
}
var arr = void 0;
var value = void 0;
var series = {};
var keys = options.keys || Object.keys(this.rules);
keys.forEach(function (z) {
arr = _this.rules[z];
value = source[z];
arr.forEach(function (r) {
var rule = r;
if (typeof rule.transform === 'function') {
if (source === source_) {
source = _extends({}, source);
}
value = source[z] = rule.transform(value);
}
if (typeof rule === 'function') {
rule = {
validator: rule
};
} else {
rule = _extends({}, rule);
}
rule.validator = _this.getValidationMethod(rule);
rule.field = z;
rule.fullField = rule.fullField || z;
rule.type = _this.getType(rule);
if (!rule.validator) {
return;
}
series[z] = series[z] || [];
series[z].push({
rule: rule,
value: value,
source: source,
field: z
});
});
});
var errorFields = {};
return (0, _util.asyncMap)(series, options, function (data, doIt) {
var rule = data.rule;
var deep = (rule.type === 'object' || rule.type === 'array') && (_typeof(rule.fields) === 'object' || _typeof(rule.defaultField) === 'object');
deep = deep && (rule.required || !rule.required && data.value);
rule.field = data.field;
function addFullfield(key, schema) {
return _extends({}, schema, {
fullField: rule.fullField + '.' + key
});
}
function cb() {
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var errors = e;
if (!Array.isArray(errors)) {
errors = [errors];
}
if (!options.suppressWarning && errors.length) {
Schema.warning('async-validator:', errors);
}
if (errors.length && rule.message) {
errors = [].concat(rule.message);
}
errors = errors.map((0, _util.complementError)(rule));
if (options.first && errors.length) {
errorFields[rule.field] = 1;
return doIt(errors);
}
if (!deep) {
doIt(errors);
} else {
// if rule is required but the target object
// does not exist fail at the rule level and don't
// go deeper
if (rule.required && !data.value) {
if (rule.message) {
errors = [].concat(rule.message).map((0, _util.complementError)(rule));
} else if (options.error) {
errors = [options.error(rule, (0, _util.format)(options.messages.required, rule.field))];
} else {
errors = [];
}
return doIt(errors);
}
var fieldsSchema = {};
if (rule.defaultField) {
for (var k in data.value) {
if (data.value.hasOwnProperty(k)) {
fieldsSchema[k] = rule.defaultField;
}
}
}
fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
for (var f in fieldsSchema) {
if (fieldsSchema.hasOwnProperty(f)) {
var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
}
}
var schema = new Schema(fieldsSchema);
schema.messages(options.messages);
if (data.rule.options) {
data.rule.options.messages = options.messages;
data.rule.options.error = options.error;
}
schema.validate(data.value, data.rule.options || options, function (errs) {
var finalErrors = [];
if (errors && errors.length) {
finalErrors.push.apply(finalErrors, errors);
}
if (errs && errs.length) {
finalErrors.push.apply(finalErrors, errs);
}
doIt(finalErrors.length ? finalErrors : null);
});
}
}
var res = void 0;
if (rule.asyncValidator) {
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
} else if (rule.validator) {
res = rule.validator(rule, data.value, cb, data.source, options);
if (res === true) {
cb();
} else if (res === false) {
cb(rule.message || rule.field + ' fails');
} else if (res instanceof Array) {
cb(res);
} else if (res instanceof Error) {
cb(res.message);
}
}
if (res && res.then) {
res.then(function () {
return cb();
}, function (e) {
return cb(e);
});
}
}, function (results) {
complete(results);
});
},
getType: function getType(rule) {
if (rule.type === undefined && rule.pattern instanceof RegExp) {
rule.type = 'pattern';
}
if (typeof rule.validator !== 'function' && rule.type && !_validator2['default'].hasOwnProperty(rule.type)) {
throw new Error((0, _util.format)('Unknown rule type %s', rule.type));
}
return rule.type || 'string';
},
getValidationMethod: function getValidationMethod(rule) {
if (typeof rule.validator === 'function') {
return rule.validator;
}
var keys = Object.keys(rule);
var messageIndex = keys.indexOf('message');
if (messageIndex !== -1) {
keys.splice(messageIndex, 1);
}
if (keys.length === 1 && keys[0] === 'required') {
return _validator2['default'].required;
}
return _validator2['default'][this.getType(rule)] || false;
}
};
Schema.register = function register(type, validator) {
if (typeof validator !== 'function') {
throw new Error('Cannot register a validator by type, validator is not a function');
}
_validator2['default'][type] = validator;
};
Schema.warning = _util.warning;
Schema.messages = _messages2.messages;
exports['default'] = Schema;
/***/ }),
/***/ 1040:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _string = __webpack_require__(1041);
var _string2 = _interopRequireDefault(_string);
var _method = __webpack_require__(1047);
var _method2 = _interopRequireDefault(_method);
var _number = __webpack_require__(1048);
var _number2 = _interopRequireDefault(_number);
var _boolean = __webpack_require__(1049);
var _boolean2 = _interopRequireDefault(_boolean);
var _regexp = __webpack_require__(1050);
var _regexp2 = _interopRequireDefault(_regexp);
var _integer = __webpack_require__(1051);
var _integer2 = _interopRequireDefault(_integer);
var _float = __webpack_require__(1052);
var _float2 = _interopRequireDefault(_float);
var _array = __webpack_require__(1053);
var _array2 = _interopRequireDefault(_array);
var _object = __webpack_require__(1054);
var _object2 = _interopRequireDefault(_object);
var _enum = __webpack_require__(1055);
var _enum2 = _interopRequireDefault(_enum);
var _pattern = __webpack_require__(1056);
var _pattern2 = _interopRequireDefault(_pattern);
var _date = __webpack_require__(1057);
var _date2 = _interopRequireDefault(_date);
var _required = __webpack_require__(1058);
var _required2 = _interopRequireDefault(_required);
var _type = __webpack_require__(1059);
var _type2 = _interopRequireDefault(_type);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = {
string: _string2['default'],
method: _method2['default'],
number: _number2['default'],
boolean: _boolean2['default'],
regexp: _regexp2['default'],
integer: _integer2['default'],
float: _float2['default'],
array: _array2['default'],
object: _object2['default'],
'enum': _enum2['default'],
pattern: _pattern2['default'],
date: _date2['default'],
url: _type2['default'],
hex: _type2['default'],
email: _type2['default'],
required: _required2['default']
};
/***/ }),
/***/ 1041:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Performs validation for string types.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function string(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options, 'string');
if (!(0, _util.isEmptyValue)(value, 'string')) {
_rule2['default'].type(rule, value, source, errors, options);
_rule2['default'].range(rule, value, source, errors, options);
_rule2['default'].pattern(rule, value, source, errors, options);
if (rule.whitespace === true) {
_rule2['default'].whitespace(rule, value, source, errors, options);
}
}
}
callback(errors);
}
exports['default'] = string;
/***/ }),
/***/ 1042:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(874);
var util = _interopRequireWildcard(_util);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
/**
* Rule for validating whitespace.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function whitespace(rule, value, source, errors, options) {
if (/^\s+$/.test(value) || value === '') {
errors.push(util.format(options.messages.whitespace, rule.fullField));
}
}
exports['default'] = whitespace;
/***/ }),
/***/ 1043:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _util = __webpack_require__(874);
var util = _interopRequireWildcard(_util);
var _required = __webpack_require__(927);
var _required2 = _interopRequireDefault(_required);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
/* eslint max-len:0 */
var pattern = {
// http://emailregex.com/
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
url: new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i'),
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
};
var types = {
integer: function integer(value) {
return types.number(value) && parseInt(value, 10) === value;
},
float: function float(value) {
return types.number(value) && !types.integer(value);
},
array: function array(value) {
return Array.isArray(value);
},
regexp: function regexp(value) {
if (value instanceof RegExp) {
return true;
}
try {
return !!new RegExp(value);
} catch (e) {
return false;
}
},
date: function date(value) {
return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
},
number: function number(value) {
if (isNaN(value)) {
return false;
}
return typeof value === 'number';
},
object: function object(value) {
return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !types.array(value);
},
method: function method(value) {
return typeof value === 'function';
},
email: function email(value) {
return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
},
url: function url(value) {
return typeof value === 'string' && !!value.match(pattern.url);
},
hex: function hex(value) {
return typeof value === 'string' && !!value.match(pattern.hex);
}
};
/**
* Rule for validating the type of a value.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function type(rule, value, source, errors, options) {
if (rule.required && value === undefined) {
(0, _required2['default'])(rule, value, source, errors, options);
return;
}
var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
var ruleType = rule.type;
if (custom.indexOf(ruleType) > -1) {
if (!types[ruleType](value)) {
errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));
}
// straight typeof check
} else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {
errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));
}
}
exports['default'] = type;
/***/ }),
/***/ 1044:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(874);
var util = _interopRequireWildcard(_util);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
/**
* Rule for validating minimum and maximum allowed values.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function range(rule, value, source, errors, options) {
var len = typeof rule.len === 'number';
var min = typeof rule.min === 'number';
var max = typeof rule.max === 'number';
// 正则匹配码点范围从U+010000一直到U+10FFFF的文字补充平面Supplementary Plane
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var val = value;
var key = null;
var num = typeof value === 'number';
var str = typeof value === 'string';
var arr = Array.isArray(value);
if (num) {
key = 'number';
} else if (str) {
key = 'string';
} else if (arr) {
key = 'array';
}
// if the value is not of a supported type for range validation
// the validation rule rule should use the
// type property to also test for a particular type
if (!key) {
return false;
}
if (arr) {
val = value.length;
}
if (str) {
// 处理码点大于U+010000的文字length属性不准确的bug如"𠮷𠮷𠮷".lenght !== 3
val = value.replace(spRegexp, '_').length;
}
if (len) {
if (val !== rule.len) {
errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));
}
} else if (min && !max && val < rule.min) {
errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));
} else if (max && !min && val > rule.max) {
errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));
} else if (min && max && (val < rule.min || val > rule.max)) {
errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));
}
}
exports['default'] = range;
/***/ }),
/***/ 1045:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(874);
var util = _interopRequireWildcard(_util);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
var ENUM = 'enum';
/**
* Rule for validating a value exists in an enumerable list.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function enumerable(rule, value, source, errors, options) {
rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
if (rule[ENUM].indexOf(value) === -1) {
errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
}
}
exports['default'] = enumerable;
/***/ }),
/***/ 1046:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(874);
var util = _interopRequireWildcard(_util);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
/**
* Rule for validating a regular expression pattern.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function pattern(rule, value, source, errors, options) {
if (rule.pattern) {
if (rule.pattern instanceof RegExp) {
// if a RegExp instance is passed, reset `lastIndex` in case its `global`
// flag is accidentally set to `true`, which in a validation scenario
// is not necessary and the result might be misleading
rule.pattern.lastIndex = 0;
if (!rule.pattern.test(value)) {
errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
} else if (typeof rule.pattern === 'string') {
var _pattern = new RegExp(rule.pattern);
if (!_pattern.test(value)) {
errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
}
}
}
exports['default'] = pattern;
/***/ }),
/***/ 1047:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates a function.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function method(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value !== undefined) {
_rule2['default'].type(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = method;
/***/ }),
/***/ 1048:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates a number.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function number(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (value === '') {
value = undefined;
}
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value !== undefined) {
_rule2['default'].type(rule, value, source, errors, options);
_rule2['default'].range(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = number;
/***/ }),
/***/ 1049:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(874);
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates a boolean.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function boolean(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value !== undefined) {
_rule2['default'].type(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = boolean;
/***/ }),
/***/ 1050:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates the regular expression type.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function regexp(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (!(0, _util.isEmptyValue)(value)) {
_rule2['default'].type(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = regexp;
/***/ }),
/***/ 1051:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates a number is an integer.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function integer(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value !== undefined) {
_rule2['default'].type(rule, value, source, errors, options);
_rule2['default'].range(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = integer;
/***/ }),
/***/ 1052:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates a number is a floating point number.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function floatFn(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value !== undefined) {
_rule2['default'].type(rule, value, source, errors, options);
_rule2['default'].range(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = floatFn;
/***/ }),
/***/ 1053:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates an array.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function array(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value, 'array') && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options, 'array');
if (!(0, _util.isEmptyValue)(value, 'array')) {
_rule2['default'].type(rule, value, source, errors, options);
_rule2['default'].range(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = array;
/***/ }),
/***/ 1054:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates an object.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function object(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value !== undefined) {
_rule2['default'].type(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = object;
/***/ }),
/***/ 1055:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ENUM = 'enum';
/**
* Validates an enumerable list.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function enumerable(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value) {
_rule2['default'][ENUM](rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = enumerable;
/***/ }),
/***/ 1056:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Validates a regular expression pattern.
*
* Performs validation when a rule only contains
* a pattern property but is not declared as a string type.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function pattern(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (!(0, _util.isEmptyValue)(value, 'string')) {
_rule2['default'].pattern(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = pattern;
/***/ }),
/***/ 1057:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function date(rule, value, callback, source, options) {
// console.log('integer rule called %j', rule);
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
// console.log('validate on %s value', value);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (!(0, _util.isEmptyValue)(value)) {
var dateObject = void 0;
if (typeof value === 'number') {
dateObject = new Date(value);
} else {
dateObject = value;
}
_rule2['default'].type(rule, dateObject, source, errors, options);
if (dateObject) {
_rule2['default'].range(rule, dateObject.getTime(), source, errors, options);
}
}
}
callback(errors);
}
exports['default'] = date;
/***/ }),
/***/ 1058:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function required(rule, value, callback, source, options) {
var errors = [];
var type = Array.isArray(value) ? 'array' : typeof value === 'undefined' ? 'undefined' : _typeof(value);
_rule2['default'].required(rule, value, source, errors, options, type);
callback(errors);
}
exports['default'] = required;
/***/ }),
/***/ 1059:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = __webpack_require__(875);
var _rule2 = _interopRequireDefault(_rule);
var _util = __webpack_require__(874);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function type(rule, value, callback, source, options) {
var ruleType = rule.type;
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value, ruleType) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options, ruleType);
if (!(0, _util.isEmptyValue)(value, ruleType)) {
_rule2['default'].type(rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = type;
/***/ }),
/***/ 1060:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.newMessages = newMessages;
function newMessages() {
return {
'default': 'Validation error on field %s',
required: '%s is required',
'enum': '%s must be one of %s',
whitespace: '%s cannot be empty',
date: {
format: '%s date %s is invalid for format %s',
parse: '%s date could not be parsed, %s is invalid ',
invalid: '%s date %s is invalid'
},
types: {
string: '%s is not a %s',
method: '%s is not a %s (function)',
array: '%s is not an %s',
object: '%s is not an %s',
number: '%s is not a %s',
date: '%s is not a %s',
boolean: '%s is not a %s',
integer: '%s is not an %s',
float: '%s is not a %s',
regexp: '%s is not a valid %s',
email: '%s is not a valid %s',
url: '%s is not a valid %s',
hex: '%s is not a valid %s'
},
string: {
len: '%s must be exactly %s characters',
min: '%s must be at least %s characters',
max: '%s cannot be longer than %s characters',
range: '%s must be between %s and %s characters'
},
number: {
len: '%s must equal %s',
min: '%s cannot be less than %s',
max: '%s cannot be greater than %s',
range: '%s must be between %s and %s'
},
array: {
len: '%s must be exactly %s in length',
min: '%s cannot be less than %s in length',
max: '%s cannot be greater than %s in length',
range: '%s must be between %s and %s in length'
},
pattern: {
mismatch: '%s value %s does not match pattern %s'
},
clone: function clone() {
var cloned = JSON.parse(JSON.stringify(this));
cloned.clone = this.clone;
return cloned;
}
};
}
var messages = exports.messages = newMessages();
/***/ }),
/***/ 1061:
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(1062),
castPath = __webpack_require__(887),
isIndex = __webpack_require__(894),
isObject = __webpack_require__(171),
toKey = __webpack_require__(882);
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
module.exports = baseSet;
/***/ }),
/***/ 1062:
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(1063),
eq = __webpack_require__(884);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ }),
/***/ 1063:
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(1064);
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ }),
/***/ 1064:
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(878);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/***/ 1065:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(59);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _extends2 = __webpack_require__(18);
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = __webpack_require__(9);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(31);
var _createClass3 = _interopRequireDefault(_createClass2);
exports['default'] = createFieldsStore;
var _set = __webpack_require__(928);
var _set2 = _interopRequireDefault(_set);
var _createFormField = __webpack_require__(929);
var _createFormField2 = _interopRequireDefault(_createFormField);
var _utils = __webpack_require__(896);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function partOf(a, b) {
return b.indexOf(a) === 0 && ['.', '['].indexOf(b[a.length]) !== -1;
}
function internalFlattenFields(fields) {
return (0, _utils.flattenFields)(fields, function (_, node) {
return (0, _createFormField.isFormField)(node);
}, 'You must wrap field data with `createFormField`.');
}
var FieldsStore = function () {
function FieldsStore(fields) {
(0, _classCallCheck3['default'])(this, FieldsStore);
_initialiseProps.call(this);
this.fields = internalFlattenFields(fields);
this.fieldsMeta = {};
}
(0, _createClass3['default'])(FieldsStore, [{
key: 'updateFields',
value: function updateFields(fields) {
this.fields = internalFlattenFields(fields);
}
}, {
key: 'flattenRegisteredFields',
value: function flattenRegisteredFields(fields) {
var validFieldsName = this.getAllFieldsName();
return (0, _utils.flattenFields)(fields, function (path) {
return validFieldsName.indexOf(path) >= 0;
}, 'You cannot set a form field before rendering a field associated with the value.');
}
}, {
key: 'setFields',
value: function setFields(fields) {
var _this = this;
var fieldsMeta = this.fieldsMeta;
var nowFields = (0, _extends3['default'])({}, this.fields, fields);
var nowValues = {};
Object.keys(fieldsMeta).forEach(function (f) {
nowValues[f] = _this.getValueFromFields(f, nowFields);
});
Object.keys(nowValues).forEach(function (f) {
var value = nowValues[f];
var fieldMeta = _this.getFieldMeta(f);
if (fieldMeta && fieldMeta.normalize) {
var nowValue = fieldMeta.normalize(value, _this.getValueFromFields(f, _this.fields), nowValues);
if (nowValue !== value) {
nowFields[f] = (0, _extends3['default'])({}, nowFields[f], {
value: nowValue
});
}
}
});
this.fields = nowFields;
}
}, {
key: 'resetFields',
value: function resetFields(ns) {
var fields = this.fields;
var names = ns ? this.getValidFieldsFullName(ns) : this.getAllFieldsName();
return names.reduce(function (acc, name) {
var field = fields[name];
if (field && 'value' in field) {
acc[name] = {};
}
return acc;
}, {});
}
}, {
key: 'setFieldMeta',
value: function setFieldMeta(name, meta) {
this.fieldsMeta[name] = meta;
}
}, {
key: 'setFieldsAsDirty',
value: function setFieldsAsDirty() {
var _this2 = this;
Object.keys(this.fields).forEach(function (name) {
var field = _this2.fields[name];
var fieldMeta = _this2.fieldsMeta[name];
if (field && fieldMeta && (0, _utils.hasRules)(fieldMeta.validate)) {
_this2.fields[name] = (0, _extends3['default'])({}, field, {
dirty: true
});
}
});
}
}, {
key: 'getFieldMeta',
value: function getFieldMeta(name) {
this.fieldsMeta[name] = this.fieldsMeta[name] || {};
return this.fieldsMeta[name];
}
}, {
key: 'getValueFromFields',
value: function getValueFromFields(name, fields) {
var field = fields[name];
if (field && 'value' in field) {
return field.value;
}
var fieldMeta = this.getFieldMeta(name);
return fieldMeta && fieldMeta.initialValue;
}
}, {
key: 'getValidFieldsName',
value: function getValidFieldsName() {
var _this3 = this;
var fieldsMeta = this.fieldsMeta;
return fieldsMeta ? Object.keys(fieldsMeta).filter(function (name) {
return !_this3.getFieldMeta(name).hidden;
}) : [];
}
}, {
key: 'getAllFieldsName',
value: function getAllFieldsName() {
var fieldsMeta = this.fieldsMeta;
return fieldsMeta ? Object.keys(fieldsMeta) : [];
}
}, {
key: 'getValidFieldsFullName',
value: function getValidFieldsFullName(maybePartialName) {
var maybePartialNames = Array.isArray(maybePartialName) ? maybePartialName : [maybePartialName];
return this.getValidFieldsName().filter(function (fullName) {
return maybePartialNames.some(function (partialName) {
return fullName === partialName || (0, _utils.startsWith)(fullName, partialName) && ['.', '['].indexOf(fullName[partialName.length]) >= 0;
});
});
}
}, {
key: 'getFieldValuePropValue',
value: function getFieldValuePropValue(fieldMeta) {
var name = fieldMeta.name,
getValueProps = fieldMeta.getValueProps,
valuePropName = fieldMeta.valuePropName;
var field = this.getField(name);
var fieldValue = 'value' in field ? field.value : fieldMeta.initialValue;
if (getValueProps) {
return getValueProps(fieldValue);
}
return (0, _defineProperty3['default'])({}, valuePropName, fieldValue);
}
}, {
key: 'getField',
value: function getField(name) {
return (0, _extends3['default'])({}, this.fields[name], {
name: name
});
}
}, {
key: 'getNotCollectedFields',
value: function getNotCollectedFields() {
var _this4 = this;
var fieldsName = this.getValidFieldsName();
return fieldsName.filter(function (name) {
return !_this4.fields[name];
}).map(function (name) {
return {
name: name,
dirty: false,
value: _this4.getFieldMeta(name).initialValue
};
}).reduce(function (acc, field) {
return (0, _set2['default'])(acc, field.name, (0, _createFormField2['default'])(field));
}, {});
}
}, {
key: 'getNestedAllFields',
value: function getNestedAllFields() {
var _this5 = this;
return Object.keys(this.fields).reduce(function (acc, name) {
return (0, _set2['default'])(acc, name, (0, _createFormField2['default'])(_this5.fields[name]));
}, this.getNotCollectedFields());
}
}, {
key: 'getFieldMember',
value: function getFieldMember(name, member) {
return this.getField(name)[member];
}
}, {
key: 'getNestedFields',
value: function getNestedFields(names, getter) {
var fields = names || this.getValidFieldsName();
return fields.reduce(function (acc, f) {
return (0, _set2['default'])(acc, f, getter(f));
}, {});
}
}, {
key: 'getNestedField',
value: function getNestedField(name, getter) {
var fullNames = this.getValidFieldsFullName(name);
if (fullNames.length === 0 || // Not registered
fullNames.length === 1 && fullNames[0] === name // Name already is full name.
) {
return getter(name);
}
var isArrayValue = fullNames[0][name.length] === '[';
var suffixNameStartIndex = isArrayValue ? name.length : name.length + 1;
return fullNames.reduce(function (acc, fullName) {
return (0, _set2['default'])(acc, fullName.slice(suffixNameStartIndex), getter(fullName));
}, isArrayValue ? [] : {});
}
}, {
key: 'isValidNestedFieldName',
// @private
// BG: `a` and `a.b` cannot be use in the same form
value: function isValidNestedFieldName(name) {
var names = this.getAllFieldsName();
return names.every(function (n) {
return !partOf(n, name) && !partOf(name, n);
});
}
}, {
key: 'clearField',
value: function clearField(name) {
delete this.fields[name];
delete this.fieldsMeta[name];
}
}]);
return FieldsStore;
}();
var _initialiseProps = function _initialiseProps() {
var _this6 = this;
this.setFieldsInitialValue = function (initialValues) {
var flattenedInitialValues = _this6.flattenRegisteredFields(initialValues);
var fieldsMeta = _this6.fieldsMeta;
Object.keys(flattenedInitialValues).forEach(function (name) {
if (fieldsMeta[name]) {
_this6.setFieldMeta(name, (0, _extends3['default'])({}, _this6.getFieldMeta(name), {
initialValue: flattenedInitialValues[name]
}));
}
});
};
this.getAllValues = function () {
var fieldsMeta = _this6.fieldsMeta,
fields = _this6.fields;
return Object.keys(fieldsMeta).reduce(function (acc, name) {
return (0, _set2['default'])(acc, name, _this6.getValueFromFields(name, fields));
}, {});
};
this.getFieldsValue = function (names) {
return _this6.getNestedFields(names, _this6.getFieldValue);
};
this.getFieldValue = function (name) {
var fields = _this6.fields;
return _this6.getNestedField(name, function (fullName) {
return _this6.getValueFromFields(fullName, fields);
});
};
this.getFieldsError = function (names) {
return _this6.getNestedFields(names, _this6.getFieldError);
};
this.getFieldError = function (name) {
return _this6.getNestedField(name, function (fullName) {
return (0, _utils.getErrorStrs)(_this6.getFieldMember(fullName, 'errors'));
});
};
this.isFieldValidating = function (name) {
return _this6.getFieldMember(name, 'validating');
};
this.isFieldsValidating = function (ns) {
var names = ns || _this6.getValidFieldsName();
return names.some(function (n) {
return _this6.isFieldValidating(n);
});
};
this.isFieldTouched = function (name) {
return _this6.getFieldMember(name, 'touched');
};
this.isFieldsTouched = function (ns) {
var names = ns || _this6.getValidFieldsName();
return names.some(function (n) {
return _this6.isFieldTouched(n);
});
};
};
function createFieldsStore(fields) {
return new FieldsStore(fields);
}
module.exports = exports['default'];
/***/ }),
/***/ 1066:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mixin = undefined;
var _createBaseForm = __webpack_require__(926);
var _createBaseForm2 = _interopRequireDefault(_createBaseForm);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var mixin = exports.mixin = {
getForm: function getForm() {
return {
getFieldsValue: this.fieldsStore.getFieldsValue,
getFieldValue: this.fieldsStore.getFieldValue,
getFieldInstance: this.getFieldInstance,
setFieldsValue: this.setFieldsValue,
setFields: this.setFields,
setFieldsInitialValue: this.fieldsStore.setFieldsInitialValue,
getFieldDecorator: this.getFieldDecorator,
getFieldProps: this.getFieldProps,
getFieldsError: this.fieldsStore.getFieldsError,
getFieldError: this.fieldsStore.getFieldError,
isFieldValidating: this.fieldsStore.isFieldValidating,
isFieldsValidating: this.fieldsStore.isFieldsValidating,
isFieldsTouched: this.fieldsStore.isFieldsTouched,
isFieldTouched: this.fieldsStore.isFieldTouched,
isSubmitting: this.isSubmitting,
submit: this.submit,
validateFields: this.validateFields,
resetFields: this.resetFields
};
}
};
function createForm(options) {
return (0, _createBaseForm2['default'])(options, [mixin]);
}
exports['default'] = createForm;
/***/ }),
/***/ 1067:
/***/ (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 PropTypes = _interopRequireWildcard(__webpack_require__(1));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _rcAnimate = _interopRequireDefault(__webpack_require__(331));
var _omit = _interopRequireDefault(__webpack_require__(43));
var _row = _interopRequireDefault(__webpack_require__(986));
var _col = _interopRequireDefault(__webpack_require__(987));
var _icon = _interopRequireDefault(__webpack_require__(26));
var _configProvider = __webpack_require__(12);
var _warning = _interopRequireDefault(__webpack_require__(40));
var _type = __webpack_require__(70);
var _constants = __webpack_require__(930);
var _context = _interopRequireDefault(__webpack_require__(931));
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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); }
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; } }
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 ValidateStatuses = (0, _type.tuple)('success', 'warning', 'error', 'validating', '');
var FormLabelAligns = (0, _type.tuple)('left', 'right');
function intersperseSpace(list) {
return list.reduce(function (current, item) {
return [].concat(_toConsumableArray(current), [' ', item]);
}, []).slice(1);
}
var FormItem =
/*#__PURE__*/
function (_React$Component) {
_inherits(FormItem, _React$Component);
function FormItem() {
var _this;
_classCallCheck(this, FormItem);
_this = _possibleConstructorReturn(this, _getPrototypeOf(FormItem).apply(this, arguments));
_this.helpShow = false; // Resolve duplicated ids bug between different forms
// https://github.com/ant-design/ant-design/issues/7351
_this.onLabelClick = function () {
var id = _this.props.id || _this.getId();
if (!id) {
return;
}
var formItemNode = ReactDOM.findDOMNode(_assertThisInitialized(_this));
var control = formItemNode.querySelector("[id=\"".concat(id, "\"]"));
if (control && control.focus) {
control.focus();
}
};
_this.onHelpAnimEnd = function (_key, helpShow) {
_this.helpShow = helpShow;
if (!helpShow) {
_this.setState({});
}
};
_this.renderFormItem = function (_ref) {
var _itemClassName;
var getPrefixCls = _ref.getPrefixCls;
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
style = _a.style,
className = _a.className,
restProps = __rest(_a, ["prefixCls", "style", "className"]);
var prefixCls = getPrefixCls('form', customizePrefixCls);
var children = _this.renderChildren(prefixCls);
var itemClassName = (_itemClassName = {}, _defineProperty(_itemClassName, "".concat(prefixCls, "-item"), true), _defineProperty(_itemClassName, "".concat(prefixCls, "-item-with-help"), _this.helpShow), _defineProperty(_itemClassName, "".concat(className), !!className), _itemClassName);
return React.createElement(_row["default"], _extends({
className: (0, _classnames["default"])(itemClassName),
style: style
}, (0, _omit["default"])(restProps, ['id', 'htmlFor', 'label', 'labelAlign', 'labelCol', 'wrapperCol', 'help', 'extra', 'validateStatus', 'hasFeedback', 'required', 'colon']), {
key: "row"
}), children);
};
return _this;
}
_createClass(FormItem, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this$props = this.props,
children = _this$props.children,
help = _this$props.help,
validateStatus = _this$props.validateStatus,
id = _this$props.id;
(0, _warning["default"])(this.getControls(children, true).length <= 1 || help !== undefined || validateStatus !== undefined, 'Form.Item', 'Cannot generate `validateStatus` and `help` automatically, ' + 'while there are more than one `getFieldDecorator` in it.');
(0, _warning["default"])(!id, 'Form.Item', '`id` is deprecated for its label `htmlFor`. Please use `htmlFor` directly.');
}
}, {
key: "getHelpMessage",
value: function getHelpMessage() {
var help = this.props.help;
if (help === undefined && this.getOnlyControl()) {
var _this$getField = this.getField(),
errors = _this$getField.errors;
if (errors) {
return intersperseSpace(errors.map(function (e, index) {
var node = null;
if (React.isValidElement(e)) {
node = e;
} else if (React.isValidElement(e.message)) {
node = e.message;
} // eslint-disable-next-line react/no-array-index-key
return node ? React.cloneElement(node, {
key: index
}) : e.message;
}));
}
return '';
}
return help;
}
}, {
key: "getControls",
value: function getControls(children, recursively) {
var controls = [];
var childrenArray = React.Children.toArray(children);
for (var i = 0; i < childrenArray.length; i++) {
if (!recursively && controls.length > 0) {
break;
}
var child = childrenArray[i];
if (child.type && (child.type === FormItem || child.type.displayName === 'FormItem')) {
continue;
}
if (!child.props) {
continue;
}
if (_constants.FIELD_META_PROP in child.props) {
// And means FIELD_DATA_PROP in child.props, too.
controls.push(child);
} else if (child.props.children) {
controls = controls.concat(this.getControls(child.props.children, recursively));
}
}
return controls;
}
}, {
key: "getOnlyControl",
value: function getOnlyControl() {
var child = this.getControls(this.props.children, false)[0];
return child !== undefined ? child : null;
}
}, {
key: "getChildProp",
value: function getChildProp(prop) {
var child = this.getOnlyControl();
return child && child.props && child.props[prop];
}
}, {
key: "getId",
value: function getId() {
return this.getChildProp('id');
}
}, {
key: "getMeta",
value: function getMeta() {
return this.getChildProp(_constants.FIELD_META_PROP);
}
}, {
key: "getField",
value: function getField() {
return this.getChildProp(_constants.FIELD_DATA_PROP);
}
}, {
key: "getValidateStatus",
value: function getValidateStatus() {
var onlyControl = this.getOnlyControl();
if (!onlyControl) {
return '';
}
var field = this.getField();
if (field.validating) {
return 'validating';
}
if (field.errors) {
return 'error';
}
var fieldValue = 'value' in field ? field.value : this.getMeta().initialValue;
if (fieldValue !== undefined && fieldValue !== null && fieldValue !== '') {
return 'success';
}
return '';
}
}, {
key: "isRequired",
value: function isRequired() {
var required = this.props.required;
if (required !== undefined) {
return required;
}
if (this.getOnlyControl()) {
var meta = this.getMeta() || {};
var validate = meta.validate || [];
return validate.filter(function (item) {
return !!item.rules;
}).some(function (item) {
return item.rules.some(function (rule) {
return rule.required;
});
});
}
return false;
}
}, {
key: "renderHelp",
value: function renderHelp(prefixCls) {
var help = this.getHelpMessage();
var children = help ? React.createElement("div", {
className: "".concat(prefixCls, "-explain"),
key: "help"
}, help) : null;
if (children) {
this.helpShow = !!children;
}
return React.createElement(_rcAnimate["default"], {
transitionName: "show-help",
component: "",
transitionAppear: true,
key: "help",
onEnd: this.onHelpAnimEnd
}, children);
}
}, {
key: "renderExtra",
value: function renderExtra(prefixCls) {
var extra = this.props.extra;
return extra ? React.createElement("div", {
className: "".concat(prefixCls, "-extra")
}, extra) : null;
}
}, {
key: "renderValidateWrapper",
value: function renderValidateWrapper(prefixCls, c1, c2, c3) {
var props = this.props;
var onlyControl = this.getOnlyControl;
var validateStatus = props.validateStatus === undefined && onlyControl ? this.getValidateStatus() : props.validateStatus;
var classes = "".concat(prefixCls, "-item-control");
if (validateStatus) {
classes = (0, _classnames["default"])("".concat(prefixCls, "-item-control"), {
'has-feedback': props.hasFeedback || validateStatus === 'validating',
'has-success': validateStatus === 'success',
'has-warning': validateStatus === 'warning',
'has-error': validateStatus === 'error',
'is-validating': validateStatus === 'validating'
});
}
var iconType = '';
switch (validateStatus) {
case 'success':
iconType = 'check-circle';
break;
case 'warning':
iconType = 'exclamation-circle';
break;
case 'error':
iconType = 'close-circle';
break;
case 'validating':
iconType = 'loading';
break;
default:
iconType = '';
break;
}
var icon = props.hasFeedback && iconType ? React.createElement("span", {
className: "".concat(prefixCls, "-item-children-icon")
}, React.createElement(_icon["default"], {
type: iconType,
theme: iconType === 'loading' ? 'outlined' : 'filled'
})) : null;
return React.createElement("div", {
className: classes
}, React.createElement("span", {
className: "".concat(prefixCls, "-item-children")
}, c1, icon), c2, c3);
}
}, {
key: "renderWrapper",
value: function renderWrapper(prefixCls, children) {
var _this2 = this;
return React.createElement(_context["default"].Consumer, {
key: "wrapper"
}, function (_ref2) {
var contextWrapperCol = _ref2.wrapperCol,
vertical = _ref2.vertical;
var wrapperCol = _this2.props.wrapperCol;
var mergedWrapperCol = ('wrapperCol' in _this2.props ? wrapperCol : contextWrapperCol) || {};
var className = (0, _classnames["default"])("".concat(prefixCls, "-item-control-wrapper"), mergedWrapperCol.className); // No pass FormContext since it's useless
return React.createElement(_context["default"].Provider, {
value: {
vertical: vertical
}
}, React.createElement(_col["default"], _extends({}, mergedWrapperCol, {
className: className
}), children));
});
}
}, {
key: "renderLabel",
value: function renderLabel(prefixCls) {
var _this3 = this;
return React.createElement(_context["default"].Consumer, {
key: "label"
}, function (_ref3) {
var _classNames;
var vertical = _ref3.vertical,
contextLabelAlign = _ref3.labelAlign,
contextLabelCol = _ref3.labelCol,
contextColon = _ref3.colon;
var _this3$props = _this3.props,
label = _this3$props.label,
labelCol = _this3$props.labelCol,
labelAlign = _this3$props.labelAlign,
colon = _this3$props.colon,
id = _this3$props.id,
htmlFor = _this3$props.htmlFor;
var required = _this3.isRequired();
var mergedLabelCol = ('labelCol' in _this3.props ? labelCol : contextLabelCol) || {};
var mergedLabelAlign = 'labelAlign' in _this3.props ? labelAlign : contextLabelAlign;
var labelClsBasic = "".concat(prefixCls, "-item-label");
var labelColClassName = (0, _classnames["default"])(labelClsBasic, mergedLabelAlign === 'left' && "".concat(labelClsBasic, "-left"), mergedLabelCol.className);
var labelChildren = label; // Keep label is original where there should have no colon
var computedColon = colon === true || contextColon !== false && colon !== false;
var haveColon = computedColon && !vertical; // Remove duplicated user input colon
if (haveColon && typeof label === 'string' && label.trim() !== '') {
labelChildren = label.replace(/[:]\s*$/, '');
}
var labelClassName = (0, _classnames["default"])((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-item-required"), required), _defineProperty(_classNames, "".concat(prefixCls, "-item-no-colon"), !computedColon), _classNames));
return label ? React.createElement(_col["default"], _extends({}, mergedLabelCol, {
className: labelColClassName
}), React.createElement("label", {
htmlFor: htmlFor || id || _this3.getId(),
className: labelClassName,
title: typeof label === 'string' ? label : '',
onClick: _this3.onLabelClick
}, labelChildren)) : null;
});
}
}, {
key: "renderChildren",
value: function renderChildren(prefixCls) {
var children = this.props.children;
return [this.renderLabel(prefixCls), this.renderWrapper(prefixCls, this.renderValidateWrapper(prefixCls, children, this.renderHelp(prefixCls), this.renderExtra(prefixCls)))];
}
}, {
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderFormItem);
}
}]);
return FormItem;
}(React.Component);
exports["default"] = FormItem;
FormItem.defaultProps = {
hasFeedback: false
};
FormItem.propTypes = {
prefixCls: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
labelCol: PropTypes.object,
help: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
validateStatus: PropTypes.oneOf(ValidateStatuses),
hasFeedback: PropTypes.bool,
wrapperCol: PropTypes.object,
className: PropTypes.string,
id: PropTypes.string,
children: PropTypes.node,
colon: PropTypes.bool
};
//# sourceMappingURL=FormItem.js.map
/***/ }),
/***/ 1085:
/***/ (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__(1086);
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;
/***/ }),
/***/ 1086:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-dropdown{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";position:absolute;top:-9999px;left:-9999px;z-index:1050;display:block}.ant-dropdown:before{position:absolute;top:-7px;right:0;bottom:-7px;left:-7px;z-index:-9999;opacity:.0001;content:\" \"}.ant-dropdown-wrap{position:relative}.ant-dropdown-wrap .ant-btn>.anticon-down{display:inline-block;font-size:12px;font-size:10px\\9;-webkit-transform:scale(.83333333) rotate(0deg);-ms-transform:scale(.83333333) rotate(0deg);transform:scale(.83333333) rotate(0deg)}:root .ant-dropdown-wrap .ant-btn>.anticon-down{font-size:12px}.ant-dropdown-wrap .anticon-down:before{-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;-o-transition:transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s}.ant-dropdown-wrap-open .anticon-down:before{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.ant-dropdown-hidden,.ant-dropdown-menu-hidden{display:none}.ant-dropdown-menu{position:relative;margin:0;padding:4px 0;text-align:left;list-style-type:none;background-color:#fff;background-clip:padding-box;border-radius:4px;outline:none;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15);-webkit-transform:translateZ(0)}.ant-dropdown-menu-item-group-title{padding:5px 12px;color:rgba(0,0,0,.45);-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-dropdown-menu-submenu-popup{position:absolute;z-index:1050}.ant-dropdown-menu-submenu-popup>.ant-dropdown-menu{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.ant-dropdown-menu-submenu-popup li,.ant-dropdown-menu-submenu-popup ul{list-style:none}.ant-dropdown-menu-submenu-popup ul{margin-right:.3em;margin-left:.3em;padding:0}.ant-dropdown-menu-item,.ant-dropdown-menu-submenu-title{clear:both;margin:0;padding:5px 12px;color:rgba(0,0,0,.65);font-weight:400;font-size:14px;line-height:22px;white-space:nowrap;cursor:pointer;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-menu-submenu-title>span>.anticon:first-child{min-width:12px;margin-right:8px;font-size:12px}.ant-dropdown-menu-item>a,.ant-dropdown-menu-submenu-title>a{display:block;margin:-5px -12px;padding:5px 12px;color:rgba(0,0,0,.65);-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-dropdown-menu-item-selected,.ant-dropdown-menu-item-selected>a,.ant-dropdown-menu-submenu-title-selected,.ant-dropdown-menu-submenu-title-selected>a{color:#1890ff;background-color:#e6f7ff}.ant-dropdown-menu-item:hover,.ant-dropdown-menu-submenu-title:hover{background-color:#e6f7ff}.ant-dropdown-menu-item-disabled,.ant-dropdown-menu-submenu-title-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-item-disabled:hover,.ant-dropdown-menu-submenu-title-disabled:hover{color:rgba(0,0,0,.25);background-color:#fff;cursor:not-allowed}.ant-dropdown-menu-item-divider,.ant-dropdown-menu-submenu-title-divider{height:1px;margin:4px 0;overflow:hidden;line-height:0;background-color:#e8e8e8}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow{position:absolute;right:8px}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{color:rgba(0,0,0,.45);font-style:normal;display:inline-block;font-size:12px;font-size:10px\\9;-webkit-transform:scale(.83333333) rotate(0deg);-ms-transform:scale(.83333333) rotate(0deg);transform:scale(.83333333) rotate(0deg)}:root .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow-icon,:root .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{font-size:12px}.ant-
// exports
/***/ }),
/***/ 1089:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Dropdown__ = __webpack_require__(1090);
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__Dropdown__["a" /* default */]);
/***/ }),
/***/ 1090:
/***/ (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_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_dom__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rc_trigger__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__placements__ = __webpack_require__(1091);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_lifecycles_compat__ = __webpack_require__(7);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 Dropdown = function (_Component) {
_inherits(Dropdown, _Component);
function Dropdown(props) {
_classCallCheck(this, Dropdown);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_initialiseProps.call(_this);
if ('visible' in props) {
_this.state = {
visible: props.visible
};
} else {
_this.state = {
visible: props.defaultVisible
};
}
return _this;
}
Dropdown.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
if ('visible' in nextProps) {
return {
visible: nextProps.visible
};
}
return null;
};
Dropdown.prototype.getOverlayElement = function getOverlayElement() {
var overlay = this.props.overlay;
var overlayElement = void 0;
if (typeof overlay === 'function') {
overlayElement = overlay();
} else {
overlayElement = overlay;
}
return overlayElement;
};
Dropdown.prototype.getMenuElementOrLambda = function getMenuElementOrLambda() {
var overlay = this.props.overlay;
if (typeof overlay === 'function') {
return this.getMenuElement;
}
return this.getMenuElement();
};
Dropdown.prototype.getPopupDomNode = function getPopupDomNode() {
return this.trigger.getPopupDomNode();
};
Dropdown.prototype.getOpenClassName = function getOpenClassName() {
var _props = this.props,
openClassName = _props.openClassName,
prefixCls = _props.prefixCls;
if (openClassName !== undefined) {
return openClassName;
}
return prefixCls + '-open';
};
Dropdown.prototype.renderChildren = function renderChildren() {
var children = this.props.children;
var visible = this.state.visible;
var childrenProps = children.props ? children.props : {};
var childClassName = __WEBPACK_IMPORTED_MODULE_4_classnames___default()(childrenProps.className, this.getOpenClassName());
return visible && children ? Object(__WEBPACK_IMPORTED_MODULE_0_react__["cloneElement"])(children, { className: childClassName }) : children;
};
Dropdown.prototype.render = function render() {
var _props2 = this.props,
prefixCls = _props2.prefixCls,
transitionName = _props2.transitionName,
animation = _props2.animation,
align = _props2.align,
placement = _props2.placement,
getPopupContainer = _props2.getPopupContainer,
showAction = _props2.showAction,
hideAction = _props2.hideAction,
overlayClassName = _props2.overlayClassName,
overlayStyle = _props2.overlayStyle,
trigger = _props2.trigger,
otherProps = _objectWithoutProperties(_props2, ['prefixCls', 'transitionName', 'animation', 'align', 'placement', 'getPopupContainer', 'showAction', 'hideAction', 'overlayClassName', 'overlayStyle', 'trigger']);
var triggerHideAction = hideAction;
if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {
triggerHideAction = ['click'];
}
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3_rc_trigger__["default"],
_extends({}, otherProps, {
prefixCls: prefixCls,
ref: this.saveTrigger,
popupClassName: overlayClassName,
popupStyle: overlayStyle,
builtinPlacements: __WEBPACK_IMPORTED_MODULE_5__placements__["a" /* default */],
action: trigger,
showAction: showAction,
hideAction: triggerHideAction || [],
popupPlacement: placement,
popupAlign: align,
popupTransitionName: transitionName,
popupAnimation: animation,
popupVisible: this.state.visible,
afterPopupVisibleChange: this.afterVisibleChange,
popup: this.getMenuElementOrLambda(),
onPopupVisibleChange: this.onVisibleChange,
getPopupContainer: getPopupContainer
}),
this.renderChildren()
);
};
return Dropdown;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
Dropdown.propTypes = {
minOverlayWidthMatchTrigger: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
onVisibleChange: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onOverlayClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
prefixCls: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any,
transitionName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
overlayClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
openClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
animation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any,
align: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
overlayStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
overlay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func]),
trigger: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array,
alignPoint: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
showAction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array,
hideAction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array,
getPopupContainer: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
visible: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
defaultVisible: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool
};
Dropdown.defaultProps = {
prefixCls: 'rc-dropdown',
trigger: ['hover'],
showAction: [],
overlayClassName: '',
overlayStyle: {},
defaultVisible: false,
onVisibleChange: function onVisibleChange() {},
placement: 'bottomLeft'
};
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.onClick = function (e) {
var props = _this2.props;
var overlayProps = _this2.getOverlayElement().props;
// do no call onVisibleChange, if you need click to hide, use onClick and control visible
if (!('visible' in props)) {
_this2.setState({
visible: false
});
}
if (props.onOverlayClick) {
props.onOverlayClick(e);
}
if (overlayProps.onClick) {
overlayProps.onClick(e);
}
};
this.onVisibleChange = function (visible) {
var props = _this2.props;
if (!('visible' in props)) {
_this2.setState({
visible: visible
});
}
props.onVisibleChange(visible);
};
this.getMinOverlayWidthMatchTrigger = function () {
var _props3 = _this2.props,
minOverlayWidthMatchTrigger = _props3.minOverlayWidthMatchTrigger,
alignPoint = _props3.alignPoint;
if ('minOverlayWidthMatchTrigger' in _this2.props) {
return minOverlayWidthMatchTrigger;
}
return !alignPoint;
};
this.getMenuElement = function () {
var prefixCls = _this2.props.prefixCls;
var overlayElement = _this2.getOverlayElement();
var extraOverlayProps = {
prefixCls: prefixCls + '-menu',
onClick: _this2.onClick
};
if (typeof overlayElement.type === 'string') {
delete extraOverlayProps.prefixCls;
}
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(overlayElement, extraOverlayProps);
};
this.afterVisibleChange = function (visible) {
if (visible && _this2.getMinOverlayWidthMatchTrigger()) {
var overlayNode = _this2.getPopupDomNode();
var rootNode = __WEBPACK_IMPORTED_MODULE_2_react_dom___default.a.findDOMNode(_this2);
if (rootNode && overlayNode && rootNode.offsetWidth > overlayNode.offsetWidth) {
overlayNode.style.minWidth = rootNode.offsetWidth + 'px';
if (_this2.trigger && _this2.trigger._component && _this2.trigger._component.alignInstance) {
_this2.trigger._component.alignInstance.forceAlign();
}
}
}
};
this.saveTrigger = function (node) {
_this2.trigger = node;
};
};
Object(__WEBPACK_IMPORTED_MODULE_6_react_lifecycles_compat__["polyfill"])(Dropdown);
/* harmony default export */ __webpack_exports__["a"] = (Dropdown);
/***/ }),
/***/ 1091:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export placements */
var autoAdjustOverflow = {
adjustX: 1,
adjustY: 1
};
var targetOffset = [0, 0];
var placements = {
topLeft: {
points: ['bl', 'tl'],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset
},
topCenter: {
points: ['bc', 'tc'],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset
},
topRight: {
points: ['br', 'tr'],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset
},
bottomLeft: {
points: ['tl', 'bl'],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset
},
bottomCenter: {
points: ['tc', 'bc'],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset
},
bottomRight: {
points: ['tr', 'br'],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset
}
};
/* harmony default export */ __webpack_exports__["a"] = (placements);
/***/ }),
/***/ 1106:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _button = _interopRequireDefault(__webpack_require__(74));
var _configProvider = __webpack_require__(12);
var _dropdown = _interopRequireDefault(__webpack_require__(922));
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 _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 ButtonGroup = _button["default"].Group;
var DropdownButton =
/*#__PURE__*/
function (_React$Component) {
_inherits(DropdownButton, _React$Component);
function DropdownButton() {
var _this;
_classCallCheck(this, DropdownButton);
_this = _possibleConstructorReturn(this, _getPrototypeOf(DropdownButton).apply(this, arguments));
_this.renderButton = function (_ref) {
var getContextPopupContainer = _ref.getPopupContainer,
getPrefixCls = _ref.getPrefixCls;
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
type = _a.type,
disabled = _a.disabled,
onClick = _a.onClick,
htmlType = _a.htmlType,
children = _a.children,
className = _a.className,
overlay = _a.overlay,
trigger = _a.trigger,
align = _a.align,
visible = _a.visible,
onVisibleChange = _a.onVisibleChange,
placement = _a.placement,
getPopupContainer = _a.getPopupContainer,
href = _a.href,
_a$icon = _a.icon,
icon = _a$icon === void 0 ? React.createElement(_icon["default"], {
type: "ellipsis"
}) : _a$icon,
title = _a.title,
restProps = __rest(_a, ["prefixCls", "type", "disabled", "onClick", "htmlType", "children", "className", "overlay", "trigger", "align", "visible", "onVisibleChange", "placement", "getPopupContainer", "href", "icon", "title"]);
var prefixCls = getPrefixCls('dropdown-button', customizePrefixCls);
var dropdownProps = {
align: align,
overlay: overlay,
disabled: disabled,
trigger: disabled ? [] : trigger,
onVisibleChange: onVisibleChange,
placement: placement,
getPopupContainer: getPopupContainer || getContextPopupContainer
};
if ('visible' in _this.props) {
dropdownProps.visible = visible;
}
return React.createElement(ButtonGroup, _extends({}, restProps, {
className: (0, _classnames["default"])(prefixCls, className)
}), React.createElement(_button["default"], {
type: type,
disabled: disabled,
onClick: onClick,
htmlType: htmlType,
href: href,
title: title
}, children), React.createElement(_dropdown["default"], dropdownProps, React.createElement(_button["default"], {
type: type
}, icon)));
};
return _this;
}
_createClass(DropdownButton, [{
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderButton);
}
}]);
return DropdownButton;
}(React.Component);
exports["default"] = DropdownButton;
DropdownButton.defaultProps = {
placement: 'bottomRight',
type: 'default'
};
//# sourceMappingURL=dropdown-button.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
/***/ }),
/***/ 1126:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(1129);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 1127:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _progress = _interopRequireDefault(__webpack_require__(1131));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = _progress["default"];
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1129:
/***/ (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__(1130);
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;
/***/ }),
/***/ 1130:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-progress{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";display:inline-block}.ant-progress-line{position:relative;width:100%;font-size:14px}.ant-progress-small.ant-progress-line,.ant-progress-small.ant-progress-line .ant-progress-text .anticon{font-size:12px}.ant-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0}.ant-progress-show-info .ant-progress-outer{margin-right:calc(-2em - 8px);padding-right:calc(2em + 8px)}.ant-progress-inner{position:relative;display:inline-block;width:100%;overflow:hidden;vertical-align:middle;background-color:#f5f5f5;border-radius:100px}.ant-progress-circle-trail{stroke:#f5f5f5}.ant-progress-circle-path{-webkit-animation:ant-progress-appear .3s;animation:ant-progress-appear .3s}.ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#1890ff}.ant-progress-bg,.ant-progress-success-bg{position:relative;background-color:#1890ff;border-radius:100px;-webkit-transition:all .4s cubic-bezier(.08,.82,.17,1) 0s;-o-transition:all .4s cubic-bezier(.08,.82,.17,1) 0s;transition:all .4s cubic-bezier(.08,.82,.17,1) 0s}.ant-progress-success-bg{position:absolute;top:0;left:0;background-color:#52c41a}.ant-progress-text{display:inline-block;width:2em;margin-left:8px;color:rgba(0,0,0,.45);font-size:1em;line-height:1;white-space:nowrap;text-align:left;vertical-align:middle;word-break:normal}.ant-progress-text .anticon{font-size:14px}.ant-progress-status-active .ant-progress-bg:before{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;border-radius:10px;opacity:0;-webkit-animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;content:\"\"}.ant-progress-status-exception .ant-progress-bg{background-color:#f5222d}.ant-progress-status-exception .ant-progress-text{color:#f5222d}.ant-progress-status-exception .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#f5222d}.ant-progress-status-success .ant-progress-bg{background-color:#52c41a}.ant-progress-status-success .ant-progress-text{color:#52c41a}.ant-progress-status-success .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#52c41a}.ant-progress-circle .ant-progress-inner{position:relative;line-height:1;background-color:transparent}.ant-progress-circle .ant-progress-text{position:absolute;top:50%;left:50%;width:100%;margin:0;padding:0;color:rgba(0,0,0,.65);line-height:1;white-space:normal;text-align:center;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ant-progress-circle .ant-progress-text .anticon{font-size:1.16666667em}.ant-progress-circle.ant-progress-status-exception .ant-progress-text{color:#f5222d}.ant-progress-circle.ant-progress-status-success .ant-progress-text{color:#52c41a}@-webkit-keyframes ant-progress-active{0%{width:0;opacity:.1}20%{width:0;opacity:.5}to{width:100%;opacity:0}}@keyframes ant-progress-active{0%{width:0;opacity:.1}20%{width:0;opacity:.5}to{width:100%;opacity:0}}", "", {"version":3,"sources":["/Users/hs/edu/educoder/public/react/node_modules/antd/lib/progress/style/index.css"],"names":[],"mappings":"AAIA,cACE,8BAA+B,AACvB,sBAAuB,AAC/B,SAAU,AACV,UAAW,AACX,sBAA2B,AAC3B,eAAgB,AAChB,0BAA2B,AAC3B,gBAAiB,AACjB,gBAAiB,AACjB,qCAAsC,AAC9B,6BAA8B,AACtC,oBAAsB,CACvB,AACD,mBACE,kBAAmB,AACnB,WAAY,AACZ,cAAgB,CACjB,AACD,wGAEE,cAAgB,CACjB,AACD,oBACE,qBAAsB,AACtB,WAAY,AACZ,eAAgB,AAChB,eAAiB,CAClB,AACD,4CACE,8BAA+B,AAC/B,6BAA+B,CAChC,AACD,oBACE,kBAAmB,AACnB,qBAAsB,AACtB,WAAY,AACZ,gBAAiB,AACjB,sBAAuB,AACvB,yBAA0B,AAC1B,mBAAqB,CACtB,AACD,2BACE,cAAgB,CACjB,AACD,0BACE,0CAA4C,AACpC,iCAAoC,CAC7C,AACD,iFACE,cAAgB,CACjB,AACD,0CAEE,kBAAmB,AACnB,yBAA0B,AAC1B,oBAAqB,AACrB,0DAAkE,AAClE,qDAA6D,AAC7D,iDAA0D,CAC3D,AACD,yBACE,kBAAmB,AACnB,MAAO,AACP,OAAQ,AACR,wBAA0B,CAC3B,AACD
// exports
/***/ }),
/***/ 1131:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var PropTypes = _interopRequireWildcard(__webpack_require__(1));
var React = _interopRequireWildcard(__webpack_require__(0));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _omit = _interopRequireDefault(__webpack_require__(43));
var _icon = _interopRequireDefault(__webpack_require__(26));
var _configProvider = __webpack_require__(12);
var _type = __webpack_require__(70);
var _Line = _interopRequireDefault(__webpack_require__(1132));
var _Circle = _interopRequireDefault(__webpack_require__(1133));
var _utils = __webpack_require__(932);
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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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 ProgressTypes = (0, _type.tuple)('line', 'circle', 'dashboard');
var ProgressStatuses = (0, _type.tuple)('normal', 'exception', 'active', 'success');
var Progress =
/*#__PURE__*/
function (_React$Component) {
_inherits(Progress, _React$Component);
function Progress() {
var _this;
_classCallCheck(this, Progress);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Progress).apply(this, arguments));
_this.renderProgress = function (_ref) {
var _classNames;
var getPrefixCls = _ref.getPrefixCls;
var _assertThisInitialize = _assertThisInitialized(_this),
props = _assertThisInitialize.props;
var customizePrefixCls = props.prefixCls,
className = props.className,
size = props.size,
type = props.type,
showInfo = props.showInfo,
restProps = __rest(props, ["prefixCls", "className", "size", "type", "showInfo"]);
var prefixCls = getPrefixCls('progress', customizePrefixCls);
var progressStatus = _this.getProgressStatus();
var progressInfo = _this.renderProcessInfo(prefixCls, progressStatus);
var progress; // Render progress shape
if (type === 'line') {
progress = React.createElement(_Line["default"], _extends({}, _this.props, {
prefixCls: prefixCls
}), progressInfo);
} else if (type === 'circle' || type === 'dashboard') {
progress = React.createElement(_Circle["default"], _extends({}, _this.props, {
prefixCls: prefixCls,
progressStatus: progressStatus
}), progressInfo);
}
var classString = (0, _classnames["default"])(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(type === 'dashboard' && 'circle' || type), true), _defineProperty(_classNames, "".concat(prefixCls, "-status-").concat(progressStatus), true), _defineProperty(_classNames, "".concat(prefixCls, "-show-info"), showInfo), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), size), _classNames), className);
return React.createElement("div", _extends({}, (0, _omit["default"])(restProps, ['status', 'format', 'trailColor', 'successPercent', 'strokeWidth', 'width', 'gapDegree', 'gapPosition', 'strokeColor', 'strokeLinecap', 'percent']), {
className: classString
}), progress);
};
return _this;
}
_createClass(Progress, [{
key: "getPercentNumber",
value: function getPercentNumber() {
var _this$props = this.props,
successPercent = _this$props.successPercent,
_this$props$percent = _this$props.percent,
percent = _this$props$percent === void 0 ? 0 : _this$props$percent;
return parseInt(successPercent !== undefined ? successPercent.toString() : percent.toString(), 10);
}
}, {
key: "getProgressStatus",
value: function getProgressStatus() {
var status = this.props.status;
if (ProgressStatuses.indexOf(status) < 0 && this.getPercentNumber() >= 100) {
return 'success';
}
return status || 'normal';
}
}, {
key: "renderProcessInfo",
value: function renderProcessInfo(prefixCls, progressStatus) {
var _this$props2 = this.props,
showInfo = _this$props2.showInfo,
format = _this$props2.format,
type = _this$props2.type,
percent = _this$props2.percent,
successPercent = _this$props2.successPercent;
if (!showInfo) return null;
var text;
var textFormatter = format || function (percentNumber) {
return "".concat(percentNumber, "%");
};
var iconType = type === 'circle' || type === 'dashboard' ? '' : '-circle';
if (format || progressStatus !== 'exception' && progressStatus !== 'success') {
text = textFormatter((0, _utils.validProgress)(percent), (0, _utils.validProgress)(successPercent));
} else if (progressStatus === 'exception') {
text = React.createElement(_icon["default"], {
type: "close".concat(iconType),
theme: type === 'line' ? 'filled' : 'outlined'
});
} else if (progressStatus === 'success') {
text = React.createElement(_icon["default"], {
type: "check".concat(iconType),
theme: type === 'line' ? 'filled' : 'outlined'
});
}
return React.createElement("span", {
className: "".concat(prefixCls, "-text"),
title: typeof text === 'string' ? text : undefined
}, text);
}
}, {
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderProgress);
}
}]);
return Progress;
}(React.Component);
exports["default"] = Progress;
Progress.defaultProps = {
type: 'line',
percent: 0,
showInfo: true,
trailColor: '#f3f3f3',
size: 'default',
gapDegree: 0,
strokeLinecap: 'round'
};
Progress.propTypes = {
status: PropTypes.oneOf(ProgressStatuses),
type: PropTypes.oneOf(ProgressTypes),
showInfo: PropTypes.bool,
percent: PropTypes.number,
width: PropTypes.number,
strokeWidth: PropTypes.number,
strokeLinecap: PropTypes.oneOf(['round', 'square']),
strokeColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
trailColor: PropTypes.string,
format: PropTypes.func,
gapDegree: PropTypes.number
};
//# sourceMappingURL=progress.js.map
/***/ }),
/***/ 1132:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.handleGradient = exports.sortGradient = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _utils = __webpack_require__(932);
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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;
};
/**
* {
* '0%': '#afc163',
* '75%': '#009900',
* '50%': 'green', ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'
* '25%': '#66FF00',
* '100%': '#ffffff'
* }
*/
var sortGradient = function sortGradient(gradients) {
var tempArr = []; // eslint-disable-next-line no-restricted-syntax
for (var _i = 0, _Object$entries = Object.entries(gradients); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
key = _Object$entries$_i[0],
value = _Object$entries$_i[1];
var formatKey = parseFloat(key.replace(/%/g, ''));
if (isNaN(formatKey)) {
return {};
}
tempArr.push({
key: formatKey,
value: value
});
}
tempArr = tempArr.sort(function (a, b) {
return a.key - b.key;
});
return tempArr.map(function (_ref) {
var key = _ref.key,
value = _ref.value;
return "".concat(value, " ").concat(key, "%");
}).join(', ');
};
/**
* {
* '0%': '#afc163',
* '25%': '#66FF00',
* '50%': '#00CC00', ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,
* '75%': '#009900', #00CC00 50%, #009900 75%, #ffffff 100%)
* '100%': '#ffffff'
* }
*
* Then this man came to realize the truth:
* Besides six pence, there is the moon.
* Besides bread and butter, there is the bug.
* And...
* Besides women, there is the code.
*/
exports.sortGradient = sortGradient;
var handleGradient = function handleGradient(strokeColor) {
var _strokeColor$from = strokeColor.from,
from = _strokeColor$from === void 0 ? '#1890ff' : _strokeColor$from,
_strokeColor$to = strokeColor.to,
to = _strokeColor$to === void 0 ? '#1890ff' : _strokeColor$to,
_strokeColor$directio = strokeColor.direction,
direction = _strokeColor$directio === void 0 ? 'to right' : _strokeColor$directio,
rest = __rest(strokeColor, ["from", "to", "direction"]);
if (Object.keys(rest).length !== 0) {
var sortedGradients = sortGradient(rest);
return {
backgroundImage: "linear-gradient(".concat(direction, ", ").concat(sortedGradients, ")")
};
}
return {
backgroundImage: "linear-gradient(".concat(direction, ", ").concat(from, ", ").concat(to, ")")
};
};
exports.handleGradient = handleGradient;
var Line = function Line(props) {
var prefixCls = props.prefixCls,
percent = props.percent,
successPercent = props.successPercent,
strokeWidth = props.strokeWidth,
size = props.size,
strokeColor = props.strokeColor,
strokeLinecap = props.strokeLinecap,
children = props.children;
var backgroundProps;
if (strokeColor && typeof strokeColor !== 'string') {
backgroundProps = handleGradient(strokeColor);
} else {
backgroundProps = {
background: strokeColor
};
}
var percentStyle = _extends({
width: "".concat((0, _utils.validProgress)(percent), "%"),
height: strokeWidth || (size === 'small' ? 6 : 8),
borderRadius: strokeLinecap === 'square' ? 0 : ''
}, backgroundProps);
var successPercentStyle = {
width: "".concat((0, _utils.validProgress)(successPercent), "%"),
height: strokeWidth || (size === 'small' ? 6 : 8),
borderRadius: strokeLinecap === 'square' ? 0 : ''
};
var successSegment = successPercent !== undefined ? React.createElement("div", {
className: "".concat(prefixCls, "-success-bg"),
style: successPercentStyle
}) : null;
return React.createElement("div", null, React.createElement("div", {
className: "".concat(prefixCls, "-outer")
}, React.createElement("div", {
className: "".concat(prefixCls, "-inner")
}, React.createElement("div", {
className: "".concat(prefixCls, "-bg"),
style: percentStyle
}), successSegment)), children);
};
var _default = Line;
exports["default"] = _default;
//# sourceMappingURL=Line.js.map
/***/ }),
/***/ 1133:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _rcProgress = __webpack_require__(1134);
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _utils = __webpack_require__(932);
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 _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; }
var statusColorMap = {
normal: '#108ee9',
exception: '#ff5500',
success: '#87d068'
};
function getPercentage(_ref) {
var percent = _ref.percent,
successPercent = _ref.successPercent;
var ptg = (0, _utils.validProgress)(percent);
if (!successPercent) {
return ptg;
}
var successPtg = (0, _utils.validProgress)(successPercent);
return [successPercent, (0, _utils.validProgress)(ptg - successPtg)];
}
function getStrokeColor(_ref2) {
var progressStatus = _ref2.progressStatus,
successPercent = _ref2.successPercent,
strokeColor = _ref2.strokeColor;
var color = strokeColor || statusColorMap[progressStatus];
if (!successPercent) {
return color;
}
return [statusColorMap.success, color];
}
var Circle = function Circle(props) {
var prefixCls = props.prefixCls,
width = props.width,
strokeWidth = props.strokeWidth,
trailColor = props.trailColor,
strokeLinecap = props.strokeLinecap,
gapPosition = props.gapPosition,
gapDegree = props.gapDegree,
type = props.type,
children = props.children;
var circleSize = width || 120;
var circleStyle = {
width: circleSize,
height: circleSize,
fontSize: circleSize * 0.15 + 6
};
var circleWidth = strokeWidth || 6;
var gapPos = gapPosition || type === 'dashboard' && 'bottom' || 'top';
var gapDeg = gapDegree || (type === 'dashboard' ? 75 : undefined);
var strokeColor = getStrokeColor(props);
var isGradient = Object.prototype.toString.call(strokeColor) === '[object Object]';
var wrapperClassName = (0, _classnames["default"])("".concat(prefixCls, "-inner"), _defineProperty({}, "".concat(prefixCls, "-circle-gradient"), isGradient));
return React.createElement("div", {
className: wrapperClassName,
style: circleStyle
}, React.createElement(_rcProgress.Circle, {
percent: getPercentage(props),
strokeWidth: circleWidth,
trailWidth: circleWidth,
strokeColor: strokeColor,
strokeLinecap: strokeLinecap,
trailColor: trailColor,
prefixCls: prefixCls,
gapDegree: gapDeg,
gapPosition: gapPos
}), children);
};
var _default = Circle;
exports["default"] = _default;
//# sourceMappingURL=Circle.js.map
/***/ }),
/***/ 1134:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Line__ = __webpack_require__(1135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Circle__ = __webpack_require__(1136);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Line", function() { return __WEBPACK_IMPORTED_MODULE_0__Line__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Circle", function() { return __WEBPACK_IMPORTED_MODULE_1__Circle__["a"]; });
/* harmony default export */ __webpack_exports__["default"] = ({
Line: __WEBPACK_IMPORTED_MODULE_0__Line__["a" /* default */],
Circle: __WEBPACK_IMPORTED_MODULE_1__Circle__["a" /* default */]
});
/***/ }),
/***/ 1135:
/***/ (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__enhancer__ = __webpack_require__(990);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__types__ = __webpack_require__(991);
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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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); }
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; }
var Line =
/*#__PURE__*/
function (_Component) {
_inherits(Line, _Component);
function Line() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, Line);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Line)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty(_assertThisInitialized(_this), "paths", {});
return _this;
}
_createClass(Line, [{
key: "render",
value: function render() {
var _this2 = this;
var _this$props = this.props,
className = _this$props.className,
percent = _this$props.percent,
prefixCls = _this$props.prefixCls,
strokeColor = _this$props.strokeColor,
strokeLinecap = _this$props.strokeLinecap,
strokeWidth = _this$props.strokeWidth,
style = _this$props.style,
trailColor = _this$props.trailColor,
trailWidth = _this$props.trailWidth,
transition = _this$props.transition,
restProps = _objectWithoutProperties(_this$props, ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"]);
delete restProps.gapPosition;
var percentList = Array.isArray(percent) ? percent : [percent];
var strokeColorList = Array.isArray(strokeColor) ? strokeColor : [strokeColor];
var center = strokeWidth / 2;
var right = 100 - strokeWidth / 2;
var pathString = "M ".concat(strokeLinecap === 'round' ? center : 0, ",").concat(center, "\n L ").concat(strokeLinecap === 'round' ? right : 100, ",").concat(center);
var viewBoxString = "0 0 100 ".concat(strokeWidth);
var stackPtg = 0;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("svg", _extends({
className: "".concat(prefixCls, "-line ").concat(className),
viewBox: viewBoxString,
preserveAspectRatio: "none",
style: style
}, restProps), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("path", {
className: "".concat(prefixCls, "-line-trail"),
d: pathString,
strokeLinecap: strokeLinecap,
stroke: trailColor,
strokeWidth: trailWidth || strokeWidth,
fillOpacity: "0"
}), percentList.map(function (ptg, index) {
var pathStyle = {
strokeDasharray: "".concat(ptg, "px, 100px"),
strokeDashoffset: "-".concat(stackPtg, "px"),
transition: transition || 'stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear'
};
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
stackPtg += ptg;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("path", {
key: index,
className: "".concat(prefixCls, "-line-path"),
d: pathString,
strokeLinecap: strokeLinecap,
stroke: color,
strokeWidth: strokeWidth,
fillOpacity: "0",
ref: function ref(path) {
_this2.paths[index] = path;
},
style: pathStyle
});
}));
}
}]);
return Line;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
Line.propTypes = __WEBPACK_IMPORTED_MODULE_2__types__["b" /* propTypes */];
Line.defaultProps = __WEBPACK_IMPORTED_MODULE_2__types__["a" /* defaultProps */];
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__enhancer__["a" /* default */])(Line));
/***/ }),
/***/ 1136:
/***/ (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_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__enhancer__ = __webpack_require__(990);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__types__ = __webpack_require__(991);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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); }
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; }
/* eslint react/prop-types: 0 */
var gradientSeed = 0;
function stripPercentToNumber(percent) {
return +percent.replace('%', '');
}
function toArray(symArray) {
return Array.isArray(symArray) ? symArray : [symArray];
}
function getPathStyles(offset, percent, strokeColor, strokeWidth) {
var gapDegree = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
var gapPosition = arguments.length > 5 ? arguments[5] : undefined;
var radius = 50 - strokeWidth / 2;
var beginPositionX = 0;
var beginPositionY = -radius;
var endPositionX = 0;
var endPositionY = -2 * radius;
switch (gapPosition) {
case 'left':
beginPositionX = -radius;
beginPositionY = 0;
endPositionX = 2 * radius;
endPositionY = 0;
break;
case 'right':
beginPositionX = radius;
beginPositionY = 0;
endPositionX = -2 * radius;
endPositionY = 0;
break;
case 'bottom':
beginPositionY = radius;
endPositionY = 2 * radius;
break;
default:
}
var pathString = "M 50,50 m ".concat(beginPositionX, ",").concat(beginPositionY, "\n a ").concat(radius, ",").concat(radius, " 0 1 1 ").concat(endPositionX, ",").concat(-endPositionY, "\n a ").concat(radius, ",").concat(radius, " 0 1 1 ").concat(-endPositionX, ",").concat(endPositionY);
var len = Math.PI * 2 * radius;
var pathStyle = {
stroke: strokeColor,
strokeDasharray: "".concat(percent / 100 * (len - gapDegree), "px ").concat(len, "px"),
strokeDashoffset: "-".concat(gapDegree / 2 + offset / 100 * (len - gapDegree), "px"),
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s' // eslint-disable-line
};
return {
pathString: pathString,
pathStyle: pathStyle
};
}
var Circle =
/*#__PURE__*/
function (_Component) {
_inherits(Circle, _Component);
function Circle() {
var _this;
_classCallCheck(this, Circle);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this));
_defineProperty(_assertThisInitialized(_this), "paths", {});
_defineProperty(_assertThisInitialized(_this), "gradientId", 0);
_this.gradientId = gradientSeed;
gradientSeed += 1;
return _this;
}
_createClass(Circle, [{
key: "getStokeList",
value: function getStokeList() {
var _this2 = this;
var _this$props = this.props,
prefixCls = _this$props.prefixCls,
percent = _this$props.percent,
strokeColor = _this$props.strokeColor,
strokeWidth = _this$props.strokeWidth,
strokeLinecap = _this$props.strokeLinecap,
gapDegree = _this$props.gapDegree,
gapPosition = _this$props.gapPosition;
var percentList = toArray(percent);
var strokeColorList = toArray(strokeColor);
var stackPtg = 0;
return percentList.map(function (ptg, index) {
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
var stroke = Object.prototype.toString.call(color) === '[object Object]' ? "url(#".concat(prefixCls, "-gradient-").concat(_this2.gradientId, ")") : '';
var _getPathStyles = getPathStyles(stackPtg, ptg, color, strokeWidth, gapDegree, gapPosition),
pathString = _getPathStyles.pathString,
pathStyle = _getPathStyles.pathStyle;
stackPtg += ptg;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("path", {
key: index,
className: "".concat(prefixCls, "-circle-path"),
d: pathString,
stroke: stroke,
strokeLinecap: strokeLinecap,
strokeWidth: ptg === 0 ? 0 : strokeWidth,
fillOpacity: "0",
style: pathStyle,
ref: function ref(path) {
_this2.paths[index] = path;
}
});
});
}
}, {
key: "render",
value: function render() {
var _this$props2 = this.props,
prefixCls = _this$props2.prefixCls,
strokeWidth = _this$props2.strokeWidth,
trailWidth = _this$props2.trailWidth,
gapDegree = _this$props2.gapDegree,
gapPosition = _this$props2.gapPosition,
trailColor = _this$props2.trailColor,
strokeLinecap = _this$props2.strokeLinecap,
style = _this$props2.style,
className = _this$props2.className,
strokeColor = _this$props2.strokeColor,
restProps = _objectWithoutProperties(_this$props2, ["prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor"]);
var _getPathStyles2 = getPathStyles(0, 100, trailColor, strokeWidth, gapDegree, gapPosition),
pathString = _getPathStyles2.pathString,
pathStyle = _getPathStyles2.pathStyle;
delete restProps.percent;
var strokeColorList = toArray(strokeColor);
var gradient = strokeColorList.find(function (color) {
return Object.prototype.toString.call(color) === '[object Object]';
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("svg", _extends({
className: "".concat(prefixCls, "-circle ").concat(className),
viewBox: "0 0 100 100",
style: style
}, restProps), gradient && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("defs", null, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("linearGradient", {
id: "".concat(prefixCls, "-gradient-").concat(this.gradientId),
x1: "100%",
y1: "0%",
x2: "0%",
y2: "0%"
}, Object.keys(gradient).sort(function (a, b) {
return stripPercentToNumber(a) - stripPercentToNumber(b);
}).map(function (key, index) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("stop", {
key: index,
offset: key,
stopColor: gradient[key]
});
}))), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("path", {
className: "".concat(prefixCls, "-circle-trail"),
d: pathString,
stroke: trailColor,
strokeLinecap: strokeLinecap,
strokeWidth: trailWidth || strokeWidth,
fillOpacity: "0",
style: pathStyle
}), this.getStokeList().reverse());
}
}]);
return Circle;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
Circle.propTypes = _objectSpread({}, __WEBPACK_IMPORTED_MODULE_3__types__["b" /* propTypes */], {
gapPosition: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['top', 'bottom', 'left', 'right'])
});
Circle.defaultProps = _objectSpread({}, __WEBPACK_IMPORTED_MODULE_3__types__["a" /* defaultProps */], {
gapPosition: 'top'
});
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__enhancer__["a" /* default */])(Circle));
/***/ }),
/***/ 1343:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toArray;
var _react = _interopRequireDefault(__webpack_require__(0));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function toArray(children) {
var ret = [];
_react.default.Children.forEach(children, function (c) {
ret.push(c);
});
return ret;
}
/***/ }),
/***/ 1345:
/***/ (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 _omit = _interopRequireDefault(__webpack_require__(43));
var _dropdown = _interopRequireDefault(__webpack_require__(922));
var _icon = _interopRequireDefault(__webpack_require__(26));
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 _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 BreadcrumbItem =
/*#__PURE__*/
function (_React$Component) {
_inherits(BreadcrumbItem, _React$Component);
function BreadcrumbItem() {
var _this;
_classCallCheck(this, BreadcrumbItem);
_this = _possibleConstructorReturn(this, _getPrototypeOf(BreadcrumbItem).apply(this, arguments));
_this.renderBreadcrumbItem = function (_ref) {
var getPrefixCls = _ref.getPrefixCls;
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
separator = _a.separator,
children = _a.children,
restProps = __rest(_a, ["prefixCls", "separator", "children"]);
var prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
var link;
if ('href' in _this.props) {
link = React.createElement("a", _extends({
className: "".concat(prefixCls, "-link")
}, (0, _omit["default"])(restProps, ['overlay'])), children);
} else {
link = React.createElement("span", _extends({
className: "".concat(prefixCls, "-link")
}, (0, _omit["default"])(restProps, ['overlay'])), children);
} // wrap to dropDown
link = _this.renderBreadcrumbNode(link, prefixCls);
if (children) {
return React.createElement("span", null, link, separator && separator !== '' && React.createElement("span", {
className: "".concat(prefixCls, "-separator")
}, separator));
}
return null;
};
/**
* if overlay is have
* Wrap a DropDown
*/
_this.renderBreadcrumbNode = function (breadcrumbItem, prefixCls) {
var overlay = _this.props.overlay;
if (overlay) {
return React.createElement(_dropdown["default"], {
overlay: overlay,
placement: "bottomCenter"
}, React.createElement("span", {
className: "".concat(prefixCls, "-overlay-link")
}, breadcrumbItem, React.createElement(_icon["default"], {
type: "down"
})));
}
return breadcrumbItem;
};
return _this;
}
_createClass(BreadcrumbItem, [{
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderBreadcrumbItem);
}
}]);
return BreadcrumbItem;
}(React.Component);
exports["default"] = BreadcrumbItem;
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
BreadcrumbItem.defaultProps = {
separator: '/'
};
BreadcrumbItem.propTypes = {
prefixCls: PropTypes.string,
separator: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
href: PropTypes.string
};
//# sourceMappingURL=BreadcrumbItem.js.map
/***/ }),
/***/ 1415:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(1508);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 1427:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(1439);
__webpack_require__(989);
__webpack_require__(985);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 1428:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _Breadcrumb = _interopRequireDefault(__webpack_require__(1441));
var _BreadcrumbItem = _interopRequireDefault(__webpack_require__(1345));
var _BreadcrumbSeparator = _interopRequireDefault(__webpack_require__(1442));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
_Breadcrumb["default"].Item = _BreadcrumbItem["default"];
_Breadcrumb["default"].Separator = _BreadcrumbSeparator["default"];
var _default = _Breadcrumb["default"];
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1439:
/***/ (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__(1440);
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;
/***/ }),
/***/ 1440:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-breadcrumb{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";color:rgba(0,0,0,.45);font-size:14px}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb a{color:rgba(0,0,0,.45);-webkit-transition:color .3s;-o-transition:color .3s;transition:color .3s}.ant-breadcrumb a:hover{color:#40a9ff}.ant-breadcrumb>span:last-child,.ant-breadcrumb>span:last-child a{color:rgba(0,0,0,.65)}.ant-breadcrumb>span:last-child .ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{margin:0 8px;color:rgba(0,0,0,.45)}.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}", "", {"version":3,"sources":["/Users/hs/edu/educoder/public/react/node_modules/antd/lib/breadcrumb/style/index.css"],"names":[],"mappings":"AAIA,gBACE,8BAA+B,AACvB,sBAAuB,AAC/B,SAAU,AACV,UAAW,AACX,sBAA2B,AAC3B,0BAA2B,AAC3B,gBAAiB,AACjB,gBAAiB,AACjB,qCAAsC,AAC9B,6BAA8B,AACtC,sBAA2B,AAC3B,cAAgB,CACjB,AACD,yBACE,cAAgB,CACjB,AACD,kBACE,sBAA2B,AAC3B,6BAA+B,AAC/B,wBAA0B,AAC1B,oBAAuB,CACxB,AACD,wBACE,aAAe,CAChB,AAID,kEACE,qBAA2B,CAC5B,AACD,0DACE,YAAc,CACf,AACD,0BACE,aAAc,AACd,qBAA2B,CAC5B,AAID,yEACE,eAAiB,CAClB","file":"index.css","sourcesContent":["/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable no-duplicate-selectors */\n/* stylelint-disable */\n/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */\n.ant-breadcrumb {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.65);\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n -webkit-font-feature-settings: 'tnum';\n font-feature-settings: 'tnum';\n color: rgba(0, 0, 0, 0.45);\n font-size: 14px;\n}\n.ant-breadcrumb .anticon {\n font-size: 14px;\n}\n.ant-breadcrumb a {\n color: rgba(0, 0, 0, 0.45);\n -webkit-transition: color 0.3s;\n -o-transition: color 0.3s;\n transition: color 0.3s;\n}\n.ant-breadcrumb a:hover {\n color: #40a9ff;\n}\n.ant-breadcrumb > span:last-child {\n color: rgba(0, 0, 0, 0.65);\n}\n.ant-breadcrumb > span:last-child a {\n color: rgba(0, 0, 0, 0.65);\n}\n.ant-breadcrumb > span:last-child .ant-breadcrumb-separator {\n display: none;\n}\n.ant-breadcrumb-separator {\n margin: 0 8px;\n color: rgba(0, 0, 0, 0.45);\n}\n.ant-breadcrumb-link > .anticon + span {\n margin-left: 4px;\n}\n.ant-breadcrumb-overlay-link > .anticon {\n margin-left: 4px;\n}\n"],"sourceRoot":""}]);
// exports
/***/ }),
/***/ 1441:
/***/ (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 _classnames = _interopRequireDefault(__webpack_require__(3));
var _toArray = _interopRequireDefault(__webpack_require__(1343));
var _omit = _interopRequireDefault(__webpack_require__(43));
var _BreadcrumbItem = _interopRequireDefault(__webpack_require__(1345));
var _menu = _interopRequireDefault(__webpack_require__(924));
var _configProvider = __webpack_require__(12);
var _warning = _interopRequireDefault(__webpack_require__(40));
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 _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 _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;
};
function getBreadcrumbName(route, params) {
if (!route.breadcrumbName) {
return null;
}
var paramsKeys = Object.keys(params).join('|');
var name = route.breadcrumbName.replace(new RegExp(":(".concat(paramsKeys, ")"), 'g'), function (replacement, key) {
return params[key] || replacement;
});
return name;
}
function defaultItemRender(route, params, routes, paths) {
var isLastItem = routes.indexOf(route) === routes.length - 1;
var name = getBreadcrumbName(route, params);
return isLastItem ? React.createElement("span", null, name) : React.createElement("a", {
href: "#/".concat(paths.join('/'))
}, name);
}
function filterFragment(children) {
return (0, _toArray["default"])(children).map(function (element) {
if (React.isValidElement(element) && element.type === React.Fragment) {
var props = element.props;
return props.children;
}
return element;
});
}
var Breadcrumb =
/*#__PURE__*/
function (_React$Component) {
_inherits(Breadcrumb, _React$Component);
function Breadcrumb() {
var _this;
_classCallCheck(this, Breadcrumb);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Breadcrumb).apply(this, arguments));
_this.getPath = function (path, params) {
path = (path || '').replace(/^\//, '');
Object.keys(params).forEach(function (key) {
path = path.replace(":".concat(key), params[key]);
});
return path;
};
_this.addChildPath = function (paths) {
var childPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var params = arguments.length > 2 ? arguments[2] : undefined;
var originalPaths = _toConsumableArray(paths);
var path = _this.getPath(childPath, params);
if (path) {
originalPaths.push(path);
}
return originalPaths;
};
_this.genForRoutes = function (_ref) {
var _ref$routes = _ref.routes,
routes = _ref$routes === void 0 ? [] : _ref$routes,
_ref$params = _ref.params,
params = _ref$params === void 0 ? {} : _ref$params,
separator = _ref.separator,
_ref$itemRender = _ref.itemRender,
itemRender = _ref$itemRender === void 0 ? defaultItemRender : _ref$itemRender;
var paths = [];
return routes.map(function (route) {
var path = _this.getPath(route.path, params);
if (path) {
paths.push(path);
} // generated overlay by route.children
var overlay = null;
if (route.children && route.children.length) {
overlay = React.createElement(_menu["default"], null, route.children.map(function (child) {
return React.createElement(_menu["default"].Item, {
key: child.breadcrumbName || child.path
}, itemRender(child, params, routes, _this.addChildPath(paths, child.path, params)));
}));
}
return React.createElement(_BreadcrumbItem["default"], {
overlay: overlay,
separator: separator,
key: route.breadcrumbName || path
}, itemRender(route, params, routes, paths));
});
};
_this.renderBreadcrumb = function (_ref2) {
var getPrefixCls = _ref2.getPrefixCls;
var crumbs;
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
separator = _a.separator,
style = _a.style,
className = _a.className,
routes = _a.routes,
children = _a.children,
restProps = __rest(_a, ["prefixCls", "separator", "style", "className", "routes", "children"]);
var prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
if (routes && routes.length > 0) {
// generated by route
crumbs = _this.genForRoutes(_this.props);
} else if (children) {
crumbs = React.Children.map(filterFragment(children), function (element, index) {
if (!element) {
return element;
}
(0, _warning["default"])(element.type && (element.type.__ANT_BREADCRUMB_ITEM === true || element.type.__ANT_BREADCRUMB_SEPARATOR === true), 'Breadcrumb', "Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children");
return React.cloneElement(element, {
separator: separator,
key: index
});
});
}
return React.createElement("div", _extends({
className: (0, _classnames["default"])(className, prefixCls),
style: style
}, (0, _omit["default"])(restProps, ['itemRender', 'params'])), crumbs);
};
return _this;
}
_createClass(Breadcrumb, [{
key: "componentDidMount",
value: function componentDidMount() {
var props = this.props;
(0, _warning["default"])(!('linkRender' in props || 'nameRender' in props), 'Breadcrumb', '`linkRender` and `nameRender` are removed, please use `itemRender` instead, ' + 'see: https://u.ant.design/item-render.');
}
}, {
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderBreadcrumb);
}
}]);
return Breadcrumb;
}(React.Component);
exports["default"] = Breadcrumb;
Breadcrumb.defaultProps = {
separator: '/'
};
Breadcrumb.propTypes = {
prefixCls: PropTypes.string,
separator: PropTypes.node,
routes: PropTypes.array
};
//# sourceMappingURL=Breadcrumb.js.map
/***/ }),
/***/ 1442:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _configProvider = __webpack_require__(12);
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 _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 BreadcrumbSeparator =
/*#__PURE__*/
function (_React$Component) {
_inherits(BreadcrumbSeparator, _React$Component);
function BreadcrumbSeparator() {
var _this;
_classCallCheck(this, BreadcrumbSeparator);
_this = _possibleConstructorReturn(this, _getPrototypeOf(BreadcrumbSeparator).apply(this, arguments));
_this.renderSeparator = function (_ref) {
var getPrefixCls = _ref.getPrefixCls;
var children = _this.props.children;
var prefixCls = getPrefixCls('breadcrumb');
return React.createElement("span", {
className: "".concat(prefixCls, "-separator")
}, children || '/');
};
return _this;
}
_createClass(BreadcrumbSeparator, [{
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderSeparator);
}
}]);
return BreadcrumbSeparator;
}(React.Component);
exports["default"] = BreadcrumbSeparator;
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
//# sourceMappingURL=BreadcrumbSeparator.js.map
/***/ }),
/***/ 1447:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Row", {
enumerable: true,
get: function get() {
return _row["default"];
}
});
Object.defineProperty(exports, "Col", {
enumerable: true,
get: function get() {
return _col["default"];
}
});
var _row = _interopRequireDefault(__webpack_require__(986));
var _col = _interopRequireDefault(__webpack_require__(987));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1471:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _tooltip = _interopRequireDefault(__webpack_require__(168));
var _configProvider = __webpack_require__(12);
var _warning = _interopRequireDefault(__webpack_require__(40));
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 Popover =
/*#__PURE__*/
function (_React$Component) {
_inherits(Popover, _React$Component);
function Popover() {
var _this;
_classCallCheck(this, Popover);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Popover).apply(this, arguments));
_this.saveTooltip = function (node) {
_this.tooltip = node;
};
_this.renderPopover = function (_ref) {
var getPrefixCls = _ref.getPrefixCls;
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
props = __rest(_a, ["prefixCls"]);
delete props.title;
var prefixCls = getPrefixCls('popover', customizePrefixCls);
return React.createElement(_tooltip["default"], _extends({}, props, {
prefixCls: prefixCls,
ref: _this.saveTooltip,
overlay: _this.getOverlay(prefixCls)
}));
};
return _this;
}
_createClass(Popover, [{
key: "getPopupDomNode",
value: function getPopupDomNode() {
return this.tooltip.getPopupDomNode();
}
}, {
key: "getOverlay",
value: function getOverlay(prefixCls) {
var _this$props = this.props,
title = _this$props.title,
content = _this$props.content;
(0, _warning["default"])(!('overlay' in this.props), 'Popover', '`overlay` is removed, please use `content` instead, ' + 'see: https://u.ant.design/popover-content');
return React.createElement("div", null, title && React.createElement("div", {
className: "".concat(prefixCls, "-title")
}, title), React.createElement("div", {
className: "".concat(prefixCls, "-inner-content")
}, content));
}
}, {
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderPopover);
}
}]);
return Popover;
}(React.Component);
exports["default"] = Popover;
Popover.defaultProps = {
placement: 'top',
transitionName: 'zoom-big',
trigger: 'hover',
mouseEnterDelay: 0.1,
mouseLeaveDelay: 0.1,
overlayStyle: {}
};
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1474:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(195);
/***/ }),
/***/ 1482:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(949);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 1483:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _grid = __webpack_require__(1447);
var _default = _grid.Row;
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1484:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(949);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 1485:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _grid = __webpack_require__(1447);
var _default = _grid.Col;
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1493:
/***/ (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__(1494);
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;
/***/ }),
/***/ 1494:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".searchinput{width:800px;margin-top:53px}.newshixunheadersear{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.packinput .ant-input{height:55px;width:663px!important;font-size:14px;border-color:#e1edf8!important;padding-left:20px}.packinput .ant-input-group-addon .ant-btn{width:137px!important;font-size:18px;height:53px;background:#4cacff}.tabtitle{-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;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.tabtitle,.tabtitles2{height:62px!important;background:#fff}.tabtitles2{width:1200px}.tabtitless{height:62px!important;line-height:62px!important}.tabtitle2{margin-left:30px!important}.counttit{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.counttittext{text-align:left;width:1200px;height:18px;color:#888;font-size:13px;margin-top:24px}.counttittexts{color:#4cacff!important;font-size:13px}.mainx{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin-top:17px}.project-package-item{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-bottom:20px;padding:20px;background:#fff}.magr11{margin-top:11px}.fonttext{font-size:20px;font-weight:700}.fontextcolor{color:#777}.tzbq{margin-left:68px}.bjyss{background:#f8f8f8}.zj{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.ziticor{color:#777;font-size:13px}.foohter{margin-top:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.maxwidth1100{white-space:nowrap;font-size:18px!important;font-weight:500;color:#333!important}.maxwidth1100,.newshixunmodelmidfont{max-width:1100px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.newshixunmodelmidfont{font-size:14px;color:#999;display:-webkit-box;-webkit-line-clamp:2}.newshixunmodelbotfont,.newshixunmodelmidfont{font-weight:400;margin-top:15px;margin-left:30px}.newshixunmodelbotfont{font-size:12px;color:#666}.newshixunlist{max-height:227px;width:1200px}.xuxianpro{height:20px;border-bottom:1px dashed;border-color:#eaeaea;margin-bottom:18px}.newshixunpd030{padding:0 30px}.pd303010{padding:30px 30px 10px}.newshixunfont12{font-size:12px;color:#4cacff;line-height:21px}.newshixunmode{width:100px;height:38px;border-radius:3px}.ntopsj{position:absolute;top:-4px}.nyslbottomsj{position:absolute;bottom:-6px}.inherits .ant-dropdown-menu-item{cursor:inherit!important}.menus{width:91px;text-align:center}.newshixunmodelbotfont span{display:inline-block;margin-right:34px}.minhegiht300{min-height:300px}.newshixunlist:hover{-webkit-box-shadow:1px 6px 16px hsla(0,0%,61%,.16);box-shadow:1px 6px 16px hsla(0,0%,61%,.16);opacity:1;border-radius:2px}.newshixun500{max-width:500px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.mt3{margin-top:3px!important}.highlight{color:#4cacff}.newshixunbottombtn{position:fixed;z-index:1000;bottom:0;width:100%;height:63px;background:#fff;-webkit-box-shadow:0 -4px 4px 0 rgba(0,0,0,.05);box-shadow:0 -4px 4px 0 rgba(0,0,0,.05)}.mb60shixun{margin-bottom:60px!important}.padding13-30{padding:13px 30px;-webkit-box-sizing:border-box;box-sizing:border-box}.displaymodulat{display:-ms-flexbox;display:flex;display:-webkit-flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.WordNumberTextarea{outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-color:#fff;text-shadow:none;-webkit-writing-mode:horizontal-tb!important;-webkit-tap-highlight-color:rgba(0,0,0,0);resize:none;width:100%;height:130px;border:none;display:block}.WordNumbernote{padding:0;margin:0;list-style:none;text-decoration:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;height:auto;border:1px solid #eaeaea;border-radius:.125rem;margin:10px 10px 0;padding:10px 10px 5px;backgroud:#eaeaea;width:530px;margin-left:10px;margin-top:25px;height:214px!important}.WordNumbernote .WordNumberTextarea
// exports
/***/ }),
/***/ 1508:
/***/ (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__(1509);
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;
/***/ }),
/***/ 1509:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-popover{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";position:absolute;top:0;left:0;z-index:1030;font-weight:400;white-space:normal;text-align:left;cursor:auto;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ant-popover:after{position:absolute;background:hsla(0,0%,100%,.01);content:\"\"}.ant-popover-hidden{display:none}.ant-popover-placement-top,.ant-popover-placement-topLeft,.ant-popover-placement-topRight{padding-bottom:10px}.ant-popover-placement-right,.ant-popover-placement-rightBottom,.ant-popover-placement-rightTop{padding-left:10px}.ant-popover-placement-bottom,.ant-popover-placement-bottomLeft,.ant-popover-placement-bottomRight{padding-top:10px}.ant-popover-placement-left,.ant-popover-placement-leftBottom,.ant-popover-placement-leftTop{padding-right:10px}.ant-popover-inner{background-color:#fff;background-clip:padding-box;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15);-webkit-box-shadow:0 0 8px rgba(0,0,0,.15)\\9;box-shadow:0 0 8px rgba(0,0,0,.15)\\9}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-popover-inner{-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15)}}.ant-popover-title{min-width:177px;min-height:32px;margin:0;padding:5px 16px 4px;color:rgba(0,0,0,.85);font-weight:500;border-bottom:1px solid #e8e8e8}.ant-popover-inner-content{padding:12px 16px;color:rgba(0,0,0,.65)}.ant-popover-message{position:relative;padding:4px 0 12px;color:rgba(0,0,0,.65);font-size:14px}.ant-popover-message>.anticon{position:absolute;top:8px;color:#faad14;font-size:14px}.ant-popover-message-title{padding-left:22px}.ant-popover-buttons{margin-bottom:4px;text-align:right}.ant-popover-buttons button{margin-left:8px}.ant-popover-arrow{position:absolute;display:block;width:8.48528137px;height:8.48528137px;background:transparent;border-style:solid;border-width:4.24264069px;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow{bottom:6.2px;border-top-color:transparent;border-right-color:#fff;border-bottom-color:#fff;border-left-color:transparent;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07)}.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);-ms-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow{left:16px}.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow{right:16px}.ant-popover-placement-right>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-rightBottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-rightTop>.ant-popover-content>.ant-popover-arrow{left:6px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:#fff;border-left-color:#fff;-webkit-box-shadow:-3px 3px 7px rgba(0,0,0,.07);box-shadow:-3px 3px 7px rgba(0,0,0,.07)}.ant-popover-placement-right>.ant-popover-content>.ant-popover-arrow{top:50%;-webkit-transform:translateY(-50%) rotate(45deg);-ms-transform:translateY(-50%) rotate(45deg);transform:translateY(-50%) rotate(45deg)}.ant-popover-placement-rightTop>.ant-popover-content>.ant-popover-arrow{top:12px}.ant-popover-placement-rightBottom>.ant-popover-content>.ant-popover-arrow{bottom:12px}.ant-popover-placement-bottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-bottomLeft>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-bottomRight>.ant-popover-content>.ant-popover-arrow{top:6px;border-top-color:#fff;border-righ
// exports
/***/ }),
/***/ 1516:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = getScrollBarSize;
var cached;
function getScrollBarSize(fresh) {
if (typeof document === 'undefined') {
return 0;
}
if (fresh || cached === undefined) {
var inner = document.createElement('div');
inner.style.width = '100%';
inner.style.height = '200px';
var outer = document.createElement('div');
var outerStyle = outer.style;
outerStyle.position = 'absolute';
outerStyle.top = 0;
outerStyle.left = 0;
outerStyle.pointerEvents = 'none';
outerStyle.visibility = 'hidden';
outerStyle.width = '200px';
outerStyle.height = '150px';
outerStyle.overflow = 'hidden';
outer.appendChild(inner);
document.body.appendChild(outer);
var widthContained = inner.offsetWidth;
outer.style.overflow = 'scroll';
var widthScroll = inner.offsetWidth;
if (widthContained === widthScroll) {
widthScroll = outer.clientWidth;
}
document.body.removeChild(outer);
cached = widthContained - widthScroll;
}
return cached;
}
/***/ }),
/***/ 1517:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* Easy to set element style, return previou style
* IE browser compatible(IE browser doesn't merge overflow style, need to set it separately)
* https://github.com/ant-design/ant-design/issues/19393
*
*/
function setStyle(style) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _options$element = options.element,
element = _options$element === void 0 ? document.body : _options$element;
var oldStyle = {};
var styleKeys = Object.keys(style); // IE browser compatible
styleKeys.forEach(function (key) {
oldStyle[key] = element.style[key];
});
styleKeys.forEach(function (key) {
element.style[key] = style[key];
});
return oldStyle;
}
/* harmony default export */ __webpack_exports__["a"] = (setStyle);
/***/ }),
/***/ 1537:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DragDropContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ConnectedDraggable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ConnectedDroppable; });
/* unused harmony export resetServerContext */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__ = __webpack_require__(1615);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__ = __webpack_require__(1616);
/* 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_redux__ = __webpack_require__(114);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tiny_invariant__ = __webpack_require__(347);
/* 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_css_box_model__ = __webpack_require__(1618);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_memoize_one__ = __webpack_require__(1584);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_corejs2_core_js_object_values__ = __webpack_require__(1619);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_corejs2_core_js_object_values___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_corejs2_core_js_object_values__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__babel_runtime_corejs2_core_js_object_keys__ = __webpack_require__(1623);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__babel_runtime_corejs2_core_js_object_keys___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__babel_runtime_corejs2_core_js_object_keys__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__babel_runtime_corejs2_core_js_object_assign__ = __webpack_require__(1474);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__babel_runtime_corejs2_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__babel_runtime_corejs2_core_js_object_assign__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__babel_runtime_corejs2_core_js_date_now__ = __webpack_require__(1624);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__babel_runtime_corejs2_core_js_date_now___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11__babel_runtime_corejs2_core_js_date_now__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_raf_schd__ = __webpack_require__(1627);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_react_redux__ = __webpack_require__(346);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__babel_runtime_corejs2_core_js_number_is_integer__ = __webpack_require__(1628);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__babel_runtime_corejs2_core_js_number_is_integer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14__babel_runtime_corejs2_core_js_number_is_integer__);
var origin = {
x: 0,
y: 0
};
var add = function add(point1, point2) {
return {
x: point1.x + point2.x,
y: point1.y + point2.y
};
};
var subtract = function subtract(point1, point2) {
return {
x: point1.x - point2.x,
y: point1.y - point2.y
};
};
var isEqual = function isEqual(point1, point2) {
return point1.x === point2.x && point1.y === point2.y;
};
var negate = function negate(point) {
return {
x: point.x !== 0 ? -point.x : 0,
y: point.y !== 0 ? -point.y : 0
};
};
var patch = function patch(line, value, otherValue) {
var _ref;
if (otherValue === void 0) {
otherValue = 0;
}
return _ref = {}, _ref[line] = value, _ref[line === 'x' ? 'y' : 'x'] = otherValue, _ref;
};
var distance = function distance(point1, point2) {
return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
};
var closest = function closest(target, points) {
return Math.min.apply(Math, points.map(function (point) {
return distance(target, point);
}));
};
var apply = function apply(fn) {
return function (point) {
return {
x: fn(point.x),
y: fn(point.y)
};
};
};
var executeClip = (function (frame, subject) {
var result = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["e" /* getRect */])({
top: Math.max(subject.top, frame.top),
right: Math.min(subject.right, frame.right),
bottom: Math.min(subject.bottom, frame.bottom),
left: Math.max(subject.left, frame.left)
});
if (result.width <= 0 || result.height <= 0) {
return null;
}
return result;
});
var isEqual$1 = function isEqual(first, second) {
return first.top === second.top && first.right === second.right && first.bottom === second.bottom && first.left === second.left;
};
var offsetByPosition = function offsetByPosition(spacing, point) {
return {
top: spacing.top + point.y,
left: spacing.left + point.x,
bottom: spacing.bottom + point.y,
right: spacing.right + point.x
};
};
var getCorners = function getCorners(spacing) {
return [{
x: spacing.left,
y: spacing.top
}, {
x: spacing.right,
y: spacing.top
}, {
x: spacing.left,
y: spacing.bottom
}, {
x: spacing.right,
y: spacing.bottom
}];
};
var noSpacing = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
var scroll = function scroll(target, frame) {
if (!frame) {
return target;
}
return offsetByPosition(target, frame.scroll.diff.displacement);
};
var increase = function increase(target, axis, withPlaceholder) {
if (withPlaceholder && withPlaceholder.increasedBy) {
var _extends2;
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, target, (_extends2 = {}, _extends2[axis.end] = target[axis.end] + withPlaceholder.increasedBy[axis.line], _extends2));
}
return target;
};
var clip = function clip(target, frame) {
if (frame && frame.shouldClipSubject) {
return executeClip(frame.pageMarginBox, target);
}
return Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["e" /* getRect */])(target);
};
var getSubject = (function (_ref) {
var page = _ref.page,
withPlaceholder = _ref.withPlaceholder,
axis = _ref.axis,
frame = _ref.frame;
var scrolled = scroll(page.marginBox, frame);
var increased = increase(scrolled, axis, withPlaceholder);
var clipped = clip(increased, frame);
return {
page: page,
withPlaceholder: withPlaceholder,
active: clipped
};
});
var scrollDroppable = (function (droppable, newScroll) {
!droppable.frame ? false ? invariant(false) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var scrollable = droppable.frame;
var scrollDiff = subtract(newScroll, scrollable.scroll.initial);
var scrollDisplacement = negate(scrollDiff);
var frame = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, scrollable, {
scroll: {
initial: scrollable.scroll.initial,
current: newScroll,
diff: {
value: scrollDiff,
displacement: scrollDisplacement
},
max: scrollable.scroll.max
}
});
var subject = getSubject({
page: droppable.subject.page,
withPlaceholder: droppable.subject.withPlaceholder,
axis: droppable.axis,
frame: frame
});
var result = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, droppable, {
frame: frame,
subject: subject
});
return result;
});
var records = {};
var isEnabled = false;
var isTimingsEnabled = function isTimingsEnabled() {
return isEnabled;
};
var start = function start(key) {
if (false) {
if (!isTimingsEnabled()) {
return;
}
var now = performance.now();
records[key] = now;
}
};
var finish = function finish(key) {
if (false) {
if (!isTimingsEnabled()) {
return;
}
var now = performance.now();
var previous = records[key];
if (!previous) {
console.warn('cannot finish timing as no previous time found', key);
return;
}
var result = now - previous;
var rounded = result.toFixed(2);
var style = function () {
if (result < 12) {
return {
textColor: 'green',
symbol: '✅'
};
}
if (result < 40) {
return {
textColor: 'orange',
symbol: '⚠️'
};
}
return {
textColor: 'red',
symbol: '❌'
};
}();
console.log(style.symbol + " %cTiming %c" + rounded + " %cms %c" + key, 'color: blue; font-weight: bold;', "color: " + style.textColor + "; font-size: 1.1em;", 'color: grey;', 'color: purple; font-weight: bold;');
}
};
var whatIsDraggedOver = (function (impact) {
var merge = impact.merge,
destination = impact.destination;
if (destination) {
return destination.droppableId;
}
if (merge) {
return merge.combine.droppableId;
}
return null;
});
function values(map) {
return __WEBPACK_IMPORTED_MODULE_8__babel_runtime_corejs2_core_js_object_values___default()(map);
}
function findIndex(list, predicate) {
if (list.findIndex) {
return list.findIndex(predicate);
}
for (var i = 0; i < list.length; i++) {
if (predicate(list[i])) {
return i;
}
}
return -1;
}
function find(list, predicate) {
if (list.find) {
return list.find(predicate);
}
var index = findIndex(list, predicate);
if (index !== -1) {
return list[index];
}
return undefined;
}
var toDroppableMap = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (droppables) {
return droppables.reduce(function (previous, current) {
previous[current.descriptor.id] = current;
return previous;
}, {});
});
var toDraggableMap = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (draggables) {
return draggables.reduce(function (previous, current) {
previous[current.descriptor.id] = current;
return previous;
}, {});
});
var toDroppableList = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (droppables) {
return values(droppables);
});
var toDraggableList = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (draggables) {
return values(draggables);
});
var isWithin = (function (lowerBound, upperBound) {
return function (value) {
return lowerBound <= value && value <= upperBound;
};
});
var isPositionInFrame = (function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (point) {
return isWithinVertical(point.y) && isWithinVertical(point.y) && isWithinHorizontal(point.x) && isWithinHorizontal(point.x);
};
});
var getDroppableOver = (function (_ref) {
var target = _ref.target,
droppables = _ref.droppables;
var maybe = find(toDroppableList(droppables), function (droppable) {
if (!droppable.isEnabled) {
return false;
}
var active = droppable.subject.active;
if (!active) {
return false;
}
return isPositionInFrame(active)(target);
});
return maybe ? maybe.descriptor.id : null;
});
var getDraggablesInsideDroppable = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (droppableId, draggables) {
var result = toDraggableList(draggables).filter(function (draggable) {
return droppableId === draggable.descriptor.droppableId;
}).sort(function (a, b) {
return a.descriptor.index - b.descriptor.index;
});
return result;
});
var withDroppableScroll = (function (droppable, point) {
var frame = droppable.frame;
if (!frame) {
return point;
}
return add(point, frame.scroll.diff.value);
});
var vertical = {
direction: 'vertical',
line: 'y',
crossAxisLine: 'x',
start: 'top',
end: 'bottom',
size: 'height',
crossAxisStart: 'left',
crossAxisEnd: 'right',
crossAxisSize: 'width'
};
var horizontal = {
direction: 'horizontal',
line: 'x',
crossAxisLine: 'y',
start: 'left',
end: 'right',
size: 'width',
crossAxisStart: 'top',
crossAxisEnd: 'bottom',
crossAxisSize: 'height'
};
var isUserMovingForward = (function (axis, direction) {
return axis === vertical ? direction.vertical === 'down' : direction.horizontal === 'right';
});
var didStartDisplaced = (function (draggableId, onLift) {
return Boolean(onLift.wasDisplaced[draggableId]);
});
var getCombinedItemDisplacement = (function (_ref) {
var displaced = _ref.displaced,
onLift = _ref.onLift,
combineWith = _ref.combineWith,
displacedBy = _ref.displacedBy;
var isDisplaced = Boolean(displaced[combineWith]);
if (didStartDisplaced(combineWith, onLift)) {
return isDisplaced ? origin : negate(displacedBy.point);
}
return isDisplaced ? displacedBy.point : origin;
});
var getWhenEntered = function getWhenEntered(id, current, oldMerge) {
if (!oldMerge) {
return current;
}
if (id !== oldMerge.combine.draggableId) {
return current;
}
return oldMerge.whenEntered;
};
var isCombiningWith = function isCombiningWith(_ref) {
var id = _ref.id,
currentCenter = _ref.currentCenter,
axis = _ref.axis,
borderBox = _ref.borderBox,
displaceBy = _ref.displaceBy,
currentUserDirection = _ref.currentUserDirection,
oldMerge = _ref.oldMerge;
var start = borderBox[axis.start] + displaceBy[axis.line];
var end = borderBox[axis.end] + displaceBy[axis.line];
var size = borderBox[axis.size];
var twoThirdsOfSize = size * 0.666;
var whenEntered = getWhenEntered(id, currentUserDirection, oldMerge);
var isMovingForward = isUserMovingForward(axis, whenEntered);
var targetCenter = currentCenter[axis.line];
if (isMovingForward) {
return isWithin(start, start + twoThirdsOfSize)(targetCenter);
}
return isWithin(end - twoThirdsOfSize, end)(targetCenter);
};
var getCombineImpact = (function (_ref2) {
var currentCenter = _ref2.pageBorderBoxCenterWithDroppableScrollChange,
previousImpact = _ref2.previousImpact,
destination = _ref2.destination,
insideDestinationWithoutDraggable = _ref2.insideDestinationWithoutDraggable,
userDirection = _ref2.userDirection,
onLift = _ref2.onLift;
if (!destination.isCombineEnabled) {
return null;
}
var axis = destination.axis;
var map = previousImpact.movement.map;
var canBeDisplacedBy = previousImpact.movement.displacedBy;
var oldMerge = previousImpact.merge;
var target = find(insideDestinationWithoutDraggable, function (child) {
var id = child.descriptor.id;
var displaceBy = getCombinedItemDisplacement({
displaced: map,
onLift: onLift,
combineWith: id,
displacedBy: canBeDisplacedBy
});
return isCombiningWith({
id: id,
currentCenter: currentCenter,
axis: axis,
borderBox: child.page.borderBox,
displaceBy: displaceBy,
currentUserDirection: userDirection,
oldMerge: oldMerge
});
});
if (!target) {
return null;
}
var merge = {
whenEntered: getWhenEntered(target.descriptor.id, userDirection, oldMerge),
combine: {
draggableId: target.descriptor.id,
droppableId: destination.descriptor.id
}
};
var withMerge = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, previousImpact, {
destination: null,
merge: merge
});
return withMerge;
});
var isPartiallyVisibleThroughFrame = (function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (subject) {
var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
if (isContained) {
return true;
}
var isPartiallyVisibleVertically = isWithinVertical(subject.top) || isWithinVertical(subject.bottom);
var isPartiallyVisibleHorizontally = isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);
var isPartiallyContained = isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;
if (isPartiallyContained) {
return true;
}
var isBiggerVertically = subject.top < frame.top && subject.bottom > frame.bottom;
var isBiggerHorizontally = subject.left < frame.left && subject.right > frame.right;
var isTargetBiggerThanFrame = isBiggerVertically && isBiggerHorizontally;
if (isTargetBiggerThanFrame) {
return true;
}
var isTargetBiggerOnOneAxis = isBiggerVertically && isPartiallyVisibleHorizontally || isBiggerHorizontally && isPartiallyVisibleVertically;
return isTargetBiggerOnOneAxis;
};
});
var isTotallyVisibleThroughFrame = (function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (subject) {
var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
return isContained;
};
});
var isTotallyVisibleThroughFrameOnAxis = (function (axis) {
return function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (subject) {
if (axis === vertical) {
return isWithinVertical(subject.top) && isWithinVertical(subject.bottom);
}
return isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
};
};
});
var getDroppableDisplaced = function getDroppableDisplaced(target, destination) {
var displacement = destination.frame ? destination.frame.scroll.diff.displacement : origin;
return offsetByPosition(target, displacement);
};
var isVisibleInDroppable = function isVisibleInDroppable(target, destination, isVisibleThroughFrameFn) {
if (!destination.subject.active) {
return false;
}
return isVisibleThroughFrameFn(destination.subject.active)(target);
};
var isVisibleInViewport = function isVisibleInViewport(target, viewport, isVisibleThroughFrameFn) {
return isVisibleThroughFrameFn(viewport)(target);
};
var isVisible = function isVisible(_ref) {
var toBeDisplaced = _ref.target,
destination = _ref.destination,
viewport = _ref.viewport,
withDroppableDisplacement = _ref.withDroppableDisplacement,
isVisibleThroughFrameFn = _ref.isVisibleThroughFrameFn;
var displacedTarget = withDroppableDisplacement ? getDroppableDisplaced(toBeDisplaced, destination) : toBeDisplaced;
return isVisibleInDroppable(displacedTarget, destination, isVisibleThroughFrameFn) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn);
};
var isPartiallyVisible = function isPartiallyVisible(args) {
return isVisible(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, args, {
isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame
}));
};
var isTotallyVisible = function isTotallyVisible(args) {
return isVisible(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, args, {
isVisibleThroughFrameFn: isTotallyVisibleThroughFrame
}));
};
var isTotallyVisibleOnAxis = function isTotallyVisibleOnAxis(args) {
return isVisible(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, args, {
isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(args.destination.axis)
}));
};
var getShouldAnimate = function getShouldAnimate(forceShouldAnimate, isVisible, previous) {
if (typeof forceShouldAnimate === 'boolean') {
return forceShouldAnimate;
}
if (!isVisible) {
return false;
}
if (!previous) {
return true;
}
return previous.shouldAnimate;
};
var getTarget = function getTarget(draggable, onLift) {
var marginBox = draggable.page.marginBox;
if (!didStartDisplaced(draggable.descriptor.id, onLift)) {
return marginBox;
}
var expandBy = {
top: onLift.displacedBy.point.y,
right: onLift.displacedBy.point.x,
bottom: 0,
left: 0
};
return Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["e" /* getRect */])(Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["c" /* expand */])(marginBox, expandBy));
};
var getDisplacement = (function (_ref) {
var draggable = _ref.draggable,
destination = _ref.destination,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
onLift = _ref.onLift,
forceShouldAnimate = _ref.forceShouldAnimate;
var id = draggable.descriptor.id;
var map = previousImpact.movement.map;
var target = getTarget(draggable, onLift);
var isVisible = isPartiallyVisible({
target: target,
destination: destination,
viewport: viewport,
withDroppableDisplacement: true
});
var shouldAnimate = getShouldAnimate(forceShouldAnimate, isVisible, map[id]);
var displacement = {
draggableId: id,
isVisible: isVisible,
shouldAnimate: shouldAnimate
};
return displacement;
});
var getDisplacementMap = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (displaced) {
return displaced.reduce(function (map, displacement) {
map[displacement.draggableId] = displacement;
return map;
}, {});
});
var getDisplacedBy = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (axis, displaceBy) {
var displacement = displaceBy[axis.line];
return {
value: displacement,
point: patch(axis.line, displacement)
};
});
var getReorderImpact = (function (_ref) {
var currentCenter = _ref.pageBorderBoxCenterWithDroppableScrollChange,
draggable = _ref.draggable,
destination = _ref.destination,
insideDestinationWithoutDraggable = _ref.insideDestinationWithoutDraggable,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
userDirection = _ref.userDirection,
onLift = _ref.onLift;
var axis = destination.axis;
var isMovingForward = isUserMovingForward(destination.axis, userDirection);
var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);
var targetCenter = currentCenter[axis.line];
var displacement = displacedBy.value;
var displaced = insideDestinationWithoutDraggable.filter(function (child) {
var borderBox = child.page.borderBox;
var start = borderBox[axis.start];
var end = borderBox[axis.end];
var didStartDisplaced$1 = didStartDisplaced(child.descriptor.id, onLift);
if (isMovingForward) {
if (didStartDisplaced$1) {
return targetCenter < start;
}
return targetCenter < start + displacement;
}
if (didStartDisplaced$1) {
return targetCenter <= end - displacement;
}
return targetCenter <= end;
}).map(function (dimension) {
return getDisplacement({
draggable: dimension,
destination: destination,
previousImpact: previousImpact,
viewport: viewport.frame,
onLift: onLift
});
});
var newIndex = insideDestinationWithoutDraggable.length - displaced.length;
var movement = {
displacedBy: displacedBy,
displaced: displaced,
map: getDisplacementMap(displaced)
};
var impact = {
movement: movement,
destination: {
droppableId: destination.descriptor.id,
index: newIndex
},
merge: null
};
return impact;
});
var noDisplacedBy = {
point: origin,
value: 0
};
var noMovement = {
displaced: [],
map: {},
displacedBy: noDisplacedBy
};
var noImpact = {
movement: noMovement,
destination: null,
merge: null
};
var removeDraggableFromList = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (remove, list) {
return list.filter(function (item) {
return item.descriptor.id !== remove.descriptor.id;
});
});
var getDragImpact = (function (_ref) {
var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
draggable = _ref.draggable,
draggables = _ref.draggables,
droppables = _ref.droppables,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
userDirection = _ref.userDirection,
onLift = _ref.onLift;
var destinationId = getDroppableOver({
target: pageBorderBoxCenter,
droppables: droppables
});
if (!destinationId) {
return noImpact;
}
var destination = droppables[destinationId];
var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);
var insideDestinationWithoutDraggable = removeDraggableFromList(draggable, insideDestination);
var pageBorderBoxCenterWithDroppableScrollChange = withDroppableScroll(destination, pageBorderBoxCenter);
var withMerge = getCombineImpact({
pageBorderBoxCenterWithDroppableScrollChange: pageBorderBoxCenterWithDroppableScrollChange,
previousImpact: previousImpact,
destination: destination,
insideDestinationWithoutDraggable: insideDestinationWithoutDraggable,
userDirection: userDirection,
onLift: onLift
});
if (withMerge) {
return withMerge;
}
return getReorderImpact({
pageBorderBoxCenterWithDroppableScrollChange: pageBorderBoxCenterWithDroppableScrollChange,
destination: destination,
draggable: draggable,
insideDestinationWithoutDraggable: insideDestinationWithoutDraggable,
previousImpact: previousImpact,
viewport: viewport,
userDirection: userDirection,
onLift: onLift
});
});
var getHomeLocation = (function (descriptor) {
return {
index: descriptor.index,
droppableId: descriptor.droppableId
};
});
var getHomeOnLift = (function (_ref) {
var draggable = _ref.draggable,
home = _ref.home,
draggables = _ref.draggables,
viewport = _ref.viewport;
var displacedBy = getDisplacedBy(home.axis, draggable.displaceBy);
var insideHome = getDraggablesInsideDroppable(home.descriptor.id, draggables);
var originallyDisplaced = insideHome.slice(draggable.descriptor.index + 1);
var wasDisplaced = originallyDisplaced.reduce(function (previous, item) {
previous[item.descriptor.id] = true;
return previous;
}, {});
var onLift = {
displacedBy: displacedBy,
wasDisplaced: wasDisplaced
};
var displaced = originallyDisplaced.map(function (dimension) {
return getDisplacement({
draggable: dimension,
destination: home,
previousImpact: noImpact,
viewport: viewport.frame,
forceShouldAnimate: false,
onLift: onLift
});
});
var movement = {
displaced: displaced,
map: getDisplacementMap(displaced),
displacedBy: displacedBy
};
var impact = {
movement: movement,
destination: getHomeLocation(draggable.descriptor),
merge: null
};
return {
impact: impact,
onLift: onLift
};
});
var getDragPositions = (function (_ref) {
var oldInitial = _ref.initial,
oldCurrent = _ref.current,
oldClientBorderBoxCenter = _ref.oldClientBorderBoxCenter,
newClientBorderBoxCenter = _ref.newClientBorderBoxCenter,
viewport = _ref.viewport;
var shift = subtract(newClientBorderBoxCenter, oldClientBorderBoxCenter);
var initial = function () {
var client = {
selection: add(oldInitial.client.selection, shift),
borderBoxCenter: newClientBorderBoxCenter,
offset: origin
};
var page = {
selection: add(client.selection, viewport.scroll.initial),
borderBoxCenter: add(client.selection, viewport.scroll.initial)
};
return {
client: client,
page: page
};
}();
var current = function () {
var reverse = negate(shift);
var offset = add(oldCurrent.client.offset, reverse);
var client = {
selection: add(initial.client.selection, offset),
borderBoxCenter: add(initial.client.borderBoxCenter, offset),
offset: offset
};
var page = {
selection: add(client.selection, viewport.scroll.current),
borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current)
};
!isEqual(oldCurrent.client.borderBoxCenter, client.borderBoxCenter) ? false ? invariant(false, "\n Incorrect new client center position.\n Expected (" + oldCurrent.client.borderBoxCenter.x + ", " + oldCurrent.client.borderBoxCenter.y + ")\n to equal (" + client.borderBoxCenter.x + ", " + client.borderBoxCenter.y + ")\n ") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return {
client: client,
page: page
};
}();
return {
current: current,
initial: initial
};
});
var offsetDraggable = (function (_ref) {
var draggable = _ref.draggable,
offset$1 = _ref.offset,
initialWindowScroll = _ref.initialWindowScroll;
var client = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["f" /* offset */])(draggable.client, offset$1);
var page = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["g" /* withScroll */])(client, initialWindowScroll);
var moved = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, draggable, {
placeholder: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, draggable.placeholder, {
client: client
}),
client: client,
page: page
});
return moved;
});
var adjustExistingForAdditionsAndRemovals = (function (_ref) {
var existing = _ref.existing,
droppables = _ref.droppables,
addedDraggables = _ref.additions,
removedDraggables = _ref.removals,
viewport = _ref.viewport;
var shifted = {};
toDroppableList(droppables).forEach(function (droppable) {
var axis = droppable.axis;
var original = getDraggablesInsideDroppable(droppable.descriptor.id, existing);
var toShift = {};
var addShift = function addShift(id, shift) {
var previous = toShift[id];
if (!previous) {
toShift[id] = shift;
return;
}
toShift[id] = {
indexChange: previous.indexChange + shift.indexChange,
offset: add(previous.offset, shift.offset)
};
};
var removals = toDraggableMap(removedDraggables.map(function (id) {
var item = existing[id];
!item ? false ? invariant(false, "Could not find removed draggable \"" + id + "\"") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return item;
}).filter(function (draggable) {
return draggable.descriptor.droppableId === droppable.descriptor.id;
}));
var withRemovals = original.filter(function (item, index) {
var isBeingRemoved = Boolean(removals[item.descriptor.id]);
if (!isBeingRemoved) {
return true;
}
var offset = negate(patch(axis.line, item.displaceBy[axis.line]));
original.slice(index).forEach(function (sibling) {
if (removals[sibling.descriptor.id]) {
return;
}
addShift(sibling.descriptor.id, {
indexChange: -1,
offset: offset
});
});
return false;
});
var additions = addedDraggables.filter(function (draggable) {
return draggable.descriptor.droppableId === droppable.descriptor.id;
});
var withAdditions = withRemovals.slice(0);
additions.forEach(function (item) {
withAdditions.splice(item.descriptor.index, 0, item);
});
var additionMap = toDraggableMap(additions);
withAdditions.forEach(function (item, index) {
var wasAdded = Boolean(additionMap[item.descriptor.id]);
if (!wasAdded) {
return;
}
var offset = patch(axis.line, item.client.marginBox[axis.size]);
withAdditions.slice(index).forEach(function (sibling) {
if (additionMap[sibling.descriptor.id]) {
return;
}
addShift(sibling.descriptor.id, {
indexChange: 1,
offset: offset
});
});
});
withAdditions.forEach(function (item) {
if (additionMap[item.descriptor.id]) {
return;
}
var shift = toShift[item.descriptor.id];
if (!shift) {
return;
}
var moved = offsetDraggable({
draggable: item,
offset: shift.offset,
initialWindowScroll: viewport.scroll.initial
});
var index = item.descriptor.index + shift.indexChange;
var updated = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, moved, {
descriptor: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, item.descriptor, {
index: index
})
});
shifted[moved.descriptor.id] = updated;
});
});
var map = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, existing, shifted);
return map;
});
var adjustAdditionsForScrollChanges = (function (_ref) {
var additions = _ref.additions,
updatedDroppables = _ref.updatedDroppables,
viewport = _ref.viewport;
var windowScrollChange = viewport.scroll.diff.value;
return additions.map(function (draggable) {
var droppableId = draggable.descriptor.droppableId;
var modified = updatedDroppables[droppableId];
var frame = modified.frame;
!frame ? false ? invariant(false) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var droppableScrollChange = frame.scroll.diff.value;
var totalChange = add(windowScrollChange, droppableScrollChange);
var moved = offsetDraggable({
draggable: draggable,
offset: totalChange,
initialWindowScroll: viewport.scroll.initial
});
return moved;
});
});
var adjustAdditionsForCollapsedHome = (function (_ref) {
var additions = _ref.additions,
dragging = _ref.dragging,
home = _ref.home,
viewport = _ref.viewport;
var displacedBy = getDisplacedBy(home.axis, dragging.displaceBy);
return additions.map(function (draggable) {
if (draggable.descriptor.droppableId !== home.descriptor.id) {
return draggable;
}
if (draggable.descriptor.index < dragging.descriptor.index) {
return draggable;
}
return offsetDraggable({
draggable: draggable,
offset: displacedBy.point,
initialWindowScroll: viewport.scroll.initial
});
});
});
var updateDraggables = (function (_ref) {
var updatedDroppables = _ref.updatedDroppables,
criticalId = _ref.criticalId,
unmodifiedExisting = _ref.existing,
unmodifiedAdditions = _ref.additions,
removals = _ref.removals,
viewport = _ref.viewport;
var existing = adjustExistingForAdditionsAndRemovals({
droppables: updatedDroppables,
existing: unmodifiedExisting,
additions: unmodifiedAdditions,
removals: removals,
viewport: viewport
});
var dragging = existing[criticalId];
var home = updatedDroppables[dragging.descriptor.droppableId];
var scrolledAdditions = adjustAdditionsForScrollChanges({
additions: unmodifiedAdditions,
updatedDroppables: updatedDroppables,
viewport: viewport
});
var additions = adjustAdditionsForCollapsedHome({
additions: scrolledAdditions,
dragging: dragging,
home: home,
viewport: viewport
});
var map = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, existing, toDraggableMap(additions));
removals.forEach(function (id) {
delete map[id];
});
return map;
});
var getMaxScroll = (function (_ref) {
var scrollHeight = _ref.scrollHeight,
scrollWidth = _ref.scrollWidth,
height = _ref.height,
width = _ref.width;
var maxScroll = subtract({
x: scrollWidth,
y: scrollHeight
}, {
x: width,
y: height
});
var adjustedMaxScroll = {
x: Math.max(0, maxScroll.x),
y: Math.max(0, maxScroll.y)
};
return adjustedMaxScroll;
});
var getDroppableDimension = (function (_ref) {
var descriptor = _ref.descriptor,
isEnabled = _ref.isEnabled,
isCombineEnabled = _ref.isCombineEnabled,
isFixedOnPage = _ref.isFixedOnPage,
direction = _ref.direction,
client = _ref.client,
page = _ref.page,
closest = _ref.closest;
var frame = function () {
if (!closest) {
return null;
}
var scrollSize = closest.scrollSize,
frameClient = closest.client;
var maxScroll = getMaxScroll({
scrollHeight: scrollSize.scrollHeight,
scrollWidth: scrollSize.scrollWidth,
height: frameClient.paddingBox.height,
width: frameClient.paddingBox.width
});
return {
pageMarginBox: closest.page.marginBox,
frameClient: frameClient,
scrollSize: scrollSize,
shouldClipSubject: closest.shouldClipSubject,
scroll: {
initial: closest.scroll,
current: closest.scroll,
max: maxScroll,
diff: {
value: origin,
displacement: origin
}
}
};
}();
var axis = direction === 'vertical' ? vertical : horizontal;
var subject = getSubject({
page: page,
withPlaceholder: null,
axis: axis,
frame: frame
});
var dimension = {
descriptor: descriptor,
isCombineEnabled: isCombineEnabled,
isFixedOnPage: isFixedOnPage,
axis: axis,
isEnabled: isEnabled,
client: client,
page: page,
frame: frame,
subject: subject
};
return dimension;
});
var isHomeOf = (function (draggable, destination) {
return draggable.descriptor.droppableId === destination.descriptor.id;
});
var getRequiredGrowthForPlaceholder = function getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables) {
var axis = droppable.axis;
var availableSpace = droppable.subject.page.contentBox[axis.size];
var insideDroppable = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);
var spaceUsed = insideDroppable.reduce(function (sum, dimension) {
return sum + dimension.client.marginBox[axis.size];
}, 0);
var requiredSpace = spaceUsed + placeholderSize[axis.line];
var needsToGrowBy = requiredSpace - availableSpace;
if (needsToGrowBy <= 0) {
return null;
}
return patch(axis.line, needsToGrowBy);
};
var withMaxScroll = function withMaxScroll(frame, max) {
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, frame, {
scroll: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, frame.scroll, {
max: max
})
});
};
var addPlaceholder = function addPlaceholder(droppable, draggable, draggables) {
var frame = droppable.frame;
!!isHomeOf(draggable, droppable) ? false ? invariant(false, 'Should not add placeholder space to home list') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!!droppable.subject.withPlaceholder ? false ? invariant(false, 'Cannot add placeholder size to a subject when it already has one') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var placeholderSize = getDisplacedBy(droppable.axis, draggable.displaceBy).point;
var requiredGrowth = getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables);
var added = {
placeholderSize: placeholderSize,
increasedBy: requiredGrowth,
oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null
};
if (!frame) {
var _subject = getSubject({
page: droppable.subject.page,
withPlaceholder: added,
axis: droppable.axis,
frame: droppable.frame
});
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, droppable, {
subject: _subject
});
}
var maxScroll = requiredGrowth ? add(frame.scroll.max, requiredGrowth) : frame.scroll.max;
var newFrame = withMaxScroll(frame, maxScroll);
var subject = getSubject({
page: droppable.subject.page,
withPlaceholder: added,
axis: droppable.axis,
frame: newFrame
});
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, droppable, {
subject: subject,
frame: newFrame
});
};
var removePlaceholder = function removePlaceholder(droppable) {
var added = droppable.subject.withPlaceholder;
!added ? false ? invariant(false, 'Cannot remove placeholder form subject when there was none') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var frame = droppable.frame;
if (!frame) {
var _subject2 = getSubject({
page: droppable.subject.page,
axis: droppable.axis,
frame: null,
withPlaceholder: null
});
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, droppable, {
subject: _subject2
});
}
var oldMaxScroll = added.oldFrameMaxScroll;
!oldMaxScroll ? false ? invariant(false, 'Expected droppable with frame to have old max frame scroll when removing placeholder') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var newFrame = withMaxScroll(frame, oldMaxScroll);
var subject = getSubject({
page: droppable.subject.page,
axis: droppable.axis,
frame: newFrame,
withPlaceholder: null
});
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, droppable, {
subject: subject,
frame: newFrame
});
};
var getFrame = (function (droppable) {
var frame = droppable.frame;
!frame ? false ? invariant(false, 'Expected Droppable to have a frame') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return frame;
});
var throwIfSpacingChange = function throwIfSpacingChange(old, fresh) {
if (false) {
var getMessage = function getMessage(spacingType) {
return "Cannot change the " + spacingType + " of a Droppable during a drag";
};
!isEqual$1(old.margin, fresh.margin) ? process.env.NODE_ENV !== "production" ? invariant(false, getMessage('margin')) : invariant(false) : void 0;
!isEqual$1(old.border, fresh.border) ? process.env.NODE_ENV !== "production" ? invariant(false, getMessage('border')) : invariant(false) : void 0;
!isEqual$1(old.padding, fresh.padding) ? process.env.NODE_ENV !== "production" ? invariant(false, getMessage('padding')) : invariant(false) : void 0;
}
};
var adjustBorderBoxSize = function adjustBorderBoxSize(axis, old, fresh) {
return {
top: old.top,
left: old.left,
right: old.left + fresh.width,
bottom: old.top + fresh.height
};
};
var updateDroppables = (function (_ref) {
var modified = _ref.modified,
existing = _ref.existing,
viewport = _ref.viewport;
if (!modified.length) {
return existing;
}
var adjusted = modified.map(function (provided) {
var raw = existing[provided.descriptor.id];
!raw ? false ? invariant(false, 'Could not locate droppable in existing droppables') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var hasPlaceholder = Boolean(raw.subject.withPlaceholder);
var dimension = hasPlaceholder ? removePlaceholder(raw) : raw;
var oldClient = dimension.client;
var newClient = provided.client;
var oldScrollable = getFrame(dimension);
var newScrollable = getFrame(provided);
if (false) {
throwIfSpacingChange(dimension.client, provided.client);
throwIfSpacingChange(oldScrollable.frameClient, newScrollable.frameClient);
var isFrameEqual = oldScrollable.frameClient.borderBox.height === newScrollable.frameClient.borderBox.height && oldScrollable.frameClient.borderBox.width === newScrollable.frameClient.borderBox.width;
!isFrameEqual ? process.env.NODE_ENV !== "production" ? invariant(false, 'The width and height of your Droppable scroll container cannot change when adding or removing Draggables during a drag') : invariant(false) : void 0;
}
var client = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["b" /* createBox */])({
borderBox: adjustBorderBoxSize(dimension.axis, oldClient.borderBox, newClient.borderBox),
margin: oldClient.margin,
border: oldClient.border,
padding: oldClient.padding
});
var closest = {
client: oldScrollable.frameClient,
page: Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["g" /* withScroll */])(oldScrollable.frameClient, viewport.scroll.initial),
shouldClipSubject: oldScrollable.shouldClipSubject,
scrollSize: newScrollable.scrollSize,
scroll: oldScrollable.scroll.initial
};
var withSizeChanged = getDroppableDimension({
descriptor: provided.descriptor,
isEnabled: provided.isEnabled,
isCombineEnabled: provided.isCombineEnabled,
isFixedOnPage: provided.isFixedOnPage,
direction: provided.axis.direction,
client: client,
page: Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["g" /* withScroll */])(client, viewport.scroll.initial),
closest: closest
});
var scrolled = scrollDroppable(withSizeChanged, newScrollable.scroll.current);
return scrolled;
});
var result = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, existing, toDroppableMap(adjusted));
return result;
});
var withNoAnimatedDisplacement = (function (impact) {
var displaced = impact.movement.displaced;
if (!displaced.length) {
return impact;
}
var withoutAnimation = displaced.map(function (displacement) {
if (!displacement.isVisible) {
return displacement;
}
if (!displacement.shouldAnimate) {
return displacement;
}
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, displacement, {
shouldAnimate: false
});
});
var result = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, impact, {
movement: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, impact.movement, {
displaced: withoutAnimation,
map: getDisplacementMap(withoutAnimation)
})
});
return result;
});
var patchDroppableMap = (function (droppables, updated) {
var _extends2;
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, droppables, (_extends2 = {}, _extends2[updated.descriptor.id] = updated, _extends2));
});
var clearUnusedPlaceholder = function clearUnusedPlaceholder(_ref) {
var previousImpact = _ref.previousImpact,
impact = _ref.impact,
droppables = _ref.droppables;
var last = whatIsDraggedOver(previousImpact);
var now = whatIsDraggedOver(impact);
if (!last) {
return droppables;
}
if (last === now) {
return droppables;
}
var lastDroppable = droppables[last];
if (!lastDroppable.subject.withPlaceholder) {
return droppables;
}
var updated = removePlaceholder(lastDroppable);
return patchDroppableMap(droppables, updated);
};
var recomputePlaceholders = (function (_ref2) {
var draggable = _ref2.draggable,
draggables = _ref2.draggables,
droppables = _ref2.droppables,
previousImpact = _ref2.previousImpact,
impact = _ref2.impact;
var cleaned = clearUnusedPlaceholder({
previousImpact: previousImpact,
impact: impact,
droppables: droppables
});
var isOver = whatIsDraggedOver(impact);
if (!isOver) {
return cleaned;
}
var droppable = droppables[isOver];
if (isHomeOf(draggable, droppable)) {
return cleaned;
}
if (droppable.subject.withPlaceholder) {
return cleaned;
}
var patched = addPlaceholder(droppable, draggable, draggables);
return patchDroppableMap(cleaned, patched);
});
var timingsKey = 'Processing dynamic changes';
var publishWhileDragging = (function (_ref) {
var _extends2, _extends3;
var state = _ref.state,
published = _ref.published;
start(timingsKey);
var updatedDroppables = updateDroppables({
modified: published.modified,
existing: state.dimensions.droppables,
viewport: state.viewport
});
var draggables = updateDraggables({
updatedDroppables: updatedDroppables,
criticalId: state.critical.draggable.id,
existing: state.dimensions.draggables,
additions: published.additions,
removals: published.removals,
viewport: state.viewport
});
var critical = {
draggable: draggables[state.critical.draggable.id].descriptor,
droppable: updatedDroppables[state.critical.droppable.id].descriptor
};
var original = state.dimensions.draggables[critical.draggable.id];
var updated = draggables[critical.draggable.id];
var droppables = recomputePlaceholders({
draggable: updated,
draggables: draggables,
droppables: updatedDroppables,
previousImpact: state.impact,
impact: state.impact
});
var dimensions = {
draggables: draggables,
droppables: droppables
};
var _getDragPositions = getDragPositions({
initial: state.initial,
current: state.current,
oldClientBorderBoxCenter: original.client.borderBox.center,
newClientBorderBoxCenter: updated.client.borderBox.center,
viewport: state.viewport
}),
initial = _getDragPositions.initial,
current = _getDragPositions.current;
var _getHomeOnLift = getHomeOnLift({
draggable: updated,
home: dimensions.droppables[critical.droppable.id],
draggables: dimensions.draggables,
viewport: state.viewport
}),
homeImpact = _getHomeOnLift.impact,
onLift = _getHomeOnLift.onLift;
var impact = withNoAnimatedDisplacement(getDragImpact({
pageBorderBoxCenter: current.page.borderBoxCenter,
draggable: updated,
draggables: dimensions.draggables,
droppables: dimensions.droppables,
previousImpact: homeImpact,
viewport: state.viewport,
userDirection: state.userDirection,
onLift: onLift
}));
var isOrphaned = Boolean(state.movementMode === 'SNAP' && !whatIsDraggedOver(impact));
!!isOrphaned ? false ? invariant(false, 'Dragging item no longer has a valid merge/destination after a dynamic update. This is not supported') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
finish(timingsKey);
var draggingState = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
phase: 'DRAGGING'
}, state, (_extends2 = {}, _extends2["phase"] = 'DRAGGING', _extends2.critical = critical, _extends2.current = current, _extends2.initial = initial, _extends2.impact = impact, _extends2.dimensions = dimensions, _extends2.onLift = onLift, _extends2.onLiftImpact = homeImpact, _extends2.forceShouldAnimate = false, _extends2));
if (state.phase === 'COLLECTING') {
return draggingState;
}
var dropPending = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
phase: 'DROP_PENDING'
}, draggingState, (_extends3 = {}, _extends3["phase"] = 'DROP_PENDING', _extends3.reason = state.reason, _extends3.isWaiting = false, _extends3));
return dropPending;
});
var forward = {
vertical: 'down',
horizontal: 'right'
};
var backward = {
vertical: 'up',
horizontal: 'left'
};
var moveToNextCombine = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
isInHomeList = _ref.isInHomeList,
draggable = _ref.draggable,
destination = _ref.destination,
originalInsideDestination = _ref.insideDestination,
previousImpact = _ref.previousImpact;
if (!destination.isCombineEnabled) {
return null;
}
if (previousImpact.merge) {
return null;
}
var location = previousImpact.destination;
!location ? false ? invariant(false, 'Need a previous location to move from into a combine') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var currentIndex = location.index;
var currentInsideDestination = function () {
var shallow = originalInsideDestination.slice();
if (isInHomeList) {
shallow.splice(draggable.descriptor.index, 1);
}
shallow.splice(location.index, 0, draggable);
return shallow;
}();
var targetIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;
if (targetIndex < 0) {
return null;
}
if (targetIndex > currentInsideDestination.length - 1) {
return null;
}
var target = currentInsideDestination[targetIndex];
!(target !== draggable) ? false ? invariant(false, 'Cannot combine with self') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var merge = {
whenEntered: isMovingForward ? forward : backward,
combine: {
draggableId: target.descriptor.id,
droppableId: destination.descriptor.id
}
};
var impact = {
movement: previousImpact.movement,
destination: null,
merge: merge
};
return impact;
});
var addClosest = function addClosest(add, displaced) {
var added = {
draggableId: add.descriptor.id,
isVisible: true,
shouldAnimate: true
};
return [added].concat(displaced);
};
var removeClosest = function removeClosest(displaced) {
return displaced.slice(1);
};
var fromReorder = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
isInHomeList = _ref.isInHomeList,
draggable = _ref.draggable,
initialInside = _ref.insideDestination,
location = _ref.location;
var insideDestination = initialInside.slice();
var currentIndex = location.index;
var isInForeignList = !isInHomeList;
if (isInForeignList) {
insideDestination.splice(location.index, 0, draggable);
}
var proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;
if (proposedIndex < 0) {
return null;
}
if (proposedIndex > insideDestination.length - 1) {
return null;
}
return {
proposedIndex: proposedIndex,
modifyDisplacement: true
};
});
var fromCombine = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
destination = _ref.destination,
previousImpact = _ref.previousImpact,
draggables = _ref.draggables,
merge = _ref.merge,
onLift = _ref.onLift;
if (!destination.isCombineEnabled) {
return null;
}
var movement = previousImpact.movement;
var combineId = merge.combine.draggableId;
var combine = draggables[combineId];
var combineIndex = combine.descriptor.index;
var wasDisplacedAtStart = didStartDisplaced(combineId, onLift);
if (wasDisplacedAtStart) {
var hasDisplacedFromStart = !movement.map[combineId];
if (hasDisplacedFromStart) {
if (isMovingForward) {
return {
proposedIndex: combineIndex,
modifyDisplacement: false
};
}
return {
proposedIndex: combineIndex - 1,
modifyDisplacement: true
};
}
if (isMovingForward) {
return {
proposedIndex: combineIndex,
modifyDisplacement: true
};
}
return {
proposedIndex: combineIndex - 1,
modifyDisplacement: false
};
}
var isDisplaced = Boolean(movement.map[combineId]);
if (isDisplaced) {
if (isMovingForward) {
return {
proposedIndex: combineIndex + 1,
modifyDisplacement: true
};
}
return {
proposedIndex: combineIndex,
modifyDisplacement: false
};
}
if (isMovingForward) {
return {
proposedIndex: combineIndex + 1,
modifyDisplacement: false
};
}
return {
proposedIndex: combineIndex,
modifyDisplacement: true
};
});
var moveToNextIndex = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
isInHomeList = _ref.isInHomeList,
draggable = _ref.draggable,
draggables = _ref.draggables,
destination = _ref.destination,
insideDestination = _ref.insideDestination,
previousImpact = _ref.previousImpact,
onLift = _ref.onLift;
var instruction = function () {
if (previousImpact.destination) {
return fromReorder({
isMovingForward: isMovingForward,
isInHomeList: isInHomeList,
draggable: draggable,
location: previousImpact.destination,
insideDestination: insideDestination
});
}
if (previousImpact.merge) {
return fromCombine({
isMovingForward: isMovingForward,
destination: destination,
previousImpact: previousImpact,
draggables: draggables,
merge: previousImpact.merge,
onLift: onLift
});
}
return null;
}();
if (instruction == null) {
return null;
}
var proposedIndex = instruction.proposedIndex,
modifyDisplacement = instruction.modifyDisplacement;
var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);
var displaced = function () {
var lastDisplaced = previousImpact.movement.displaced;
if (!modifyDisplacement) {
return lastDisplaced;
}
if (isMovingForward) {
return removeClosest(lastDisplaced);
}
var withoutDraggable = removeDraggableFromList(draggable, insideDestination);
var atProposedIndex = withoutDraggable[proposedIndex];
return addClosest(atProposedIndex, lastDisplaced);
}();
return {
movement: {
displacedBy: displacedBy,
displaced: displaced,
map: getDisplacementMap(displaced)
},
destination: {
droppableId: destination.descriptor.id,
index: proposedIndex
},
merge: null
};
});
var whenCombining = (function (_ref) {
var combine = _ref.combine,
onLift = _ref.onLift,
movement = _ref.movement,
draggables = _ref.draggables;
var combineWith = combine.draggableId;
var center = draggables[combineWith].page.borderBox.center;
var displaceBy = getCombinedItemDisplacement({
displaced: movement.map,
onLift: onLift,
combineWith: combineWith,
displacedBy: movement.displacedBy
});
return add(center, displaceBy);
});
var distanceFromStartToBorderBoxCenter = function distanceFromStartToBorderBoxCenter(axis, box) {
return box.margin[axis.start] + box.borderBox[axis.size] / 2;
};
var distanceFromEndToBorderBoxCenter = function distanceFromEndToBorderBoxCenter(axis, box) {
return box.margin[axis.end] + box.borderBox[axis.size] / 2;
};
var getCrossAxisBorderBoxCenter = function getCrossAxisBorderBoxCenter(axis, target, isMoving) {
return target[axis.crossAxisStart] + isMoving.margin[axis.crossAxisStart] + isMoving.borderBox[axis.crossAxisSize] / 2;
};
var goAfter = function goAfter(_ref) {
var axis = _ref.axis,
moveRelativeTo = _ref.moveRelativeTo,
isMoving = _ref.isMoving;
return patch(axis.line, moveRelativeTo.marginBox[axis.end] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));
};
var goBefore = function goBefore(_ref2) {
var axis = _ref2.axis,
moveRelativeTo = _ref2.moveRelativeTo,
isMoving = _ref2.isMoving;
return patch(axis.line, moveRelativeTo.marginBox[axis.start] - distanceFromEndToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));
};
var goIntoStart = function goIntoStart(_ref3) {
var axis = _ref3.axis,
moveInto = _ref3.moveInto,
isMoving = _ref3.isMoving;
return patch(axis.line, moveInto.contentBox[axis.start] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving));
};
var whenReordering = (function (_ref) {
var movement = _ref.movement,
draggable = _ref.draggable,
draggables = _ref.draggables,
droppable = _ref.droppable,
onLift = _ref.onLift;
var insideDestination = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);
var draggablePage = draggable.page;
var axis = droppable.axis;
if (!insideDestination.length) {
return goIntoStart({
axis: axis,
moveInto: droppable.page,
isMoving: draggablePage
});
}
var displaced = movement.displaced,
displacedBy = movement.displacedBy;
if (displaced.length) {
var closestAfter = draggables[displaced[0].draggableId];
if (didStartDisplaced(closestAfter.descriptor.id, onLift)) {
return goBefore({
axis: axis,
moveRelativeTo: closestAfter.page,
isMoving: draggablePage
});
}
var withDisplacement = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["f" /* offset */])(closestAfter.page, displacedBy.point);
return goBefore({
axis: axis,
moveRelativeTo: withDisplacement,
isMoving: draggablePage
});
}
var last = insideDestination[insideDestination.length - 1];
if (last.descriptor.id === draggable.descriptor.id) {
return draggablePage.borderBox.center;
}
if (didStartDisplaced(last.descriptor.id, onLift)) {
var page = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["f" /* offset */])(last.page, negate(onLift.displacedBy.point));
return goAfter({
axis: axis,
moveRelativeTo: page,
isMoving: draggablePage
});
}
return goAfter({
axis: axis,
moveRelativeTo: last.page,
isMoving: draggablePage
});
});
var withDroppableDisplacement = (function (droppable, point) {
var frame = droppable.frame;
if (!frame) {
return point;
}
return add(point, frame.scroll.diff.displacement);
});
var getResultWithoutDroppableDisplacement = function getResultWithoutDroppableDisplacement(_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
droppable = _ref.droppable,
draggables = _ref.draggables,
onLift = _ref.onLift;
var merge = impact.merge;
var destination = impact.destination;
var original = draggable.page.borderBox.center;
if (!droppable) {
return original;
}
if (destination) {
return whenReordering({
movement: impact.movement,
draggable: draggable,
draggables: draggables,
droppable: droppable,
onLift: onLift
});
}
if (merge) {
return whenCombining({
movement: impact.movement,
combine: merge.combine,
draggables: draggables,
onLift: onLift
});
}
return original;
};
var getPageBorderBoxCenterFromImpact = (function (args) {
var withoutDisplacement = getResultWithoutDroppableDisplacement(args);
var droppable = args.droppable;
var withDisplacement = droppable ? withDroppableDisplacement(droppable, withoutDisplacement) : withoutDisplacement;
return withDisplacement;
});
var scrollViewport = (function (viewport, newScroll) {
var diff = subtract(newScroll, viewport.scroll.initial);
var displacement = negate(diff);
var frame = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["e" /* getRect */])({
top: newScroll.y,
bottom: newScroll.y + viewport.frame.height,
left: newScroll.x,
right: newScroll.x + viewport.frame.width
});
var updated = {
frame: frame,
scroll: {
initial: viewport.scroll.initial,
max: viewport.scroll.max,
current: newScroll,
diff: {
value: diff,
displacement: displacement
}
}
};
return updated;
});
var withNewDisplacement = (function (impact, displaced) {
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, impact, {
movement: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, impact.movement, {
displaced: displaced,
map: getDisplacementMap(displaced)
})
});
});
var speculativelyIncrease = (function (_ref) {
var impact = _ref.impact,
viewport = _ref.viewport,
destination = _ref.destination,
draggables = _ref.draggables,
maxScrollChange = _ref.maxScrollChange,
onLift = _ref.onLift;
var displaced = impact.movement.displaced;
var scrolledViewport = scrollViewport(viewport, add(viewport.scroll.current, maxScrollChange));
var scrolledDroppable = destination.frame ? scrollDroppable(destination, add(destination.frame.scroll.current, maxScrollChange)) : destination;
var updated = displaced.map(function (entry) {
if (entry.isVisible) {
return entry;
}
var draggable = draggables[entry.draggableId];
var withScrolledViewport = getDisplacement({
draggable: draggable,
destination: destination,
previousImpact: impact,
viewport: scrolledViewport.frame,
onLift: onLift,
forceShouldAnimate: false
});
if (withScrolledViewport.isVisible) {
return withScrolledViewport;
}
var withScrolledDroppable = getDisplacement({
draggable: draggable,
destination: scrolledDroppable,
previousImpact: impact,
viewport: viewport.frame,
onLift: onLift,
forceShouldAnimate: false
});
if (withScrolledDroppable.isVisible) {
return withScrolledDroppable;
}
return entry;
});
return withNewDisplacement(impact, updated);
});
var withViewportDisplacement = (function (viewport, point) {
return add(viewport.scroll.diff.displacement, point);
});
var getClientFromPageBorderBoxCenter = (function (_ref) {
var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
draggable = _ref.draggable,
viewport = _ref.viewport;
var withoutPageScrollChange = withViewportDisplacement(viewport, pageBorderBoxCenter);
var offset = subtract(withoutPageScrollChange, draggable.page.borderBox.center);
return add(draggable.client.borderBox.center, offset);
});
var isTotallyVisibleInNewLocation = (function (_ref) {
var draggable = _ref.draggable,
destination = _ref.destination,
newPageBorderBoxCenter = _ref.newPageBorderBoxCenter,
viewport = _ref.viewport,
withDroppableDisplacement = _ref.withDroppableDisplacement,
_ref$onlyOnMainAxis = _ref.onlyOnMainAxis,
onlyOnMainAxis = _ref$onlyOnMainAxis === void 0 ? false : _ref$onlyOnMainAxis;
var changeNeeded = subtract(newPageBorderBoxCenter, draggable.page.borderBox.center);
var shifted = offsetByPosition(draggable.page.borderBox, changeNeeded);
var args = {
target: shifted,
destination: destination,
withDroppableDisplacement: withDroppableDisplacement,
viewport: viewport
};
return onlyOnMainAxis ? isTotallyVisibleOnAxis(args) : isTotallyVisible(args);
});
var moveToNextPlace = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
draggable = _ref.draggable,
destination = _ref.destination,
draggables = _ref.draggables,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
previousClientSelection = _ref.previousClientSelection,
onLift = _ref.onLift;
if (!destination.isEnabled) {
return null;
}
var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);
var isInHomeList = isHomeOf(draggable, destination);
var impact = moveToNextCombine({
isInHomeList: isInHomeList,
isMovingForward: isMovingForward,
draggable: draggable,
destination: destination,
insideDestination: insideDestination,
previousImpact: previousImpact
}) || moveToNextIndex({
isMovingForward: isMovingForward,
isInHomeList: isInHomeList,
draggable: draggable,
draggables: draggables,
destination: destination,
insideDestination: insideDestination,
previousImpact: previousImpact,
onLift: onLift
});
if (!impact) {
return null;
}
var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: impact,
draggable: draggable,
droppable: destination,
draggables: draggables,
onLift: onLift
});
var isVisibleInNewLocation = isTotallyVisibleInNewLocation({
draggable: draggable,
destination: destination,
newPageBorderBoxCenter: pageBorderBoxCenter,
viewport: viewport.frame,
withDroppableDisplacement: false,
onlyOnMainAxis: true
});
if (isVisibleInNewLocation) {
var clientSelection = getClientFromPageBorderBoxCenter({
pageBorderBoxCenter: pageBorderBoxCenter,
draggable: draggable,
viewport: viewport
});
return {
clientSelection: clientSelection,
impact: impact,
scrollJumpRequest: null
};
}
var distance = subtract(pageBorderBoxCenter, previousPageBorderBoxCenter);
var cautious = speculativelyIncrease({
impact: impact,
viewport: viewport,
destination: destination,
draggables: draggables,
maxScrollChange: distance,
onLift: onLift
});
return {
clientSelection: previousClientSelection,
impact: cautious,
scrollJumpRequest: distance
};
});
var getKnownActive = function getKnownActive(droppable) {
var rect = droppable.subject.active;
!rect ? false ? invariant(false, 'Cannot get clipped area from droppable') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return rect;
};
var getBestCrossAxisDroppable = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
pageBorderBoxCenter = _ref.pageBorderBoxCenter,
source = _ref.source,
droppables = _ref.droppables,
viewport = _ref.viewport;
var active = source.subject.active;
if (!active) {
return null;
}
var axis = source.axis;
var isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]);
var candidates = toDroppableList(droppables).filter(function (droppable) {
return droppable !== source;
}).filter(function (droppable) {
return droppable.isEnabled;
}).filter(function (droppable) {
return Boolean(droppable.subject.active);
}).filter(function (droppable) {
return isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable));
}).filter(function (droppable) {
var activeOfTarget = getKnownActive(droppable);
if (isMovingForward) {
return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd];
}
return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart];
}).filter(function (droppable) {
var activeOfTarget = getKnownActive(droppable);
var isBetweenDestinationClipped = isWithin(activeOfTarget[axis.start], activeOfTarget[axis.end]);
return isBetweenSourceClipped(activeOfTarget[axis.start]) || isBetweenSourceClipped(activeOfTarget[axis.end]) || isBetweenDestinationClipped(active[axis.start]) || isBetweenDestinationClipped(active[axis.end]);
}).sort(function (a, b) {
var first = getKnownActive(a)[axis.crossAxisStart];
var second = getKnownActive(b)[axis.crossAxisStart];
if (isMovingForward) {
return first - second;
}
return second - first;
}).filter(function (droppable, index, array) {
return getKnownActive(droppable)[axis.crossAxisStart] === getKnownActive(array[0])[axis.crossAxisStart];
});
if (!candidates.length) {
return null;
}
if (candidates.length === 1) {
return candidates[0];
}
var contains = candidates.filter(function (droppable) {
var isWithinDroppable = isWithin(getKnownActive(droppable)[axis.start], getKnownActive(droppable)[axis.end]);
return isWithinDroppable(pageBorderBoxCenter[axis.line]);
});
if (contains.length === 1) {
return contains[0];
}
if (contains.length > 1) {
return contains.sort(function (a, b) {
return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];
})[0];
}
return candidates.sort(function (a, b) {
var first = closest(pageBorderBoxCenter, getCorners(getKnownActive(a)));
var second = closest(pageBorderBoxCenter, getCorners(getKnownActive(b)));
if (first !== second) {
return first - second;
}
return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];
})[0];
});
var getCurrentPageBorderBoxCenter = function getCurrentPageBorderBoxCenter(draggable, onLift) {
var original = draggable.page.borderBox.center;
return didStartDisplaced(draggable.descriptor.id, onLift) ? subtract(original, onLift.displacedBy.point) : original;
};
var getCurrentPageBorderBox = function getCurrentPageBorderBox(draggable, onLift) {
var original = draggable.page.borderBox;
return didStartDisplaced(draggable.descriptor.id, onLift) ? offsetByPosition(original, negate(onLift.displacedBy.point)) : original;
};
var getClosestDraggable = (function (_ref) {
var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
viewport = _ref.viewport,
destination = _ref.destination,
insideDestination = _ref.insideDestination,
onLift = _ref.onLift;
var sorted = insideDestination.filter(function (draggable) {
return isTotallyVisible({
target: getCurrentPageBorderBox(draggable, onLift),
destination: destination,
viewport: viewport.frame,
withDroppableDisplacement: true
});
}).sort(function (a, b) {
var distanceToA = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(a, onLift)));
var distanceToB = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(b, onLift)));
if (distanceToA < distanceToB) {
return -1;
}
if (distanceToB < distanceToA) {
return 1;
}
return a.descriptor.index - b.descriptor.index;
});
return sorted[0] || null;
});
var moveToNewDroppable = (function (_ref) {
var previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
moveRelativeTo = _ref.moveRelativeTo,
insideDestination = _ref.insideDestination,
draggable = _ref.draggable,
draggables = _ref.draggables,
destination = _ref.destination,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
onLift = _ref.onLift;
if (!moveRelativeTo) {
if (insideDestination.length) {
return null;
}
var proposed = {
movement: noMovement,
destination: {
droppableId: destination.descriptor.id,
index: 0
},
merge: null
};
var proposedPageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: proposed,
draggable: draggable,
droppable: destination,
draggables: draggables,
onLift: onLift
});
var withPlaceholder = isHomeOf(draggable, destination) ? destination : addPlaceholder(destination, draggable, draggables);
var isVisibleInNewLocation = isTotallyVisibleInNewLocation({
draggable: draggable,
destination: withPlaceholder,
newPageBorderBoxCenter: proposedPageBorderBoxCenter,
viewport: viewport.frame,
withDroppableDisplacement: false,
onlyOnMainAxis: true
});
return isVisibleInNewLocation ? proposed : null;
}
var isGoingBeforeTarget = Boolean(previousPageBorderBoxCenter[destination.axis.line] < moveRelativeTo.page.borderBox.center[destination.axis.line]);
var targetIndex = insideDestination.indexOf(moveRelativeTo);
!(targetIndex !== -1) ? false ? invariant(false, 'Cannot find target in list') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var proposedIndex = function () {
if (moveRelativeTo.descriptor.id === draggable.descriptor.id) {
return targetIndex;
}
if (isGoingBeforeTarget) {
return targetIndex;
}
return targetIndex + 1;
}();
var displaced = removeDraggableFromList(draggable, insideDestination).slice(proposedIndex).map(function (dimension) {
return getDisplacement({
draggable: dimension,
destination: destination,
viewport: viewport.frame,
previousImpact: previousImpact,
onLift: onLift
});
});
var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);
var impact = {
movement: {
displacedBy: displacedBy,
displaced: displaced,
map: getDisplacementMap(displaced)
},
destination: {
droppableId: destination.descriptor.id,
index: proposedIndex
},
merge: null
};
return impact;
});
var moveCrossAxis = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
draggable = _ref.draggable,
isOver = _ref.isOver,
draggables = _ref.draggables,
droppables = _ref.droppables,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
onLift = _ref.onLift;
var destination = getBestCrossAxisDroppable({
isMovingForward: isMovingForward,
pageBorderBoxCenter: previousPageBorderBoxCenter,
source: isOver,
droppables: droppables,
viewport: viewport
});
if (!destination) {
return null;
}
var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);
var moveRelativeTo = getClosestDraggable({
pageBorderBoxCenter: previousPageBorderBoxCenter,
viewport: viewport,
destination: destination,
insideDestination: insideDestination,
onLift: onLift
});
var impact = moveToNewDroppable({
previousPageBorderBoxCenter: previousPageBorderBoxCenter,
destination: destination,
draggable: draggable,
draggables: draggables,
moveRelativeTo: moveRelativeTo,
insideDestination: insideDestination,
previousImpact: previousImpact,
viewport: viewport,
onLift: onLift
});
if (!impact) {
return null;
}
var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: impact,
draggable: draggable,
droppable: destination,
draggables: draggables,
onLift: onLift
});
var clientSelection = getClientFromPageBorderBoxCenter({
pageBorderBoxCenter: pageBorderBoxCenter,
draggable: draggable,
viewport: viewport
});
return {
clientSelection: clientSelection,
impact: impact,
scrollJumpRequest: null
};
});
var getDroppableOver$1 = function getDroppableOver(impact, droppables) {
var id = whatIsDraggedOver(impact);
return id ? droppables[id] : null;
};
var moveInDirection = (function (_ref) {
var state = _ref.state,
type = _ref.type;
var isActuallyOver = getDroppableOver$1(state.impact, state.dimensions.droppables);
var isMainAxisMovementAllowed = Boolean(isActuallyOver);
var home = state.dimensions.droppables[state.critical.droppable.id];
var isOver = isActuallyOver || home;
var direction = isOver.axis.direction;
var isMovingOnMainAxis = direction === 'vertical' && (type === 'MOVE_UP' || type === 'MOVE_DOWN') || direction === 'horizontal' && (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT');
if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {
return null;
}
var isMovingForward = type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';
var draggable = state.dimensions.draggables[state.critical.draggable.id];
var previousPageBorderBoxCenter = state.current.page.borderBoxCenter;
var _state$dimensions = state.dimensions,
draggables = _state$dimensions.draggables,
droppables = _state$dimensions.droppables;
return isMovingOnMainAxis ? moveToNextPlace({
isMovingForward: isMovingForward,
previousPageBorderBoxCenter: previousPageBorderBoxCenter,
draggable: draggable,
destination: isOver,
draggables: draggables,
viewport: state.viewport,
previousClientSelection: state.current.client.selection,
previousImpact: state.impact,
onLift: state.onLift
}) : moveCrossAxis({
isMovingForward: isMovingForward,
previousPageBorderBoxCenter: previousPageBorderBoxCenter,
draggable: draggable,
isOver: isOver,
draggables: draggables,
droppables: droppables,
previousImpact: state.impact,
viewport: state.viewport,
onLift: state.onLift
});
});
function isMovementAllowed(state) {
return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';
}
var getVertical = function getVertical(previous, diff) {
if (diff === 0) {
return previous;
}
return diff > 0 ? 'down' : 'up';
};
var getHorizontal = function getHorizontal(previous, diff) {
if (diff === 0) {
return previous;
}
return diff > 0 ? 'right' : 'left';
};
var getUserDirection = (function (previous, oldPageBorderBoxCenter, newPageBorderBoxCenter) {
var diff = subtract(newPageBorderBoxCenter, oldPageBorderBoxCenter);
return {
horizontal: getHorizontal(previous.horizontal, diff.x),
vertical: getVertical(previous.vertical, diff.y)
};
});
var update = (function (_ref) {
var state = _ref.state,
forcedClientSelection = _ref.clientSelection,
forcedDimensions = _ref.dimensions,
forcedViewport = _ref.viewport,
forcedImpact = _ref.impact,
scrollJumpRequest = _ref.scrollJumpRequest;
var viewport = forcedViewport || state.viewport;
var currentWindowScroll = viewport.scroll.current;
var dimensions = forcedDimensions || state.dimensions;
var clientSelection = forcedClientSelection || state.current.client.selection;
var offset = subtract(clientSelection, state.initial.client.selection);
var client = {
offset: offset,
selection: clientSelection,
borderBoxCenter: add(state.initial.client.borderBoxCenter, offset)
};
var page = {
selection: add(client.selection, currentWindowScroll),
borderBoxCenter: add(client.borderBoxCenter, currentWindowScroll)
};
var current = {
client: client,
page: page
};
var userDirection = getUserDirection(state.userDirection, state.current.page.borderBoxCenter, current.page.borderBoxCenter);
if (state.phase === 'COLLECTING') {
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
phase: 'COLLECTING'
}, state, {
dimensions: dimensions,
viewport: viewport,
current: current,
userDirection: userDirection
});
}
var draggable = dimensions.draggables[state.critical.draggable.id];
var newImpact = forcedImpact || getDragImpact({
pageBorderBoxCenter: page.borderBoxCenter,
draggable: draggable,
draggables: dimensions.draggables,
droppables: dimensions.droppables,
previousImpact: state.impact,
viewport: viewport,
userDirection: userDirection,
onLift: state.onLift
});
var withUpdatedPlaceholders = recomputePlaceholders({
draggable: draggable,
impact: newImpact,
previousImpact: state.impact,
draggables: dimensions.draggables,
droppables: dimensions.droppables
});
var result = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, state, {
current: current,
userDirection: userDirection,
dimensions: {
draggables: dimensions.draggables,
droppables: withUpdatedPlaceholders
},
impact: newImpact,
viewport: viewport,
scrollJumpRequest: scrollJumpRequest || null,
forceShouldAnimate: scrollJumpRequest ? false : null
});
return result;
});
var recompute = (function (_ref) {
var impact = _ref.impact,
viewport = _ref.viewport,
destination = _ref.destination,
draggables = _ref.draggables,
onLift = _ref.onLift,
forceShouldAnimate = _ref.forceShouldAnimate;
var updated = impact.movement.displaced.map(function (entry) {
return getDisplacement({
draggable: draggables[entry.draggableId],
destination: destination,
previousImpact: impact,
viewport: viewport.frame,
onLift: onLift,
forceShouldAnimate: forceShouldAnimate
});
});
return withNewDisplacement(impact, updated);
});
var getClientBorderBoxCenter = (function (_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
droppable = _ref.droppable,
draggables = _ref.draggables,
viewport = _ref.viewport,
onLift = _ref.onLift;
var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: impact,
draggable: draggable,
draggables: draggables,
droppable: droppable,
onLift: onLift
});
return getClientFromPageBorderBoxCenter({
pageBorderBoxCenter: pageBorderBoxCenter,
draggable: draggable,
viewport: viewport
});
});
var refreshSnap = (function (_ref) {
var state = _ref.state,
forcedDimensions = _ref.dimensions,
forcedViewport = _ref.viewport;
!(state.movementMode === 'SNAP') ? false ? invariant(false) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var needsVisibilityCheck = state.impact;
var viewport = forcedViewport || state.viewport;
var dimensions = forcedDimensions || state.dimensions;
var draggables = dimensions.draggables,
droppables = dimensions.droppables;
var draggable = draggables[state.critical.draggable.id];
var isOver = whatIsDraggedOver(needsVisibilityCheck);
!isOver ? false ? invariant(false, 'Must be over a destination in SNAP movement mode') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var destination = droppables[isOver];
var impact = recompute({
impact: needsVisibilityCheck,
viewport: viewport,
destination: destination,
draggables: draggables,
onLift: state.onLift
});
var clientSelection = getClientBorderBoxCenter({
impact: impact,
draggable: draggable,
droppable: destination,
draggables: draggables,
viewport: viewport,
onLift: state.onLift
});
return update({
impact: impact,
clientSelection: clientSelection,
state: state,
dimensions: dimensions,
viewport: viewport
});
});
var patchDimensionMap = (function (dimensions, updated) {
return {
draggables: dimensions.draggables,
droppables: patchDroppableMap(dimensions.droppables, updated)
};
});
var isSnapping = function isSnapping(state) {
return state.movementMode === 'SNAP';
};
var postDroppableChange = function postDroppableChange(state, updated, isEnabledChanging) {
var dimensions = patchDimensionMap(state.dimensions, updated);
if (!isSnapping(state) || isEnabledChanging) {
return update({
state: state,
dimensions: dimensions
});
}
return refreshSnap({
state: state,
dimensions: dimensions
});
};
var idle = {
phase: 'IDLE',
completed: null,
shouldFlush: false
};
var reducer = (function (state, action) {
if (state === void 0) {
state = idle;
}
if (action.type === 'CLEAN') {
return idle;
}
if (action.type === 'INITIAL_PUBLISH') {
!(state.phase === 'IDLE') ? false ? invariant(false, 'INITIAL_PUBLISH must come after a IDLE phase') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _action$payload = action.payload,
critical = _action$payload.critical,
clientSelection = _action$payload.clientSelection,
viewport = _action$payload.viewport,
dimensions = _action$payload.dimensions,
movementMode = _action$payload.movementMode;
var draggable = dimensions.draggables[critical.draggable.id];
var home = dimensions.droppables[critical.droppable.id];
var client = {
selection: clientSelection,
borderBoxCenter: draggable.client.borderBox.center,
offset: origin
};
var initial = {
client: client,
page: {
selection: add(client.selection, viewport.scroll.initial),
borderBoxCenter: add(client.selection, viewport.scroll.initial)
}
};
var isWindowScrollAllowed = toDroppableList(dimensions.droppables).every(function (item) {
return !item.isFixedOnPage;
});
var _getHomeOnLift = getHomeOnLift({
draggable: draggable,
home: home,
draggables: dimensions.draggables,
viewport: viewport
}),
impact = _getHomeOnLift.impact,
onLift = _getHomeOnLift.onLift;
var result = {
phase: 'DRAGGING',
isDragging: true,
critical: critical,
movementMode: movementMode,
dimensions: dimensions,
initial: initial,
current: initial,
isWindowScrollAllowed: isWindowScrollAllowed,
impact: impact,
onLift: onLift,
onLiftImpact: impact,
viewport: viewport,
userDirection: forward,
scrollJumpRequest: null,
forceShouldAnimate: null
};
return result;
}
if (action.type === 'COLLECTION_STARTING') {
var _extends2;
if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {
return state;
}
!(state.phase === 'DRAGGING') ? false ? invariant(false, "Collection cannot start from phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _result = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
phase: 'COLLECTING'
}, state, (_extends2 = {}, _extends2["phase"] = 'COLLECTING', _extends2));
return _result;
}
if (action.type === 'PUBLISH_WHILE_DRAGGING') {
!(state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') ? false ? invariant(false, "Unexpected " + action.type + " received in phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return publishWhileDragging({
state: state,
published: action.payload
});
}
if (action.type === 'MOVE') {
if (state.phase === 'DROP_PENDING') {
return state;
}
!isMovementAllowed(state) ? false ? invariant(false, action.type + " not permitted in phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _clientSelection = action.payload.client;
if (isEqual(_clientSelection, state.current.client.selection)) {
return state;
}
return update({
state: state,
clientSelection: _clientSelection,
impact: isSnapping(state) ? state.impact : null
});
}
if (action.type === 'UPDATE_DROPPABLE_SCROLL') {
if (state.phase === 'DROP_PENDING') {
return state;
}
if (state.phase === 'COLLECTING') {
return state;
}
!isMovementAllowed(state) ? false ? invariant(false, action.type + " not permitted in phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _action$payload2 = action.payload,
id = _action$payload2.id,
offset = _action$payload2.offset;
var target = state.dimensions.droppables[id];
if (!target) {
return state;
}
var scrolled = scrollDroppable(target, offset);
return postDroppableChange(state, scrolled, false);
}
if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {
if (state.phase === 'DROP_PENDING') {
return state;
}
!isMovementAllowed(state) ? false ? invariant(false, "Attempting to move in an unsupported phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _action$payload3 = action.payload,
_id = _action$payload3.id,
isEnabled = _action$payload3.isEnabled;
var _target = state.dimensions.droppables[_id];
!_target ? false ? invariant(false, "Cannot find Droppable[id: " + _id + "] to toggle its enabled state") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(_target.isEnabled !== isEnabled) ? false ? invariant(false, "Trying to set droppable isEnabled to " + String(isEnabled) + "\n but it is already " + String(_target.isEnabled)) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var updated = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, _target, {
isEnabled: isEnabled
});
return postDroppableChange(state, updated, true);
}
if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {
if (state.phase === 'DROP_PENDING') {
return state;
}
!isMovementAllowed(state) ? false ? invariant(false, "Attempting to move in an unsupported phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _action$payload4 = action.payload,
_id2 = _action$payload4.id,
isCombineEnabled = _action$payload4.isCombineEnabled;
var _target2 = state.dimensions.droppables[_id2];
!_target2 ? false ? invariant(false, "Cannot find Droppable[id: " + _id2 + "] to toggle its isCombineEnabled state") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(_target2.isCombineEnabled !== isCombineEnabled) ? false ? invariant(false, "Trying to set droppable isCombineEnabled to " + String(isCombineEnabled) + "\n but it is already " + String(_target2.isCombineEnabled)) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _updated = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, _target2, {
isCombineEnabled: isCombineEnabled
});
return postDroppableChange(state, _updated, true);
}
if (action.type === 'MOVE_BY_WINDOW_SCROLL') {
if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {
return state;
}
!isMovementAllowed(state) ? false ? invariant(false, "Cannot move by window in phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!state.isWindowScrollAllowed ? false ? invariant(false, 'Window scrolling is currently not supported for fixed lists. Aborting drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var newScroll = action.payload.newScroll;
if (isEqual(state.viewport.scroll.current, newScroll)) {
return state;
}
var _viewport = scrollViewport(state.viewport, newScroll);
if (isSnapping(state)) {
return refreshSnap({
state: state,
viewport: _viewport
});
}
return update({
state: state,
viewport: _viewport
});
}
if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {
if (!isMovementAllowed(state)) {
return state;
}
var maxScroll = action.payload.maxScroll;
if (isEqual(maxScroll, state.viewport.scroll.max)) {
return state;
}
var withMaxScroll = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, state.viewport, {
scroll: Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, state.viewport.scroll, {
max: maxScroll
})
});
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
phase: 'DRAGGING'
}, state, {
viewport: withMaxScroll
});
}
if (action.type === 'MOVE_UP' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_RIGHT') {
if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {
return state;
}
!(state.phase === 'DRAGGING') ? false ? invariant(false, action.type + " received while not in DRAGGING phase") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _result2 = moveInDirection({
state: state,
type: action.type
});
if (!_result2) {
return state;
}
return update({
state: state,
impact: _result2.impact,
clientSelection: _result2.clientSelection,
scrollJumpRequest: _result2.scrollJumpRequest
});
}
if (action.type === 'DROP_PENDING') {
var _extends3;
var reason = action.payload.reason;
!(state.phase === 'COLLECTING') ? false ? invariant(false, 'Can only move into the DROP_PENDING phase from the COLLECTING phase') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var newState = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
phase: 'DROP_PENDING'
}, state, (_extends3 = {}, _extends3["phase"] = 'DROP_PENDING', _extends3.isWaiting = true, _extends3.reason = reason, _extends3));
return newState;
}
if (action.type === 'DROP_ANIMATE') {
var _action$payload5 = action.payload,
completed = _action$payload5.completed,
dropDuration = _action$payload5.dropDuration,
newHomeClientOffset = _action$payload5.newHomeClientOffset;
!(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? false ? invariant(false, "Cannot animate drop from phase " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _result3 = {
phase: 'DROP_ANIMATING',
dimensions: state.dimensions,
completed: completed,
dropDuration: dropDuration,
newHomeClientOffset: newHomeClientOffset
};
return _result3;
}
if (action.type === 'DROP_COMPLETE') {
var _action$payload6 = action.payload,
_completed = _action$payload6.completed,
shouldFlush = _action$payload6.shouldFlush;
return {
phase: 'IDLE',
completed: _completed,
shouldFlush: shouldFlush
};
}
return state;
});
var lift = function lift(args) {
return {
type: 'LIFT',
payload: args
};
};
var initialPublish = function initialPublish(args) {
return {
type: 'INITIAL_PUBLISH',
payload: args
};
};
var publishWhileDragging$1 = function publishWhileDragging(args) {
return {
type: 'PUBLISH_WHILE_DRAGGING',
payload: args
};
};
var collectionStarting = function collectionStarting() {
return {
type: 'COLLECTION_STARTING',
payload: null
};
};
var updateDroppableScroll = function updateDroppableScroll(args) {
return {
type: 'UPDATE_DROPPABLE_SCROLL',
payload: args
};
};
var updateDroppableIsEnabled = function updateDroppableIsEnabled(args) {
return {
type: 'UPDATE_DROPPABLE_IS_ENABLED',
payload: args
};
};
var updateDroppableIsCombineEnabled = function updateDroppableIsCombineEnabled(args) {
return {
type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',
payload: args
};
};
var move = function move(args) {
return {
type: 'MOVE',
payload: args
};
};
var moveByWindowScroll = function moveByWindowScroll(args) {
return {
type: 'MOVE_BY_WINDOW_SCROLL',
payload: args
};
};
var updateViewportMaxScroll = function updateViewportMaxScroll(args) {
return {
type: 'UPDATE_VIEWPORT_MAX_SCROLL',
payload: args
};
};
var moveUp = function moveUp() {
return {
type: 'MOVE_UP',
payload: null
};
};
var moveDown = function moveDown() {
return {
type: 'MOVE_DOWN',
payload: null
};
};
var moveRight = function moveRight() {
return {
type: 'MOVE_RIGHT',
payload: null
};
};
var moveLeft = function moveLeft() {
return {
type: 'MOVE_LEFT',
payload: null
};
};
var clean = function clean() {
return {
type: 'CLEAN',
payload: null
};
};
var animateDrop = function animateDrop(args) {
return {
type: 'DROP_ANIMATE',
payload: args
};
};
var completeDrop = function completeDrop(args) {
return {
type: 'DROP_COMPLETE',
payload: args
};
};
var drop = function drop(args) {
return {
type: 'DROP',
payload: args
};
};
var dropPending = function dropPending(args) {
return {
type: 'DROP_PENDING',
payload: args
};
};
var dropAnimationFinished = function dropAnimationFinished() {
return {
type: 'DROP_ANIMATION_FINISHED',
payload: null
};
};
var lift$1 = (function (getMarshal) {
return function (_ref) {
var getState = _ref.getState,
dispatch = _ref.dispatch;
return function (next) {
return function (action) {
if (action.type !== 'LIFT') {
next(action);
return;
}
var marshal = getMarshal();
var _action$payload = action.payload,
id = _action$payload.id,
clientSelection = _action$payload.clientSelection,
movementMode = _action$payload.movementMode;
var initial = getState();
if (initial.phase === 'DROP_ANIMATING') {
dispatch(completeDrop({
completed: initial.completed,
shouldFlush: true
}));
}
!(getState().phase === 'IDLE') ? false ? invariant(false, 'Incorrect phase to start a drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var scrollOptions = {
shouldPublishImmediately: movementMode === 'SNAP'
};
var request = {
draggableId: id,
scrollOptions: scrollOptions
};
var _marshal$startPublish = marshal.startPublishing(request),
critical = _marshal$startPublish.critical,
dimensions = _marshal$startPublish.dimensions,
viewport = _marshal$startPublish.viewport;
dispatch(initialPublish({
critical: critical,
dimensions: dimensions,
clientSelection: clientSelection,
movementMode: movementMode,
viewport: viewport
}));
};
};
};
});
var style = (function (marshal) {
return function () {
return function (next) {
return function (action) {
if (action.type === 'INITIAL_PUBLISH') {
marshal.dragging();
}
if (action.type === 'DROP_ANIMATE') {
marshal.dropping(action.payload.completed.result.reason);
}
if (action.type === 'CLEAN' || action.type === 'DROP_COMPLETE') {
marshal.resting();
}
next(action);
};
};
};
});
var curves = {
outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)',
drop: 'cubic-bezier(.2,1,.1,1)'
};
var combine = {
opacity: {
drop: 0,
combining: 0.7
},
scale: {
drop: 0.75
}
};
var timings = {
outOfTheWay: 0.2,
minDropTime: 0.33,
maxDropTime: 0.55
};
var outOfTheWayTiming = timings.outOfTheWay + "s " + curves.outOfTheWay;
var transitions = {
fluid: "opacity " + outOfTheWayTiming,
snap: "transform " + outOfTheWayTiming + ", opacity " + outOfTheWayTiming,
drop: function drop(duration) {
var timing = duration + "s " + curves.drop;
return "transform " + timing + ", opacity " + timing;
},
outOfTheWay: "transform " + outOfTheWayTiming,
placeholder: "height " + outOfTheWayTiming + ", width " + outOfTheWayTiming + ", margin " + outOfTheWayTiming
};
var moveTo = function moveTo(offset) {
return isEqual(offset, origin) ? null : "translate(" + offset.x + "px, " + offset.y + "px)";
};
var transforms = {
moveTo: moveTo,
drop: function drop(offset, isCombining) {
var translate = moveTo(offset);
if (!translate) {
return null;
}
if (!isCombining) {
return translate;
}
return translate + " scale(" + combine.scale.drop + ")";
}
};
var minDropTime = timings.minDropTime,
maxDropTime = timings.maxDropTime;
var dropTimeRange = maxDropTime - minDropTime;
var maxDropTimeAtDistance = 1500;
var cancelDropModifier = 0.6;
var getDropDuration = (function (_ref) {
var current = _ref.current,
destination = _ref.destination,
reason = _ref.reason;
var distance$1 = distance(current, destination);
if (distance$1 <= 0) {
return minDropTime;
}
if (distance$1 >= maxDropTimeAtDistance) {
return maxDropTime;
}
var percentage = distance$1 / maxDropTimeAtDistance;
var duration = minDropTime + dropTimeRange * percentage;
var withDuration = reason === 'CANCEL' ? duration * cancelDropModifier : duration;
return Number(withDuration.toFixed(2));
});
var getNewHomeClientOffset = (function (_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
dimensions = _ref.dimensions,
viewport = _ref.viewport,
onLift = _ref.onLift;
var draggables = dimensions.draggables,
droppables = dimensions.droppables;
var droppableId = whatIsDraggedOver(impact);
var destination = droppableId ? droppables[droppableId] : null;
var home = droppables[draggable.descriptor.droppableId];
var newClientCenter = getClientBorderBoxCenter({
impact: impact,
draggable: draggable,
draggables: draggables,
onLift: onLift,
droppable: destination || home,
viewport: viewport
});
var offset = subtract(newClientCenter, draggable.client.borderBox.center);
var merge = impact.merge;
if (merge && didStartDisplaced(merge.combine.draggableId, onLift)) {
return subtract(offset, onLift.displacedBy.point);
}
return offset;
});
var getDropImpact = (function (_ref) {
var reason = _ref.reason,
lastImpact = _ref.lastImpact,
home = _ref.home,
viewport = _ref.viewport,
draggables = _ref.draggables,
onLiftImpact = _ref.onLiftImpact,
onLift = _ref.onLift;
var didDropInsideDroppable = reason === 'DROP' && Boolean(whatIsDraggedOver(lastImpact));
if (!didDropInsideDroppable) {
var impact = recompute({
impact: onLiftImpact,
destination: home,
viewport: viewport,
draggables: draggables,
onLift: onLift,
forceShouldAnimate: true
});
return {
impact: impact,
didDropInsideDroppable: didDropInsideDroppable
};
}
if (lastImpact.destination) {
return {
impact: lastImpact,
didDropInsideDroppable: didDropInsideDroppable
};
}
var withoutMovement = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, lastImpact, {
movement: noMovement
});
return {
impact: withoutMovement,
didDropInsideDroppable: didDropInsideDroppable
};
});
var drop$1 = (function (_ref) {
var getState = _ref.getState,
dispatch = _ref.dispatch;
return function (next) {
return function (action) {
if (action.type !== 'DROP') {
next(action);
return;
}
var state = getState();
var reason = action.payload.reason;
if (state.phase === 'COLLECTING') {
dispatch(dropPending({
reason: reason
}));
return;
}
if (state.phase === 'IDLE') {
return;
}
var isWaitingForDrop = state.phase === 'DROP_PENDING' && state.isWaiting;
!!isWaitingForDrop ? false ? invariant(false, 'A DROP action occurred while DROP_PENDING and still waiting') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? false ? invariant(false, "Cannot drop in phase: " + state.phase) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var critical = state.critical;
var dimensions = state.dimensions;
var _getDropImpact = getDropImpact({
reason: reason,
lastImpact: state.impact,
onLift: state.onLift,
onLiftImpact: state.onLiftImpact,
home: state.dimensions.droppables[state.critical.droppable.id],
viewport: state.viewport,
draggables: state.dimensions.draggables
}),
impact = _getDropImpact.impact,
didDropInsideDroppable = _getDropImpact.didDropInsideDroppable;
var draggable = dimensions.draggables[state.critical.draggable.id];
var destination = didDropInsideDroppable ? impact.destination : null;
var combine = didDropInsideDroppable && impact.merge ? impact.merge.combine : null;
var source = {
index: critical.draggable.index,
droppableId: critical.droppable.id
};
var result = {
draggableId: draggable.descriptor.id,
type: draggable.descriptor.type,
source: source,
reason: reason,
mode: state.movementMode,
destination: destination,
combine: combine
};
var newHomeClientOffset = getNewHomeClientOffset({
impact: impact,
draggable: draggable,
dimensions: dimensions,
viewport: state.viewport,
onLift: state.onLift
});
var completed = {
critical: state.critical,
result: result,
impact: impact
};
var isAnimationRequired = !isEqual(state.current.client.offset, newHomeClientOffset) || Boolean(result.combine);
if (!isAnimationRequired) {
dispatch(completeDrop({
completed: completed,
shouldFlush: false
}));
return;
}
var dropDuration = getDropDuration({
current: state.current.client.offset,
destination: newHomeClientOffset,
reason: reason
});
var args = {
newHomeClientOffset: newHomeClientOffset,
dropDuration: dropDuration,
completed: completed
};
dispatch(animateDrop(args));
};
};
});
var position = function position(index) {
return index + 1;
};
var onDragStart = function onDragStart(start) {
return "\n You have lifted an item in position " + position(start.source.index) + ".\n Use the arrow keys to move, space bar to drop, and escape to cancel.\n";
};
var withLocation = function withLocation(source, destination) {
var isInHomeList = source.droppableId === destination.droppableId;
var startPosition = position(source.index);
var endPosition = position(destination.index);
if (isInHomeList) {
return "\n You have moved the item from position " + startPosition + "\n to position " + endPosition + "\n ";
}
return "\n You have moved the item from position " + startPosition + "\n in list " + source.droppableId + "\n to list " + destination.droppableId + "\n in position " + endPosition + "\n ";
};
var withCombine = function withCombine(id, source, combine) {
var inHomeList = source.droppableId === combine.droppableId;
if (inHomeList) {
return "\n The item " + id + "\n has been combined with " + combine.draggableId;
}
return "\n The item " + id + "\n in list " + source.droppableId + "\n has been combined with " + combine.draggableId + "\n in list " + combine.droppableId + "\n ";
};
var onDragUpdate = function onDragUpdate(update) {
var location = update.destination;
if (location) {
return withLocation(update.source, location);
}
var combine = update.combine;
if (combine) {
return withCombine(update.draggableId, update.source, combine);
}
return 'You are over an area that cannot be dropped on';
};
var returnedToStart = function returnedToStart(source) {
return "\n The item has returned to its starting position\n of " + position(source.index) + "\n";
};
var onDragEnd = function onDragEnd(result) {
if (result.reason === 'CANCEL') {
return "\n Movement cancelled.\n " + returnedToStart(result.source) + "\n ";
}
var location = result.destination;
var combine = result.combine;
if (location) {
return "\n You have dropped the item.\n " + withLocation(result.source, location) + "\n ";
}
if (combine) {
return "\n You have dropped the item.\n " + withCombine(result.draggableId, result.source, combine) + "\n ";
}
return "\n The item has been dropped while not over a drop area.\n " + returnedToStart(result.source) + "\n ";
};
var preset = {
onDragStart: onDragStart,
onDragUpdate: onDragUpdate,
onDragEnd: onDragEnd
};
var isProduction = "production" === 'production';
var spacesAndTabs = /[ \t]{2,}/g;
var lineStartWithSpaces = /^[ \t]*/gm;
var clean$1 = function clean(value) {
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
};
var getDevMessage = function getDevMessage(message) {
return clean$1("\n %creact-beautiful-dnd\n\n %c" + clean$1(message) + "\n\n %c\uD83D\uDC77\u200D This is a development only message. It will be removed in production builds.\n");
};
var getFormattedMessage = function getFormattedMessage(message) {
return [getDevMessage(message), 'color: #00C584; font-size: 1.2em; font-weight: bold;', 'line-height: 1.5', 'color: #723874;'];
};
var isDisabledFlag = '__react-beautiful-dnd-disable-dev-warnings';
var warning = function warning(message) {
var _console;
if (isProduction) {
return;
}
if (typeof window !== 'undefined' && window[isDisabledFlag]) {
return;
}
(_console = console).warn.apply(_console, getFormattedMessage(message));
};
var getExpiringAnnounce = (function (announce) {
var wasCalled = false;
var isExpired = false;
var timeoutId = setTimeout(function () {
isExpired = true;
});
var result = function result(message) {
if (wasCalled) {
false ? warning('Announcement already made. Not making a second announcement') : void 0;
return;
}
if (isExpired) {
false ? warning("\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n ") : void 0;
return;
}
wasCalled = true;
announce(message);
clearTimeout(timeoutId);
};
result.wasCalled = function () {
return wasCalled;
};
return result;
});
var getAsyncMarshal = (function () {
var entries = [];
var execute = function execute(timerId) {
var index = findIndex(entries, function (item) {
return item.timerId === timerId;
});
!(index !== -1) ? false ? invariant(false, 'Could not find timer') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _entries$splice = entries.splice(index, 1),
entry = _entries$splice[0];
entry.callback();
};
var add = function add(fn) {
var timerId = setTimeout(function () {
return execute(timerId);
});
var entry = {
timerId: timerId,
callback: fn
};
entries.push(entry);
};
var flush = function flush() {
if (!entries.length) {
return;
}
var shallow = [].concat(entries);
entries.length = 0;
shallow.forEach(function (entry) {
clearTimeout(entry.timerId);
entry.callback();
});
};
return {
add: add,
flush: flush
};
});
var areLocationsEqual = function areLocationsEqual(first, second) {
if (first == null && second == null) {
return true;
}
if (first == null || second == null) {
return false;
}
return first.droppableId === second.droppableId && first.index === second.index;
};
var isCombineEqual = function isCombineEqual(first, second) {
if (first == null && second == null) {
return true;
}
if (first == null || second == null) {
return false;
}
return first.draggableId === second.draggableId && first.droppableId === second.droppableId;
};
var isCriticalEqual = function isCriticalEqual(first, second) {
if (first === second) {
return true;
}
var isDraggableEqual = first.draggable.id === second.draggable.id && first.draggable.droppableId === second.draggable.droppableId && first.draggable.type === second.draggable.type && first.draggable.index === second.draggable.index;
var isDroppableEqual = first.droppable.id === second.droppable.id && first.droppable.type === second.droppable.type;
return isDraggableEqual && isDroppableEqual;
};
var withTimings = function withTimings(key, fn) {
start(key);
fn();
finish(key);
};
var getDragStart = function getDragStart(critical, mode) {
return {
draggableId: critical.draggable.id,
type: critical.droppable.type,
source: {
droppableId: critical.droppable.id,
index: critical.draggable.index
},
mode: mode
};
};
var execute = function execute(responder, data, announce, getDefaultMessage) {
if (!responder) {
announce(getDefaultMessage(data));
return;
}
var willExpire = getExpiringAnnounce(announce);
var provided = {
announce: willExpire
};
responder(data, provided);
if (!willExpire.wasCalled()) {
announce(getDefaultMessage(data));
}
};
var getPublisher = (function (getResponders, announce) {
var asyncMarshal = getAsyncMarshal();
var dragging = null;
var beforeStart = function beforeStart(critical, mode) {
!!dragging ? false ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
withTimings('onBeforeDragStart', function () {
var fn = getResponders().onBeforeDragStart;
if (fn) {
fn(getDragStart(critical, mode));
}
});
};
var start = function start(critical, mode) {
!!dragging ? false ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var data = getDragStart(critical, mode);
dragging = {
mode: mode,
lastCritical: critical,
lastLocation: data.source,
lastCombine: null
};
asyncMarshal.add(function () {
withTimings('onDragStart', function () {
return execute(getResponders().onDragStart, data, announce, preset.onDragStart);
});
});
};
var update = function update(critical, impact) {
var location = impact.destination;
var combine = impact.merge ? impact.merge.combine : null;
!dragging ? false ? invariant(false, 'Cannot fire onDragMove when onDragStart has not been called') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var hasCriticalChanged = !isCriticalEqual(critical, dragging.lastCritical);
if (hasCriticalChanged) {
dragging.lastCritical = critical;
}
var hasLocationChanged = !areLocationsEqual(dragging.lastLocation, location);
if (hasLocationChanged) {
dragging.lastLocation = location;
}
var hasGroupingChanged = !isCombineEqual(dragging.lastCombine, combine);
if (hasGroupingChanged) {
dragging.lastCombine = combine;
}
if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) {
return;
}
var data = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, getDragStart(critical, dragging.mode), {
combine: combine,
destination: location
});
asyncMarshal.add(function () {
withTimings('onDragUpdate', function () {
return execute(getResponders().onDragUpdate, data, announce, preset.onDragUpdate);
});
});
};
var flush = function flush() {
!dragging ? false ? invariant(false, 'Can only flush responders while dragging') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
asyncMarshal.flush();
};
var drop = function drop(result) {
!dragging ? false ? invariant(false, 'Cannot fire onDragEnd when there is no matching onDragStart') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
dragging = null;
withTimings('onDragEnd', function () {
return execute(getResponders().onDragEnd, result, announce, preset.onDragEnd);
});
};
var abort = function abort() {
if (!dragging) {
return;
}
var result = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, getDragStart(dragging.lastCritical, dragging.mode), {
combine: null,
destination: null,
reason: 'CANCEL'
});
drop(result);
};
return {
beforeStart: beforeStart,
start: start,
update: update,
flush: flush,
drop: drop,
abort: abort
};
});
var responders = (function (getResponders, announce) {
var publisher = getPublisher(getResponders, announce);
return function (store) {
return function (next) {
return function (action) {
if (action.type === 'INITIAL_PUBLISH') {
var critical = action.payload.critical;
publisher.beforeStart(critical, action.payload.movementMode);
next(action);
publisher.start(critical, action.payload.movementMode);
return;
}
if (action.type === 'DROP_COMPLETE') {
var result = action.payload.completed.result;
publisher.flush();
next(action);
publisher.drop(result);
return;
}
next(action);
if (action.type === 'CLEAN') {
publisher.abort();
return;
}
var state = store.getState();
if (state.phase === 'DRAGGING') {
publisher.update(state.critical, state.impact);
}
};
};
};
});
var dropAnimationFinish = (function (store) {
return function (next) {
return function (action) {
if (action.type !== 'DROP_ANIMATION_FINISHED') {
next(action);
return;
}
var state = store.getState();
!(state.phase === 'DROP_ANIMATING') ? false ? invariant(false, 'Cannot finish a drop animating when no drop is occurring') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
store.dispatch(completeDrop({
completed: state.completed,
shouldFlush: false
}));
};
};
});
var dimensionMarshalStopper = (function (getMarshal) {
return function () {
return function (next) {
return function (action) {
if (action.type === 'DROP_COMPLETE' || action.type === 'CLEAN' || action.type === 'DROP_ANIMATE') {
var marshal = getMarshal();
marshal.stopPublishing();
}
next(action);
};
};
};
});
var shouldEnd = function shouldEnd(action) {
return action.type === 'DROP_COMPLETE' || action.type === 'DROP_ANIMATE' || action.type === 'CLEAN';
};
var shouldCancelPending = function shouldCancelPending(action) {
return action.type === 'COLLECTION_STARTING';
};
var autoScroll = (function (getScroller) {
return function (store) {
return function (next) {
return function (action) {
if (shouldEnd(action)) {
getScroller().stop();
next(action);
return;
}
if (shouldCancelPending(action)) {
getScroller().cancelPending();
next(action);
return;
}
if (action.type === 'INITIAL_PUBLISH') {
next(action);
var state = store.getState();
!(state.phase === 'DRAGGING') ? false ? invariant(false, 'Expected phase to be DRAGGING after INITIAL_PUBLISH') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
getScroller().start(state);
return;
}
next(action);
getScroller().scroll(store.getState());
};
};
};
});
var pendingDrop = (function (store) {
return function (next) {
return function (action) {
next(action);
if (action.type !== 'PUBLISH_WHILE_DRAGGING') {
return;
}
var postActionState = store.getState();
if (postActionState.phase !== 'DROP_PENDING') {
return;
}
if (postActionState.isWaiting) {
return;
}
store.dispatch(drop({
reason: postActionState.reason
}));
};
};
});
var composeEnhancers = false ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : __WEBPACK_IMPORTED_MODULE_3_redux__["d" /* compose */];
var createStore = (function (_ref) {
var getDimensionMarshal = _ref.getDimensionMarshal,
styleMarshal = _ref.styleMarshal,
getResponders = _ref.getResponders,
announce = _ref.announce,
getScroller = _ref.getScroller;
return Object(__WEBPACK_IMPORTED_MODULE_3_redux__["e" /* createStore */])(reducer, composeEnhancers(Object(__WEBPACK_IMPORTED_MODULE_3_redux__["a" /* applyMiddleware */])(style(styleMarshal), dimensionMarshalStopper(getDimensionMarshal), lift$1(getDimensionMarshal), drop$1, dropAnimationFinish, pendingDrop, autoScroll(getScroller), responders(getResponders, announce))));
});
var clean$2 = function clean() {
return {
additions: {},
removals: {},
modified: {}
};
};
var timingKey = 'Publish collection from DOM';
var createPublisher = (function (_ref) {
var getEntries = _ref.getEntries,
callbacks = _ref.callbacks;
var advancedUsageWarning = function () {
if (true) {
return function () {};
}
var hasAnnounced = false;
return function () {
if (hasAnnounced) {
return;
}
hasAnnounced = true;
false ? warning("\n Advanced usage warning: you are adding or removing a dimension during a drag\n This an advanced feature.\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/changes-while-dragging.md\n ") : void 0;
};
}();
var staging = clean$2();
var frameId = null;
var collect = function collect() {
advancedUsageWarning();
if (frameId) {
return;
}
frameId = requestAnimationFrame(function () {
frameId = null;
callbacks.collectionStarting();
var critical = callbacks.getCritical();
start(timingKey);
var entries = getEntries();
var _staging = staging,
additions = _staging.additions,
removals = _staging.removals,
modified = _staging.modified;
var added = __WEBPACK_IMPORTED_MODULE_9__babel_runtime_corejs2_core_js_object_keys___default()(additions).map(function (id) {
return entries.draggables[id].getDimension(origin);
}).sort(function (a, b) {
return a.descriptor.index - b.descriptor.index;
});
var updated = __WEBPACK_IMPORTED_MODULE_9__babel_runtime_corejs2_core_js_object_keys___default()(modified).map(function (id) {
var entry = entries.droppables[id];
!entry ? false ? invariant(false, 'Cannot find dynamically added droppable in cache') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var isHome = entry.descriptor.id === critical.droppable.id;
var options = {
withoutPlaceholder: !isHome
};
return entry.callbacks.recollect(options);
});
var result = {
additions: added,
removals: __WEBPACK_IMPORTED_MODULE_9__babel_runtime_corejs2_core_js_object_keys___default()(removals),
modified: updated
};
staging = clean$2();
finish(timingKey);
callbacks.publish(result);
});
};
var add = function add(descriptor) {
staging.additions[descriptor.id] = descriptor;
staging.modified[descriptor.droppableId] = true;
if (staging.removals[descriptor.id]) {
delete staging.removals[descriptor.id];
}
collect();
};
var remove = function remove(descriptor) {
staging.removals[descriptor.id] = descriptor;
staging.modified[descriptor.droppableId] = true;
if (staging.additions[descriptor.id]) {
delete staging.additions[descriptor.id];
}
collect();
};
var stop = function stop() {
if (!frameId) {
return;
}
cancelAnimationFrame(frameId);
frameId = null;
staging = clean$2();
};
return {
add: add,
remove: remove,
stop: stop
};
});
var getWindowScroll = (function () {
return {
x: window.pageXOffset,
y: window.pageYOffset
};
});
var getDocumentElement = (function () {
var doc = document.documentElement;
!doc ? false ? invariant(false, 'Cannot find document.documentElement') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return doc;
});
var getMaxWindowScroll = (function () {
var doc = getDocumentElement();
var maxScroll = getMaxScroll({
scrollHeight: doc.scrollHeight,
scrollWidth: doc.scrollWidth,
width: doc.clientWidth,
height: doc.clientHeight
});
return maxScroll;
});
var getViewport = (function () {
var scroll = getWindowScroll();
var maxScroll = getMaxWindowScroll();
var top = scroll.y;
var left = scroll.x;
var doc = getDocumentElement();
var width = doc.clientWidth;
var height = doc.clientHeight;
var right = left + width;
var bottom = top + height;
var frame = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["e" /* getRect */])({
top: top,
left: left,
right: right,
bottom: bottom
});
var viewport = {
frame: frame,
scroll: {
initial: scroll,
current: scroll,
max: maxScroll,
diff: {
value: origin,
displacement: origin
}
}
};
return viewport;
});
var getInitialPublish = (function (_ref) {
var critical = _ref.critical,
scrollOptions = _ref.scrollOptions,
entries = _ref.entries;
var timingKey = 'Initial collection from DOM';
start(timingKey);
var viewport = getViewport();
var windowScroll = viewport.scroll.current;
var home = critical.droppable;
var droppables = values(entries.droppables).filter(function (entry) {
return entry.descriptor.type === home.type;
}).map(function (entry) {
return entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions);
});
var draggables = values(entries.draggables).filter(function (entry) {
return entry.descriptor.type === critical.draggable.type;
}).map(function (entry) {
return entry.getDimension(windowScroll);
});
var dimensions = {
draggables: toDraggableMap(draggables),
droppables: toDroppableMap(droppables)
};
finish(timingKey);
var result = {
dimensions: dimensions,
critical: critical,
viewport: viewport
};
return result;
});
var throwIfAddOrRemoveOfWrongType = function throwIfAddOrRemoveOfWrongType(collection, descriptor) {
!(collection.critical.draggable.type === descriptor.type) ? false ? invariant(false, "We have detected that you have added a Draggable during a drag.\n This is not of the same type as the dragging item\n\n Dragging type: " + collection.critical.draggable.type + ".\n Added type: " + descriptor.type + "\n\n We are not allowing this as you can run into problems if your change\n has shifted the positioning of other Droppables, or has changed the size of the page") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
};
var createDimensionMarshal = (function (callbacks) {
var entries = {
droppables: {},
draggables: {}
};
var collection = null;
var publisher = createPublisher({
callbacks: {
publish: callbacks.publishWhileDragging,
collectionStarting: callbacks.collectionStarting,
getCritical: function getCritical() {
!collection ? false ? invariant(false, 'Cannot get critical when there is no collection') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return collection.critical;
}
},
getEntries: function getEntries() {
return entries;
}
});
var registerDraggable = function registerDraggable(descriptor, getDimension) {
var entry = {
descriptor: descriptor,
getDimension: getDimension
};
entries.draggables[descriptor.id] = entry;
if (!collection) {
return;
}
throwIfAddOrRemoveOfWrongType(collection, descriptor);
publisher.add(descriptor);
};
var updateDraggable = function updateDraggable(previous, descriptor, getDimension) {
!entries.draggables[previous.id] ? false ? invariant(false, 'Cannot update draggable registration as no previous registration was found') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
delete entries.draggables[previous.id];
var entry = {
descriptor: descriptor,
getDimension: getDimension
};
entries.draggables[descriptor.id] = entry;
};
var unregisterDraggable = function unregisterDraggable(descriptor) {
var entry = entries.draggables[descriptor.id];
!entry ? false ? invariant(false, "Cannot unregister Draggable with id:\n " + descriptor.id + " as it is not registered") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (entry.descriptor !== descriptor) {
return;
}
delete entries.draggables[descriptor.id];
if (!collection) {
return;
}
!(collection.critical.draggable.id !== descriptor.id) ? false ? invariant(false, 'Cannot remove the dragging item during a drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
throwIfAddOrRemoveOfWrongType(collection, descriptor);
publisher.remove(descriptor);
};
var registerDroppable = function registerDroppable(descriptor, droppableCallbacks) {
var id = descriptor.id;
entries.droppables[id] = {
descriptor: descriptor,
callbacks: droppableCallbacks
};
!!collection ? false ? invariant(false, 'Cannot add a Droppable during a drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
};
var updateDroppable = function updateDroppable(previous, descriptor, droppableCallbacks) {
!entries.droppables[previous.id] ? false ? invariant(false, 'Cannot update droppable registration as no previous registration was found') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
delete entries.droppables[previous.id];
var entry = {
descriptor: descriptor,
callbacks: droppableCallbacks
};
entries.droppables[descriptor.id] = entry;
!!collection ? false ? invariant(false, 'You are not able to update the id or type of a droppable during a drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
};
var unregisterDroppable = function unregisterDroppable(descriptor) {
var entry = entries.droppables[descriptor.id];
!entry ? false ? invariant(false, "Cannot unregister Droppable with id " + descriptor.id + " as as it is not registered") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (entry.descriptor !== descriptor) {
return;
}
delete entries.droppables[descriptor.id];
!!collection ? false ? invariant(false, 'Cannot add a Droppable during a drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
};
var updateDroppableIsEnabled = function updateDroppableIsEnabled(id, isEnabled) {
!entries.droppables[id] ? false ? invariant(false, "Cannot update is enabled flag of Droppable " + id + " as it is not registered") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!collection) {
return;
}
callbacks.updateDroppableIsEnabled({
id: id,
isEnabled: isEnabled
});
};
var updateDroppableIsCombineEnabled = function updateDroppableIsCombineEnabled(id, isCombineEnabled) {
!entries.droppables[id] ? false ? invariant(false, "Cannot update isCombineEnabled flag of Droppable " + id + " as it is not registered") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!collection) {
return;
}
callbacks.updateDroppableIsCombineEnabled({
id: id,
isCombineEnabled: isCombineEnabled
});
};
var updateDroppableScroll = function updateDroppableScroll(id, newScroll) {
!entries.droppables[id] ? false ? invariant(false, "Cannot update the scroll on Droppable " + id + " as it is not registered") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!collection) {
return;
}
callbacks.updateDroppableScroll({
id: id,
offset: newScroll
});
};
var scrollDroppable = function scrollDroppable(id, change) {
var entry = entries.droppables[id];
!entry ? false ? invariant(false, "Cannot scroll Droppable " + id + " as it is not registered") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!collection) {
return;
}
entry.callbacks.scroll(change);
};
var stopPublishing = function stopPublishing() {
if (!collection) {
return;
}
publisher.stop();
var home = collection.critical.droppable;
values(entries.droppables).filter(function (entry) {
return entry.descriptor.type === home.type;
}).forEach(function (entry) {
return entry.callbacks.dragStopped();
});
collection = null;
};
var startPublishing = function startPublishing(request) {
!!collection ? false ? invariant(false, 'Cannot start capturing critical dimensions as there is already a collection') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var entry = entries.draggables[request.draggableId];
!entry ? false ? invariant(false, 'Cannot find critical draggable entry') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var home = entries.droppables[entry.descriptor.droppableId];
!home ? false ? invariant(false, 'Cannot find critical droppable entry') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var critical = {
draggable: entry.descriptor,
droppable: home.descriptor
};
collection = {
critical: critical
};
return getInitialPublish({
critical: critical,
entries: entries,
scrollOptions: request.scrollOptions
});
};
var marshal = {
registerDraggable: registerDraggable,
updateDraggable: updateDraggable,
unregisterDraggable: unregisterDraggable,
registerDroppable: registerDroppable,
updateDroppable: updateDroppable,
unregisterDroppable: unregisterDroppable,
updateDroppableIsEnabled: updateDroppableIsEnabled,
updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled,
scrollDroppable: scrollDroppable,
updateDroppableScroll: updateDroppableScroll,
startPublishing: startPublishing,
stopPublishing: stopPublishing
};
return marshal;
});
var prefix = 'data-react-beautiful-dnd';
var dragHandle = prefix + "-drag-handle";
var draggable = prefix + "-draggable";
var droppable = prefix + "-droppable";
var makeGetSelector = function makeGetSelector(context) {
return function (attribute) {
return "[" + attribute + "=\"" + context + "\"]";
};
};
var getStyles = function getStyles(rules, property) {
return rules.map(function (rule) {
var value = rule.styles[property];
if (!value) {
return '';
}
return rule.selector + " { " + value + " }";
}).join(' ');
};
var noPointerEvents = 'pointer-events: none;';
var getStyles$1 = (function (styleContext) {
var getSelector = makeGetSelector(styleContext);
var dragHandle$1 = function () {
var grabCursor = "\n cursor: -webkit-grab;\n cursor: grab;\n ";
return {
selector: getSelector(dragHandle),
styles: {
always: "\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",
resting: grabCursor,
dragging: noPointerEvents,
dropAnimating: grabCursor
}
};
}();
var draggable$1 = function () {
var transition = "\n transition: " + transitions.outOfTheWay + ";\n ";
return {
selector: getSelector(draggable),
styles: {
dragging: transition,
dropAnimating: transition,
userCancel: transition
}
};
}();
var droppable$1 = {
selector: getSelector(droppable),
styles: {
always: "overflow-anchor: none;"
}
};
var body = {
selector: 'body',
styles: {
dragging: "\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "
}
};
var rules = [draggable$1, dragHandle$1, droppable$1, body];
return {
always: getStyles(rules, 'always'),
resting: getStyles(rules, 'resting'),
dragging: getStyles(rules, 'dragging'),
dropAnimating: getStyles(rules, 'dropAnimating'),
userCancel: getStyles(rules, 'userCancel')
};
});
var count = 0;
var resetStyleContext = function resetStyleContext() {
count = 0;
};
var getHead = function getHead() {
var head = document.querySelector('head');
!head ? false ? invariant(false, 'Cannot find the head to append a style to') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return head;
};
var createStyleEl = function createStyleEl() {
var el = document.createElement('style');
el.type = 'text/css';
return el;
};
var createStyleMarshal = (function () {
var context = "" + count++;
var styles = getStyles$1(context);
var always = null;
var dynamic = null;
var setStyle = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (el, proposed) {
!el ? false ? invariant(false, 'Cannot set style of style tag if not mounted') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
el.innerHTML = proposed;
});
var mount = function mount() {
!(!always && !dynamic) ? false ? invariant(false, 'Style marshal already mounted') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
always = createStyleEl();
dynamic = createStyleEl();
always.setAttribute(prefix + "-always", context);
dynamic.setAttribute(prefix + "-dynamic", context);
getHead().appendChild(always);
getHead().appendChild(dynamic);
setStyle(always, styles.always);
setStyle(dynamic, styles.resting);
};
var dragging = function dragging() {
return setStyle(dynamic, styles.dragging);
};
var dropping = function dropping(reason) {
if (reason === 'DROP') {
setStyle(dynamic, styles.dropAnimating);
return;
}
setStyle(dynamic, styles.userCancel);
};
var resting = function resting() {
return setStyle(dynamic, styles.resting);
};
var unmount = function unmount() {
!(always && dynamic) ? false ? invariant(false, 'Cannot unmount style marshal as it is already unmounted') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
getHead().removeChild(always);
getHead().removeChild(dynamic);
always = null;
dynamic = null;
};
var marshal = {
dragging: dragging,
dropping: dropping,
resting: resting,
styleContext: context,
mount: mount,
unmount: unmount
};
return marshal;
});
var canStartDrag = (function (state, id) {
if (state.phase === 'IDLE') {
return true;
}
if (state.phase !== 'DROP_ANIMATING') {
return false;
}
if (state.completed.result.draggableId === id) {
return false;
}
return state.completed.result.reason === 'DROP';
});
var scrollWindow = (function (change) {
window.scrollBy(change.x, change.y);
});
var getBodyElement = (function () {
var body = document.body;
!body ? false ? invariant(false, 'Cannot find document.body') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return body;
});
var count$1 = 0;
var visuallyHidden = {
position: 'absolute',
width: '1px',
height: '1px',
margin: '-1px',
border: '0',
padding: '0',
overflow: 'hidden',
clip: 'rect(0 0 0 0)',
'clip-path': 'inset(100%)'
};
var createAnnouncer = (function () {
var id = "react-beautiful-dnd-announcement-" + count$1++;
var el = null;
var announce = function announce(message) {
if (el) {
el.textContent = message;
return;
}
false ? warning("\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n \"" + message + "\"\n ") : void 0;
};
var mount = function mount() {
!!el ? false ? invariant(false, 'Announcer already mounted') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
el = document.createElement('div');
el.id = id;
el.setAttribute('aria-live', 'assertive');
el.setAttribute('role', 'log');
el.setAttribute('aria-atomic', 'true');
__WEBPACK_IMPORTED_MODULE_10__babel_runtime_corejs2_core_js_object_assign___default()(el.style, visuallyHidden);
getBodyElement().appendChild(el);
};
var unmount = function unmount() {
!el ? false ? invariant(false, 'Will not unmount announcer as it is already unmounted') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
getBodyElement().removeChild(el);
el = null;
};
var announcer = {
announce: announce,
id: id,
mount: mount,
unmount: unmount
};
return announcer;
});
var getScrollableDroppables = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (droppables) {
return toDroppableList(droppables).filter(function (droppable) {
if (!droppable.isEnabled) {
return false;
}
if (!droppable.frame) {
return false;
}
return true;
});
});
var getScrollableDroppableOver = function getScrollableDroppableOver(target, droppables) {
var maybe = find(getScrollableDroppables(droppables), function (droppable) {
!droppable.frame ? false ? invariant(false, 'Invalid result') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return isPositionInFrame(droppable.frame.pageMarginBox)(target);
});
return maybe;
};
var getBestScrollableDroppable = (function (_ref) {
var center = _ref.center,
destination = _ref.destination,
droppables = _ref.droppables;
if (destination) {
var _dimension = droppables[destination];
if (!_dimension.frame) {
return null;
}
return _dimension;
}
var dimension = getScrollableDroppableOver(center, droppables);
return dimension;
});
var config = {
startFromPercentage: 0.25,
maxScrollAtPercentage: 0.05,
maxPixelScroll: 28,
ease: function ease(percentage) {
return Math.pow(percentage, 2);
},
durationDampening: {
stopDampeningAt: 1200,
accelerateAt: 360
}
};
var getDistanceThresholds = (function (container, axis) {
var startScrollingFrom = container[axis.size] * config.startFromPercentage;
var maxScrollValueAt = container[axis.size] * config.maxScrollAtPercentage;
var thresholds = {
startScrollingFrom: startScrollingFrom,
maxScrollValueAt: maxScrollValueAt
};
return thresholds;
});
var getPercentage = (function (_ref) {
var startOfRange = _ref.startOfRange,
endOfRange = _ref.endOfRange,
current = _ref.current;
var range = endOfRange - startOfRange;
if (range === 0) {
false ? warning("\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n ") : void 0;
return 0;
}
var currentInRange = current - startOfRange;
var percentage = currentInRange / range;
return percentage;
});
var minScroll = 1;
var getValueFromDistance = (function (distanceToEdge, thresholds) {
if (distanceToEdge > thresholds.startScrollingFrom) {
return 0;
}
if (distanceToEdge <= thresholds.maxScrollValueAt) {
return config.maxPixelScroll;
}
if (distanceToEdge === thresholds.startScrollingFrom) {
return minScroll;
}
var percentageFromMaxScrollValueAt = getPercentage({
startOfRange: thresholds.maxScrollValueAt,
endOfRange: thresholds.startScrollingFrom,
current: distanceToEdge
});
var percentageFromStartScrollingFrom = 1 - percentageFromMaxScrollValueAt;
var scroll = config.maxPixelScroll * config.ease(percentageFromStartScrollingFrom);
return Math.ceil(scroll);
});
var accelerateAt = config.durationDampening.accelerateAt;
var stopAt = config.durationDampening.stopDampeningAt;
var dampenValueByTime = (function (proposedScroll, dragStartTime) {
var startOfRange = dragStartTime;
var endOfRange = stopAt;
var now = __WEBPACK_IMPORTED_MODULE_11__babel_runtime_corejs2_core_js_date_now___default()();
var runTime = now - startOfRange;
if (runTime >= stopAt) {
return proposedScroll;
}
if (runTime < accelerateAt) {
return minScroll;
}
var betweenAccelerateAtAndStopAtPercentage = getPercentage({
startOfRange: accelerateAt,
endOfRange: endOfRange,
current: runTime
});
var scroll = proposedScroll * config.ease(betweenAccelerateAtAndStopAtPercentage);
return Math.ceil(scroll);
});
var getValue = (function (_ref) {
var distanceToEdge = _ref.distanceToEdge,
thresholds = _ref.thresholds,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var scroll = getValueFromDistance(distanceToEdge, thresholds);
if (scroll === 0) {
return 0;
}
if (!shouldUseTimeDampening) {
return scroll;
}
return Math.max(dampenValueByTime(scroll, dragStartTime), minScroll);
});
var getScrollOnAxis = (function (_ref) {
var container = _ref.container,
distanceToEdges = _ref.distanceToEdges,
dragStartTime = _ref.dragStartTime,
axis = _ref.axis,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var thresholds = getDistanceThresholds(container, axis);
var isCloserToEnd = distanceToEdges[axis.end] < distanceToEdges[axis.start];
if (isCloserToEnd) {
return getValue({
distanceToEdge: distanceToEdges[axis.end],
thresholds: thresholds,
dragStartTime: dragStartTime,
shouldUseTimeDampening: shouldUseTimeDampening
});
}
return -1 * getValue({
distanceToEdge: distanceToEdges[axis.start],
thresholds: thresholds,
dragStartTime: dragStartTime,
shouldUseTimeDampening: shouldUseTimeDampening
});
});
var adjustForSizeLimits = (function (_ref) {
var container = _ref.container,
subject = _ref.subject,
proposedScroll = _ref.proposedScroll;
var isTooBigVertically = subject.height > container.height;
var isTooBigHorizontally = subject.width > container.width;
if (!isTooBigHorizontally && !isTooBigVertically) {
return proposedScroll;
}
if (isTooBigHorizontally && isTooBigVertically) {
return null;
}
return {
x: isTooBigHorizontally ? 0 : proposedScroll.x,
y: isTooBigVertically ? 0 : proposedScroll.y
};
});
var clean$3 = apply(function (value) {
return value === 0 ? 0 : value;
});
var getScroll = (function (_ref) {
var dragStartTime = _ref.dragStartTime,
container = _ref.container,
subject = _ref.subject,
center = _ref.center,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var distanceToEdges = {
top: center.y - container.top,
right: container.right - center.x,
bottom: container.bottom - center.y,
left: center.x - container.left
};
var y = getScrollOnAxis({
container: container,
distanceToEdges: distanceToEdges,
dragStartTime: dragStartTime,
axis: vertical,
shouldUseTimeDampening: shouldUseTimeDampening
});
var x = getScrollOnAxis({
container: container,
distanceToEdges: distanceToEdges,
dragStartTime: dragStartTime,
axis: horizontal,
shouldUseTimeDampening: shouldUseTimeDampening
});
var required = clean$3({
x: x,
y: y
});
if (isEqual(required, origin)) {
return null;
}
var limited = adjustForSizeLimits({
container: container,
subject: subject,
proposedScroll: required
});
if (!limited) {
return null;
}
return isEqual(limited, origin) ? null : limited;
});
var smallestSigned = apply(function (value) {
if (value === 0) {
return 0;
}
return value > 0 ? 1 : -1;
});
var getOverlap = function () {
var getRemainder = function getRemainder(target, max) {
if (target < 0) {
return target;
}
if (target > max) {
return target - max;
}
return 0;
};
return function (_ref) {
var current = _ref.current,
max = _ref.max,
change = _ref.change;
var targetScroll = add(current, change);
var overlap = {
x: getRemainder(targetScroll.x, max.x),
y: getRemainder(targetScroll.y, max.y)
};
if (isEqual(overlap, origin)) {
return null;
}
return overlap;
};
}();
var canPartiallyScroll = function canPartiallyScroll(_ref2) {
var rawMax = _ref2.max,
current = _ref2.current,
change = _ref2.change;
var max = {
x: Math.max(current.x, rawMax.x),
y: Math.max(current.y, rawMax.y)
};
var smallestChange = smallestSigned(change);
var overlap = getOverlap({
max: max,
current: current,
change: smallestChange
});
if (!overlap) {
return true;
}
if (smallestChange.x !== 0 && overlap.x === 0) {
return true;
}
if (smallestChange.y !== 0 && overlap.y === 0) {
return true;
}
return false;
};
var canScrollWindow = function canScrollWindow(viewport, change) {
return canPartiallyScroll({
current: viewport.scroll.current,
max: viewport.scroll.max,
change: change
});
};
var getWindowOverlap = function getWindowOverlap(viewport, change) {
if (!canScrollWindow(viewport, change)) {
return null;
}
var max = viewport.scroll.max;
var current = viewport.scroll.current;
return getOverlap({
current: current,
max: max,
change: change
});
};
var canScrollDroppable = function canScrollDroppable(droppable, change) {
var frame = droppable.frame;
if (!frame) {
return false;
}
return canPartiallyScroll({
current: frame.scroll.current,
max: frame.scroll.max,
change: change
});
};
var getDroppableOverlap = function getDroppableOverlap(droppable, change) {
var frame = droppable.frame;
if (!frame) {
return null;
}
if (!canScrollDroppable(droppable, change)) {
return null;
}
return getOverlap({
current: frame.scroll.current,
max: frame.scroll.max,
change: change
});
};
var getWindowScrollChange = (function (_ref) {
var viewport = _ref.viewport,
subject = _ref.subject,
center = _ref.center,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var scroll = getScroll({
dragStartTime: dragStartTime,
container: viewport.frame,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
return scroll && canScrollWindow(viewport, scroll) ? scroll : null;
});
var getDroppableScrollChange = (function (_ref) {
var droppable = _ref.droppable,
subject = _ref.subject,
center = _ref.center,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var frame = droppable.frame;
if (!frame) {
return null;
}
var scroll = getScroll({
dragStartTime: dragStartTime,
container: frame.pageMarginBox,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
return scroll && canScrollDroppable(droppable, scroll) ? scroll : null;
});
var scroll$1 = (function (_ref) {
var state = _ref.state,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening,
scrollWindow = _ref.scrollWindow,
scrollDroppable = _ref.scrollDroppable;
var center = state.current.page.borderBoxCenter;
var draggable = state.dimensions.draggables[state.critical.draggable.id];
var subject = draggable.page.marginBox;
if (state.isWindowScrollAllowed) {
var viewport = state.viewport;
var _change = getWindowScrollChange({
dragStartTime: dragStartTime,
viewport: viewport,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
if (_change) {
scrollWindow(_change);
return;
}
}
var droppable = getBestScrollableDroppable({
center: center,
destination: whatIsDraggedOver(state.impact),
droppables: state.dimensions.droppables
});
if (!droppable) {
return;
}
var change = getDroppableScrollChange({
dragStartTime: dragStartTime,
droppable: droppable,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
if (change) {
scrollDroppable(droppable.descriptor.id, change);
}
});
var createFluidScroller = (function (_ref) {
var scrollWindow = _ref.scrollWindow,
scrollDroppable = _ref.scrollDroppable;
var scheduleWindowScroll = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(scrollWindow);
var scheduleDroppableScroll = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(scrollDroppable);
var dragging = null;
var tryScroll = function tryScroll(state) {
!dragging ? false ? invariant(false, 'Cannot fluid scroll if not dragging') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var _dragging = dragging,
shouldUseTimeDampening = _dragging.shouldUseTimeDampening,
dragStartTime = _dragging.dragStartTime;
scroll$1({
state: state,
scrollWindow: scheduleWindowScroll,
scrollDroppable: scheduleDroppableScroll,
dragStartTime: dragStartTime,
shouldUseTimeDampening: shouldUseTimeDampening
});
};
var cancelPending = function cancelPending() {
!dragging ? false ? invariant(false, 'Cannot cancel pending fluid scroll when not started') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
scheduleWindowScroll.cancel();
scheduleDroppableScroll.cancel();
};
var start$1 = function start$1(state) {
start('starting fluid scroller');
!!dragging ? false ? invariant(false, 'Cannot start auto scrolling when already started') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var dragStartTime = __WEBPACK_IMPORTED_MODULE_11__babel_runtime_corejs2_core_js_date_now___default()();
var wasScrollNeeded = false;
var fakeScrollCallback = function fakeScrollCallback() {
wasScrollNeeded = true;
};
scroll$1({
state: state,
dragStartTime: 0,
shouldUseTimeDampening: false,
scrollWindow: fakeScrollCallback,
scrollDroppable: fakeScrollCallback
});
dragging = {
dragStartTime: dragStartTime,
shouldUseTimeDampening: wasScrollNeeded
};
finish('starting fluid scroller');
if (wasScrollNeeded) {
tryScroll(state);
}
};
var stop = function stop() {
if (!dragging) {
return;
}
cancelPending();
dragging = null;
};
return {
start: start$1,
stop: stop,
cancelPending: cancelPending,
scroll: tryScroll
};
});
var createJumpScroller = (function (_ref) {
var move = _ref.move,
scrollDroppable = _ref.scrollDroppable,
scrollWindow = _ref.scrollWindow;
var moveByOffset = function moveByOffset(state, offset) {
var client = add(state.current.client.selection, offset);
move({
client: client
});
};
var scrollDroppableAsMuchAsItCan = function scrollDroppableAsMuchAsItCan(droppable, change) {
if (!canScrollDroppable(droppable, change)) {
return change;
}
var overlap = getDroppableOverlap(droppable, change);
if (!overlap) {
scrollDroppable(droppable.descriptor.id, change);
return null;
}
var whatTheDroppableCanScroll = subtract(change, overlap);
scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);
var remainder = subtract(change, whatTheDroppableCanScroll);
return remainder;
};
var scrollWindowAsMuchAsItCan = function scrollWindowAsMuchAsItCan(isWindowScrollAllowed, viewport, change) {
if (!isWindowScrollAllowed) {
return change;
}
if (!canScrollWindow(viewport, change)) {
return change;
}
var overlap = getWindowOverlap(viewport, change);
if (!overlap) {
scrollWindow(change);
return null;
}
var whatTheWindowCanScroll = subtract(change, overlap);
scrollWindow(whatTheWindowCanScroll);
var remainder = subtract(change, whatTheWindowCanScroll);
return remainder;
};
var jumpScroller = function jumpScroller(state) {
var request = state.scrollJumpRequest;
if (!request) {
return;
}
var destination = whatIsDraggedOver(state.impact);
!destination ? false ? invariant(false, 'Cannot perform a jump scroll when there is no destination') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var droppableRemainder = scrollDroppableAsMuchAsItCan(state.dimensions.droppables[destination], request);
if (!droppableRemainder) {
return;
}
var viewport = state.viewport;
var windowRemainder = scrollWindowAsMuchAsItCan(state.isWindowScrollAllowed, viewport, droppableRemainder);
if (!windowRemainder) {
return;
}
moveByOffset(state, windowRemainder);
};
return jumpScroller;
});
var createAutoScroller = (function (_ref) {
var scrollDroppable = _ref.scrollDroppable,
scrollWindow = _ref.scrollWindow,
move = _ref.move;
var fluidScroller = createFluidScroller({
scrollWindow: scrollWindow,
scrollDroppable: scrollDroppable
});
var jumpScroll = createJumpScroller({
move: move,
scrollWindow: scrollWindow,
scrollDroppable: scrollDroppable
});
var scroll = function scroll(state) {
if (state.phase !== 'DRAGGING') {
return;
}
if (state.movementMode === 'FLUID') {
fluidScroller.scroll(state);
return;
}
if (!state.scrollJumpRequest) {
return;
}
jumpScroll(state);
};
var scroller = {
scroll: scroll,
cancelPending: fluidScroller.cancelPending,
start: fluidScroller.start,
stop: fluidScroller.stop
};
return scroller;
});
var prefix$1 = function prefix(key) {
return "private-react-beautiful-dnd-key-do-not-use-" + key;
};
var storeKey = prefix$1('store');
var droppableIdKey = prefix$1('droppable-id');
var droppableTypeKey = prefix$1('droppable-type');
var dimensionMarshalKey = prefix$1('dimension-marshal');
var styleKey = prefix$1('style');
var canLiftKey = prefix$1('can-lift');
var isMovementAllowedKey = prefix$1('is-movement-allowed');
var peerDependencies = {
react: "^16.3.1"
};
var semver = /(\d+)\.(\d+)\.(\d+)/;
var getVersion = function getVersion(value) {
var result = semver.exec(value);
!(result != null) ? false ? invariant(false, "Unable to parse React version " + value) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var major = Number(result[1]);
var minor = Number(result[2]);
var patch = Number(result[3]);
return {
major: major,
minor: minor,
patch: patch,
raw: value
};
};
var isSatisfied = function isSatisfied(expected, actual) {
if (actual.major > expected.major) {
return true;
}
if (actual.major < expected.major) {
return false;
}
if (actual.minor > expected.minor) {
return true;
}
if (actual.minor < expected.minor) {
return false;
}
return actual.patch >= expected.patch;
};
var checkReactVersion = (function (peerDepValue, actualValue) {
var peerDep = getVersion(peerDepValue);
var actual = getVersion(actualValue);
if (isSatisfied(peerDep, actual)) {
return;
}
false ? warning("\n React version: [" + actual.raw + "]\n does not satisfy expected peer dependency version: [" + peerDep.raw + "]\n\n This can result in run time bugs, and even fatal crashes\n ") : void 0;
});
var suffix = "\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md\n";
var checkDoctype = (function (doc) {
var doctype = doc.doctype;
if (!doctype) {
false ? warning("\n No <!doctype html> found.\n\n " + suffix + "\n ") : void 0;
return;
}
if (doctype.name.toLowerCase() !== 'html') {
false ? warning("\n Unexpected <!doctype> found: (" + doctype.name + ")\n\n " + suffix + "\n ") : void 0;
}
if (doctype.publicId !== '') {
false ? warning("\n Unexpected <!doctype> publicId found: (" + doctype.publicId + ")\n A html5 doctype does not have a publicId\n\n " + suffix + "\n ") : void 0;
}
});
function printFatalError(error) {
var _console;
if (true) {
return;
}
(_console = console).error.apply(_console, getFormattedMessage("\n An error has occurred while a drag is occurring.\n Any existing drag will be cancelled.\n\n > " + error.message + "\n "));
console.error('raw', error);
}
var ErrorBoundary = function (_React$Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(ErrorBoundary, _React$Component);
function ErrorBoundary() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.onFatalError = function (error) {
printFatalError(error);
_this.props.onError();
if (error.message.indexOf('Invariant failed') !== -1) {
_this.setState({});
return;
}
throw error;
};
return _this;
}
var _proto = ErrorBoundary.prototype;
_proto.componentDidMount = function componentDidMount() {
window.addEventListener('error', this.onFatalError);
};
_proto.componentWillUnmount = function componentWillUnmount() {
window.removeEventListener('error', this.onFatalError);
};
_proto.componentDidCatch = function componentDidCatch(error) {
this.onFatalError(error);
};
_proto.render = function render() {
return this.props.children;
};
return ErrorBoundary;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
var _DragDropContext$chil;
var resetServerContext = function resetServerContext() {
resetStyleContext();
};
var DragDropContext = function (_React$Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(DragDropContext, _React$Component);
function DragDropContext(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this.store = void 0;
_this.dimensionMarshal = void 0;
_this.styleMarshal = void 0;
_this.autoScroller = void 0;
_this.announcer = void 0;
_this.unsubscribe = void 0;
_this.canLift = function (id) {
return canStartDrag(_this.store.getState(), id);
};
_this.getIsMovementAllowed = function () {
return isMovementAllowed(_this.store.getState());
};
_this.tryResetStore = function () {
var state = _this.store.getState();
if (state.phase !== 'IDLE') {
_this.store.dispatch(clean());
}
};
if (false) {
!(typeof props.onDragEnd === 'function') ? process.env.NODE_ENV !== "production" ? invariant(false, 'A DragDropContext requires an onDragEnd function to perform reordering logic') : invariant(false) : void 0;
}
_this.announcer = createAnnouncer();
_this.styleMarshal = createStyleMarshal();
_this.store = createStore({
getDimensionMarshal: function getDimensionMarshal() {
return _this.dimensionMarshal;
},
styleMarshal: _this.styleMarshal,
getResponders: function getResponders() {
return {
onBeforeDragStart: _this.props.onBeforeDragStart,
onDragStart: _this.props.onDragStart,
onDragEnd: _this.props.onDragEnd,
onDragUpdate: _this.props.onDragUpdate
};
},
announce: _this.announcer.announce,
getScroller: function getScroller() {
return _this.autoScroller;
}
});
var callbacks = Object(__WEBPACK_IMPORTED_MODULE_3_redux__["b" /* bindActionCreators */])({
publishWhileDragging: publishWhileDragging$1,
updateDroppableScroll: updateDroppableScroll,
updateDroppableIsEnabled: updateDroppableIsEnabled,
updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled,
collectionStarting: collectionStarting
}, _this.store.dispatch);
_this.dimensionMarshal = createDimensionMarshal(callbacks);
_this.autoScroller = createAutoScroller(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({
scrollWindow: scrollWindow,
scrollDroppable: _this.dimensionMarshal.scrollDroppable
}, Object(__WEBPACK_IMPORTED_MODULE_3_redux__["b" /* bindActionCreators */])({
move: move
}, _this.store.dispatch)));
return _this;
}
var _proto = DragDropContext.prototype;
_proto.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[storeKey] = this.store, _ref[dimensionMarshalKey] = this.dimensionMarshal, _ref[styleKey] = this.styleMarshal.styleContext, _ref[canLiftKey] = this.canLift, _ref[isMovementAllowedKey] = this.getIsMovementAllowed, _ref;
};
_proto.componentDidMount = function componentDidMount() {
this.styleMarshal.mount();
this.announcer.mount();
if (false) {
checkReactVersion(peerDependencies.react, React.version);
checkDoctype(document);
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.tryResetStore();
this.styleMarshal.unmount();
this.announcer.unmount();
};
_proto.render = function render() {
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(ErrorBoundary, {
onError: this.tryResetStore
}, this.props.children);
};
return DragDropContext;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
DragDropContext.childContextTypes = (_DragDropContext$chil = {}, _DragDropContext$chil[storeKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.shape({
dispatch: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired,
subscribe: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired,
getState: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired
}).isRequired, _DragDropContext$chil[dimensionMarshalKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object.isRequired, _DragDropContext$chil[styleKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _DragDropContext$chil[canLiftKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired, _DragDropContext$chil[isMovementAllowedKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired, _DragDropContext$chil);
var isEqual$2 = function isEqual(base) {
return function (value) {
return base === value;
};
};
var isScroll = isEqual$2('scroll');
var isAuto = isEqual$2('auto');
var isVisible$1 = isEqual$2('visible');
var isEither = function isEither(overflow, fn) {
return fn(overflow.overflowX) || fn(overflow.overflowY);
};
var isBoth = function isBoth(overflow, fn) {
return fn(overflow.overflowX) && fn(overflow.overflowY);
};
var isElementScrollable = function isElementScrollable(el) {
var style = window.getComputedStyle(el);
var overflow = {
overflowX: style.overflowX,
overflowY: style.overflowY
};
return isEither(overflow, isScroll) || isEither(overflow, isAuto);
};
var isBodyScrollable = function isBodyScrollable() {
if (true) {
return false;
}
var body = getBodyElement();
var html = document.documentElement;
!html ? false ? invariant(false) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!isElementScrollable(body)) {
return false;
}
var htmlStyle = window.getComputedStyle(html);
var htmlOverflow = {
overflowX: htmlStyle.overflowX,
overflowY: htmlStyle.overflowY
};
if (isBoth(htmlOverflow, isVisible$1)) {
return false;
}
false ? warning("\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/how-we-detect-scroll-containers.md\n ") : void 0;
return false;
};
var getClosestScrollable = function getClosestScrollable(el) {
if (el == null) {
return null;
}
if (el === document.body) {
return isBodyScrollable() ? el : null;
}
if (el === document.documentElement) {
return null;
}
if (!isElementScrollable(el)) {
return getClosestScrollable(el.parentElement);
}
return el;
};
var checkForNestedScrollContainers = (function (scrollable) {
if (!scrollable) {
return;
}
var anotherScrollParent = getClosestScrollable(scrollable.parentElement);
if (!anotherScrollParent) {
return;
}
false ? warning("\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n ") : void 0;
});
var getScroll$1 = (function (el) {
return {
x: el.scrollLeft,
y: el.scrollTop
};
});
var getIsFixed = function getIsFixed(el) {
if (!el) {
return false;
}
var style = window.getComputedStyle(el);
if (style.position === 'fixed') {
return true;
}
return getIsFixed(el.parentElement);
};
var getEnv = (function (start) {
var closestScrollable = getClosestScrollable(start);
var isFixedOnPage = getIsFixed(start);
return {
closestScrollable: closestScrollable,
isFixedOnPage: isFixedOnPage
};
});
var getClient = function getClient(targetRef, closestScrollable) {
var base = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["d" /* getBox */])(targetRef);
if (!closestScrollable) {
return base;
}
if (targetRef !== closestScrollable) {
return base;
}
var top = base.paddingBox.top - closestScrollable.scrollTop;
var left = base.paddingBox.left - closestScrollable.scrollLeft;
var bottom = top + closestScrollable.scrollHeight;
var right = left + closestScrollable.scrollWidth;
var paddingBox = {
top: top,
right: right,
bottom: bottom,
left: left
};
var borderBox = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["c" /* expand */])(paddingBox, base.border);
var client = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["b" /* createBox */])({
borderBox: borderBox,
margin: base.margin,
border: base.border,
padding: base.padding
});
return client;
};
var getDimension = (function (_ref) {
var ref = _ref.ref,
descriptor = _ref.descriptor,
env = _ref.env,
windowScroll = _ref.windowScroll,
direction = _ref.direction,
isDropDisabled = _ref.isDropDisabled,
isCombineEnabled = _ref.isCombineEnabled,
shouldClipSubject = _ref.shouldClipSubject;
var closestScrollable = env.closestScrollable;
var client = getClient(ref, closestScrollable);
var page = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["g" /* withScroll */])(client, windowScroll);
var closest = function () {
if (!closestScrollable) {
return null;
}
var frameClient = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["d" /* getBox */])(closestScrollable);
var scrollSize = {
scrollHeight: closestScrollable.scrollHeight,
scrollWidth: closestScrollable.scrollWidth
};
return {
client: frameClient,
page: Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["g" /* withScroll */])(frameClient, windowScroll),
scroll: getScroll$1(closestScrollable),
scrollSize: scrollSize,
shouldClipSubject: shouldClipSubject
};
}();
var dimension = getDroppableDimension({
descriptor: descriptor,
isEnabled: !isDropDisabled,
isCombineEnabled: isCombineEnabled,
isFixedOnPage: env.isFixedOnPage,
direction: direction,
client: client,
page: page,
closest: closest
});
return dimension;
});
var _DroppableDimensionPu;
var getClosestScrollable$1 = function getClosestScrollable(dragging) {
return dragging && dragging.env.closestScrollable || null;
};
var immediate = {
passive: false
};
var delayed = {
passive: true
};
var getListenerOptions = function getListenerOptions(options) {
return options.shouldPublishImmediately ? immediate : delayed;
};
var withoutPlaceholder = function withoutPlaceholder(placeholder, fn) {
if (!placeholder) {
return fn();
}
var last = placeholder.style.display;
placeholder.style.display = 'none';
var result = fn();
placeholder.style.display = last;
return result;
};
var DroppableDimensionPublisher = function (_React$Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(DroppableDimensionPublisher, _React$Component);
function DroppableDimensionPublisher(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this.dragging = void 0;
_this.callbacks = void 0;
_this.publishedDescriptor = null;
_this.getClosestScroll = function () {
var dragging = _this.dragging;
if (!dragging || !dragging.env.closestScrollable) {
return origin;
}
return getScroll$1(dragging.env.closestScrollable);
};
_this.memoizedUpdateScroll = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (x, y) {
!_this.publishedDescriptor ? false ? invariant(false, 'Cannot update scroll on unpublished droppable') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var newScroll = {
x: x,
y: y
};
var marshal = _this.context[dimensionMarshalKey];
marshal.updateDroppableScroll(_this.publishedDescriptor.id, newScroll);
});
_this.updateScroll = function () {
var scroll = _this.getClosestScroll();
_this.memoizedUpdateScroll(scroll.x, scroll.y);
};
_this.scheduleScrollUpdate = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(_this.updateScroll);
_this.onClosestScroll = function () {
var dragging = _this.dragging;
var closest = getClosestScrollable$1(_this.dragging);
!(dragging && closest) ? false ? invariant(false, 'Could not find scroll options while scrolling') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var options = dragging.scrollOptions;
if (options.shouldPublishImmediately) {
_this.updateScroll();
return;
}
_this.scheduleScrollUpdate();
};
_this.scroll = function (change) {
var closest = getClosestScrollable$1(_this.dragging);
!closest ? false ? invariant(false, 'Cannot scroll a droppable with no closest scrollable') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
closest.scrollTop += change.y;
closest.scrollLeft += change.x;
};
_this.dragStopped = function () {
var dragging = _this.dragging;
!dragging ? false ? invariant(false, 'Cannot stop drag when no active drag') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var closest = getClosestScrollable$1(dragging);
_this.dragging = null;
if (!closest) {
return;
}
_this.scheduleScrollUpdate.cancel();
closest.removeEventListener('scroll', _this.onClosestScroll, getListenerOptions(dragging.scrollOptions));
};
_this.getMemoizedDescriptor = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (id, type) {
return {
id: id,
type: type
};
});
_this.publish = function () {
var marshal = _this.context[dimensionMarshalKey];
var descriptor = _this.getMemoizedDescriptor(_this.props.droppableId, _this.props.type);
if (!_this.publishedDescriptor) {
marshal.registerDroppable(descriptor, _this.callbacks);
_this.publishedDescriptor = descriptor;
return;
}
if (_this.publishedDescriptor === descriptor) {
return;
}
marshal.updateDroppable(_this.publishedDescriptor, descriptor, _this.callbacks);
_this.publishedDescriptor = descriptor;
};
_this.unpublish = function () {
!_this.publishedDescriptor ? false ? invariant(false, 'Cannot unpublish descriptor when none is published') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var marshal = _this.context[dimensionMarshalKey];
marshal.unregisterDroppable(_this.publishedDescriptor);
_this.publishedDescriptor = null;
};
_this.recollect = function (options) {
var dragging = _this.dragging;
var closest = getClosestScrollable$1(dragging);
!(dragging && closest) ? false ? invariant(false, 'Can only recollect Droppable client for Droppables that have a scroll container') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var execute = function execute() {
return getDimension({
ref: dragging.ref,
descriptor: dragging.descriptor,
env: dragging.env,
windowScroll: origin,
direction: _this.props.direction,
isDropDisabled: _this.props.isDropDisabled,
isCombineEnabled: _this.props.isCombineEnabled,
shouldClipSubject: !_this.props.ignoreContainerClipping
});
};
if (!options.withoutPlaceholder) {
return execute();
}
return withoutPlaceholder(_this.props.getPlaceholderRef(), execute);
};
_this.getDimensionAndWatchScroll = function (windowScroll, options) {
!!_this.dragging ? false ? invariant(false, 'Cannot collect a droppable while a drag is occurring') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var descriptor = _this.publishedDescriptor;
!descriptor ? false ? invariant(false, 'Cannot get dimension for unpublished droppable') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var ref = _this.props.getDroppableRef();
!ref ? false ? invariant(false, 'Cannot collect without a droppable ref') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var env = getEnv(ref);
var dragging = {
ref: ref,
descriptor: descriptor,
env: env,
scrollOptions: options
};
_this.dragging = dragging;
var dimension = getDimension({
ref: ref,
descriptor: descriptor,
env: env,
windowScroll: windowScroll,
direction: _this.props.direction,
isDropDisabled: _this.props.isDropDisabled,
isCombineEnabled: _this.props.isCombineEnabled,
shouldClipSubject: !_this.props.ignoreContainerClipping
});
if (env.closestScrollable) {
env.closestScrollable.addEventListener('scroll', _this.onClosestScroll, getListenerOptions(dragging.scrollOptions));
if (false) {
checkForNestedScrollContainers(env.closestScrollable);
}
}
return dimension;
};
var callbacks = {
getDimensionAndWatchScroll: _this.getDimensionAndWatchScroll,
recollect: _this.recollect,
dragStopped: _this.dragStopped,
scroll: _this.scroll
};
_this.callbacks = callbacks;
return _this;
}
var _proto = DroppableDimensionPublisher.prototype;
_proto.componentDidMount = function componentDidMount() {
this.publish();
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
this.publish();
if (!this.dragging) {
return;
}
var isDisabledChanged = this.props.isDropDisabled !== prevProps.isDropDisabled;
var isCombineChanged = this.props.isCombineEnabled !== prevProps.isCombineEnabled;
if (!isDisabledChanged && !isCombineChanged) {
return;
}
var marshal = this.context[dimensionMarshalKey];
if (isDisabledChanged) {
marshal.updateDroppableIsEnabled(this.props.droppableId, !this.props.isDropDisabled);
}
if (isCombineChanged) {
marshal.updateDroppableIsCombineEnabled(this.props.droppableId, this.props.isCombineEnabled);
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.dragging) {
false ? warning('unmounting droppable while a drag is occurring') : void 0;
this.dragStopped();
}
this.unpublish();
};
_proto.render = function render() {
return this.props.children;
};
return DroppableDimensionPublisher;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
DroppableDimensionPublisher.contextTypes = (_DroppableDimensionPu = {}, _DroppableDimensionPu[dimensionMarshalKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object.isRequired, _DroppableDimensionPu);
var empty = {
width: 0,
height: 0,
margin: noSpacing
};
var Placeholder = function (_PureComponent) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(Placeholder, _PureComponent);
function Placeholder() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _PureComponent.call.apply(_PureComponent, [this].concat(args)) || this;
_this.mountTimerId = null;
_this.state = {
isAnimatingOpenOnMount: _this.props.animate === 'open'
};
_this.onTransitionEnd = function (event) {
if (event.propertyName !== 'height') {
return;
}
_this.props.onTransitionEnd();
if (_this.props.animate === 'close') {
_this.props.onClose();
}
};
return _this;
}
Placeholder.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
if (state.isAnimatingOpenOnMount && props.animate !== 'open') {
return {
isAnimatingOpenOnMount: false
};
}
return state;
};
var _proto = Placeholder.prototype;
_proto.componentDidMount = function componentDidMount() {
var _this2 = this;
if (!this.state.isAnimatingOpenOnMount) {
return;
}
this.mountTimerId = setTimeout(function () {
_this2.mountTimerId = null;
if (_this2.state.isAnimatingOpenOnMount) {
_this2.setState({
isAnimatingOpenOnMount: false
});
}
});
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (!this.mountTimerId) {
return;
}
clearTimeout(this.mountTimerId);
this.mountTimerId = null;
};
_proto.getSize = function getSize() {
if (this.state.isAnimatingOpenOnMount) {
return empty;
}
if (this.props.animate === 'close') {
return empty;
}
var placeholder = this.props.placeholder;
return {
height: placeholder.client.borderBox.height,
width: placeholder.client.borderBox.width,
margin: placeholder.client.margin
};
};
_proto.render = function render() {
var placeholder = this.props.placeholder;
var size = this.getSize();
var display = placeholder.display,
tagName = placeholder.tagName;
var style = {
display: display,
boxSizing: 'border-box',
width: size.width,
height: size.height,
marginTop: size.margin.top,
marginRight: size.margin.right,
marginBottom: size.margin.bottom,
marginLeft: size.margin.left,
flexShrink: '0',
flexGrow: '0',
pointerEvents: 'none',
transition: transitions.placeholder
};
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(tagName, {
style: style,
onTransitionEnd: this.onTransitionEnd,
ref: this.props.innerRef
});
};
return Placeholder;
}(__WEBPACK_IMPORTED_MODULE_2_react__["PureComponent"]);
var getWindowFromEl = (function (el) {
return el && el.ownerDocument ? el.ownerDocument.defaultView : window;
});
function isHtmlElement(el) {
return el instanceof getWindowFromEl(el).HTMLElement;
}
var throwIfRefIsInvalid = (function (ref) {
!(ref && isHtmlElement(ref)) ? false ? invariant(false, "\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md\n ") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
});
var checkOwnProps = (function (props) {
!props.droppableId ? false ? invariant(false, 'A Droppable requires a droppableId prop') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(typeof props.isDropDisabled === 'boolean') ? false ? invariant(false, 'isDropDisabled must be a boolean') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(typeof props.isCombineEnabled === 'boolean') ? false ? invariant(false, 'isCombineEnabled must be a boolean') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(typeof props.ignoreContainerClipping === 'boolean') ? false ? invariant(false, 'ignoreContainerClipping must be a boolean') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
});
var AnimateInOut = function (_React$PureComponent) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(AnimateInOut, _React$PureComponent);
function AnimateInOut() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
_this.state = {
isVisible: Boolean(_this.props.on),
data: _this.props.on,
animate: _this.props.shouldAnimate && _this.props.on ? 'open' : 'none'
};
_this.onClose = function () {
if (_this.state.animate !== 'close') {
return;
}
_this.setState({
isVisible: false
});
};
return _this;
}
AnimateInOut.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
if (!props.shouldAnimate) {
return {
isVisible: Boolean(props.on),
data: props.on,
animate: 'none'
};
}
if (props.on) {
return {
isVisible: true,
data: props.on,
animate: 'open'
};
}
if (state.isVisible) {
return {
isVisible: true,
data: state.data,
animate: 'close'
};
}
return {
isVisible: false,
animate: 'close',
data: null
};
};
var _proto = AnimateInOut.prototype;
_proto.render = function render() {
if (!this.state.isVisible) {
return null;
}
var provided = {
onClose: this.onClose,
data: this.state.data,
animate: this.state.animate
};
return this.props.children(provided);
};
return AnimateInOut;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.PureComponent);
var _Droppable$contextTyp, _Droppable$childConte;
var Droppable = function (_React$Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(Droppable, _React$Component);
function Droppable(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this.styleContext = void 0;
_this.ref = null;
_this.placeholderRef = null;
_this.setPlaceholderRef = function (ref) {
_this.placeholderRef = ref;
};
_this.getPlaceholderRef = function () {
return _this.placeholderRef;
};
_this.setRef = function (ref) {
if (ref === null) {
return;
}
if (ref === _this.ref) {
return;
}
_this.ref = ref;
throwIfRefIsInvalid(ref);
};
_this.getDroppableRef = function () {
return _this.ref;
};
_this.onPlaceholderTransitionEnd = function () {
var isMovementAllowed = _this.context[isMovementAllowedKey]();
if (isMovementAllowed) {
_this.props.updateViewportMaxScroll({
maxScroll: getMaxWindowScroll()
});
}
};
_this.styleContext = context[styleKey];
if (false) {
checkOwnProps(props);
}
return _this;
}
var _proto = Droppable.prototype;
_proto.getChildContext = function getChildContext() {
var _value;
var value = (_value = {}, _value[droppableIdKey] = this.props.droppableId, _value[droppableTypeKey] = this.props.type, _value);
return value;
};
_proto.componentDidMount = function componentDidMount() {
throwIfRefIsInvalid(this.ref);
this.warnIfPlaceholderNotMounted();
};
_proto.componentDidUpdate = function componentDidUpdate() {
this.warnIfPlaceholderNotMounted();
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.ref = null;
this.placeholderRef = null;
};
_proto.warnIfPlaceholderNotMounted = function warnIfPlaceholderNotMounted() {
if (true) {
return;
}
if (!this.props.placeholder) {
return;
}
if (this.placeholderRef) {
return;
}
false ? warning("\n Droppable setup issue [droppableId: \"" + this.props.droppableId + "\"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/droppable.md\n ") : void 0;
};
_proto.getPlaceholder = function getPlaceholder() {
var _this2 = this;
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(AnimateInOut, {
on: this.props.placeholder,
shouldAnimate: this.props.shouldAnimatePlaceholder
}, function (_ref) {
var onClose = _ref.onClose,
data = _ref.data,
animate = _ref.animate;
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Placeholder, {
placeholder: data,
onClose: onClose,
innerRef: _this2.setPlaceholderRef,
animate: animate,
onTransitionEnd: _this2.onPlaceholderTransitionEnd
});
});
};
_proto.render = function render() {
var _this$props = this.props,
children = _this$props.children,
direction = _this$props.direction,
type = _this$props.type,
droppableId = _this$props.droppableId,
isDropDisabled = _this$props.isDropDisabled,
isCombineEnabled = _this$props.isCombineEnabled,
ignoreContainerClipping = _this$props.ignoreContainerClipping,
snapshot = _this$props.snapshot;
var provided = {
innerRef: this.setRef,
placeholder: this.getPlaceholder(),
droppableProps: {
'data-react-beautiful-dnd-droppable': this.styleContext
}
};
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(DroppableDimensionPublisher, {
droppableId: droppableId,
type: type,
direction: direction,
ignoreContainerClipping: ignoreContainerClipping,
isDropDisabled: isDropDisabled,
isCombineEnabled: isCombineEnabled,
getDroppableRef: this.getDroppableRef,
getPlaceholderRef: this.getPlaceholderRef
}, children(provided, snapshot));
};
return Droppable;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
Droppable.contextTypes = (_Droppable$contextTyp = {}, _Droppable$contextTyp[styleKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _Droppable$contextTyp[isMovementAllowedKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired, _Droppable$contextTyp);
Droppable.childContextTypes = (_Droppable$childConte = {}, _Droppable$childConte[droppableIdKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _Droppable$childConte[droppableTypeKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _Droppable$childConte);
var isStrictEqual = (function (a, b) {
return a === b;
});
var whatIsDraggedOverFromResult = (function (result) {
var combine = result.combine,
destination = result.destination;
if (destination) {
return destination.droppableId;
}
if (combine) {
return combine.droppableId;
}
return null;
});
var isMatchingType = function isMatchingType(type, critical) {
return type === critical.droppable.type;
};
var getDraggable = function getDraggable(critical, dimensions) {
return dimensions.draggables[critical.draggable.id];
};
var makeMapStateToProps = function makeMapStateToProps() {
var idle = {
placeholder: null,
shouldAnimatePlaceholder: true,
snapshot: {
isDraggingOver: false,
draggingOverWith: null,
draggingFromThisWith: null
}
};
var idleWithoutAnimation = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, idle, {
shouldAnimatePlaceholder: false
});
var getMapProps = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (id, isDraggingOver, dragging, snapshot) {
var isHome = dragging.descriptor.droppableId === id;
if (isHome) {
return {
placeholder: dragging.placeholder,
shouldAnimatePlaceholder: false,
snapshot: snapshot
};
}
if (!isDraggingOver) {
return idle;
}
return {
placeholder: dragging.placeholder,
shouldAnimatePlaceholder: true,
snapshot: snapshot
};
});
var getSnapshot = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (id, isDraggingOver, dragging) {
var draggableId = dragging.descriptor.id;
var isHome = dragging.descriptor.droppableId === id;
var draggingOverWith = isDraggingOver ? draggableId : null;
var draggingFromThisWith = isHome ? draggableId : null;
return {
isDraggingOver: isDraggingOver,
draggingOverWith: draggingOverWith,
draggingFromThisWith: draggingFromThisWith
};
});
var selector = function selector(state, ownProps) {
var id = ownProps.droppableId;
var type = ownProps.type;
if (state.isDragging) {
var critical = state.critical;
if (!isMatchingType(type, critical)) {
return idle;
}
var dragging = getDraggable(critical, state.dimensions);
var isDraggingOver = whatIsDraggedOver(state.impact) === id;
var snapshot = getSnapshot(id, isDraggingOver, dragging);
return getMapProps(id, isDraggingOver, dragging, snapshot);
}
if (state.phase === 'DROP_ANIMATING') {
var completed = state.completed;
if (!isMatchingType(type, completed.critical)) {
return idle;
}
var _dragging = getDraggable(completed.critical, state.dimensions);
var _snapshot = getSnapshot(id, whatIsDraggedOverFromResult(completed.result) === id, _dragging);
return getMapProps(id, whatIsDraggedOver(completed.impact) === id, _dragging, _snapshot);
}
if (state.phase === 'IDLE' && state.completed) {
var _completed = state.completed;
if (!isMatchingType(type, _completed.critical)) {
return idle;
}
var wasOver = whatIsDraggedOver(_completed.impact) === id;
var wasCombining = Boolean(_completed.impact.merge);
if (state.shouldFlush) {
return idleWithoutAnimation;
}
if (wasOver) {
return wasCombining ? idle : idleWithoutAnimation;
}
return idle;
}
return idle;
};
return selector;
};
var mapDispatchToProps = {
updateViewportMaxScroll: updateViewportMaxScroll
};
var defaultProps = {
type: 'DEFAULT',
direction: 'vertical',
isDropDisabled: false,
isCombineEnabled: false,
ignoreContainerClipping: false
};
var ConnectedDroppable = Object(__WEBPACK_IMPORTED_MODULE_13_react_redux__["b" /* connect */])(makeMapStateToProps, mapDispatchToProps, null, {
storeKey: storeKey,
pure: true,
areStatePropsEqual: isStrictEqual
})(Droppable);
ConnectedDroppable.defaultProps = defaultProps;
var _DraggableDimensionPu;
var DraggableDimensionPublisher = function (_Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(DraggableDimensionPublisher, _Component);
function DraggableDimensionPublisher() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.publishedDescriptor = null;
_this.getMemoizedDescriptor = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (id, index, droppableId, type) {
return {
id: id,
index: index,
droppableId: droppableId,
type: type
};
});
_this.publish = function () {
var marshal = _this.context[dimensionMarshalKey];
var descriptor = _this.getMemoizedDescriptor(_this.props.draggableId, _this.props.index, _this.props.droppableId, _this.props.type);
if (!_this.publishedDescriptor) {
marshal.registerDraggable(descriptor, _this.getDimension);
_this.publishedDescriptor = descriptor;
return;
}
if (descriptor === _this.publishedDescriptor) {
return;
}
marshal.updateDraggable(_this.publishedDescriptor, descriptor, _this.getDimension);
_this.publishedDescriptor = descriptor;
};
_this.unpublish = function () {
!_this.publishedDescriptor ? false ? invariant(false, 'Cannot unpublish descriptor when none is published') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var marshal = _this.context[dimensionMarshalKey];
marshal.unregisterDraggable(_this.publishedDescriptor);
_this.publishedDescriptor = null;
};
_this.getDimension = function (windowScroll) {
if (windowScroll === void 0) {
windowScroll = origin;
}
var targetRef = _this.props.getDraggableRef();
var descriptor = _this.publishedDescriptor;
!targetRef ? false ? invariant(false, 'DraggableDimensionPublisher cannot calculate a dimension when not attached to the DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!descriptor ? false ? invariant(false, 'Cannot get dimension for unpublished draggable') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var computedStyles = window.getComputedStyle(targetRef);
var borderBox = targetRef.getBoundingClientRect();
var client = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["a" /* calculateBox */])(borderBox, computedStyles);
var page = Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["g" /* withScroll */])(client, windowScroll);
var placeholder = {
client: client,
tagName: targetRef.tagName.toLowerCase(),
display: computedStyles.display
};
var displaceBy = {
x: client.marginBox.width,
y: client.marginBox.height
};
var dimension = {
descriptor: descriptor,
placeholder: placeholder,
displaceBy: displaceBy,
client: client,
page: page
};
return dimension;
};
return _this;
}
var _proto = DraggableDimensionPublisher.prototype;
_proto.componentDidMount = function componentDidMount() {
this.publish();
};
_proto.componentDidUpdate = function componentDidUpdate() {
this.publish();
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.unpublish();
};
_proto.render = function render() {
return this.props.children;
};
return DraggableDimensionPublisher;
}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
DraggableDimensionPublisher.contextTypes = (_DraggableDimensionPu = {}, _DraggableDimensionPu[dimensionMarshalKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object.isRequired, _DraggableDimensionPu);
function isSvgElement(el) {
return el instanceof getWindowFromEl(el).SVGElement;
}
var selector = "[" + dragHandle + "]";
var throwIfSVG = function throwIfSVG(el) {
!!isSvgElement(el) ? false ? invariant(false, "A drag handle cannot be an SVGElement: it has inconsistent focus support.\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/dragging-svgs.md") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
};
var getDragHandleRef = function getDragHandleRef(draggableRef) {
if (draggableRef.hasAttribute(dragHandle)) {
throwIfSVG(draggableRef);
return draggableRef;
}
var el = draggableRef.querySelector(selector);
throwIfSVG(draggableRef);
!el ? false ? invariant(false, "\n Cannot find drag handle element inside of Draggable.\n Please be sure to apply the {...provided.dragHandleProps} to your Draggable\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/draggable.md\n ") : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!isHtmlElement(el) ? false ? invariant(false, 'A drag handle must be a HTMLElement') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
return el;
};
var retainingFocusFor = null;
var listenerOptions = {
capture: true
};
var clearRetentionOnFocusChange = function () {
var isBound = false;
var bind = function bind() {
if (isBound) {
return;
}
isBound = true;
window.addEventListener('focus', onWindowFocusChange, listenerOptions);
};
var unbind = function unbind() {
if (!isBound) {
return;
}
isBound = false;
window.removeEventListener('focus', onWindowFocusChange, listenerOptions);
};
var onWindowFocusChange = function onWindowFocusChange() {
unbind();
retainingFocusFor = null;
};
var result = function result() {
return bind();
};
result.cancel = function () {
return unbind();
};
return result;
}();
var retain = function retain(id) {
retainingFocusFor = id;
clearRetentionOnFocusChange();
};
var tryRestoreFocus = function tryRestoreFocus(id, draggableRef) {
if (!retainingFocusFor) {
return;
}
if (id !== retainingFocusFor) {
return;
}
retainingFocusFor = null;
clearRetentionOnFocusChange.cancel();
var dragHandleRef = getDragHandleRef(draggableRef);
if (!dragHandleRef) {
false ? warning('Could not find drag handle in the DOM to focus on it') : void 0;
return;
}
dragHandleRef.focus();
};
var retainer = {
retain: retain,
tryRestoreFocus: tryRestoreFocus
};
function isElement(el) {
return el instanceof getWindowFromEl(el).Element;
}
var interactiveTagNames = {
input: true,
button: true,
textarea: true,
select: true,
option: true,
optgroup: true,
video: true,
audio: true
};
var isAnInteractiveElement = function isAnInteractiveElement(parent, current) {
if (current == null) {
return false;
}
var hasAnInteractiveTag = Boolean(interactiveTagNames[current.tagName.toLowerCase()]);
if (hasAnInteractiveTag) {
return true;
}
var attribute = current.getAttribute('contenteditable');
if (attribute === 'true' || attribute === '') {
return true;
}
if (current === parent) {
return false;
}
return isAnInteractiveElement(parent, current.parentElement);
};
var shouldAllowDraggingFromTarget = (function (event, props) {
if (props.canDragInteractiveElements) {
return true;
}
var target = event.target,
currentTarget = event.currentTarget;
if (!isElement(target) || !isElement(currentTarget)) {
return true;
}
return !isAnInteractiveElement(currentTarget, target);
});
var createScheduler = (function (callbacks) {
var memoizedMove = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (x, y) {
var point = {
x: x,
y: y
};
callbacks.onMove(point);
});
var move = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(function (point) {
return memoizedMove(point.x, point.y);
});
var moveUp = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(callbacks.onMoveUp);
var moveDown = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(callbacks.onMoveDown);
var moveRight = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(callbacks.onMoveRight);
var moveLeft = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(callbacks.onMoveLeft);
var windowScrollMove = Object(__WEBPACK_IMPORTED_MODULE_12_raf_schd__["a" /* default */])(callbacks.onWindowScroll);
var cancel = function cancel() {
move.cancel();
moveUp.cancel();
moveDown.cancel();
moveRight.cancel();
moveLeft.cancel();
windowScrollMove.cancel();
};
return {
move: move,
moveUp: moveUp,
moveDown: moveDown,
moveRight: moveRight,
moveLeft: moveLeft,
windowScrollMove: windowScrollMove,
cancel: cancel
};
});
var sloppyClickThreshold = 5;
var isSloppyClickThresholdExceeded = (function (original, current) {
return Math.abs(current.x - original.x) >= sloppyClickThreshold || Math.abs(current.y - original.y) >= sloppyClickThreshold;
});
var tab = 9;
var enter = 13;
var escape = 27;
var space = 32;
var pageUp = 33;
var pageDown = 34;
var end = 35;
var home = 36;
var arrowLeft = 37;
var arrowUp = 38;
var arrowRight = 39;
var arrowDown = 40;
var _preventedKeys;
var preventedKeys = (_preventedKeys = {}, _preventedKeys[enter] = true, _preventedKeys[tab] = true, _preventedKeys);
var preventStandardKeyEvents = (function (event) {
if (preventedKeys[event.keyCode]) {
event.preventDefault();
}
});
var getOptions = function getOptions(shared, fromBinding) {
return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, shared, fromBinding);
};
var bindEvents = function bindEvents(el, bindings, sharedOptions) {
bindings.forEach(function (binding) {
var options = getOptions(sharedOptions, binding.options);
el.addEventListener(binding.eventName, binding.fn, options);
});
};
var unbindEvents = function unbindEvents(el, bindings, sharedOptions) {
bindings.forEach(function (binding) {
var options = getOptions(sharedOptions, binding.options);
el.removeEventListener(binding.eventName, binding.fn, options);
});
};
var sharedOptions = {
capture: true
};
var createPostDragEventPreventer = (function (getWindow) {
var isBound = false;
var bind = function bind() {
if (isBound) {
return;
}
isBound = true;
bindEvents(getWindow(), pointerEvents, sharedOptions);
};
var unbind = function unbind() {
if (!isBound) {
return;
}
isBound = false;
unbindEvents(getWindow(), pointerEvents, sharedOptions);
};
var pointerEvents = [{
eventName: 'click',
fn: function fn(event) {
event.preventDefault();
unbind();
}
}, {
eventName: 'mousedown',
fn: unbind
}, {
eventName: 'touchstart',
fn: unbind
}];
var preventNext = function preventNext() {
if (isBound) {
unbind();
}
bind();
};
var preventer = {
preventNext: preventNext,
abort: unbind
};
return preventer;
});
var createEventMarshal = (function () {
var isMouseDownHandled = false;
var handle = function handle() {
!!isMouseDownHandled ? false ? invariant(false, 'Cannot handle mouse down as it is already handled') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
isMouseDownHandled = true;
};
var isHandled = function isHandled() {
return isMouseDownHandled;
};
var reset = function reset() {
isMouseDownHandled = false;
};
return {
handle: handle,
isHandled: isHandled,
reset: reset
};
});
var supportedEventName = function () {
var base = 'visibilitychange';
if (typeof document === 'undefined') {
return base;
}
var candidates = [base, "ms" + base, "webkit" + base, "moz" + base, "o" + base];
var supported = find(candidates, function (eventName) {
return "on" + eventName in document;
});
return supported || base;
}();
var primaryButton = 0;
var noop = function noop() {};
var mouseDownMarshal = createEventMarshal();
var createMouseSensor = (function (_ref) {
var callbacks = _ref.callbacks,
getWindow = _ref.getWindow,
canStartCapturing = _ref.canStartCapturing,
getShouldRespectForceTouch = _ref.getShouldRespectForceTouch;
var state = {
isDragging: false,
pending: null
};
var setState = function setState(newState) {
state = newState;
};
var isDragging = function isDragging() {
return state.isDragging;
};
var isCapturing = function isCapturing() {
return Boolean(state.pending || state.isDragging);
};
var schedule = createScheduler(callbacks);
var postDragEventPreventer = createPostDragEventPreventer(getWindow);
var startDragging = function startDragging(fn) {
if (fn === void 0) {
fn = noop;
}
setState({
pending: null,
isDragging: true
});
fn();
};
var stopDragging = function stopDragging(fn, shouldBlockClick) {
if (fn === void 0) {
fn = noop;
}
if (shouldBlockClick === void 0) {
shouldBlockClick = true;
}
schedule.cancel();
unbindWindowEvents();
mouseDownMarshal.reset();
if (shouldBlockClick) {
postDragEventPreventer.preventNext();
}
setState({
isDragging: false,
pending: null
});
fn();
};
var startPendingDrag = function startPendingDrag(point) {
setState({
pending: point,
isDragging: false
});
bindWindowEvents();
};
var stopPendingDrag = function stopPendingDrag() {
stopDragging(noop, false);
};
var kill = function kill(fn) {
if (fn === void 0) {
fn = noop;
}
if (state.pending) {
stopPendingDrag();
return;
}
if (state.isDragging) {
stopDragging(fn);
}
};
var unmount = function unmount() {
kill();
postDragEventPreventer.abort();
};
var cancel = function cancel() {
kill(callbacks.onCancel);
};
var windowBindings = [{
eventName: 'mousemove',
fn: function fn(event) {
var button = event.button,
clientX = event.clientX,
clientY = event.clientY;
if (button !== primaryButton) {
return;
}
var point = {
x: clientX,
y: clientY
};
if (state.isDragging) {
event.preventDefault();
schedule.move(point);
return;
}
if (!state.pending) {
stopPendingDrag();
false ? invariant(false, 'Expected there to be an active or pending drag when window mousemove event is received') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false);
}
if (!isSloppyClickThresholdExceeded(state.pending, point)) {
return;
}
event.preventDefault();
startDragging(function () {
return callbacks.onLift({
clientSelection: point,
movementMode: 'FLUID'
});
});
}
}, {
eventName: 'mouseup',
fn: function fn(event) {
if (state.pending) {
stopPendingDrag();
return;
}
event.preventDefault();
stopDragging(callbacks.onDrop);
}
}, {
eventName: 'mousedown',
fn: function fn(event) {
if (state.isDragging) {
event.preventDefault();
}
stopDragging(callbacks.onCancel);
}
}, {
eventName: 'keydown',
fn: function fn(event) {
if (!state.isDragging) {
cancel();
return;
}
if (event.keyCode === escape) {
event.preventDefault();
cancel();
return;
}
preventStandardKeyEvents(event);
}
}, {
eventName: 'resize',
fn: cancel
}, {
eventName: 'scroll',
options: {
passive: true,
capture: false
},
fn: function fn(event) {
if (event.currentTarget !== getWindow()) {
return;
}
if (state.pending) {
stopPendingDrag();
return;
}
schedule.windowScrollMove();
}
}, {
eventName: 'webkitmouseforcechanged',
fn: function fn(event) {
if (event.webkitForce == null || MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN == null) {
false ? warning('handling a mouse force changed event when it is not supported') : void 0;
return;
}
var forcePressThreshold = MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN;
var isForcePressing = event.webkitForce >= forcePressThreshold;
if (!getShouldRespectForceTouch()) {
event.preventDefault();
return;
}
if (isForcePressing) {
cancel();
}
}
}, {
eventName: supportedEventName,
fn: cancel
}];
var bindWindowEvents = function bindWindowEvents() {
var win = getWindow();
bindEvents(win, windowBindings, {
capture: true
});
};
var unbindWindowEvents = function unbindWindowEvents() {
var win = getWindow();
unbindEvents(win, windowBindings, {
capture: true
});
};
var onMouseDown = function onMouseDown(event) {
if (mouseDownMarshal.isHandled()) {
return;
}
!!isCapturing() ? false ? invariant(false, 'Should not be able to perform a mouse down while a drag or pending drag is occurring') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!canStartCapturing(event)) {
return;
}
if (event.button !== primaryButton) {
return;
}
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
return;
}
mouseDownMarshal.handle();
event.preventDefault();
var point = {
x: event.clientX,
y: event.clientY
};
startPendingDrag(point);
};
var sensor = {
onMouseDown: onMouseDown,
kill: kill,
isCapturing: isCapturing,
isDragging: isDragging,
unmount: unmount
};
return sensor;
});
var getBorderBoxCenterPosition = (function (el) {
return Object(__WEBPACK_IMPORTED_MODULE_6_css_box_model__["e" /* getRect */])(el.getBoundingClientRect()).center;
});
var _scrollJumpKeys;
var scrollJumpKeys = (_scrollJumpKeys = {}, _scrollJumpKeys[pageDown] = true, _scrollJumpKeys[pageUp] = true, _scrollJumpKeys[home] = true, _scrollJumpKeys[end] = true, _scrollJumpKeys);
var noop$1 = function noop() {};
var createKeyboardSensor = (function (_ref) {
var callbacks = _ref.callbacks,
getWindow = _ref.getWindow,
getDraggableRef = _ref.getDraggableRef,
canStartCapturing = _ref.canStartCapturing;
var state = {
isDragging: false
};
var setState = function setState(newState) {
state = newState;
};
var startDragging = function startDragging(fn) {
if (fn === void 0) {
fn = noop$1;
}
setState({
isDragging: true
});
bindWindowEvents();
fn();
};
var stopDragging = function stopDragging(postDragFn) {
if (postDragFn === void 0) {
postDragFn = noop$1;
}
schedule.cancel();
unbindWindowEvents();
setState({
isDragging: false
});
postDragFn();
};
var kill = function kill() {
if (state.isDragging) {
stopDragging();
}
};
var cancel = function cancel() {
stopDragging(callbacks.onCancel);
};
var isDragging = function isDragging() {
return state.isDragging;
};
var schedule = createScheduler(callbacks);
var onKeyDown = function onKeyDown(event) {
if (!isDragging()) {
if (event.defaultPrevented) {
return;
}
if (!canStartCapturing(event)) {
return;
}
if (event.keyCode !== space) {
return;
}
var ref = getDraggableRef();
!ref ? false ? invariant(false, 'Cannot start a keyboard drag without a draggable ref') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var center = getBorderBoxCenterPosition(ref);
event.preventDefault();
startDragging(function () {
return callbacks.onLift({
clientSelection: center,
movementMode: 'SNAP'
});
});
return;
}
if (event.keyCode === escape) {
event.preventDefault();
cancel();
return;
}
if (event.keyCode === space) {
event.preventDefault();
stopDragging(callbacks.onDrop);
return;
}
if (event.keyCode === arrowDown) {
event.preventDefault();
schedule.moveDown();
return;
}
if (event.keyCode === arrowUp) {
event.preventDefault();
schedule.moveUp();
return;
}
if (event.keyCode === arrowRight) {
event.preventDefault();
schedule.moveRight();
return;
}
if (event.keyCode === arrowLeft) {
event.preventDefault();
schedule.moveLeft();
return;
}
if (scrollJumpKeys[event.keyCode]) {
event.preventDefault();
return;
}
preventStandardKeyEvents(event);
};
var windowBindings = [{
eventName: 'mousedown',
fn: cancel
}, {
eventName: 'mouseup',
fn: cancel
}, {
eventName: 'click',
fn: cancel
}, {
eventName: 'touchstart',
fn: cancel
}, {
eventName: 'resize',
fn: cancel
}, {
eventName: 'wheel',
fn: cancel,
options: {
passive: true
}
}, {
eventName: 'scroll',
options: {
capture: false
},
fn: function fn(event) {
if (event.currentTarget !== getWindow()) {
return;
}
callbacks.onWindowScroll();
}
}, {
eventName: supportedEventName,
fn: cancel
}];
var bindWindowEvents = function bindWindowEvents() {
bindEvents(getWindow(), windowBindings, {
capture: true
});
};
var unbindWindowEvents = function unbindWindowEvents() {
unbindEvents(getWindow(), windowBindings, {
capture: true
});
};
var sensor = {
onKeyDown: onKeyDown,
kill: kill,
isDragging: isDragging,
isCapturing: isDragging,
unmount: kill
};
return sensor;
});
var timeForLongPress = 150;
var forcePressThreshold = 0.15;
var touchStartMarshal = createEventMarshal();
var noop$2 = function noop() {};
var webkitHack = function () {
var stub = {
preventTouchMove: noop$2,
releaseTouchMove: noop$2
};
if (typeof window === 'undefined') {
return stub;
}
if (!('ontouchstart' in window)) {
return stub;
}
var isBlocking = false;
window.addEventListener('touchmove', function (event) {
if (!isBlocking) {
return;
}
if (event.defaultPrevented) {
return;
}
event.preventDefault();
}, {
passive: false,
capture: false
});
var preventTouchMove = function preventTouchMove() {
isBlocking = true;
};
var releaseTouchMove = function releaseTouchMove() {
isBlocking = false;
};
return {
preventTouchMove: preventTouchMove,
releaseTouchMove: releaseTouchMove
};
}();
var initial = {
isDragging: false,
pending: null,
hasMoved: false,
longPressTimerId: null
};
var createTouchSensor = (function (_ref) {
var callbacks = _ref.callbacks,
getWindow = _ref.getWindow,
canStartCapturing = _ref.canStartCapturing,
getShouldRespectForceTouch = _ref.getShouldRespectForceTouch;
var state = initial;
var setState = function setState(partial) {
state = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_corejs2_helpers_esm_extends__["a" /* default */])({}, state, partial);
};
var isDragging = function isDragging() {
return state.isDragging;
};
var isCapturing = function isCapturing() {
return Boolean(state.pending || state.isDragging || state.longPressTimerId);
};
var schedule = createScheduler(callbacks);
var postDragEventPreventer = createPostDragEventPreventer(getWindow);
var startDragging = function startDragging() {
var pending = state.pending;
if (!pending) {
stopPendingDrag();
false ? invariant(false, 'cannot start a touch drag without a pending position') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false);
}
setState({
isDragging: true,
hasMoved: false,
pending: null,
longPressTimerId: null
});
callbacks.onLift({
clientSelection: pending,
movementMode: 'FLUID'
});
};
var stopDragging = function stopDragging(fn) {
if (fn === void 0) {
fn = noop$2;
}
schedule.cancel();
touchStartMarshal.reset();
webkitHack.releaseTouchMove();
unbindWindowEvents();
postDragEventPreventer.preventNext();
setState(initial);
fn();
};
var startPendingDrag = function startPendingDrag(event) {
var touch = event.touches[0];
var clientX = touch.clientX,
clientY = touch.clientY;
var point = {
x: clientX,
y: clientY
};
var longPressTimerId = setTimeout(startDragging, timeForLongPress);
setState({
longPressTimerId: longPressTimerId,
pending: point,
isDragging: false,
hasMoved: false
});
bindWindowEvents();
};
var stopPendingDrag = function stopPendingDrag() {
if (state.longPressTimerId) {
clearTimeout(state.longPressTimerId);
}
schedule.cancel();
touchStartMarshal.reset();
webkitHack.releaseTouchMove();
unbindWindowEvents();
setState(initial);
};
var kill = function kill(fn) {
if (fn === void 0) {
fn = noop$2;
}
if (state.pending) {
stopPendingDrag();
return;
}
if (state.isDragging) {
stopDragging(fn);
}
};
var unmount = function unmount() {
kill();
postDragEventPreventer.abort();
};
var cancel = function cancel() {
kill(callbacks.onCancel);
};
var windowBindings = [{
eventName: 'touchmove',
options: {
passive: false
},
fn: function fn(event) {
if (!state.isDragging) {
stopPendingDrag();
return;
}
if (!state.hasMoved) {
setState({
hasMoved: true
});
}
var _event$touches$ = event.touches[0],
clientX = _event$touches$.clientX,
clientY = _event$touches$.clientY;
var point = {
x: clientX,
y: clientY
};
event.preventDefault();
schedule.move(point);
}
}, {
eventName: 'touchend',
fn: function fn(event) {
if (!state.isDragging) {
stopPendingDrag();
return;
}
event.preventDefault();
stopDragging(callbacks.onDrop);
}
}, {
eventName: 'touchcancel',
fn: function fn(event) {
if (!state.isDragging) {
stopPendingDrag();
return;
}
event.preventDefault();
stopDragging(callbacks.onCancel);
}
}, {
eventName: 'touchstart',
fn: cancel
}, {
eventName: 'orientationchange',
fn: cancel
}, {
eventName: 'resize',
fn: cancel
}, {
eventName: 'scroll',
options: {
passive: true,
capture: false
},
fn: function fn() {
if (state.pending) {
stopPendingDrag();
return;
}
schedule.windowScrollMove();
}
}, {
eventName: 'contextmenu',
fn: function fn(event) {
event.preventDefault();
}
}, {
eventName: 'keydown',
fn: function fn(event) {
if (!state.isDragging) {
cancel();
return;
}
if (event.keyCode === escape) {
event.preventDefault();
}
cancel();
}
}, {
eventName: 'touchforcechange',
fn: function fn(event) {
if (!state.isDragging && !state.pending) {
return;
}
if (state.hasMoved) {
event.preventDefault();
return;
}
if (!getShouldRespectForceTouch()) {
event.preventDefault();
return;
}
var touch = event.touches[0];
if (touch.force >= forcePressThreshold) {
cancel();
}
}
}, {
eventName: supportedEventName,
fn: cancel
}];
var bindWindowEvents = function bindWindowEvents() {
bindEvents(getWindow(), windowBindings, {
capture: true
});
};
var unbindWindowEvents = function unbindWindowEvents() {
unbindEvents(getWindow(), windowBindings, {
capture: true
});
};
var onTouchStart = function onTouchStart(event) {
if (touchStartMarshal.isHandled()) {
return;
}
!!isCapturing() ? false ? invariant(false, 'Should not be able to perform a touch start while a drag or pending drag is occurring') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!canStartCapturing(event)) {
return;
}
touchStartMarshal.handle();
webkitHack.preventTouchMove();
startPendingDrag(event);
};
var sensor = {
onTouchStart: onTouchStart,
kill: kill,
isCapturing: isCapturing,
isDragging: isDragging,
unmount: unmount
};
return sensor;
});
var _DragHandle$contextTy;
var preventHtml5Dnd = function preventHtml5Dnd(event) {
event.preventDefault();
};
var DragHandle = function (_Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(DragHandle, _Component);
function DragHandle(props, context) {
var _this;
_this = _Component.call(this, props, context) || this;
_this.mouseSensor = void 0;
_this.keyboardSensor = void 0;
_this.touchSensor = void 0;
_this.sensors = void 0;
_this.styleContext = void 0;
_this.canLift = void 0;
_this.isFocused = false;
_this.lastDraggableRef = void 0;
_this.onFocus = function () {
_this.isFocused = true;
};
_this.onBlur = function () {
_this.isFocused = false;
};
_this.onKeyDown = function (event) {
if (_this.mouseSensor.isCapturing() || _this.touchSensor.isCapturing()) {
return;
}
_this.keyboardSensor.onKeyDown(event);
};
_this.onMouseDown = function (event) {
if (_this.keyboardSensor.isCapturing() || _this.mouseSensor.isCapturing()) {
return;
}
_this.mouseSensor.onMouseDown(event);
};
_this.onTouchStart = function (event) {
if (_this.mouseSensor.isCapturing() || _this.keyboardSensor.isCapturing()) {
return;
}
_this.touchSensor.onTouchStart(event);
};
_this.canStartCapturing = function (event) {
if (_this.isAnySensorCapturing()) {
return false;
}
if (!_this.canLift(_this.props.draggableId)) {
return false;
}
return shouldAllowDraggingFromTarget(event, _this.props);
};
_this.isAnySensorCapturing = function () {
return _this.sensors.some(function (sensor) {
return sensor.isCapturing();
});
};
_this.getProvided = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (isEnabled) {
if (!isEnabled) {
return null;
}
var provided = {
onMouseDown: _this.onMouseDown,
onKeyDown: _this.onKeyDown,
onTouchStart: _this.onTouchStart,
onFocus: _this.onFocus,
onBlur: _this.onBlur,
tabIndex: 0,
'data-react-beautiful-dnd-drag-handle': _this.styleContext,
'aria-roledescription': 'Draggable item. Press space bar to lift',
draggable: false,
onDragStart: preventHtml5Dnd
};
return provided;
});
var getWindow = function getWindow() {
return getWindowFromEl(_this.props.getDraggableRef());
};
var args = {
callbacks: _this.props.callbacks,
getDraggableRef: _this.props.getDraggableRef,
getWindow: getWindow,
canStartCapturing: _this.canStartCapturing,
getShouldRespectForceTouch: _this.props.getShouldRespectForceTouch
};
_this.mouseSensor = createMouseSensor(args);
_this.keyboardSensor = createKeyboardSensor(args);
_this.touchSensor = createTouchSensor(args);
_this.sensors = [_this.mouseSensor, _this.keyboardSensor, _this.touchSensor];
_this.styleContext = context[styleKey];
_this.canLift = context[canLiftKey];
return _this;
}
var _proto = DragHandle.prototype;
_proto.componentDidMount = function componentDidMount() {
var draggableRef = this.props.getDraggableRef();
this.lastDraggableRef = draggableRef;
!draggableRef ? false ? invariant(false, 'Cannot get draggable ref from drag handle') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
if (!this.props.isEnabled) {
return;
}
var dragHandleRef = getDragHandleRef(draggableRef);
retainer.tryRestoreFocus(this.props.draggableId, dragHandleRef);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
var _this2 = this;
var ref = this.props.getDraggableRef();
if (ref !== this.lastDraggableRef) {
this.lastDraggableRef = ref;
if (ref && this.isFocused && this.props.isEnabled) {
getDragHandleRef(ref).focus();
}
}
var isCapturing = this.isAnySensorCapturing();
if (!isCapturing) {
return;
}
var isBeingDisabled = prevProps.isEnabled && !this.props.isEnabled;
if (isBeingDisabled) {
this.sensors.forEach(function (sensor) {
if (!sensor.isCapturing()) {
return;
}
var wasDragging = sensor.isDragging();
sensor.kill();
if (wasDragging) {
false ? warning('You have disabled dragging on a Draggable while it was dragging. The drag has been cancelled') : void 0;
_this2.props.callbacks.onCancel();
}
});
}
var isDragAborted = prevProps.isDragging && !this.props.isDragging;
if (isDragAborted) {
this.sensors.forEach(function (sensor) {
if (sensor.isCapturing()) {
sensor.kill();
}
});
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
var _this3 = this;
this.sensors.forEach(function (sensor) {
var wasDragging = sensor.isDragging();
sensor.unmount();
if (wasDragging) {
_this3.props.callbacks.onCancel();
}
});
var shouldRetainFocus = function () {
if (!_this3.props.isEnabled) {
return false;
}
if (!_this3.isFocused) {
return false;
}
return _this3.props.isDragging || _this3.props.isDropAnimating;
}();
if (shouldRetainFocus) {
retainer.retain(this.props.draggableId);
}
};
_proto.render = function render() {
var _this$props = this.props,
children = _this$props.children,
isEnabled = _this$props.isEnabled;
return children(this.getProvided(isEnabled));
};
return DragHandle;
}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
DragHandle.contextTypes = (_DragHandle$contextTy = {}, _DragHandle$contextTy[styleKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _DragHandle$contextTy[canLiftKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired, _DragHandle$contextTy);
var zIndexOptions = {
dragging: 5000,
dropAnimating: 4500
};
var getDraggingTransition = function getDraggingTransition(shouldAnimateDragMovement, dropping) {
if (dropping) {
return transitions.drop(dropping.duration);
}
if (shouldAnimateDragMovement) {
return transitions.snap;
}
return transitions.fluid;
};
var getDraggingOpacity = function getDraggingOpacity(isCombining, isDropAnimating) {
if (!isCombining) {
return null;
}
return isDropAnimating ? combine.opacity.drop : combine.opacity.combining;
};
var getShouldDraggingAnimate = function getShouldDraggingAnimate(dragging) {
if (dragging.forceShouldAnimate != null) {
return dragging.forceShouldAnimate;
}
return dragging.mode === 'SNAP';
};
function getDraggingStyle(dragging) {
var dimension = dragging.dimension;
var box = dimension.client;
var offset = dragging.offset,
combineWith = dragging.combineWith,
dropping = dragging.dropping;
var isCombining = Boolean(combineWith);
var shouldAnimate = getShouldDraggingAnimate(dragging);
var isDropAnimating = Boolean(dropping);
var transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset);
var style = {
position: 'fixed',
top: box.marginBox.top,
left: box.marginBox.left,
boxSizing: 'border-box',
width: box.borderBox.width,
height: box.borderBox.height,
transition: getDraggingTransition(shouldAnimate, dropping),
transform: transform,
opacity: getDraggingOpacity(isCombining, isDropAnimating),
zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,
pointerEvents: 'none'
};
return style;
}
function getSecondaryStyle(secondary) {
return {
transform: transforms.moveTo(secondary.offset),
transition: secondary.shouldAnimateDisplacement ? null : 'none'
};
}
function getStyle(mapped) {
return mapped.type === 'DRAGGING' ? getDraggingStyle(mapped) : getSecondaryStyle(mapped);
}
var checkOwnProps$1 = (function (props) {
!__WEBPACK_IMPORTED_MODULE_14__babel_runtime_corejs2_core_js_number_is_integer___default()(props.index) ? false ? invariant(false, 'Draggable requires an integer index prop') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!props.draggableId ? false ? invariant(false, 'Draggable requires a draggableId') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!(typeof props.isDragDisabled === 'boolean') ? false ? invariant(false, 'isDragDisabled must be a boolean') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
});
var _Draggable$contextTyp;
var Draggable = function (_React$Component) {
Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_helpers_esm_inheritsLoose__["a" /* default */])(Draggable, _React$Component);
function Draggable(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this.callbacks = void 0;
_this.styleContext = void 0;
_this.ref = null;
_this.onMoveEnd = function (event) {
var mapped = _this.props.mapped;
var isDropping = mapped.type === 'DRAGGING' && Boolean(mapped.dropping);
if (!isDropping) {
return;
}
if (event.propertyName !== 'transform') {
return;
}
_this.props.dropAnimationFinished();
};
_this.onLift = function (options) {
start('LIFT');
var ref = _this.ref;
!ref ? false ? invariant(false) : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
!!_this.props.isDragDisabled ? false ? invariant(false, 'Cannot lift a Draggable when it is disabled') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
var clientSelection = options.clientSelection,
movementMode = options.movementMode;
var _this$props = _this.props,
lift = _this$props.lift,
draggableId = _this$props.draggableId;
lift({
id: draggableId,
clientSelection: clientSelection,
movementMode: movementMode
});
finish('LIFT');
};
_this.setRef = function (ref) {
if (ref === null) {
return;
}
if (ref === _this.ref) {
return;
}
_this.ref = ref;
throwIfRefIsInvalid(ref);
};
_this.getDraggableRef = function () {
return _this.ref;
};
_this.getShouldRespectForceTouch = function () {
return _this.props.shouldRespectForceTouch;
};
_this.getProvided = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (mapped, dragHandleProps) {
var style = getStyle(mapped);
var onTransitionEnd = mapped.type === 'DRAGGING' && Boolean(mapped.dropping) ? _this.onMoveEnd : null;
var result = {
innerRef: _this.setRef,
draggableProps: {
'data-react-beautiful-dnd-draggable': _this.styleContext,
style: style,
onTransitionEnd: onTransitionEnd
},
dragHandleProps: dragHandleProps
};
return result;
});
_this.renderChildren = function (dragHandleProps) {
var _this$props2 = _this.props,
children = _this$props2.children,
mapped = _this$props2.mapped;
return children(_this.getProvided(mapped, dragHandleProps), mapped.snapshot);
};
var callbacks = {
onLift: _this.onLift,
onMove: function onMove(clientSelection) {
return props.move({
client: clientSelection
});
},
onDrop: function onDrop() {
return props.drop({
reason: 'DROP'
});
},
onCancel: function onCancel() {
return props.drop({
reason: 'CANCEL'
});
},
onMoveUp: props.moveUp,
onMoveDown: props.moveDown,
onMoveRight: props.moveRight,
onMoveLeft: props.moveLeft,
onWindowScroll: function onWindowScroll() {
return props.moveByWindowScroll({
newScroll: getWindowScroll()
});
}
};
_this.callbacks = callbacks;
_this.styleContext = context[styleKey];
if (false) {
checkOwnProps$1(props);
}
return _this;
}
var _proto = Draggable.prototype;
_proto.componentWillUnmount = function componentWillUnmount() {
this.ref = null;
};
_proto.render = function render() {
var _this$props3 = this.props,
draggableId = _this$props3.draggableId,
index = _this$props3.index,
mapped = _this$props3.mapped,
isDragDisabled = _this$props3.isDragDisabled,
disableInteractiveElementBlocking = _this$props3.disableInteractiveElementBlocking;
var droppableId = this.context[droppableIdKey];
var type = this.context[droppableTypeKey];
var isDragging = mapped.type === 'DRAGGING';
var isDropAnimating = mapped.type === 'DRAGGING' && Boolean(mapped.dropping);
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(DraggableDimensionPublisher, {
key: draggableId,
draggableId: draggableId,
droppableId: droppableId,
type: type,
index: index,
getDraggableRef: this.getDraggableRef
}, __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(DragHandle, {
draggableId: draggableId,
isDragging: isDragging,
isDropAnimating: isDropAnimating,
isEnabled: !isDragDisabled,
callbacks: this.callbacks,
getDraggableRef: this.getDraggableRef,
getShouldRespectForceTouch: this.getShouldRespectForceTouch,
canDragInteractiveElements: disableInteractiveElementBlocking
}, this.renderChildren));
};
return Draggable;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
Draggable.contextTypes = (_Draggable$contextTyp = {}, _Draggable$contextTyp[droppableIdKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _Draggable$contextTyp[droppableTypeKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _Draggable$contextTyp[styleKey] = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string.isRequired, _Draggable$contextTyp);
var getCombineWithFromResult = function getCombineWithFromResult(result) {
return result.combine ? result.combine.draggableId : null;
};
var getCombineWithFromImpact = function getCombineWithFromImpact(impact) {
return impact.merge ? impact.merge.combine.draggableId : null;
};
var makeMapStateToProps$1 = function makeMapStateToProps() {
var getDraggingSnapshot = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (mode, draggingOver, combineWith, dropping) {
return {
isDragging: true,
isDropAnimating: Boolean(dropping),
dropAnimation: dropping,
mode: mode,
draggingOver: draggingOver,
combineWith: combineWith,
combineTargetFor: null
};
});
var getSecondarySnapshot = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (combineTargetFor) {
return {
isDragging: false,
isDropAnimating: false,
dropAnimation: null,
mode: null,
draggingOver: null,
combineTargetFor: combineTargetFor,
combineWith: null
};
});
var defaultMapProps = {
mapped: {
type: 'SECONDARY',
offset: origin,
combineTargetFor: null,
shouldAnimateDisplacement: true,
snapshot: getSecondarySnapshot(null)
}
};
var memoizedOffset = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (x, y) {
return {
x: x,
y: y
};
});
var getDraggingProps = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (offset, mode, dimension, draggingOver, combineWith, forceShouldAnimate) {
return {
mapped: {
type: 'DRAGGING',
dropping: null,
draggingOver: draggingOver,
combineWith: combineWith,
mode: mode,
offset: offset,
dimension: dimension,
forceShouldAnimate: forceShouldAnimate,
snapshot: getDraggingSnapshot(mode, draggingOver, combineWith, null)
}
};
});
var getSecondaryProps = Object(__WEBPACK_IMPORTED_MODULE_7_memoize_one__["a" /* default */])(function (offset, combineTargetFor, shouldAnimateDisplacement) {
if (combineTargetFor === void 0) {
combineTargetFor = null;
}
return {
mapped: {
type: 'SECONDARY',
offset: offset,
combineTargetFor: combineTargetFor,
shouldAnimateDisplacement: shouldAnimateDisplacement,
snapshot: getSecondarySnapshot(combineTargetFor)
}
};
});
var getSecondaryMovement = function getSecondaryMovement(ownId, draggingId, impact) {
var map = impact.movement.map;
var displacement = map[ownId];
var movement = impact.movement;
var merge = impact.merge;
var isCombinedWith = Boolean(merge && merge.combine.draggableId === ownId);
var displacedBy = movement.displacedBy.point;
var offset = memoizedOffset(displacedBy.x, displacedBy.y);
if (isCombinedWith) {
return getSecondaryProps(displacement ? offset : origin, draggingId, displacement ? displacement.shouldAnimate : true);
}
if (!displacement) {
return null;
}
if (!displacement.isVisible) {
return null;
}
return getSecondaryProps(offset, null, displacement.shouldAnimate);
};
var draggingSelector = function draggingSelector(state, ownProps) {
if (state.isDragging) {
if (state.critical.draggable.id !== ownProps.draggableId) {
return null;
}
var offset = state.current.client.offset;
var dimension = state.dimensions.draggables[ownProps.draggableId];
var mode = state.movementMode;
var draggingOver = whatIsDraggedOver(state.impact);
var combineWith = getCombineWithFromImpact(state.impact);
var forceShouldAnimate = state.forceShouldAnimate;
return getDraggingProps(memoizedOffset(offset.x, offset.y), mode, dimension, draggingOver, combineWith, forceShouldAnimate);
}
if (state.phase === 'DROP_ANIMATING') {
var completed = state.completed;
if (completed.result.draggableId !== ownProps.draggableId) {
return null;
}
var _dimension = state.dimensions.draggables[ownProps.draggableId];
var result = completed.result;
var _mode = result.mode;
var _draggingOver = whatIsDraggedOverFromResult(result);
var _combineWith = getCombineWithFromResult(result);
var duration = state.dropDuration;
var dropping = {
duration: duration,
curve: curves.drop,
moveTo: state.newHomeClientOffset,
opacity: _combineWith ? combine.opacity.drop : null,
scale: _combineWith ? combine.scale.drop : null
};
return {
mapped: {
type: 'DRAGGING',
offset: state.newHomeClientOffset,
dimension: _dimension,
dropping: dropping,
draggingOver: _draggingOver,
combineWith: _combineWith,
mode: _mode,
forceShouldAnimate: null,
snapshot: getDraggingSnapshot(_mode, _draggingOver, _combineWith, dropping)
}
};
}
return null;
};
var secondarySelector = function secondarySelector(state, ownProps) {
if (state.isDragging) {
if (state.critical.draggable.id === ownProps.draggableId) {
return null;
}
return getSecondaryMovement(ownProps.draggableId, state.critical.draggable.id, state.impact);
}
if (state.phase === 'DROP_ANIMATING') {
var completed = state.completed;
if (completed.result.draggableId === ownProps.draggableId) {
return null;
}
return getSecondaryMovement(ownProps.draggableId, completed.result.draggableId, completed.impact);
}
return null;
};
var selector = function selector(state, ownProps) {
return draggingSelector(state, ownProps) || secondarySelector(state, ownProps) || defaultMapProps;
};
return selector;
};
var mapDispatchToProps$1 = {
lift: lift,
move: move,
moveUp: moveUp,
moveDown: moveDown,
moveLeft: moveLeft,
moveRight: moveRight,
moveByWindowScroll: moveByWindowScroll,
drop: drop,
dropAnimationFinished: dropAnimationFinished
};
var defaultProps$1 = {
isDragDisabled: false,
disableInteractiveElementBlocking: false,
shouldRespectForceTouch: true
};
var ConnectedDraggable = Object(__WEBPACK_IMPORTED_MODULE_13_react_redux__["b" /* connect */])(makeMapStateToProps$1, mapDispatchToProps$1, null, {
storeKey: storeKey,
pure: true,
areStatePropsEqual: isStrictEqual
})(Draggable);
ConnectedDraggable.defaultProps = defaultProps$1;
/***/ }),
/***/ 1584:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (newInputs[i] !== lastInputs[i]) {
return false;
}
}
return true;
}
function index (resultFn, isEqual) {
if (isEqual === void 0) {
isEqual = areInputsEqual;
}
var lastThis;
var lastArgs = [];
var lastResult;
var calledOnce = false;
var result = function result() {
for (var _len = arguments.length, newArgs = new Array(_len), _key = 0; _key < _len; _key++) {
newArgs[_key] = arguments[_key];
}
if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
return lastResult;
}
lastResult = resultFn.apply(this, newArgs);
calledOnce = true;
lastThis = this;
lastArgs = newArgs;
return lastResult;
};
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (index);
/***/ }),
/***/ 1615:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = _extends;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_js_object_assign__ = __webpack_require__(1474);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__core_js_object_assign__);
function _extends() {
_extends = __WEBPACK_IMPORTED_MODULE_0__core_js_object_assign___default.a || 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);
}
/***/ }),
/***/ 1616:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = _inheritsLoose;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_js_object_create__ = __webpack_require__(1617);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_js_object_create___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__core_js_object_create__);
function _inheritsLoose(subClass, superClass) {
subClass.prototype = __WEBPACK_IMPORTED_MODULE_0__core_js_object_create___default()(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
/***/ }),
/***/ 1617:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(196);
/***/ }),
/***/ 1618:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getRect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return expand; });
/* unused harmony export shrink */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createBox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return offset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return withScroll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return calculateBox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getBox; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tiny_invariant__ = __webpack_require__(347);
var getRect = function getRect(_ref) {
var top = _ref.top,
right = _ref.right,
bottom = _ref.bottom,
left = _ref.left;
var width = right - left;
var height = bottom - top;
var rect = {
top: top,
right: right,
bottom: bottom,
left: left,
width: width,
height: height,
x: left,
y: top,
center: {
x: (right + left) / 2,
y: (bottom + top) / 2
}
};
return rect;
};
var expand = function expand(target, expandBy) {
return {
top: target.top - expandBy.top,
left: target.left - expandBy.left,
bottom: target.bottom + expandBy.bottom,
right: target.right + expandBy.right
};
};
var shrink = function shrink(target, shrinkBy) {
return {
top: target.top + shrinkBy.top,
left: target.left + shrinkBy.left,
bottom: target.bottom - shrinkBy.bottom,
right: target.right - shrinkBy.right
};
};
var shift = function shift(target, shiftBy) {
return {
top: target.top + shiftBy.y,
left: target.left + shiftBy.x,
bottom: target.bottom + shiftBy.y,
right: target.right + shiftBy.x
};
};
var noSpacing = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
var createBox = function createBox(_ref2) {
var borderBox = _ref2.borderBox,
_ref2$margin = _ref2.margin,
margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,
_ref2$border = _ref2.border,
border = _ref2$border === void 0 ? noSpacing : _ref2$border,
_ref2$padding = _ref2.padding,
padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;
var marginBox = getRect(expand(borderBox, margin));
var paddingBox = getRect(shrink(borderBox, border));
var contentBox = getRect(shrink(paddingBox, padding));
return {
marginBox: marginBox,
borderBox: getRect(borderBox),
paddingBox: paddingBox,
contentBox: contentBox,
margin: margin,
border: border,
padding: padding
};
};
var parse = function parse(raw) {
var value = raw.slice(0, -2);
var suffix = raw.slice(-2);
!(suffix === 'px') ? false ? invariant(false, "Expected value to be a pixel value.\n Expected form: 10px\n Actual value: " + raw + "\n ") : Object(__WEBPACK_IMPORTED_MODULE_0_tiny_invariant__["a" /* default */])(false) : void 0;
var result = Number(value);
!!isNaN(result) ? false ? invariant(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : Object(__WEBPACK_IMPORTED_MODULE_0_tiny_invariant__["a" /* default */])(false) : void 0;
return result;
};
var getWindowScroll = function getWindowScroll() {
return {
x: window.pageXOffset,
y: window.pageYOffset
};
};
var offset = function offset(original, change) {
var borderBox = original.borderBox,
border = original.border,
margin = original.margin,
padding = original.padding;
var shifted = shift(borderBox, change);
return createBox({
borderBox: shifted,
border: border,
margin: margin,
padding: padding
});
};
var withScroll = function withScroll(original, scroll) {
if (scroll === void 0) {
scroll = getWindowScroll();
}
return offset(original, scroll);
};
var calculateBox = function calculateBox(borderBox, styles) {
var margin = {
top: parse(styles.marginTop),
right: parse(styles.marginRight),
bottom: parse(styles.marginBottom),
left: parse(styles.marginLeft)
};
var padding = {
top: parse(styles.paddingTop),
right: parse(styles.paddingRight),
bottom: parse(styles.paddingBottom),
left: parse(styles.paddingLeft)
};
var border = {
top: parse(styles.borderTopWidth),
right: parse(styles.borderRightWidth),
bottom: parse(styles.borderBottomWidth),
left: parse(styles.borderLeftWidth)
};
return createBox({
borderBox: borderBox,
margin: margin,
padding: padding,
border: border
});
};
var getBox = function getBox(el) {
var borderBox = el.getBoundingClientRect();
var styles = window.getComputedStyle(el);
return calculateBox(borderBox, styles);
};
/***/ }),
/***/ 1619:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1620);
/***/ }),
/***/ 1620:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(1621);
module.exports = __webpack_require__(14).Object.values;
/***/ }),
/***/ 1621:
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(27);
var $values = __webpack_require__(1622)(false);
$export($export.S, 'Object', {
values: function values(it) {
return $values(it);
}
});
/***/ }),
/***/ 1622:
/***/ (function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(78);
var toIObject = __webpack_require__(52);
var isEnum = __webpack_require__(92).f;
module.exports = function (isEntries) {
return function (it) {
var O = toIObject(it);
var keys = getKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) if (isEnum.call(O, key = keys[i++])) {
result.push(isEntries ? [key, O[key]] : O[key]);
} return result;
};
};
/***/ }),
/***/ 1623:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(352);
/***/ }),
/***/ 1624:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1625);
/***/ }),
/***/ 1625:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(1626);
module.exports = __webpack_require__(14).Date.now;
/***/ }),
/***/ 1626:
/***/ (function(module, exports, __webpack_require__) {
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(27);
$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
/***/ }),
/***/ 1627:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var index = (function (fn) {
var lastArgs = [];
var frameId = null;
var wrapperFn = function wrapperFn() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
lastArgs = args;
if (frameId) {
return;
}
frameId = requestAnimationFrame(function () {
frameId = null;
fn.apply(undefined, lastArgs);
});
};
wrapperFn.cancel = function () {
if (!frameId) {
return;
}
cancelAnimationFrame(frameId);
frameId = null;
};
var resultFn = wrapperFn;
return resultFn;
});
/* harmony default export */ __webpack_exports__["a"] = (index);
/***/ }),
/***/ 1628:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1629);
/***/ }),
/***/ 1629:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(1630);
module.exports = __webpack_require__(14).Number.isInteger;
/***/ }),
/***/ 1630:
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var $export = __webpack_require__(27);
$export($export.S, 'Number', { isInteger: __webpack_require__(1631) });
/***/ }),
/***/ 1631:
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var isObject = __webpack_require__(41);
var floor = Math.floor;
module.exports = function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};
/***/ }),
/***/ 1653:
/***/ (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_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Modals__ = __webpack_require__(173);
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 Jointheclass=function(_Component){_inherits(Jointheclass,_Component);function Jointheclass(props){_classCallCheck(this,Jointheclass);var _this=_possibleConstructorReturn(this,(Jointheclass.__proto__||Object.getPrototypeOf(Jointheclass)).call(this,props));_this.modalCancel=function(){_this.props.ysljoinmodalCancel();};_this.setDownload=function(){var cousestype=_this.props.pathcousestypeid;var id=_this.props.Pathcourseid===undefined?_this.props.match.params.coursesId:_this.props.Pathcourseid;var url='/courses/'+id+'/join_excellent_course.json';__WEBPACK_IMPORTED_MODULE_1_axios___default.a.post(url).then(function(result){if(result){if(result.data){if(result.data.status===0){_this.props.showNotification(result.data.message);_this.props.ysljoinmodalCanceltwo();if(cousestype===1){window.open('/courses/'+id+'/informs');}}else{_this.props.showNotification(result.data.message);}}}}).catch(function(error){console.log(error);});};return _this;}_createClass(Jointheclass,[{key:'componentDidMount',value:function componentDidMount(){// console.log("加入精品课堂");
// console.log(this.props);
var type=this.props.yslJointhe===undefined?false:this.props.yslJointhe;if(type===true){this.setState({Modalstype:true});}}},{key:'render',value:function render(){var _this2=this;// console.log("加入精品课堂2");
//console.log(this.props.Pathcourseid);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__Modals__["a" /* default */],{modalsType:this.props.yslJointhe===undefined?false:this.props.yslJointhe,modalsTopval:"是否确定加入该课堂?",modalCancel:function modalCancel(){return _this2.modalCancel();},modalSave:function modalSave(){return _this2.setDownload();}});}}]);return Jointheclass;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (Jointheclass);
/***/ }),
/***/ 1666:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(1679);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 1667:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _rcDrawer = _interopRequireDefault(__webpack_require__(1681));
var _createReactContext = _interopRequireDefault(__webpack_require__(316));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _omit = _interopRequireDefault(__webpack_require__(43));
var _warning = _interopRequireDefault(__webpack_require__(40));
var _icon = _interopRequireDefault(__webpack_require__(26));
var _context = __webpack_require__(355);
var _type = __webpack_require__(70);
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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 DrawerContext = (0, _createReactContext["default"])(null);
var PlacementTypes = (0, _type.tuple)('top', 'right', 'bottom', 'left');
var Drawer =
/*#__PURE__*/
function (_React$Component) {
_inherits(Drawer, _React$Component);
function Drawer() {
var _this;
_classCallCheck(this, Drawer);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Drawer).apply(this, arguments));
_this.state = {
push: false
};
_this.push = function () {
_this.setState({
push: true
});
};
_this.pull = function () {
_this.setState({
push: false
});
};
_this.onDestroyTransitionEnd = function () {
var isDestroyOnClose = _this.getDestroyOnClose();
if (!isDestroyOnClose) {
return;
}
if (!_this.props.visible) {
_this.destroyClose = true;
_this.forceUpdate();
}
};
_this.getDestroyOnClose = function () {
return _this.props.destroyOnClose && !_this.props.visible;
}; // get drawer push width or height
_this.getPushTransform = function (placement) {
if (placement === 'left' || placement === 'right') {
return "translateX(".concat(placement === 'left' ? 180 : -180, "px)");
}
if (placement === 'top' || placement === 'bottom') {
return "translateY(".concat(placement === 'top' ? 180 : -180, "px)");
}
};
_this.getRcDrawerStyle = function () {
var _this$props = _this.props,
zIndex = _this$props.zIndex,
placement = _this$props.placement,
style = _this$props.style;
var push = _this.state.push;
return _extends({
zIndex: zIndex,
transform: push ? _this.getPushTransform(placement) : undefined
}, style);
}; // render drawer body dom
_this.renderBody = function () {
var _this$props2 = _this.props,
bodyStyle = _this$props2.bodyStyle,
drawerStyle = _this$props2.drawerStyle,
prefixCls = _this$props2.prefixCls,
visible = _this$props2.visible;
if (_this.destroyClose && !visible) {
return null;
}
_this.destroyClose = false;
var containerStyle = {};
var isDestroyOnClose = _this.getDestroyOnClose();
if (isDestroyOnClose) {
// Increase the opacity transition, delete children after closing.
containerStyle.opacity = 0;
containerStyle.transition = 'opacity .3s';
}
return React.createElement("div", {
className: "".concat(prefixCls, "-wrapper-body"),
style: _extends(_extends({}, containerStyle), drawerStyle),
onTransitionEnd: _this.onDestroyTransitionEnd
}, _this.renderHeader(), React.createElement("div", {
className: "".concat(prefixCls, "-body"),
style: bodyStyle
}, _this.props.children));
}; // render Provider for Multi-level drawer
_this.renderProvider = function (value) {
var _a = _this.props,
prefixCls = _a.prefixCls,
placement = _a.placement,
className = _a.className,
wrapClassName = _a.wrapClassName,
width = _a.width,
height = _a.height,
mask = _a.mask,
rest = __rest(_a, ["prefixCls", "placement", "className", "wrapClassName", "width", "height", "mask"]);
(0, _warning["default"])(wrapClassName === undefined, 'Drawer', 'wrapClassName is deprecated, please use className instead.');
var haveMask = mask ? '' : 'no-mask';
_this.parentDrawer = value;
var offsetStyle = {};
if (placement === 'left' || placement === 'right') {
offsetStyle.width = width;
} else {
offsetStyle.height = height;
}
return React.createElement(DrawerContext.Provider, {
value: _assertThisInitialized(_this)
}, React.createElement(_rcDrawer["default"], _extends({
handler: false
}, (0, _omit["default"])(rest, ['zIndex', 'style', 'closable', 'destroyOnClose', 'drawerStyle', 'headerStyle', 'bodyStyle', 'title', 'push', 'visible', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'pageHeader', 'autoInsertSpaceInButton']), offsetStyle, {
prefixCls: prefixCls,
open: _this.props.visible,
showMask: mask,
placement: placement,
style: _this.getRcDrawerStyle(),
className: (0, _classnames["default"])(wrapClassName, className, haveMask)
}), _this.renderBody()));
};
return _this;
}
_createClass(Drawer, [{
key: "componentDidMount",
value: function componentDidMount() {
// fix: delete drawer in child and re-render, no push started.
// <Drawer>{show && <Drawer />}</Drawer>
var visible = this.props.visible;
if (visible && this.parentDrawer) {
this.parentDrawer.push();
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(preProps) {
var visible = this.props.visible;
if (preProps.visible !== visible && this.parentDrawer) {
if (visible) {
this.parentDrawer.push();
} else {
this.parentDrawer.pull();
}
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
// unmount drawer in child, clear push.
if (this.parentDrawer) {
this.parentDrawer.pull();
this.parentDrawer = null;
}
}
}, {
key: "renderHeader",
value: function renderHeader() {
var _this$props3 = this.props,
title = _this$props3.title,
prefixCls = _this$props3.prefixCls,
closable = _this$props3.closable,
headerStyle = _this$props3.headerStyle;
if (!title && !closable) {
return null;
}
var headerClassName = title ? "".concat(prefixCls, "-header") : "".concat(prefixCls, "-header-no-title");
return React.createElement("div", {
className: headerClassName,
style: headerStyle
}, title && React.createElement("div", {
className: "".concat(prefixCls, "-title")
}, title), closable && this.renderCloseIcon());
}
}, {
key: "renderCloseIcon",
value: function renderCloseIcon() {
var _this$props4 = this.props,
closable = _this$props4.closable,
prefixCls = _this$props4.prefixCls,
onClose = _this$props4.onClose;
return closable && // eslint-disable-next-line react/button-has-type
React.createElement("button", {
onClick: onClose,
"aria-label": "Close",
className: "".concat(prefixCls, "-close")
}, React.createElement(_icon["default"], {
type: "close"
}));
}
}, {
key: "render",
value: function render() {
return React.createElement(DrawerContext.Consumer, null, this.renderProvider);
}
}]);
return Drawer;
}(React.Component);
Drawer.defaultProps = {
width: 256,
height: 256,
closable: true,
placement: 'right',
maskClosable: true,
mask: true,
level: null,
keyboard: true
};
var _default = (0, _context.withConfigConsumer)({
prefixCls: 'drawer'
})(Drawer);
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1679:
/***/ (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__(1680);
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;
/***/ }),
/***/ 1680:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-drawer{position:fixed;z-index:1000;width:0;height:100%;-webkit-transition:height 0s ease .3s,width 0s ease .3s,-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:height 0s ease .3s,width 0s ease .3s,-webkit-transform .3s cubic-bezier(.7,.3,.1,1);-o-transition:transform .3s cubic-bezier(.7,.3,.1,1),height 0s ease .3s,width 0s ease .3s;transition:transform .3s cubic-bezier(.7,.3,.1,1),height 0s ease .3s,width 0s ease .3s;transition:transform .3s cubic-bezier(.7,.3,.1,1),height 0s ease .3s,width 0s ease .3s,-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer>*{-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1),-webkit-box-shadow .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1),-webkit-box-shadow .3s cubic-bezier(.7,.3,.1,1);-o-transition:transform .3s cubic-bezier(.7,.3,.1,1),box-shadow .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),box-shadow .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),box-shadow .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1),-webkit-box-shadow .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-content-wrapper{position:absolute}.ant-drawer .ant-drawer-content{width:100%;height:100%}.ant-drawer-left,.ant-drawer-right{top:0;width:0;height:100%}.ant-drawer-left .ant-drawer-content-wrapper,.ant-drawer-right .ant-drawer-content-wrapper{height:100%}.ant-drawer-left.ant-drawer-open,.ant-drawer-right.ant-drawer-open{width:100%;-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);-o-transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-left.ant-drawer-open.no-mask,.ant-drawer-right.ant-drawer-open.no-mask{width:0}.ant-drawer-left.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:2px 0 8px rgba(0,0,0,.15);box-shadow:2px 0 8px rgba(0,0,0,.15)}.ant-drawer-right,.ant-drawer-right .ant-drawer-content-wrapper{right:0}.ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:-2px 0 8px rgba(0,0,0,.15);box-shadow:-2px 0 8px rgba(0,0,0,.15)}.ant-drawer-right.ant-drawer-open.no-mask{right:1px;-webkit-transform:translateX(1px);-ms-transform:translateX(1px);transform:translateX(1px)}.ant-drawer-bottom,.ant-drawer-top{left:0;width:100%;height:0%}.ant-drawer-bottom .ant-drawer-content-wrapper,.ant-drawer-top .ant-drawer-content-wrapper{width:100%}.ant-drawer-bottom.ant-drawer-open,.ant-drawer-top.ant-drawer-open{height:100%;-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);-o-transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-bottom.ant-drawer-open.no-mask,.ant-drawer-top.ant-drawer-open.no-mask{height:0%}.ant-drawer-top{top:0}.ant-drawer-top.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15)}.ant-drawer-bottom,.ant-drawer-bottom .ant-drawer-content-wrapper{bottom:0}.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:0 -2px 8px rgba(0,0,0,.15);box-shadow:0 -2px 8px rgba(0,0,0,.15)}.ant-drawer-bottom.ant-drawer-open.no-mask{bottom:1px;-webkit-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.ant-drawer.ant-drawer-open .ant-drawer-mask{height:100%;opacity:1;-webkit-transition:none;-o-transition:none;transition:none;-webkit-animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1);animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-title{margin:0;color:rgba(0,0,0,.85);font-weight:500;font-size:16px;line-height:22px}.ant-drawer-content{position:relative;z-index:1;overflow:auto;background-color:#fff;background-clip:padd
// exports
/***/ }),
/***/ 1681:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerWrapper__ = __webpack_require__(1682);
// export this package's api
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__DrawerWrapper__["a" /* default */]);
/***/ }),
/***/ 1682:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rc_util_es_PortalWrapper__ = __webpack_require__(1683);
/* 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__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_lifecycles_compat__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__DrawerChild__ = __webpack_require__(1687);
function _typeof(obj) { 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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 DrawerWrapper =
/*#__PURE__*/
function (_React$Component) {
_inherits(DrawerWrapper, _React$Component);
function DrawerWrapper(props) {
var _this;
_classCallCheck(this, DrawerWrapper);
_this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerWrapper).call(this, props));
_this.onHandleClick = function (e) {
var _this$props = _this.props,
onHandleClick = _this$props.onHandleClick,
$open = _this$props.open;
if (onHandleClick) {
onHandleClick(e);
}
if (typeof $open === 'undefined') {
var _open = _this.state.open;
_this.setState({
open: !_open
});
}
};
_this.onClose = function (e) {
var _this$props2 = _this.props,
onClose = _this$props2.onClose,
open = _this$props2.open;
if (onClose) {
onClose(e);
}
if (typeof open === 'undefined') {
_this.setState({
open: false
});
}
};
var open = typeof props.open !== 'undefined' ? props.open : !!props.defaultOpen;
_this.state = {
open: open
};
if ('onMaskClick' in props) {
console.warn('`onMaskClick` are removed, please use `onClose` instead.');
}
return _this;
}
_createClass(DrawerWrapper, [{
key: "render",
// tslint:disable-next-line:member-ordering
value: function render() {
var _this2 = this;
var _this$props3 = this.props,
defaultOpen = _this$props3.defaultOpen,
getContainer = _this$props3.getContainer,
wrapperClassName = _this$props3.wrapperClassName,
forceRender = _this$props3.forceRender,
handler = _this$props3.handler,
props = _objectWithoutProperties(_this$props3, ["defaultOpen", "getContainer", "wrapperClassName", "forceRender", "handler"]);
var open = this.state.open; // 渲染在当前 dom 里;
if (!getContainer) {
return __WEBPACK_IMPORTED_MODULE_1_react__["createElement"]("div", {
className: wrapperClassName,
ref: function ref(c) {
_this2.dom = c;
}
}, __WEBPACK_IMPORTED_MODULE_1_react__["createElement"](__WEBPACK_IMPORTED_MODULE_3__DrawerChild__["a" /* default */], Object.assign({}, props, {
open: open,
handler: handler,
getContainer: function getContainer() {
return _this2.dom;
},
onClose: this.onClose,
onHandleClick: this.onHandleClick
})));
} // 如果有 handler 为内置强制渲染;
var $forceRender = !!handler || forceRender;
return __WEBPACK_IMPORTED_MODULE_1_react__["createElement"](__WEBPACK_IMPORTED_MODULE_0_rc_util_es_PortalWrapper__["a" /* default */], {
visible: open,
forceRender: $forceRender,
getContainer: getContainer,
wrapperClassName: wrapperClassName
}, function (_ref) {
var visible = _ref.visible,
afterClose = _ref.afterClose,
rest = _objectWithoutProperties(_ref, ["visible", "afterClose"]);
return (// react 15componentWillUnmount 时 Portal 返回 afterClose, visible.
__WEBPACK_IMPORTED_MODULE_1_react__["createElement"](__WEBPACK_IMPORTED_MODULE_3__DrawerChild__["a" /* default */], Object.assign({}, props, rest, {
open: visible !== undefined ? visible : open,
afterVisibleChange: afterClose !== undefined ? afterClose : props.afterVisibleChange,
handler: handler,
onClose: _this2.onClose,
onHandleClick: _this2.onHandleClick
}))
);
});
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, _ref2) {
var prevProps = _ref2.prevProps;
var newState = {
prevProps: props
};
if (typeof prevProps !== 'undefined' && props.open !== prevProps.open) {
newState.open = props.open;
}
return newState;
}
}]);
return DrawerWrapper;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
DrawerWrapper.defaultProps = {
prefixCls: 'drawer',
placement: 'left',
getContainer: 'body',
defaultOpen: false,
level: 'all',
duration: '.3s',
ease: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)',
onChange: function onChange() {},
afterVisibleChange: function afterVisibleChange() {},
handler: __WEBPACK_IMPORTED_MODULE_1_react__["createElement"]("div", {
className: "drawer-handle"
}, __WEBPACK_IMPORTED_MODULE_1_react__["createElement"]("i", {
className: "drawer-handle-icon"
})),
showMask: true,
maskClosable: true,
maskStyle: {},
wrapperClassName: '',
className: '',
keyboard: true,
forceRender: false
};
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2_react_lifecycles_compat__["polyfill"])(DrawerWrapper));
/***/ }),
/***/ 1683:
/***/ (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_react_dom__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_lifecycles_compat__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ContainerRender__ = __webpack_require__(1684);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Portal__ = __webpack_require__(1685);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__switchScrollingEffect__ = __webpack_require__(1686);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__setStyle__ = __webpack_require__(1517);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
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) { 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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); }
/* eslint-disable no-underscore-dangle,react/require-default-props */
var openCount = 0;
var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement);
var IS_REACT_16 = 'createPortal' in __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a; // https://github.com/ant-design/ant-design/issues/19340
// https://github.com/ant-design/ant-design/issues/19332
var cacheOverflow = {};
var PortalWrapper =
/*#__PURE__*/
function (_React$Component) {
_inherits(PortalWrapper, _React$Component);
function PortalWrapper(props) {
var _this;
_classCallCheck(this, PortalWrapper);
_this = _possibleConstructorReturn(this, _getPrototypeOf(PortalWrapper).call(this, props));
_this.getParent = function () {
var getContainer = _this.props.getContainer;
if (getContainer) {
if (typeof getContainer === 'string') {
return document.querySelectorAll(getContainer)[0];
}
if (typeof getContainer === 'function') {
return getContainer();
}
if (_typeof(getContainer) === 'object' && getContainer instanceof window.HTMLElement) {
return getContainer;
}
}
return document.body;
};
_this.getContainer = function () {
if (windowIsUndefined) {
return null;
}
if (!_this.container) {
_this.container = document.createElement('div');
var parent = _this.getParent();
if (parent) {
parent.appendChild(_this.container);
}
}
_this.setWrapperClassName();
return _this.container;
};
_this.setWrapperClassName = function () {
var wrapperClassName = _this.props.wrapperClassName;
if (_this.container && wrapperClassName && wrapperClassName !== _this.container.className) {
_this.container.className = wrapperClassName;
}
};
_this.savePortal = function (c) {
// Warning: don't rename _component
// https://github.com/react-component/util/pull/65#discussion_r352407916
_this._component = c;
};
_this.removeCurrentContainer = function (visible) {
_this.container = null;
_this._component = null;
if (!IS_REACT_16) {
if (visible) {
_this.renderComponent({
afterClose: _this.removeContainer,
onClose: function onClose() {},
visible: false
});
} else {
_this.removeContainer();
}
}
};
_this.switchScrollingEffect = function () {
if (openCount === 1 && !Object.keys(cacheOverflow).length) {
Object(__WEBPACK_IMPORTED_MODULE_6__switchScrollingEffect__["a" /* default */])(); // Must be set after switchScrollingEffect
cacheOverflow = Object(__WEBPACK_IMPORTED_MODULE_7__setStyle__["a" /* default */])({
overflow: 'hidden',
overflowX: 'hidden',
overflowY: 'hidden'
});
} else if (!openCount) {
Object(__WEBPACK_IMPORTED_MODULE_7__setStyle__["a" /* default */])(cacheOverflow);
cacheOverflow = {};
Object(__WEBPACK_IMPORTED_MODULE_6__switchScrollingEffect__["a" /* default */])(true);
}
};
var _visible = props.visible;
openCount = _visible ? openCount + 1 : openCount;
_this.state = {
_self: _assertThisInitialized(_this)
};
return _this;
}
_createClass(PortalWrapper, [{
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.setWrapperClassName();
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var visible = this.props.visible; // 离开时不会 render 导到离开时数值不变,改用 func 。。
openCount = visible && openCount ? openCount - 1 : openCount;
this.removeCurrentContainer(visible);
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var _this$props = this.props,
children = _this$props.children,
forceRender = _this$props.forceRender,
visible = _this$props.visible;
var portal = null;
var childProps = {
getOpenCount: function getOpenCount() {
return openCount;
},
getContainer: this.getContainer,
switchScrollingEffect: this.switchScrollingEffect
}; // suppport react15
if (!IS_REACT_16) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__ContainerRender__["a" /* default */], {
parent: this,
visible: visible,
autoDestroy: false,
getComponent: function getComponent() {
var extra = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return children(_objectSpread({}, extra, {}, childProps, {
ref: _this2.savePortal
}));
},
getContainer: this.getContainer,
forceRender: forceRender
}, function (_ref) {
var renderComponent = _ref.renderComponent,
removeContainer = _ref.removeContainer;
_this2.renderComponent = renderComponent;
_this2.removeContainer = removeContainer;
return null;
});
}
if (forceRender || visible || this._component) {
portal = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__Portal__["a" /* default */], {
getContainer: this.getContainer,
ref: this.savePortal
}, children(childProps));
}
return portal;
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, _ref2) {
var prevProps = _ref2.prevProps,
_self = _ref2._self;
var visible = props.visible,
getContainer = props.getContainer;
if (prevProps) {
var prevVisible = prevProps.visible,
prevGetContainer = prevProps.getContainer;
if (visible !== prevVisible) {
openCount = visible && !prevVisible ? openCount + 1 : openCount - 1;
}
var getContainerIsFunc = typeof getContainer === 'function' && typeof prevGetContainer === 'function';
if (getContainerIsFunc ? getContainer.toString() !== prevGetContainer.toString() : getContainer !== prevGetContainer) {
_self.removeCurrentContainer(false);
}
}
return {
prevProps: props
};
}
}]);
return PortalWrapper;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
PortalWrapper.propTypes = {
wrapperClassName: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
forceRender: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
getContainer: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.any,
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
visible: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_3_react_lifecycles_compat__["polyfill"])(PortalWrapper));
/***/ }),
/***/ 1684:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ContainerRender; });
/* 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_dom__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
function _typeof(obj) { 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 ContainerRender =
/*#__PURE__*/
function (_React$Component) {
_inherits(ContainerRender, _React$Component);
function ContainerRender() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, ContainerRender);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ContainerRender)).call.apply(_getPrototypeOf2, [this].concat(args)));
_this.removeContainer = function () {
if (_this.container) {
__WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unmountComponentAtNode(_this.container);
_this.container.parentNode.removeChild(_this.container);
_this.container = null;
}
};
_this.renderComponent = function (props, ready) {
var _this$props = _this.props,
visible = _this$props.visible,
getComponent = _this$props.getComponent,
forceRender = _this$props.forceRender,
getContainer = _this$props.getContainer,
parent = _this$props.parent;
if (visible || parent._component || forceRender) {
if (!_this.container) {
_this.container = getContainer();
}
__WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_renderSubtreeIntoContainer(parent, getComponent(props), _this.container, function callback() {
if (ready) {
ready.call(this);
}
});
}
};
return _this;
}
_createClass(ContainerRender, [{
key: "componentDidMount",
value: function componentDidMount() {
if (this.props.autoMount) {
this.renderComponent();
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
if (this.props.autoMount) {
this.renderComponent();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.props.autoDestroy) {
this.removeContainer();
}
}
}, {
key: "render",
value: function render() {
return this.props.children({
renderComponent: this.renderComponent,
removeContainer: this.removeContainer
});
}
}]);
return ContainerRender;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
ContainerRender.propTypes = {
autoMount: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
autoDestroy: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
visible: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
forceRender: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
parent: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.any,
getComponent: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
getContainer: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired
};
ContainerRender.defaultProps = {
autoMount: true,
autoDestroy: true,
forceRender: false
};
/***/ }),
/***/ 1685:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Portal; });
/* 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_dom__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
function _typeof(obj) { 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 Portal =
/*#__PURE__*/
function (_React$Component) {
_inherits(Portal, _React$Component);
function Portal() {
_classCallCheck(this, Portal);
return _possibleConstructorReturn(this, _getPrototypeOf(Portal).apply(this, arguments));
}
_createClass(Portal, [{
key: "componentDidMount",
value: function componentDidMount() {
this.createContainer();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var didUpdate = this.props.didUpdate;
if (didUpdate) {
didUpdate(prevProps);
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.removeContainer();
}
}, {
key: "createContainer",
value: function createContainer() {
this._container = this.props.getContainer();
this.forceUpdate();
}
}, {
key: "removeContainer",
value: function removeContainer() {
if (this._container) {
this._container.parentNode.removeChild(this._container);
}
}
}, {
key: "render",
value: function render() {
if (this._container) {
return __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.createPortal(this.props.children, this._container);
}
return null;
}
}]);
return Portal;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Portal.propTypes = {
getContainer: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node.isRequired,
didUpdate: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func
};
/***/ }),
/***/ 1686:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getScrollBarSize__ = __webpack_require__(1516);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setStyle__ = __webpack_require__(1517);
function isBodyOverflowing() {
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
}
var cacheStyle = {};
/* harmony default export */ __webpack_exports__["a"] = (function (close) {
if (!isBodyOverflowing() && !close) {
return;
} // https://github.com/ant-design/ant-design/issues/19729
var scrollingEffectClassName = 'ant-scrolling-effect';
var scrollingEffectClassNameReg = new RegExp("".concat(scrollingEffectClassName), 'g');
var bodyClassName = document.body.className;
if (close) {
if (!scrollingEffectClassNameReg.test(bodyClassName)) return;
Object(__WEBPACK_IMPORTED_MODULE_1__setStyle__["a" /* default */])(cacheStyle);
cacheStyle = {};
document.body.className = bodyClassName.replace(scrollingEffectClassNameReg, '').trim();
return;
}
var scrollBarSize = Object(__WEBPACK_IMPORTED_MODULE_0__getScrollBarSize__["a" /* default */])();
if (scrollBarSize) {
cacheStyle = Object(__WEBPACK_IMPORTED_MODULE_1__setStyle__["a" /* default */])({
position: 'relative',
width: "calc(100% - ".concat(scrollBarSize, "px)")
});
if (!scrollingEffectClassNameReg.test(bodyClassName)) {
var addClassName = "".concat(bodyClassName, " ").concat(scrollingEffectClassName);
document.body.className = addClassName.trim();
}
}
});
/***/ }),
/***/ 1687:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rc_util_es_getScrollBarSize__ = __webpack_require__(1516);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__ = __webpack_require__(1688);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react_lifecycles_compat__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils__ = __webpack_require__(1689);
function _typeof(obj) { 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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 currentDrawer = {};
var DrawerChild =
/*#__PURE__*/
function (_React$Component) {
_inherits(DrawerChild, _React$Component);
function DrawerChild(props) {
var _this;
_classCallCheck(this, DrawerChild);
_this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerChild).call(this, props));
_this.domFocus = function () {
if (_this.dom) {
_this.dom.focus();
}
};
_this.removeStartHandler = function (e) {
if (e.touches.length > 1) {
return;
}
_this.startPos = {
x: e.touches[0].clientX,
y: e.touches[0].clientY
};
};
_this.removeMoveHandler = function (e) {
if (e.changedTouches.length > 1) {
return;
}
var currentTarget = e.currentTarget;
var differX = e.changedTouches[0].clientX - _this.startPos.x;
var differY = e.changedTouches[0].clientY - _this.startPos.y;
if (currentTarget === _this.maskDom || currentTarget === _this.handlerDom || currentTarget === _this.contentDom && Object(__WEBPACK_IMPORTED_MODULE_5__utils__["c" /* getTouchParentScroll */])(currentTarget, e.target, differX, differY)) {
e.preventDefault();
}
};
_this.transitionEnd = function (e) {
var dom = e.target;
Object(__WEBPACK_IMPORTED_MODULE_5__utils__["e" /* removeEventListener */])(dom, __WEBPACK_IMPORTED_MODULE_5__utils__["g" /* transitionEnd */], _this.transitionEnd);
dom.style.transition = '';
};
_this.onKeyDown = function (e) {
if (e.keyCode === __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].ESC) {
var onClose = _this.props.onClose;
e.stopPropagation();
if (onClose) {
onClose(e);
}
}
};
_this.onWrapperTransitionEnd = function (e) {
var _this$props = _this.props,
open = _this$props.open,
afterVisibleChange = _this$props.afterVisibleChange;
if (e.target === _this.contentWrapper && e.propertyName.match(/transform$/)) {
_this.dom.style.transition = '';
if (!open && _this.getCurrentDrawerSome()) {
document.body.style.overflowX = '';
if (_this.maskDom) {
_this.maskDom.style.left = '';
_this.maskDom.style.width = '';
}
}
if (afterVisibleChange) {
afterVisibleChange(!!open);
}
}
};
_this.openLevelTransition = function () {
var _this$props2 = _this.props,
open = _this$props2.open,
width = _this$props2.width,
height = _this$props2.height;
var _this$getHorizontalBo = _this.getHorizontalBoolAndPlacementName(),
isHorizontal = _this$getHorizontalBo.isHorizontal,
placementName = _this$getHorizontalBo.placementName;
var contentValue = _this.contentDom ? _this.contentDom.getBoundingClientRect()[isHorizontal ? 'width' : 'height'] : 0;
var value = (isHorizontal ? width : height) || contentValue;
_this.setLevelAndScrolling(open, placementName, value);
};
_this.setLevelTransform = function (open, placementName, value, right) {
var _this$props3 = _this.props,
placement = _this$props3.placement,
levelMove = _this$props3.levelMove,
duration = _this$props3.duration,
ease = _this$props3.ease,
showMask = _this$props3.showMask; // router 切换时可能会导至页面失去滚动条,所以需要时时获取。
_this.levelDom.forEach(function (dom) {
dom.style.transition = "transform ".concat(duration, " ").concat(ease);
Object(__WEBPACK_IMPORTED_MODULE_5__utils__["a" /* addEventListener */])(dom, __WEBPACK_IMPORTED_MODULE_5__utils__["g" /* transitionEnd */], _this.transitionEnd);
var levelValue = open ? value : 0;
if (levelMove) {
var $levelMove = Object(__WEBPACK_IMPORTED_MODULE_5__utils__["f" /* transformArguments */])(levelMove, {
target: dom,
open: open
});
levelValue = open ? $levelMove[0] : $levelMove[1] || 0;
}
var $value = typeof levelValue === 'number' ? "".concat(levelValue, "px") : levelValue;
var placementPos = placement === 'left' || placement === 'top' ? $value : "-".concat($value);
placementPos = showMask && placement === 'right' && right ? "calc(".concat(placementPos, " + ").concat(right, "px)") : placementPos;
dom.style.transform = levelValue ? "".concat(placementName, "(").concat(placementPos, ")") : '';
});
};
_this.setLevelAndScrolling = function (open, placementName, value) {
var onChange = _this.props.onChange;
if (!__WEBPACK_IMPORTED_MODULE_5__utils__["i" /* windowIsUndefined */]) {
var right = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth ? Object(__WEBPACK_IMPORTED_MODULE_1_rc_util_es_getScrollBarSize__["a" /* default */])(true) : 0;
_this.setLevelTransform(open, placementName, value, right);
_this.toggleScrollingToDrawerAndBody(right);
}
if (onChange) {
onChange(open);
}
};
_this.toggleScrollingToDrawerAndBody = function (right) {
var _this$props4 = _this.props,
getOpenCount = _this$props4.getOpenCount,
getContainer = _this$props4.getContainer,
showMask = _this$props4.showMask,
open = _this$props4.open;
var container = getContainer && getContainer();
var openCount = getOpenCount && getOpenCount(); // 处理 body 滚动
if (container && container.parentNode === document.body && showMask) {
var eventArray = ['touchstart'];
var domArray = [document.body, _this.maskDom, _this.handlerDom, _this.contentDom];
if (open && document.body.style.overflow !== 'hidden') {
if (right) {
_this.addScrollingEffect(right);
}
if (openCount === 1) {
document.body.style.overflow = 'hidden';
}
document.body.style.touchAction = 'none'; // 手机禁滚
domArray.forEach(function (item, i) {
if (!item) {
return;
}
Object(__WEBPACK_IMPORTED_MODULE_5__utils__["a" /* addEventListener */])(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);
});
} else if (_this.getCurrentDrawerSome()) {
// 没有弹框的状态下清除 overflow;
if (!openCount) {
document.body.style.overflow = '';
}
document.body.style.touchAction = '';
if (right) {
_this.remScrollingEffect(right);
} // 恢复事件
domArray.forEach(function (item, i) {
if (!item) {
return;
}
Object(__WEBPACK_IMPORTED_MODULE_5__utils__["e" /* removeEventListener */])(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);
});
}
}
};
_this.addScrollingEffect = function (right) {
var _this$props5 = _this.props,
placement = _this$props5.placement,
duration = _this$props5.duration,
ease = _this$props5.ease,
getOpenCount = _this$props5.getOpenCount,
switchScrollingEffect = _this$props5.switchScrollingEffect;
var openCount = getOpenCount && getOpenCount();
if (openCount === 1) {
switchScrollingEffect();
}
var widthTransition = "width ".concat(duration, " ").concat(ease);
var transformTransition = "transform ".concat(duration, " ").concat(ease);
_this.dom.style.transition = 'none';
switch (placement) {
case 'right':
_this.dom.style.transform = "translateX(-".concat(right, "px)");
break;
case 'top':
case 'bottom':
_this.dom.style.width = "calc(100% - ".concat(right, "px)");
_this.dom.style.transform = 'translateZ(0)';
break;
default:
break;
}
clearTimeout(_this.timeout);
_this.timeout = setTimeout(function () {
if (_this.dom) {
_this.dom.style.transition = "".concat(transformTransition, ",").concat(widthTransition);
_this.dom.style.width = '';
_this.dom.style.transform = '';
}
});
};
_this.remScrollingEffect = function (right) {
var _this$props6 = _this.props,
placement = _this$props6.placement,
duration = _this$props6.duration,
ease = _this$props6.ease,
getOpenCount = _this$props6.getOpenCount,
switchScrollingEffect = _this$props6.switchScrollingEffect;
var openCount = getOpenCount && getOpenCount();
if (!openCount) {
switchScrollingEffect(true);
}
if (__WEBPACK_IMPORTED_MODULE_5__utils__["h" /* transitionStr */]) {
document.body.style.overflowX = 'hidden';
}
_this.dom.style.transition = 'none';
var heightTransition;
var widthTransition = "width ".concat(duration, " ").concat(ease);
var transformTransition = "transform ".concat(duration, " ").concat(ease);
switch (placement) {
case 'left':
{
_this.dom.style.width = '100%';
widthTransition = "width 0s ".concat(ease, " ").concat(duration);
break;
}
case 'right':
{
_this.dom.style.transform = "translateX(".concat(right, "px)");
_this.dom.style.width = '100%';
widthTransition = "width 0s ".concat(ease, " ").concat(duration);
if (_this.maskDom) {
_this.maskDom.style.left = "-".concat(right, "px");
_this.maskDom.style.width = "calc(100% + ".concat(right, "px)");
}
break;
}
case 'top':
case 'bottom':
{
_this.dom.style.width = "calc(100% + ".concat(right, "px)");
_this.dom.style.height = '100%';
_this.dom.style.transform = 'translateZ(0)';
heightTransition = "height 0s ".concat(ease, " ").concat(duration);
break;
}
default:
break;
}
clearTimeout(_this.timeout);
_this.timeout = setTimeout(function () {
if (_this.dom) {
_this.dom.style.transition = "".concat(transformTransition, ",").concat(heightTransition ? "".concat(heightTransition, ",") : '').concat(widthTransition);
_this.dom.style.transform = '';
_this.dom.style.width = '';
_this.dom.style.height = '';
}
});
};
_this.getCurrentDrawerSome = function () {
return !Object.keys(currentDrawer).some(function (key) {
return currentDrawer[key];
});
};
_this.getLevelDom = function (_ref) {
var level = _ref.level,
getContainer = _ref.getContainer;
if (__WEBPACK_IMPORTED_MODULE_5__utils__["i" /* windowIsUndefined */]) {
return;
}
var container = getContainer && getContainer();
var parent = container ? container.parentNode : null;
_this.levelDom = [];
if (level === 'all') {
var children = parent ? Array.prototype.slice.call(parent.children) : [];
children.forEach(function (child) {
if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'STYLE' && child.nodeName !== 'LINK' && child !== container) {
_this.levelDom.push(child);
}
});
} else if (level) {
Object(__WEBPACK_IMPORTED_MODULE_5__utils__["b" /* dataToArray */])(level).forEach(function (key) {
document.querySelectorAll(key).forEach(function (item) {
_this.levelDom.push(item);
});
});
}
};
_this.getHorizontalBoolAndPlacementName = function () {
var placement = _this.props.placement;
var isHorizontal = placement === 'left' || placement === 'right';
var placementName = "translate".concat(isHorizontal ? 'X' : 'Y');
return {
isHorizontal: isHorizontal,
placementName: placementName
};
};
_this.state = {
_self: _assertThisInitialized(_this)
};
return _this;
}
_createClass(DrawerChild, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
if (!__WEBPACK_IMPORTED_MODULE_5__utils__["i" /* windowIsUndefined */]) {
var passiveSupported = false;
try {
window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
get: function get() {
passiveSupported = true;
return null;
}
}));
} catch (err) {}
this.passive = passiveSupported ? {
passive: false
} : false;
}
var open = this.props.open;
this.drawerId = "drawer_id_".concat(Number((Date.now() + Math.random()).toString().replace('.', Math.round(Math.random() * 9).toString())).toString(16));
this.getLevelDom(this.props);
if (open) {
currentDrawer[this.drawerId] = open; // 默认打开状态时推出 level;
this.openLevelTransition();
this.forceUpdate(function () {
_this2.domFocus();
});
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var open = this.props.open;
if (open !== prevProps.open) {
if (open) {
this.domFocus();
}
currentDrawer[this.drawerId] = !!open;
this.openLevelTransition();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var _this$props7 = this.props,
getOpenCount = _this$props7.getOpenCount,
open = _this$props7.open,
switchScrollingEffect = _this$props7.switchScrollingEffect;
var openCount = typeof getOpenCount === 'function' && getOpenCount();
delete currentDrawer[this.drawerId];
if (open) {
this.setLevelTransform(false);
document.body.style.touchAction = '';
}
if (!openCount) {
document.body.style.overflow = '';
switchScrollingEffect(true);
}
} // tslint:disable-next-line:member-ordering
}, {
key: "render",
value: function render() {
var _classnames,
_this3 = this;
var _this$props8 = this.props,
className = _this$props8.className,
children = _this$props8.children,
style = _this$props8.style,
width = _this$props8.width,
height = _this$props8.height,
defaultOpen = _this$props8.defaultOpen,
$open = _this$props8.open,
prefixCls = _this$props8.prefixCls,
placement = _this$props8.placement,
level = _this$props8.level,
levelMove = _this$props8.levelMove,
ease = _this$props8.ease,
duration = _this$props8.duration,
getContainer = _this$props8.getContainer,
handler = _this$props8.handler,
onChange = _this$props8.onChange,
afterVisibleChange = _this$props8.afterVisibleChange,
showMask = _this$props8.showMask,
maskClosable = _this$props8.maskClosable,
maskStyle = _this$props8.maskStyle,
onClose = _this$props8.onClose,
onHandleClick = _this$props8.onHandleClick,
keyboard = _this$props8.keyboard,
getOpenCount = _this$props8.getOpenCount,
switchScrollingEffect = _this$props8.switchScrollingEffect,
props = _objectWithoutProperties(_this$props8, ["className", "children", "style", "width", "height", "defaultOpen", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "handler", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "onClose", "onHandleClick", "keyboard", "getOpenCount", "switchScrollingEffect"]); // 首次渲染都将是关闭状态。
var open = this.dom ? $open : false;
var wrapperClassName = __WEBPACK_IMPORTED_MODULE_0_classnames___default()(prefixCls, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-").concat(placement), true), _defineProperty(_classnames, "".concat(prefixCls, "-open"), open), _defineProperty(_classnames, className || '', !!className), _defineProperty(_classnames, 'no-mask', !showMask), _classnames));
var _this$getHorizontalBo2 = this.getHorizontalBoolAndPlacementName(),
placementName = _this$getHorizontalBo2.placementName; // 百分比与像素动画不同步,第一次打用后全用像素动画。
// const defaultValue = !this.contentDom || !level ? '100%' : `${value}px`;
var placementPos = placement === 'left' || placement === 'top' ? '-100%' : '100%';
var transform = open ? '' : "".concat(placementName, "(").concat(placementPos, ")");
var handlerChildren = handler && __WEBPACK_IMPORTED_MODULE_3_react__["cloneElement"](handler, {
onClick: function onClick(e) {
if (handler.props.onClick) {
handler.props.onClick();
}
if (onHandleClick) {
onHandleClick(e);
}
},
ref: function ref(c) {
_this3.handlerDom = c;
}
});
return __WEBPACK_IMPORTED_MODULE_3_react__["createElement"]("div", Object.assign({}, props, {
tabIndex: -1,
className: wrapperClassName,
style: style,
ref: function ref(c) {
_this3.dom = c;
},
onKeyDown: open && keyboard ? this.onKeyDown : undefined,
onTransitionEnd: this.onWrapperTransitionEnd
}), showMask && __WEBPACK_IMPORTED_MODULE_3_react__["createElement"]("div", {
className: "".concat(prefixCls, "-mask"),
onClick: maskClosable ? onClose : undefined,
style: maskStyle,
ref: function ref(c) {
_this3.maskDom = c;
}
}), __WEBPACK_IMPORTED_MODULE_3_react__["createElement"]("div", {
className: "".concat(prefixCls, "-content-wrapper"),
style: {
transform: transform,
msTransform: transform,
width: Object(__WEBPACK_IMPORTED_MODULE_5__utils__["d" /* isNumeric */])(width) ? "".concat(width, "px") : width,
height: Object(__WEBPACK_IMPORTED_MODULE_5__utils__["d" /* isNumeric */])(height) ? "".concat(height, "px") : height
},
ref: function ref(c) {
_this3.contentWrapper = c;
}
}, __WEBPACK_IMPORTED_MODULE_3_react__["createElement"]("div", {
className: "".concat(prefixCls, "-content"),
ref: function ref(c) {
_this3.contentDom = c;
},
onTouchStart: open && showMask ? this.removeStartHandler : undefined,
onTouchMove: open && showMask ? this.removeMoveHandler : undefined
}, children), handlerChildren));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, _ref2) {
var prevProps = _ref2.prevProps,
_self = _ref2._self;
var nextState = {
prevProps: props
};
if (prevProps !== undefined) {
var placement = props.placement,
level = props.level;
if (placement !== prevProps.placement) {
// test 的 bug, 有动画过场,删除 dom
_self.contentDom = null;
}
if (level !== prevProps.level) {
_self.getLevelDom(props);
}
}
return nextState;
}
}]);
return DrawerChild;
}(__WEBPACK_IMPORTED_MODULE_3_react__["Component"]);
DrawerChild.defaultProps = {
switchScrollingEffect: function switchScrollingEffect() {}
};
/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_4_react_lifecycles_compat__["polyfill"])(DrawerChild));
/***/ }),
/***/ 1688:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
var KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12,
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
/**
* END
*/
END: 35,
/**
* HOME
*/
HOME: 36,
/**
* LEFT
*/
LEFT: 37,
/**
* UP
*/
UP: 38,
/**
* RIGHT
*/
RIGHT: 39,
/**
* DOWN
*/
DOWN: 40,
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45,
/**
* DELETE
*/
DELETE: 46,
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63,
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91,
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186,
/**
* DASH
*/
DASH: 189,
/**
* EQUALS
*/
EQUALS: 187,
/**
* COMMA
*/
COMMA: 188,
/**
* PERIOD
*/
PERIOD: 190,
/**
* SLASH
*/
SLASH: 191,
/**
* APOSTROPHE
*/
APOSTROPHE: 192,
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222,
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219,
/**
* BACKSLASH
*/
BACKSLASH: 220,
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221,
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224,
/**
* WIN_IME
*/
WIN_IME: 229,
// ======================== Function ========================
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
var keyCode = e.keyCode;
if (e.altKey && !e.ctrlKey || e.metaKey || // Function keys don't generate text
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
return false;
} // The following keys are quite harmless, even in combination with
// CTRL, ALT or SHIFT.
switch (keyCode) {
case KeyCode.ALT:
case KeyCode.CAPS_LOCK:
case KeyCode.CONTEXT_MENU:
case KeyCode.CTRL:
case KeyCode.DOWN:
case KeyCode.END:
case KeyCode.ESC:
case KeyCode.HOME:
case KeyCode.INSERT:
case KeyCode.LEFT:
case KeyCode.MAC_FF_META:
case KeyCode.META:
case KeyCode.NUMLOCK:
case KeyCode.NUM_CENTER:
case KeyCode.PAGE_DOWN:
case KeyCode.PAGE_UP:
case KeyCode.PAUSE:
case KeyCode.PRINT_SCREEN:
case KeyCode.RIGHT:
case KeyCode.SHIFT:
case KeyCode.UP:
case KeyCode.WIN_KEY:
case KeyCode.WIN_KEY_RIGHT:
return false;
default:
return true;
}
},
/**
* whether character is entered.
*/
isCharacterKey: function isCharacterKey(keyCode) {
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
return true;
}
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
return true;
}
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
return true;
} // Safari sends zero key code for non-latin characters.
if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
return true;
}
switch (keyCode) {
case KeyCode.SPACE:
case KeyCode.QUESTION_MARK:
case KeyCode.NUM_PLUS:
case KeyCode.NUM_MINUS:
case KeyCode.NUM_PERIOD:
case KeyCode.NUM_DIVISION:
case KeyCode.SEMICOLON:
case KeyCode.DASH:
case KeyCode.EQUALS:
case KeyCode.COMMA:
case KeyCode.PERIOD:
case KeyCode.SLASH:
case KeyCode.APOSTROPHE:
case KeyCode.SINGLE_QUOTE:
case KeyCode.OPEN_SQUARE_BRACKET:
case KeyCode.BACKSLASH:
case KeyCode.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
}
};
/* harmony default export */ __webpack_exports__["a"] = (KeyCode);
/***/ }),
/***/ 1689:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["b"] = dataToArray;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return transitionStr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return transitionEnd; });
/* harmony export (immutable) */ __webpack_exports__["a"] = addEventListener;
/* harmony export (immutable) */ __webpack_exports__["e"] = removeEventListener;
/* harmony export (immutable) */ __webpack_exports__["f"] = transformArguments;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isNumeric; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return windowIsUndefined; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getTouchParentScroll; });
function dataToArray(vars) {
if (Array.isArray(vars)) {
return vars;
}
return [vars];
}
var transitionEndObject = {
transition: 'transitionend',
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'transitionend',
OTransition: 'oTransitionEnd otransitionend'
};
var transitionStr = Object.keys(transitionEndObject).filter(function (key) {
if (typeof document === 'undefined') {
return false;
}
var html = document.getElementsByTagName('html')[0];
return key in (html ? html.style : {});
})[0];
var transitionEnd = transitionEndObject[transitionStr];
function addEventListener(target, eventType, callback, options) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, options);
} else if (target.attachEvent) {
// tslint:disable-line
target.attachEvent("on".concat(eventType), callback); // tslint:disable-line
}
}
function removeEventListener(target, eventType, callback, options) {
if (target.removeEventListener) {
target.removeEventListener(eventType, callback, options);
} else if (target.attachEvent) {
// tslint:disable-line
target.detachEvent("on".concat(eventType), callback); // tslint:disable-line
}
}
function transformArguments(arg, cb) {
var result = typeof arg === 'function' ? arg(cb) : arg;
if (Array.isArray(result)) {
if (result.length === 2) {
return result;
}
return [result[0], result[1]];
}
return [result];
}
var isNumeric = function isNumeric(value) {
return !isNaN(parseFloat(value)) && isFinite(value);
};
var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement);
var getTouchParentScroll = function getTouchParentScroll(root, currentTarget, differX, differY) {
if (!currentTarget || currentTarget === document || currentTarget instanceof Document) {
return false;
} // root 为 drawer-content 设定了 overflow, 判断为 root 的 parent 时结束滚动;
if (currentTarget === root.parentNode) {
return true;
}
var isY = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differY);
var isX = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differX);
var scrollY = currentTarget.scrollHeight - currentTarget.clientHeight;
var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth;
var style = document.defaultView.getComputedStyle(currentTarget);
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll';
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll';
var y = scrollY && overflowY;
var x = scrollX && overflowX;
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) {
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY);
}
return false;
};
/***/ }),
/***/ 1783:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_drawer_style_css__ = __webpack_require__(1666);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_drawer_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_drawer_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_drawer__ = __webpack_require__(1667);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_drawer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_drawer__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_spin_style_css__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_spin_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_spin_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_spin__ = __webpack_require__(73);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_spin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_spin__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_button_style_css__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_button_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_button_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_button__ = __webpack_require__(74);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_button___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_button__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_pagination_style_css__ = __webpack_require__(905);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_pagination_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_pagination_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_pagination__ = __webpack_require__(906);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_pagination___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_pagination__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_breadcrumb_style_css__ = __webpack_require__(1427);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_breadcrumb_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_antd_lib_breadcrumb_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_breadcrumb__ = __webpack_require__(1428);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_breadcrumb___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_antd_lib_breadcrumb__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_checkbox_style_css__ = __webpack_require__(317);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_checkbox_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_antd_lib_checkbox_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_checkbox__ = __webpack_require__(314);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_checkbox___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_antd_lib_checkbox__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_antd_lib_dropdown_style_css__ = __webpack_require__(985);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_antd_lib_dropdown_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_antd_lib_dropdown_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_antd_lib_dropdown__ = __webpack_require__(982);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_antd_lib_dropdown___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_antd_lib_dropdown__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_antd_lib_icon_style_css__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_antd_lib_icon_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_antd_lib_icon_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_antd_lib_icon__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_antd_lib_icon___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_antd_lib_icon__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_antd_lib_notification_style_css__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_antd_lib_notification_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_antd_lib_notification_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_antd_lib_notification__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_antd_lib_notification___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_antd_lib_notification__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_antd_lib_menu_style_css__ = __webpack_require__(989);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_antd_lib_menu_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18_antd_lib_menu_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_antd_lib_menu__ = __webpack_require__(924);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_antd_lib_input_style_css__ = __webpack_require__(68);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_antd_lib_input_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_20_antd_lib_input_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_antd_lib_input__ = __webpack_require__(69);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_antd_lib_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_21_antd_lib_input__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_22_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_23_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__coursesPublic_NoneData__ = __webpack_require__(328);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__Newshixunmodel_css__ = __webpack_require__(1493);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__Newshixunmodel_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_25__Newshixunmodel_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 Search=__WEBPACK_IMPORTED_MODULE_21_antd_lib_input___default.a.Search;var NewShixunModel=function(_Component){_inherits(NewShixunModel,_Component);function NewShixunModel(props){_classCallCheck(this,NewShixunModel);var _this=_possibleConstructorReturn(this,(NewShixunModel.__proto__||Object.getPrototypeOf(NewShixunModel)).call(this,props));_this.getdatalist=function(page,type,newstatus,keyword,order,diff,limit,pagetype,sort){_this.setState({isspinning:true});var status=_this.props.statustype===undefined?newstatus:'published';var url=void 0;if(_this.props.type==='shixuns'){url="/shixun_lists.json";}else{url="/subject_lists.json";}__WEBPACK_IMPORTED_MODULE_23_axios___default.a.get(url,{params:{page:page,type:type,status:status,keyword:keyword,order:order,diff:diff,limit:limit,sort:sort}}).then(function(response){if(response.data){if(pagetype===undefined){_this.setState({shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list,shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count,Grouplist:[],isspinning:false});}else if(pagetype==="pagetype"){_this.setState({shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list,shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count,isspinning:false});}}}).catch(function(error){_this.setState({isspinning:false});});};_this.DropdownClick=function(diff){_this.setState({diff:diff});var _this$state=_this.state,page=_this$state.page,type=_this$state.type,status=_this$state.status,keyword=_this$state.keyword,order=_this$state.order,limit=_this$state.limit;_this.getdatalist(page,type,status,keyword,order,diff,limit);};_this.ItsCourse=function(item){return __WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a,null,item.map(function(list,key){return __WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,{key:key,id:list.id},__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{target:'_blank',href:'/paths/'+list.id,className:"newshixun500"},list.name));}));};_this.getGrouplist=function(Grouplist){var _this$state2=_this.state,page=_this$state2.page,allGrouplist=_this$state2.allGrouplist;var newallGrouplist=allGrouplist;var a=newallGrouplist.find(function(value,index,arr){return value.page==page;});if(a!=undefined){newallGrouplist.map(function(item,key){if(item.page===page){item.list=Grouplist;}});}var newGrouplist=[];newallGrouplist.map(function(item,key){item.list.map(function(items,ke){newGrouplist.push(items);});});_this.setState({Grouplist:newGrouplist,a
}else{// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
_this.showNotification("操作成功");_this.props.homeworkupdatalists(_this.props.Coursename,_this.props.page,_this.props.order);_this.props.hideNewShixunModelType();_this.props.updataleftNavfun();}_this.setState({hometypepvisible:false});// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch(function(error){console.log(error);_this.setState({hometypepvisible:false});});}else{var _url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json";__WEBPACK_IMPORTED_MODULE_23_axios___default.a.post(_url,{category_id:_this.props.category_id===null||_this.props.category_id===undefined?undefined:parseInt(_this.props.category_id),subject_ids:Grouplist}).then(function(response){if(response.data.status===-1){// this.props.showNotification(response.data.message)
}else{// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
_this.showNotification("操作成功");_this.props.homeworkupdatalists(_this.props.Coursename,_this.props.page,_this.props.order);_this.props.hideNewShixunModelType();_this.props.updataleftNavfun();}_this.setState({hometypepvisible:false});// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch(function(error){console.log(error);_this.setState({hometypepvisible:false});});}};_this.poststatus=function(status){_this.setState({status:status});var _this$state7=_this.state,page=_this$state7.page,type=_this$state7.type,keyword=_this$state7.keyword,order=_this$state7.order,diff=_this$state7.diff,limit=_this$state7.limit;_this.getdatalist(page,type,status,keyword,order,diff,limit);};_this.updatepathlist=function(sorts,orders){var _this$state8=_this.state,page=_this$state8.page,type=_this$state8.type,keyword=_this$state8.keyword,order=_this$state8.order,diff=_this$state8.diff,limit=_this$state8.limit,status=_this$state8.status,sort=_this$state8.sort;var seartorders=void 0;if(sort===sorts){if(orders==="desc"){_this.setState({sort:sorts,order:"asc"});seartorders="asc";}else{_this.setState({sort:sorts,order:"desc"});seartorders="desc";}}else{_this.setState({sort:sorts,order:"desc"});seartorders=orders;}_this.getdatalist(page,type,undefined,keyword,seartorders,undefined,limit,undefined,sorts);};_this.state={shixun_list:undefined,shixuns_count:undefined,Grouplist:[],allGrouplist:[{page:1,list:[]}],page:1,type:'all',status:'all',keyword:undefined,order:'desc',diff:0,limit:15,sort:"myshixuns_count",belongtoindex:0};return _this;}_createClass(NewShixunModel,[{key:'componentDidMount',value:function componentDidMount(){var _state=this.state,page=_state.page,type=_state.type,keyword=_state.keyword,order=_state.order,diff=_state.diff,limit=_state.limit,status=_state.status,sort=_state.sort;if(this.props.type==='shixuns'){this.getdatalist(page,type,status,keyword,order,diff,limit);}else{this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort);}}},{key:'render',value:function render(){var _this2=this;var _state2=this.state,diff=_state2.diff,Grouplist=_state2.Grouplist,status=_state2.status,shixun_list=_state2.shixun_list,shixuns_count=_state2.shixuns_count,page=_state2.page,type=_state2.type,order=_state2.order,sort=_state2.sort,belongtoindex=_state2.belongtoindex;// let {visible,patheditarry}=this.props;
// console.log(Grouplist)
// console.log(allGrouplist)
var statusmenus=__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a,{className:'menus'},__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:status==="all"?"color-blue":"",onClick:function onClick(){return _this2.poststatus("all");}},'\u6240\u6709')),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:status==="published"?"color-blue":"",onClick:function onClick(){return _this2.poststatus("published");}},'\u5DF2\u53D1\u5E03')),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:status==="unpublished"?"color-blue":"",onClick:function onClick(){return _this2.poststatus("unpublished");}},'\u672A\u53D1\u5E03')));var menus=__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a,{className:'menus'},__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:diff===0?"color-blue":"",onClick:function onClick(){return _this2.DropdownClick(0);}},'\u6240\u6709')),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:diff===1?"color-blue":"",onClick:function onClick(){return _this2.DropdownClick(1);}},'\u521D\u7EA7')),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:diff===2?"color-blue":"",onClick:function onClick(){return _this2.DropdownClick(2);}},'\u4E2D\u7EA7')),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:diff===3?"color-blue":"",onClick:function onClick(){return _this2.DropdownClick(3);}},'\u9AD8\u7EA7')),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('a',{className:diff===4?"color-blue":"",onClick:function onClick(){return _this2.DropdownClick(4);}},'\u9876\u7EA7')));console.log(shixun_list);return __WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('style',null,'body{ overflow: hidden !important; }\n\t\t\t\t\t .ant-drawer-content{ overflow:auto !important; background: #f5f5f5; }\n\t\t\t\t\t .yslbottomsj{position: absolute;bottom: -8px;}\n\t\t\t\t\t .ant-drawer-close{\n\t\t\t\t\t font-size:24px !important;\n\t\t\t\t\t }\n\t\t\t\t\t .ant-drawer-body {\n\t\t\t\t\t\t\t\tpadding:15px 24px 24px 0px;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t.ant-dropdown {\n\t\t\t\t\t \t z-index:11000\n\t\t\t\t\t \t}\n\t\t\t\t\t '),__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_drawer___default.a,{placement:'bottom',closable:true,destroyOnClose:true,onClose:function onClose(){return _this2.props.hideNewShixunModelType();},visible:this.props.type==='shixuns'?this.props.NewShixunModelType:this.props.shixunpath,height:'100%'},__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_spin___default.a,{spinning:this.state.isspinning},__WEBPACK_IMPORTED_MODULE_22_react___default.a.createElement('div',{className:"clearfix educontent pr mb60shixun"},__WEBPACK_IMPORTED_MODULE_22_react___de
// </div>:<div className="newshixunmodelbotfont">
// {item.content.description === undefined || item.content.description===0?"":item.content.description.map((item,key)=>{
// return(
// <span dangerouslySetInnerHTML={{__html: item}}>{}</span>
// )
// })}
// </div>}
//
// {JSON.stringify(item.content) == "{}"?item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
// {item.challenge_names.map((item,key)=>{
// return(
// <span>第{key+1}关:{item}</span>
// )
// })}
// </div>:<div className="newshixunmodelbotfont">
// {item.content.challenge_names === undefined || item.content.challenge_names===0?"":item.content.challenge_names.map((item,key)=>{
// return(
// <span dangerouslySetInnerHTML={{__html: item}}>{}</span>
// )
// })}
// </div>}
/***/ }),
/***/ 1900:
/***/ (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__(2415);
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;
/***/ }),
/***/ 1920:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_progress_style_css__ = __webpack_require__(1126);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_progress_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_progress_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_progress__ = __webpack_require__(1127);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_progress___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_progress__);
/* 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_react_router_dom__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__TPMright_css__ = __webpack_require__(3203);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__TPMright_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__TPMright_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;}// import "antd/dist/antd.css";
var TPMRightSection=function(_Component){_inherits(TPMRightSection,_Component);function TPMRightSection(props){_classCallCheck(this,TPMRightSection);var _this=_possibleConstructorReturn(this,(TPMRightSection.__proto__||Object.getPrototypeOf(TPMRightSection)).call(this,props));_this.clickNewsubscript=function(val){if(val===0){_this.setState({TPMRightSection:true,clickNewsubscripttype:true});}else{_this.setState({TPMRightSection:false,clickNewsubscripttype:false});}};_this.state={TPMRightSection:false,clickNewsubscripttype:false};return _this;}// componentDidMount() {
// let id=this.props.match.params.shixunId;
//
// let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
//
// axios.get(shixunsDetailsURL).then((response)=> {
// if(response.status===200){
// this.setState({
// TPMRightSectionData: response.data
// });
// }
// }).catch((error)=>{
// console.log(error)
// });
// }
// shouldComponentUpdate(nextProps, nextState) {
// return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData
// }
_createClass(TPMRightSection,[{key:'render',value:function render(){var _this2=this;var _state=this.state,TPMRightSection=_state.TPMRightSection,clickNewsubscripttype=_state.clickNewsubscripttype;var TPMRightSectionData=this.props.TPMRightSectionData;var Progresssum=void 0;if(TPMRightSectionData&&TPMRightSectionData.complete_count!=null){Progresssum=parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count)/parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count)*100;}return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',null,TPMRightSectionData===undefined?"":__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'edu-back-white pd302020zuoze mb10'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('p',{className:'font-16 mb20'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('i',{className:"iconfont icon-chuangjianzhe1 audit_situationactive font-14"}),' \u521B\u5EFA\u8005'),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'df'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('a',{href:TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":'/users/'+TPMRightSectionData.creator.login+'/courses'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('img',{alt:'\u5934\u50CF',className:'radius mr10',height:'36',src:Object(__WEBPACK_IMPORTED_MODULE_7_educoder__["M" /* getImageUrl */])(TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":'images/'+TPMRightSectionData.creator.image_url+"?1532489442"),width:'36'})),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'flex1'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'creatorname sortinxdirection space-between'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:"creatornamelist"},TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:"creatornamelist width80center"},TPMRightSectionData.user_shixuns_count)),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'clearfix'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:"fr color888hezuo"},'\u53D1\u5E03\u5B9E\u8BAD\u9879\u76EE'))))),this.props&&this.props.status>1?__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'edu-back-white padd252020px relative borderbottomf4'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'font-16 mb5'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('i',{className:"iconfont icon-jilu1 audit_situationactive font-14"}),' \u5B66\u4E60\u7EDF\u8BA1'),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:"sortinxdirection space-between fr"},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'color888hezuo font-12'},'\u5DF2\u5B8C\u6210 ',TPMRightSectionData&&TPMRightSectionData.complete_count===null?0:TPMRightSectionData&&TPMRightSectionData.complete_count,' \u4E2A / \u5171 ',TPMRightSectionData&&TPMRightSectionData.challenge_count,' \u5173'))),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_progress___default.a,{percent:Progresssum,showInfo:false,status:'active',strokeColor:{'0%':'#29BD8B','100%':'#29BD8B'}})):"",TPMRightSectionData===undefined?"":TPMRightSectionData.tags===undefined?"":TPMRightSectionData.tags.length===0?"":__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'edu-back-white padd252020px mb10 relative'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('p',{className:'font-16 mb20'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,__WEBPACK_IMPORTED_MODULE_4_react___default.a.createEleme
/***/ }),
/***/ 2297:
/***/ (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__(2715);
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;
/***/ }),
/***/ 2415:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".pathImg{background:#4cacff}.pathIndexNav{-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,.04);box-shadow:0 4px 8px 0 rgba(0,0,0,.04)}.pathIndexNav ul li{float:left;margin-right:10px}.pathIndexNav ul li a{display:block;font-size:15px;color:#333;padding:0 20px;border-radius:18px;height:32px;line-height:32px;margin:5px 0}.pathIndexNav ul li.active a,.pathIndexNav ul li:hover a{background:#ddecf9;color:#4cacff}\n /*!* background-size: cover; *!*/.mainPageArray span{font-size:14px;float:left;background:#ebebeb;padding:0 16px;height:30px;line-height:30px;color:#666;margin-right:20px;cursor:pointer;border-radius:15px}.mainPageArray span.active{background:#4cacff;color:#fff}.squareCard{position:relative;width:280px;margin-right:26px;margin-bottom:40px;float:left;border-radius:6px}.squareCard:nth-child(4n){margin-right:0}.squareCard .squareImg{height:175px;width:280px;overflow:hidden;display:block;border-radius:6px;position:relative}.squareCard .squareImg img{transition:all 1s;-webkit-transition:all 1s;-o-transition:all 1s;width:100%;position:absolute;top:-17.5px}.squareCard .squareImg img:hover{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}.cardName{font-size:16px;font-weight:600;height:20px;line-height:20px;margin-bottom:10px}.squareLine:after{position:absolute;width:1px;height:10px;background:#adadad;content:\"\";right:-10px;top:4px}.squareInfo{color:#777;font-size:12px;font-weight:400;height:18px;line-height:18px}.tag_open{position:absolute;left:0;top:12px;z-index:1}.tag_open .tag_open_name{width:auto;background-color:#ff6800;background-size:100% 100%;padding:0 8px;color:#fff;display:block;height:28px;line-height:28px;border-radius:0 15px 15px 0}.paragraph:hover .status_li a{display:block}.newedu-filter-btn{background-color:#f5f5f5;color:#666}.edu-filter-btn29BD8B,.newedu-filter-btn{display:block;float:left;padding:0 9px;line-height:28px;border-radius:14px;margin-right:10px;margin-bottom:9px}.edu-filter-btn29BD8B{height:28px;background-color:#29bd8b;color:#fff}.lesson-saved-list-item{border-bottom:none!important;margin-bottom:10px;background-color:#fff}.click_add{border-top:none!important}.white-panel li{border:1px solid #fafafa!important}.white-panel li.active{border:1px solid #4cacff!important}.greybackHead{height:40px;line-height:40px;padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#676767;background-color:#eaeaea}.mtf3{margin-top:-3px}.mtf5{margin-top:-5px}.color204{color:#ccc}.lesson-saved-list-itemdrop{height:93px;overflow:hidden}.lesson-saved-list{position:relative}.itempositionleft,.itempositionright{position:absolute}.ant-input{background-color:#fafafa!important}.ant-input:focus{background-color:#fff!important}.pathNavLine{bottom:-11px}#shixun_operation:hover{color:#fff!important}.cursor{cursor:pointer}.paragraph_nameid:hover{color:#4cacff!important}.statisticsNav{height:100px}.statisticsNav ul{margin-top:35px}.statisticsNav ul li{float:left;font-size:18px;color:#4d4d4d;height:64px;line-height:64px;margin:0 30px;cursor:pointer}.statisticsNav ul li a{color:#4d4d4d!important}.statisticsNav ul li.active{color:#05101a;border-bottom:2px solid #05101a}.statisticsNav ul li.active a{color:#05101a!important;text-decoration:none!important}.next-loading{width:100%}.paddingleft22{text-align:left;padding-left:22px}.paddingl5{padding-left:5px}.paddingl10{padding-left:10px}.red{color:red}.pl38{padding-left:38px}.ml37{margin-left:37px}.newmustlearn{padding:34px 25px;text-align:center}.color181818{color:#181818}.colorD5D8D6{color:#d5d8d6}", "", {"version":3,"sources":["/Users/hs/edu/educoder/public/react/src/modules/paths/ShixunPaths.css"],"names":[],"mappings":"AAAA,SACE,kBAAmB,CACpB,AACD,cACE,+CAAoD,AAC5C,sCAA4C,CACrD,AACD,oBACE,WAAY,AACZ,iBAAmB,CACpB,AACD,sBACE,cAAe,AACf,eAAgB,AAChB,WAAe,AACf,eAAiB,AACjB,mBAAmB,AACnB,YAAa,AACb,iBAAkB,AAClB,YAAe,CAChB,AACD,yDACE,mBAAoB,AACpB,aAAc,CACf;EAMC,iCAAiC,AAMnC,oBACE,eAAgB,AAChB,WAAY,AACZ,mBAAoB,AACpB,eAAkB,AAClB,YAAa,AACb,iBAAkB,AAClB,WAAe,AACf,kBAAmB,AACnB,eAAgB,AAChB,kBAAoB,CACrB,AACD,2BACE,mBAAoB,AACpB,UAAY,C
// exports
/***/ }),
/***/ 2714:
/***/ (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_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_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_educoder__ = __webpack_require__(5);
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 Addshixuns=function(_Component){_inherits(Addshixuns,_Component);function Addshixuns(props){_classCallCheck(this,Addshixuns);var _this=_possibleConstructorReturn(this,(Addshixuns.__proto__||Object.getPrototypeOf(Addshixuns)).call(this,props));_this.handleChange=function(e){_this.setState({shixunname:e.target.value});if(e.target.value.length>0){_this.setState({shixunzero:false});}};_this.modalCancel=function(){_this.setState({shixunname:undefined});_this.props.modalCancel();};_this.modalSave=function(){var shixunname=_this.state.shixunname;if(_this.getshixunname(shixunname)===true){_this.setState({shixunzero:true});return;}if(shixunname===undefined||shixunname.length===0){_this.setState({shixunzero:true});return;}var is_jupyter=_this.state.is_jupyter==="1"?false:true;_this.props.Setaddshixuns(shixunname,is_jupyter);_this.props.modalCancel();};_this.GrouponChange=function(e){_this.setState({is_jupyter:e.target.value});};_this.state={shixunname:undefined,shixunzero:false,is_jupyter:"1"};return _this;}_createClass(Addshixuns,[{key:'getshixunname',//判断是否为空
value:function getshixunname(str){if(str=="")return true;var regu="^[ ]+$";var re=new RegExp(regu);return re.test(str);}},{key:'render',value:function render(){var formItemLayout={labelCol:{span:4},wrapperCol:{span:14}};console.log(this.props);return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_modal___default.a,{className:this.props.className,keyboard:false,title:'\u65B0\u5EFA\u5B9E\u8BAD\u9879\u76EE',visible:this.props.Addshixunstype===undefined?false:this.props.Addshixunstype,closable:false,footer:null,destroyOnClose:true,centered:true,width:'530px'},this.props.Addshixunstype===true?__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t \tbody{\n\t\t\t\t\t\t \t overflow: hidden !important;\n\t\t\t\t\t\t \t }\n\t\t\t\t\t\t \t'):"",__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'task-popup-content'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('p',{className:'task-popup-text-center font-16'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{style:{"line-height":"30px"}},'\u5B9E\u8BAD\u540D\u79F0\uFF1A'),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_input___default.a,{style:{width:"80%"},className:'yslzxueshisy ',placeholder:'\u8BF7\u8F93\u516560\u5B57\u4EE5\u5185\u7684\u5B9E\u8BAD\u540D\u79F0',onChange:this.handleChange,addonAfter:String(this.state.shixunname===undefined?0:this.state.shixunname.length)+"/60",maxLength:60}))),this.state.shixunzero===true?__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('p',{className:"color-red ml85"},'\u8BF7\u8F93\u5165\u5B9E\u8BAD\u540D\u79F0'):"",__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'clearfix mt30 edu-txt-center'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('a',{className:'task-btn mr30 colorFFF',onClick:this.modalCancel},'\u53D6\u6D88'),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('a',{className:'task-btn task-btn-orange',onClick:this.modalSave},'\u786E\u5B9A'))));}}]);return Addshixuns;}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (Addshixuns);
/***/ }),
/***/ 2715:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, "/*!\n * \n * antd v3.26.9\n * \n * Copyright 2015-present, Alipay, Inc.\n * All rights reserved.\n * \n */body,html{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;color:rgba(0,0,0,.65);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-variant:tabular-nums;line-height:1.5;background-color:#fff;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\"}[tabindex=\"-1\"]:focus{outline:none!important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-top:0;margin-bottom:1em}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#1890ff;text-decoration:none;background-color:transparent;outline:none;cursor:pointer;-webkit-transition:color .3s;-o-transition:color .3s;transition:color .3s;-webkit-text-decoration-skip:objects}a:hover{color:#40a9ff}a:active{color:#096dd9}a:active,a:hover{text-decoration:none;outline:0}a[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;color:rgba(0,0,0,.45);text-align:left;caption-side:bottom}th{text-align:inherit}button,input,optgroup,select,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color
// exports
/***/ }),
/***/ 3203:
/***/ (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__(3204);
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;
/***/ }),
/***/ 3204:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".newedu-filter-btn{display:block;float:left;padding:0 9px;line-height:28px;border-radius:14px;background-color:#f5f5f5;color:#666;margin-right:10px;margin-bottom:9px}.newedbox{width:360px;position:relative;overflow:hidden}.newsubscript{position:absolute;right:23px;bottom:16px;cursor:pointer}.newsubscript:hover{color:#00bfff}.edu-filter-btn29BD8B{display:block;float:left;padding:0 9px;height:28px;line-height:28px;border-radius:14px;background-color:#29bd8b;color:#fff;margin-right:10px;margin-bottom:9px}.relative{position:relative}.newedboxheight{max-height:177px;overflow-y:hidden}.newminheight{max-height:300px;overflow-y:auto}.delSubentry{font-size:7px;font-family:MicrosoftYaHei;font-weight:400;color:#4cacff;line-height:9px;cursor:pointer}.operationalter .delSubentry{font-size:15px!important;line-height:25px}.headerRight a{color:#1a3f5f}.-task-list-title a:link,.-task-list-title a:visited{color:#bcc6cd}.-task-list-title a:hover{color:#459be5}.headerLeft .-header-right{height:32px}.creatorname{font-size:16px;color:#333}.creatornamelist{-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;cursor:default}.width80center{width:80px;text-align:center}.pd302020zuoze{padding:30px 20px 20px}.textcenter{text-align:center}.padd252020px{padding:25px 20px 15px}.rightjinengs{height:35px;margin-top:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.borderbottomf4{border-bottom:1px solid #f4f4f4}", "", {"version":3,"sources":["/Users/hs/edu/educoder/public/react/src/modules/tpm/component/TPMright.css"],"names":[],"mappings":"AACA,mBACI,cAAe,AACf,WAAY,AACZ,cAAe,AAEf,iBAAkB,AAClB,mBAAoB,AACpB,yBAA0B,AAC1B,WAAY,AACZ,kBAAmB,AACnB,iBAAmB,CACtB,AAED,UAII,YAAa,AACb,kBAAmB,AACnB,eAAiB,CACpB,AAED,cACI,kBAAmB,AACnB,WAAY,AACZ,YAAa,AACb,cAAgB,CACnB,AAED,oBACI,aAAmB,CACtB,AAED,sBACI,cAAe,AACf,WAAY,AACZ,cAAe,AACf,YAAa,AACb,iBAAkB,AAClB,mBAAoB,AACpB,yBAA0B,AAC1B,WAAY,AACZ,kBAAmB,AACnB,iBAAmB,CACtB,AAED,UACI,iBAAmB,CACtB,AAED,gBACI,iBAAkB,AAClB,iBAAmB,CACtB,AAED,cAEI,iBAAkB,AAClB,eAAiB,CACpB,AAED,aACI,cAAe,AACf,2BAA4B,AAC5B,gBAAiB,AACjB,cAA6B,AAC7B,gBAAiB,AACjB,cAAgB,CACnB,AAED,6BACI,yBAA2B,AAC3B,gBAAkB,CACrB,AAGD,eACI,aAAe,CAClB,AAGD,qDACI,aAAe,CAClB,AAED,0BACI,aAAe,CAClB,AAED,2BACI,WAAa,CAChB,AAED,aACI,eAAgB,AAChB,UAA2B,CAC9B,AAED,iBACI,0BAA2B,AAC3B,uBAAwB,AACxB,mBAAoB,AACpB,cAAgB,CACnB,AAED,eACI,WAAY,AACZ,iBAAmB,CACtB,AAED,eACI,sBAAwB,CAC3B,AAED,YACI,iBAAmB,CACtB,AACD,cACI,sBAAwB,CAC3B,AAED,cACI,YAAa,AACb,gBAAiB,AACjB,oBAAqB,AACrB,aAAc,AACd,0BAA2B,AACvB,sBAAuB,AAC3B,sBAAuB,AACnB,mBAAoB,AACxB,qBAAsB,AAClB,sBAAwB,CAC/B,AAED,gBACI,+BAAgC,CACnC","file":"TPMright.css","sourcesContent":["/*bæ°æ ‡ç­¾*/\n.newedu-filter-btn {\n display: block;\n float: left;\n padding: 0 9px;\n /*height: 28px;*/\n line-height: 28px;\n border-radius: 14px;\n background-color: #F5F5F5;\n color: #666;\n margin-right: 10px;\n margin-bottom: 9px;\n}\n\n.newedbox {\n /*flex-wrap: wrap;*/\n /*display: -webkit-flex; !* Safari *!*/\n /*display: flex;*/\n width: 360px;\n position: relative;\n overflow: hidden;\n}\n\n.newsubscript {\n position: absolute;\n right: 23px;\n bottom: 16px;\n cursor: pointer;\n}\n\n.newsubscript:hover {\n color: deepskyblue;\n}\n\n.edu-filter-btn29BD8B {\n display: block;\n float: left;\n padding: 0 9px;\n height: 28px;\n line-height: 28px;\n border-radius: 14px;\n background-color: #29BD8B;\n color: #FFF;\n margin-right: 10px;\n margin-bottom: 9px;\n}\n\n.relative {\n position: relative;\n}\n\n.newedboxheight {\n max-height: 177px;\n overflow-y: hidden;\n}\n\n.newminheight {\n /*max-height: 670px;*/\n max-height: 300px;\n overflow-y: auto;\n}\n\n.delSubentry {\n font-size: 7px;\n font-family: MicrosoftYaHei;\n font-weight: 400;\n color: rgba(76, 172, 255, 1);\n line-height: 9px;\n cursor: pointer;\n}\n\n.operationalter .delSubentry {\n font-size: 15px !impo
// exports
/***/ }),
/***/ 3207:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_notification_style_css__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_notification_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_notification_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_notification__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_notification___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_notification__);
/* 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_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_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_beautiful_dnd__ = __webpack_require__(1537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__modals_Modals__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Addshixuns__ = __webpack_require__(2714);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ShixunPaths_css__ = __webpack_require__(1900);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ShixunPaths_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11__ShixunPaths_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__courses_coursesPublic_NewShixunModel__ = __webpack_require__(1783);
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;};}();var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();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 $=window.$;var Search=__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a.Search;//a little function to help us with reordering the result
var reorder=function reorder(list,startIndex,endIndex){// console.log(list)
// console.log(startIndex)
// console.log(endIndex)
var newlist=list;var result=Array.from(newlist);var _result$splice=result.splice(startIndex,1),_result$splice2=_slicedToArray(_result$splice,1),removed=_result$splice2[0];result.splice(endIndex,0,removed);return result;};var getItemStyle=function getItemStyle(isDragging,draggableStyle){return Object.assign({// change background colour if dragging
background:isDragging?'#dceeff':''},draggableStyle);};var DetailCardsEditAndAdd=function(_Component){_inherits(DetailCardsEditAndAdd,_Component);function DetailCardsEditAndAdd(props){_classCallCheck(this,DetailCardsEditAndAdd);var _this=_possibleConstructorReturn(this,(DetailCardsEditAndAdd.__proto__||Object.getPrototypeOf(DetailCardsEditAndAdd)).call(this,props));_this.AddShixunBox=function(){_this.setState({selectShixun:true,patheditarry:[]});// this.changeTag(0,"");
};_this.cloasShixunBox=function(){_this.setState({selectShixun:false,patheditarry:[]});};_this.showNotification=function(description){var message=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"提示";var icon=arguments[2];var data={message:message,description:description};if(icon){data.icon=icon;}__WEBPACK_IMPORTED_MODULE_3_antd_lib_notification___default.a.open(data);};_this.clickShixunchoose=function(patheditarry){var _this$state=_this.state,shixuns_listeditlist=_this$state.shixuns_listeditlist,shixuns_listedit=_this$state.shixuns_listedit;var newshixuns_listedit=shixuns_listedit;var list=shixuns_listeditlist;var url='/paths/append_to_stage.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.post(url,{shixun_id:patheditarry}).then(function(response){if(response){if(response.data){var newshixun_lists=response.data.shixun_lists;for(var j=0;j<newshixuns_listedit.length;j++){for(var a=0;a<newshixun_lists.length;a++){if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){// this.setState({
// Modalstype:true,
// Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
// })
_this.showNotification('请勿重复选择:'+newshixun_lists[a].shixun_name+'实训');return;}}}for(var z=0;z<newshixun_lists.length;z++){newshixuns_listedit.push(newshixun_lists[z]);}for(var i=0;i<newshixun_lists.length;i++){list.push(newshixun_lists[i].shixun_id);}_this.setState({shixuns_listedit:newshixuns_listedit,shixuns_listeditlist:list,patheditarry:[],selectShixun:false,page:1});}}}).catch(function(error){console.log(error);});};_this.addStage=function(){_this.setState({editPanel:true});_this.props.editeditbuttomtypes();};_this.cancelAddState=function(){_this.setState({editPanel:false,stage_names:undefined,stage_descriptions:undefined,shixuns_listeditlist:[],shixuns_listedit:[]});_this.props.getPathCardsLists();};_this.searchNameInput=function(e){_this.setState({search:e.target.value});};_this.shixunhomeworkedit=function(list){var newpatheditarry=[];for(var i=0;i<list.length;i++){newpatheditarry.push(list[i]);}_this.setState({patheditarry:newpatheditarry});};_this.updatastage_names=function(e){_this.setState({stage_names:e.target.value});};_this.updatastage_descriptions=function(e){_this.setState({stage_descriptions:e.target.value});};_this.shixunslisteditdelect=function(e){_this.setState({Modalstype:true,Modalstopval:'是否删除该实训?',Modalsbottomval:'',delectfunvalue:e.target.id});};_this.shixunslisteditdelectfun=function(){var delectfunvalue=_this.state.delectfunvalue;var sum=parseInt(delectfunvalue);var _this$state2=_this.state,shixuns_listedit=_this$state2.shixuns_listedit,shixuns_listeditlist=_this$state2.shixuns_listeditlist;var newshixuns_listedit=shixuns_listedit;var newshixuns_listeditlist=shixuns_listeditlist;newshixuns_listedit.splice(sum,1);newshixuns_listeditlist.splice(sum,1);_this.setState({shixuns_listedit:newshixuns_listedit,shixuns_listeditlist:newshixuns_listeditlist});_this.setState({Modalstype:false,Modalstopval:'',Modalsbottomval:'',delectfunvalue:undefined});};_this.cardsModalcancel=function(){_this.setState({Modalstype:false,Modalstopval:'',Modalsbottomval:'',delectfunvalue:undefined,Addshixunstype:false});};_this.clickShixunsaves=function(){var _this$state3=_this.state,stage_names=_this$state3.stage_names,stage_descriptions=_this$state3.stage_descriptions,shixuns_listeditlist=_this$state3.shixuns_listeditlist;var newstage_descriptions=stage_descriptions;if(stage_names===""||stage_names===undefined){_this.setState({stage_nametype:true});return;}else{_this.setState({stage_nametype:false});}if(newstage_descriptions!=undefined){if(newstage_descriptions.length>300){_this.setState({descriptiontype:true});return;}}else{newstage_descriptions="";}var pathId=_this.props.pathid;var url=void 0;if(_this.props.ysldetailcards===undefined){url='/stages.json?subject_id='+pathId;}else{url='/courses/'+_this.props.coursesId+'/course_stages.json';}__WEBPACK_IMPORTED_MODULE_12_axios___default.a.post(url,{name:stage_names,description:newstage_descriptions,shixun_id:shixuns_listeditlist}).then(function(response){// window.location.href = "/paths/" + response.data.subject_id
_this.cancelAddState();_this.setState({stage_nametype:false,descriptiontype:false});_this.props.getPathCardsLists();}).catch(function(error){console.log(error);});};_this.Addshixuns=function(){_this.setState({Addshixunstype:true});};_this.Getaddshixuns=function(value,is_jupyter){var _this$state4=_this.state,shixuns_listeditlist=_this$state4.shixuns_listeditlist,shixuns_listedit=_this$state4.shixuns_listedit;var newshixuns_listedit=shixuns_listedit;var list=shixuns_listeditlist;var url='/paths/add_shixun_to_stage.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.post(url,{name:value,is_jupyter:is_jupyter}).then(function(response){if(response){if(response.data){newshixuns_listedit.push(response.data);list.push(response.data.shixun_id);_this.setState({shixuns_listedit:newshixuns_listedit,shixuns_listeditlist:list,patheditarry:[],selectShixun:false,page:1});}}}).catch(function(error){console.log(error);});};_this.state={selectShixun:false,editPanel:false,search:"",type:0,page:1,ChooseShixunList:undefined,hometypepvisible:true,shixuns_listedit:[],shixuns_listeditlist:[],patheditarry:[],stage_descriptions:undefined,stage_names:undefined,delectfunvalue:undefined,Modalstype:false,Modalstopval:"",Modalsbottomval:"",ChooseShixunListshixun_list:undefined,stage_nametype:false,descriptiontype:false,Addshixunstype:false};_this.onDragEnd=_this.onDragEnd.bind(_this);return _this;}//选择实训弹框
//关闭选择实训弹框
//点击新建阶段
//取消新建阶段
//勾选实训
//双向绑定
//删除实训
//保存
_createClass(DetailCardsEditAndAdd,[{key:'onDragEnd',value:function onDragEnd(result){var _state=this.state,shixuns_listedit=_state.shixuns_listedit,shixuns_listeditlist=_state.shixuns_listeditlist;var listedit=reorder(shixuns_listedit,result.source.index,result.destination.index);var listeditlist=reorder(shixuns_listeditlist,result.source.index,result.destination.index);this.setState({shixuns_listedit:listedit,shixuns_listeditlist:listeditlist});}},{key:'render',value:function render(){var _this2=this;var _state2=this.state,selectShixun=_state2.selectShixun,editPanel=_state2.editPanel,ChooseShixunList=_state2.ChooseShixunList,type=_state2.type,page=_state2.page,search=_state2.search,hometypepvisible=_state2.hometypepvisible,stage_descriptions=_state2.stage_descriptions,stage_names=_state2.stage_names,shixuns_listedit=_state2.shixuns_listedit,delectfunvalue=_state2.delectfunvalue,Modalstype=_state2.Modalstype,Modalstopval=_state2.Modalstopval,Modalsbottomval=_state2.Modalsbottomval,ChooseShixunListshixun_list=_state2.ChooseShixunListshixun_list,stage_nametype=_state2.stage_nametype,descriptiontype=_state2.descriptiontype;return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__modals_Modals__["a" /* default */],{modalsType:Modalstype,modalsTopval:Modalstopval,modalsBottomval:Modalsbottomval,modalCancel:this.cardsModalcancel,modalSave:this.shixunslisteditdelectfun}),this.state.Addshixunstype===true?__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__Addshixuns__["a" /* default */],Object.assign({modalCancel:this.cardsModalcancel,Setaddshixuns:function Setaddshixuns(value,is_jupyter){return _this2.Getaddshixuns(value,is_jupyter);}},this.props,this.state)):"",__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t.mb10 {\n\t\t\t\t\t\t\t\tmargin-bottom: 10px !important;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t'),editPanel&&__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'lesson-edit-content mb10'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'clearfix edu-back-white pt30 pb30'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'clearfix mb30 font-18 font-bd pl25 pr25'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('a',{className:'fl ring-blue mr10 mt2'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('img',{src:Object(__WEBPACK_IMPORTED_MODULE_7_educoder__["M" /* getImageUrl */])("images/educoder/icon/charpter-white.svg"),className:'fl ml3 mt3'})),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'fl'},'\u7B2C',this.props.sum,'\u90E8\u5206')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'pl50 pr20 clearfix'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'color-grey-6 font-16 mb20'},'\u7AE0\u8282\u540D\u79F0'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'df mb30'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'mr30 color-orange pt10'},'*'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'flex1 mr20'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('input',{maxLength:'60',type:'text',style:{width:'670px'},className:stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red",name:'stage_name',value:stage_names,onInput:this.updatastage_names,placeholder:"请输入第"+this.props.sum+"阶段名称,最大限制60个字符"}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:stage_nametype===true?"red":'none'},'\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{style:{"width":"60px"}},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'color-orange fl mt8 none',id:'stage_name_notice'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.creat
// <Modal
// keyboard={false}
// title="选择实训"
// visible={selectShixun}
// closable={false}
// footer={null}
// width="840px"
// destroyOnClose={true}
// >
// <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
// <div className="newupload_conbox">
// <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
// <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
// {
// ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
// return(
// <li className="fl mr5 mt5" key={key}>
// <a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
// </li>
// )
// })
// }
//
//
// </div>
// <div className="clearfix mb20" id="shixun_search_form_div">
// <span className="fl color-grey-9 font-16 mt3">
// <span>共</span>
// <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
// <span>个实训</span>
// </span>
// <div className="fr search-new mb0">
// <Search
// placeholder="请输入创建者或者实训名称进行搜索"
// onInput={this.searchNameInput}
// onSearch={()=>this.changeTag(`${type}`,`${search}`)}
// style={{width: '115%'}}
// ></Search>
// </div>
// </div>
// <ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
// <li className="fl with40 paddingleft22">实训名称</li>
// <li className="fl with30 edu-txt-left">使用院校</li>
// <li className="fl with10">使用人数</li>
// <li className="fl with10">评价等级</li>
// <li className="fl with10"></li>
// </ul>
//
// <style>
// {
// `
// .over180{min-height: 180px;max-height: 180px;overflow-y: auto}
// `
// }
// </style>
// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
// onScroll={this.contentViewScrolladd}
// >
// <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
// {
// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
// return(
// <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
// <li className="fl with40">
// <Checkbox
// id={"shixun_input_"+item.shixun_id}
// value={item.shixun_id}
// key={item.shixun_id}
// className="fl task-hide edu-txt-left"
// style={{"width":"298px"}}
// name="shixun_homework[]"
// >
// <label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
// </Checkbox>
// </li>
// <li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
// <li className="fl with10 paddingl10">{item.myshixuns_count}</li>
// <li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
// <li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
// </div>
// )
// })
// }
// </Checkbox.Group>
// </div>}
// <div className="mt20 marginauto clearfix edu-txt-center">
// <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
// <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
// </div>
// </div>
// </Spin>
// </Modal>
// contentViewScrolladd=(e)=>{
// const {ChooseShixunList}=this.state;
// //滑动到底判断
// let newscrollTop=parseInt(e.currentTarget.scrollTop);
// let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
//
// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
//
// if(ChooseShixunList.shixun_list.length===0){
// return
// }else{
// // console.log("到达底部");
// this.setState({
// hometypepvisible:true
// })
// let pathId=this.props.pathid;
// let {search,page,type,ChooseShixunListshixun_list}=this.state;
// let newpage=page+1;
// let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(type!=0){
// url+="&type="+type;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// let list =result.data.shixun_list;
//
// for(var i=0; i<list.length; i++){
// newChooseShixunListshixun_list.push(list[i])
// }
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:type,
// search:search,
// page:newpage,
// ChooseShixunListshixun_list:newChooseShixunListshixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
//
// }
//
// }
//
// }
//
// //打开选择实训弹框初始化tag标签和列表
// changeTag=(id,search)=>{
//
// this.setState({
// ChooseShixunListshixun_list:[],
// page:1,
// hometypepvisible:true,
// })
//
// let pathId=this.props.pathid;
//
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(id!=0){
// url+="&type="+id;
// }
//
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:id,
// ChooseShixunListshixun_list:result.data.shixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
/***/ }),
/***/ 3208:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_notification_style_css__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_notification_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_notification_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_notification__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_notification___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_notification__);
/* 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_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_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_beautiful_dnd__ = __webpack_require__(1537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__modals_Modals__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Addshixuns__ = __webpack_require__(2714);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__courses_coursesPublic_NewShixunModel__ = __webpack_require__(1783);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__ShixunPaths_css__ = __webpack_require__(1900);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__ShixunPaths_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12__ShixunPaths_css__);
/* 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__);
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;};}();var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();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 $=window.$;var Search=__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a.Search;//a little function to help us with reordering the result
var reorder=function reorder(list,startIndex,endIndex){// console.log(list)
// console.log(startIndex)
// console.log(endIndex)
var newlist=list;var result=Array.from(newlist);var _result$splice=result.splice(startIndex,1),_result$splice2=_slicedToArray(_result$splice,1),removed=_result$splice2[0];result.splice(endIndex,0,removed);return result;};var getItemStyle=function getItemStyle(isDragging,draggableStyle){return Object.assign({// change background colour if dragging
background:isDragging?'#dceeff':''},draggableStyle);};var DetailCardsEditAndEdit=function(_Component){_inherits(DetailCardsEditAndEdit,_Component);function DetailCardsEditAndEdit(props){_classCallCheck(this,DetailCardsEditAndEdit);var _this=_possibleConstructorReturn(this,(DetailCardsEditAndEdit.__proto__||Object.getPrototypeOf(DetailCardsEditAndEdit)).call(this,props));_this.AddShixunBox=function(){_this.setState({selectShixun:true,patheditarry:[]});// this.changeTag(0,"");
};_this.cloasShixunBox=function(){_this.setState({selectShixun:false,patheditarry:[]});};_this.Addshixuns=function(){_this.setState({Addshixunstype:true});};_this.shixunhomeworkedit=function(list){var newpatheditarry=[];for(var i=0;i<list.length;i++){newpatheditarry.push(list[i]);}_this.setState({patheditarry:newpatheditarry});};_this.updatastage_name=function(e){_this.setState({stage_name:e.target.value});};_this.updatastage_description=function(e){//输入数据绑定
_this.setState({stage_description:e.target.value});};_this.clickShixunchoose=function(patheditarry){var _this$state=_this.state,shixuns_listedit=_this$state.shixuns_listedit,shixuns_listeditlist=_this$state.shixuns_listeditlist;var newshixuns_listedit=shixuns_listedit;var list=shixuns_listeditlist;var url='/paths/append_to_stage.json';__WEBPACK_IMPORTED_MODULE_13_axios___default.a.post(url,{shixun_id:patheditarry}).then(function(response){var newshixun_lists=response.data.shixun_lists;for(var j=0;j<newshixuns_listedit.length;j++){for(var a=0;a<newshixun_lists.length;a++){if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){// this.setState({
// Modalstype:true,
// Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
// })
_this.showNotification('请勿重复选择:'+newshixun_lists[a].shixun_name+'实训');return;}}}for(var z=0;z<newshixun_lists.length;z++){newshixuns_listedit.push(newshixun_lists[z]);}for(var i=0;i<newshixun_lists.length;i++){list.push(newshixun_lists[i].shixun_id);}_this.setState({shixuns_listedit:newshixuns_listedit,shixuns_listeditlist:list,patheditarry:[],selectShixun:false});}).catch(function(error){console.log(error);});};_this.clickShixunsave=function(){var _this$state2=_this.state,stage_name=_this$state2.stage_name,stage_description=_this$state2.stage_description,stageid=_this$state2.stageid,shixuns_listeditlist=_this$state2.shixuns_listeditlist;var newstage_descriptions=stage_description;if(stage_name===""||stage_name===undefined){_this.setState({stage_nametype:true});return;}if(newstage_descriptions!=undefined){if(newstage_descriptions.length>300){_this.setState({descriptiontype:true});return;}}else{newstage_descriptions="";}var url=void 0;if(_this.props.ysldetailcards===undefined){url='/stages/'+stageid+'.json';}else{url='/course_stages/'+stageid+'.json';}__WEBPACK_IMPORTED_MODULE_13_axios___default.a.put(url,{name:stage_name,description:newstage_descriptions,shixun_id:shixuns_listeditlist}).then(function(response){// window.location.href = "/paths/" + response.data.subject_id
_this.setState({stage_name:undefined,stage_description:undefined,shixuns_listeditlist:[],shixuns_listedit:undefined,stage_nametype:false,descriptiontype:false});_this.props.updatapathCardsedits();}).catch(function(error){console.log(error);});};_this.shixunslisteditdelect=function(e){_this.setState({Modalstype:true,Modalstopval:'是否删除该实训?',Modalsbottomval:'',delectfunvalue:e.target.id});};_this.shixunslisteditdelectfun=function(){var delectfunvalue=_this.state.delectfunvalue;var sum=parseInt(delectfunvalue);var _this$state3=_this.state,shixuns_listedit=_this$state3.shixuns_listedit,shixuns_listeditlist=_this$state3.shixuns_listeditlist;var newshixuns_listedit=shixuns_listedit;var newshixuns_listeditlist=shixuns_listeditlist;newshixuns_listedit.splice(sum,1);newshixuns_listeditlist.splice(sum,1);_this.setState({shixuns_listedit:newshixuns_listedit,shixuns_listeditlist:newshixuns_listeditlist,Modalstype:false,Modalstopval:' ',Modalsbottomval:'',delectfunvalue:undefined});};_this.cardsModalcancel=function(){_this.setState({Modalstype:false,Modalstopval:'',Modalsbottomval:'',delectfunvalue:undefined,Addshixunstype:false});};_this.cardsModalsave=function(){_this.setState({Modalstype:false,Modalstopval:'',Modalsbottomval:''});};_this.onDragStart=function(){/*...*/};_this.onDragUpdate=function(){/*...*/};_this.showNotification=function(description){var message=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"提示";var icon=arguments[2];var data={message:message,description:description};if(icon){data.icon=icon;}__WEBPACK_IMPORTED_MODULE_3_antd_lib_notification___default.a.open(data);};_this.Getaddshixuns=function(value,is_jupyter){var _this$state4=_this.state,shixuns_listeditlist=_this$state4.shixuns_listeditlist,shixuns_listedit=_this$state4.shixuns_listedit;var newshixuns_listedit=shixuns_listedit;var list=shixuns_listeditlist;var url='/paths/add_shixun_to_stage.json';__WEBPACK_IMPORTED_MODULE_13_axios___default.a.post(url,{name:value,is_jupyter:is_jupyter}).then(function(response){if(response){if(response.data){newshixuns_listedit.push(response.data);list.push(response.data.shixun_id);_this.setState({shixuns_listedit:newshixuns_listedit,shixuns_listeditlist:list,patheditarry:[],selectShixun:false,page:1});}}}).catch(function(error){console.log(error);});};_this.state={selectShixun:false,editPanel:true,search:"",type:0,page:1,ChooseShixunList:undefined,hometypepvisible:true,shixuns_listedit:undefined,patheditarry:[],stage_name:undefined,stage_description:undefined,stageid:undefined,Modalstype:false,Modalstopval:'',Modalsbottomval:'',delectfunvalue:undefined,ChooseShixunListshixun_list:undefined,stage_nametype:false,descriptiontype:false,Addshixunstype:false};_this.onDragEnd=_this.onDragEnd.bind(_this);return _this;}//选择实训弹框
//关闭选择实训弹框
_createClass(DetailCardsEditAndEdit,[{key:'componentDidMount',value:function componentDidMount(){}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(nextProps,nextState){if(nextProps.pathlisteditlist!=undefined){var list=[];for(var i=0;i<nextProps.pathlisteditlist.shixuns_list.length;i++){list.push(nextProps.pathlisteditlist.shixuns_list[i].shixun_id);}// console.log("DetailCardsEditAndEdit");
// console.log("componentWillReceiveProps(nextProps, nextState)");
// console.log("nextProps.pathlisteditlist.stage_description");
this.setState({shixuns_listedit:nextProps.pathlisteditlist.shixuns_list,shixuns_listeditlist:list,stage_name:nextProps.pathlisteditlist.stage_name,stage_description:nextProps.pathlisteditlist.stage_description,stageid:nextProps.stageid});this.props.Pathlisteditundefined();}}//双向绑定
//保存
//删除实训
},{key:'onDragEnd',value:function onDragEnd(result){var _state=this.state,shixuns_listedit=_state.shixuns_listedit,shixuns_listeditlist=_state.shixuns_listeditlist;var listedit=reorder(shixuns_listedit,result.source.index,result.destination.index);var listeditlist=reorder(shixuns_listeditlist,result.source.index,result.destination.index);this.setState({shixuns_listedit:listedit,shixuns_listeditlist:listeditlist});}},{key:'render',value:function render(){var _this2=this;var _state2=this.state,selectShixun=_state2.selectShixun,editPanel=_state2.editPanel,ChooseShixunList=_state2.ChooseShixunList,type=_state2.type,page=_state2.page,search=_state2.search,hometypepvisible=_state2.hometypepvisible,shixuns_listedit=_state2.shixuns_listedit,patheditarry=_state2.patheditarry,stage_name=_state2.stage_name,stage_description=_state2.stage_description,Modalstype=_state2.Modalstype,Modalstopval=_state2.Modalstopval,Modalsbottomval=_state2.Modalsbottomval,delectfunvalue=_state2.delectfunvalue,ChooseShixunListshixun_list=_state2.ChooseShixunListshixun_list,stage_nametype=_state2.stage_nametype,descriptiontype=_state2.descriptiontype;return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__modals_Modals__["a" /* default */],{modalsType:Modalstype,modalsTopval:Modalstopval,modalsBottomval:Modalsbottomval,modalCancel:this.cardsModalcancel,modalSave:delectfunvalue===undefined?function(){return _this2.cardsModalsave();}:function(){return _this2.shixunslisteditdelectfun();}}),this.state.Addshixunstype===true?__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__Addshixuns__["a" /* default */],Object.assign({modalCancel:this.cardsModalcancel,Setaddshixuns:function Setaddshixuns(value,is_jupyter){return _this2.Getaddshixuns(value,is_jupyter);}},this.props,this.state)):"",__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t.mb10 {\n\t\t\t\t\t\t\t\tmargin-bottom: 10px !important;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t'),this.props.idsum===this.props.keys&&this.props.pathCardsedittype===true?__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'lesson-edit-content mb10'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'clearfix edu-back-white'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'clearfix mb30 font-18 font-bd pl25 pr25'}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'pl50 pr20 clearfix'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'df mb30'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'mr30 color-orange pt10'},'*'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'flex1 mr20'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('input',{maxLength:'60',type:'text',style:{width:'670px'},className:stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red",name:'stage_name',value:stage_name,onInput:this.updatastage_name,placeholder:"请输入第"+(this.props.keys+1)+"阶段名称,最大限制60个字符"}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:stage_nametype===true?"red":'none'},'\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{style:{"width":"60px"}},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'color-orange fl mt8 none',id:'stage_name_notice'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('i',{className:'iconfont icon-tishi font-14 mr3'}),'\u5FC5\u586B\u9879'))),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'color-grey-6 font-16 mb20'},'\u63CF\u8FF0'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'width89 mb30 pl35'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('textarea',{className:descriptiontype===false?"winput-100-1
// shixuns_listedit===undefined?'':shixuns_listedit.map((item,key)=>{
// return(
// <div className="clearfix paragraph lineh-30" key={key}>
//
// <li className="fl li-width63">
//
// <span className="progressRing mr10">
// <i className="iconfont icon-bofang progressRing-part font-18 mt10"></i>
// </span>
//
// <a className={ "paragraph_name paragraph_nameid"}
// href={/shixuns/+item.shixun_identifier}
// >
//
// <span className="subject_stage_shixun_index">
//
// <span className="subject_stage_shixun_index">{this.props.idsum+1}</span>-{key+1}&nbsp;&nbsp;{item.shixun_name}
//
// </span>
//
// </a>
//
// </li>
//
// <li className="fr status_li">
// <Tooltip placement="bottom" title="删除">
// <i className="iconfont icon-shanchu color-grey-c font-14 font-n cursor" key={key} onClick={this.shixunslisteditdelect}></i>
// </Tooltip>
// </li>
//
// </div>
// )
// })
// }
// <Modal
// keyboard={false}
// title="选择实训"
// visible={selectShixun}
// closable={false}
// footer={null}
// width="840px"
// destroyOnClose={true}
// >
// <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
// <div className="newupload_conbox">
// <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
// <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
// {
// ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
// return(
// <li className="fl mr5 mt5" key={key}>
// <a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
// </li>
// )
// })
// }
//
//
// </div>
// <div className="clearfix mb20" id="shixun_search_form_div">
// <span className="fl color-grey-9 font-16 mt3">
// <span>共</span>
// <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
// <span>个实训</span>
// </span>
// <div className="fr search-new mb0">
// <Search
// placeholder="请输入创建者或者实训名称进行搜索"
// onInput={this.searchNameInput}
// onSearch={()=>this.changeTag(`${type}`,`${search}`)}
// style={{width: '115%'}}
// ></Search>
// </div>
// </div>
// <ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
// <li className="fl with40 paddingleft22">实训名称</li>
// <li className="fl with30 edu-txt-left">使用院校</li>
// <li className="fl with10">使用人数</li>
// <li className="fl with10">评价等级</li>
// <li className="fl with10"></li>
// </ul>
//
// <style>
// {
// `
// .over180{min-height: 180px;max-height: 180px;overflow-y: auto}
// `
// }
// </style>
// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":<div className="over180 pl20 pr20"
// onScroll={this.contentViewScrolledit}
// >
// <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
// {
// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
// return(
// <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
// <li className="fl with40">
// <Checkbox
// id={"shixun_input_"+item.shixun_id}
// value={item.shixun_id}
// key={item.shixun_id}
// className="fl task-hide edu-txt-left"
// style={{"width":"298px"}}
// name="shixun_homework[]"
// >
// <label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
// </Checkbox>
// </li>
// <li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
// <li className="fl with10 paddingl10">{item.myshixuns_count}</li>
// <li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
// <li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
// </div>
// )
// })
// }
// </Checkbox.Group>
// </div>}
// <div className="mt20 marginauto clearfix edu-txt-center">
// <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
// <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
// </div>
// </div>
// </Spin>
// </Modal>
// //打开选择实训弹框初始化tag标签和列表
// changeTag(id,search){
//
// this.setState({
// ChooseShixunListshixun_list:[],
// page:1,
// hometypepvisible:true
// })
// let pathId=this.props.pathid;
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(id!=0){
// url+="&type="+id;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:id,
// search:search,
// ChooseShixunListshixun_list:result.data.shixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
// contentViewScrolledit=(e)=>{
// //滑动到底判断
// const {ChooseShixunList}=this.state;
// let newscrollTop=parseInt(e.currentTarget.scrollTop);
// let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
//
// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
//
// if(ChooseShixunList.shixun_list.length===0){
// return
// }else{
// this.setState({
// hometypepvisible:true
// })
// // console.log("到达底部");
//
// let {page,type,search,ChooseShixunListshixun_list}=this.state;
//
// let newpage=page+1;
//
// let pathId=this.props.pathid;
//
// let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
//
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
//
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
//
// if(type!=0){
// url+="&type="+type;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
//
// let list =result.data.shixun_list;
//
// for(var i=0; i<list.length; i++){
// newChooseShixunListshixun_list.push(list[i])
// }
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:type,
// page:newpage,
// search:search,
// ChooseShixunListshixun_list:newChooseShixunListshixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
//
//
// }
//
//
//
// }
//
// }
/***/ }),
/***/ 4518:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_popover_style_css__ = __webpack_require__(1415);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_popover_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_popover_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_popover__ = __webpack_require__(1471);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_popover___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_popover__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_tooltip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_icon_style_css__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_icon_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_icon_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_icon__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_icon___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_icon__);
/* 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_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__DetailTop_js__ = __webpack_require__(4519);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__DetailCards_js__ = __webpack_require__(4524);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__addCollaborators_js__ = __webpack_require__(4525);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_react_router_dom__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react_beautiful_dnd__ = __webpack_require__(1537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__paths_ShixunPaths_css__ = __webpack_require__(1900);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__paths_ShixunPaths_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13__paths_ShixunPaths_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_antd_dist_antd_css__ = __webpack_require__(2297);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_antd_dist_antd_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_antd_dist_antd_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__modals_Modals__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__tpm_component_TPMRightSection__ = __webpack_require__(1920);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_styled_components__ = __webpack_require__(4526);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__Modifytext__ = __webpack_require__(4532);
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;};}();var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _templateObject=_taggedTemplateLiteral(['\n background: lightgrey;\n padding: 10px;\n'],['\n background: lightgrey;\n padding: 10px;\n']),_templateObject2=_taggedTemplateLiteral(['\n display: flex;\n align-items: center;\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid grey;\n background: white;\n &:hover {\n background: lightgrey;\n }\n'],['\n display: flex;\n align-items: center;\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid grey;\n background: white;\n &:hover {\n background: lightgrey;\n }\n']),_templateObject3=_taggedTemplateLiteral(['\n width: 15px;\n height: 15px;\n margin-right: 8px;\n background: grey;\n visibility: hidden;\n &:hover {\n background: black;\n }\n ',':hover & {\n visibility: visible;\n }\n'],['\n width: 15px;\n height: 15px;\n margin-right: 8px;\n background: grey;\n visibility: hidden;\n &:hover {\n background: black;\n }\n ',':hover & {\n visibility: visible;\n }\n']);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;}function _taggedTemplateLiteral(strings,raw){return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}var getItemStyle=function getItemStyle(isDragging,draggableStyle){return Object.assign({// change background colour if dragging
background:isDragging?'#dceeff':''},draggableStyle);};var getItems=function getItems(count){return Array.from({length:count},function(v,k){return k;}).map(function(k){return{id:'item-'+k,content:'item '+k};});};// a little function to help us with reordering the result
var reorder=function reorder(list,startIndex,endIndex){var result=Array.from(list);var _result$splice=result.splice(startIndex,1),_result$splice2=_slicedToArray(_result$splice,1),removed=_result$splice2[0];result.splice(endIndex,0,removed);return result;};var List=__WEBPACK_IMPORTED_MODULE_18_styled_components__["a" /* default */].div(_templateObject);var Item=__WEBPACK_IMPORTED_MODULE_18_styled_components__["a" /* default */].div(_templateObject2);var DragHandle=__WEBPACK_IMPORTED_MODULE_18_styled_components__["a" /* default */].div(_templateObject3,Item);var $=window.$;var PathDetailIndex=function(_Component){_inherits(PathDetailIndex,_Component);function PathDetailIndex(props){_classCallCheck(this,PathDetailIndex);var _this=_possibleConstructorReturn(this,(PathDetailIndex.__proto__||Object.getPrototypeOf(PathDetailIndex)).call(this,props));_this.cardsModalcancel=function(){_this.setState({Modalstype:false});// TODO 这个是临时处理,还需要优化,这里要看怎么区分处理
if(_this.state.Modalstopval=='你确定要删除该成员吗?'){return;}_this.props.history.goBack();};_this.cardsModalsave=function(){_this.setState({Modalstype:false});_this.props.history.goBack();};_this.updatamakedown=function(id){setTimeout(function(){var shixunDescr=window.editormd.markdownToHTML(id,{htmlDecode:"style,script,iframe",taskList:true,tex:true,flowChart:true,sequenceDiagram:true});$("#"+id+" p:first").addClass("ReactMarkdown");},200);};_this.getlistdatas=function(){var query=_this.props.location.search;// const type = query.split('?chinaoocTimestamp=');
// console.log("Eduinforms12345");
// console.log(this.foo(query));
// console.log(JSON.stringify(this.foo(query)));
var dataqueryss={};try{var foqus=_this.foo(query);if(JSON.stringify(foqus)==="{}"){_this.setState({dataquerys:{}});}else{_this.setState({dataquerys:foqus});dataqueryss=foqus;}}catch(e){_this.setState({dataquerys:{}});}_this.getdatasindexs(undefined,dataqueryss);};_this.foo=function(url){var json={};var regExp=/[\?\&](\w+)(=?)(\w*)/g;var arr;do{arr=regExp.exec(url);// console.log(arr); // arr = [完整的字符串, key, 等号或'', value或'']
if(arr){var key=arr[1];var value=arr[3];// arr[2] === ''时, value = undefined
if(!arr[2])value=undefined;json[key]=value;}}while(arr);return json;};_this.getdatasindexs=function(key,yslwebobject){// yslwebobject 后端需要的接口
var pathid=_this.props.match.params.pathId;var url="/paths/"+pathid+".json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(url,{params:yslwebobject}).then(function(result){if(result.data.status===407||result.data.status===401){debugger;return;}if(result.data.status===403){debugger;// window.location.href = "/403";
return;}Object(__WEBPACK_IMPORTED_MODULE_7_educoder__["G" /* configShareForCustom */])(result.data.name,result.data.description);if(result.data.allow_visit===true){_this.setState({detailInfoList:result.data,courses:result.data.courses,pathtopskey:key===undefined?1:key// items: getItems(result.data.members.length),
});document.title=result.data.name;}}).catch(function(error){console.log(error);});var righturl="/paths/"+pathid+"/right_banner.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(righturl).then(function(result){if(result.data.status===407||result.data.status===401){debugger;return;}if(result.data.status===403){debugger;// window.location.href = "/403";
return;}_this.setState({qrcode_img:result.data.qrcode_img,tags:result.data.tags,progress:result.data.progress,members:result.data.members,items:getItems(result.data.members.length),team_title:result.data.team_title});}).catch(function(error){console.log(error);});};_this.getMenuItemsindex=function(key,status){_this.setState({MenuItemsindex:key,MenuItemsindextype:status});};_this.getdatasindex=function(key){// yslwebobject 后端需要的接口
var pathid=_this.props.match.params.pathId;var url="/paths/"+pathid+".json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(url,{params:_this.state.dataquerys}).then(function(result){if(result.data.status===407||result.data.status===401){debugger;return;}if(result.data.status===403){debugger;// window.location.href = "/403";
return;}Object(__WEBPACK_IMPORTED_MODULE_7_educoder__["G" /* configShareForCustom */])(result.data.name,result.data.description);if(result.data.allow_visit===true){_this.setState({detailInfoList:result.data,courses:result.data.courses,pathtopskey:key===undefined?1:key// items: getItems(result.data.members.length),
});}}).catch(function(error){console.log(error);});var righturl="/paths/"+pathid+"/right_banner.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(righturl).then(function(result){if(result.data.status===407||result.data.status===401){debugger;return;}if(result.data.status===403){debugger;// window.location.href = "/403";
return;}_this.setState({// detailInfoList:result.data,
tags:result.data.tags,progress:result.data.progress,members:result.data.members,items:getItems(result.data.members.length),team_title:result.data.team_title});}).catch(function(error){console.log(error);});};_this.updatadetailInfoList=function(){_this.getdatasindex();};_this.clickNewsubscript=function(val){if(val===0){_this.setState({clickdetailInfoListtype:true});}else{_this.setState({clickdetailInfoListtype:false});}};_this.timeStamp=function(value){var secondTime=parseInt(value);// 秒
var minuteTime=0;// 分
var hourTime=0;// 小时
if(secondTime>60){//如果秒数大于60将秒数转换成整数
//获取分钟除以60取整数得到整数分钟
minuteTime=parseInt(secondTime/60);//获取秒数,秒数取佘,得到整数秒数
secondTime=parseInt(secondTime%60);//如果分钟大于60将分钟转换成小时
if(minuteTime>60){//获取小时获取分钟除以60得到整数小时
hourTime=parseInt(minuteTime/60);//获取小时后取佘的分获取分钟除以60取佘的分
minuteTime=parseInt(minuteTime%60);}}var result=""+parseInt(secondTime)+"秒";if(minuteTime>0){result=""+parseInt(minuteTime)+"分"+result;}if(hourTime>0){result=""+parseInt(hourTime)+"小时"+result;}return result;};_this.shanchuallow=function(id){_this.setState({user_id:id,Modalstype:true,Modalstopval:"你确定要删除该成员吗?",cardsModalsave:_this.delectshanchuallow,loadtype:false});};_this.delectshanchuallow=function(){var user_id=_this.state.user_id;var pathid=_this.props.match.params.pathId;var url="/paths/"+pathid+"/delete_member.json";var param={user_id:user_id};__WEBPACK_IMPORTED_MODULE_16_axios___default.a.delete(url,{data:param}).then(function(response){if(response.data.status===1){if(_this.props.current_user.user_id==user_id){_this.props.history.push('/paths');return;}_this.props.showNotification(response.data.message);_this.setState({Modalstype:false,// Modalstopval:response.data.message,
loadtype:false// cardsModalsave:this.cardsModalsave,
});_this.updatadetailInfoList();}}).catch(function(error){console.log(error);});};_this.moveup=function(data){// console.log(data);
var pathid=_this.props.match.params.pathId;var url='/paths/'+pathid+'/up_member_position.json';__WEBPACK_IMPORTED_MODULE_16_axios___default.a.post(url,{user_id:data.id}).then(function(response){if(response.status===200){console.log("上移");// console.log(this.state.detailInfoList.members);
// console.log(response);
_this.setState({detailInfoList:_this.state.detailInfoList,members:response.data.members});// console.log(this.state.detailInfoList.members);
}}).catch(function(error){console.log(error);});};_this.movedown=function(data){// console.log(data);
var pathid=_this.props.match.params.pathId;var url='/paths/'+pathid+'/down_member_position.json';__WEBPACK_IMPORTED_MODULE_16_axios___default.a.post(url,{user_id:data.id}).then(function(response){if(response.status===200){console.log("下移");// console.log(this.state.detailInfoList.members);
// console.log(response);
_this.setState({detailInfoList:_this.state.detailInfoList,members:response.data.members});// console.log(this.state.detailInfoList.members);
}}).catch(function(error){console.log(error);});};_this.modifysy=function(i){if(i===1){_this.setState({modify:true});}else if(i===2){_this.setState({modify:false});var righturl="/paths/"+_this.props.match.params.pathId+"/right_banner.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(righturl).then(function(result){if(result.data.status===407||result.data.status===401){debugger;return;}if(result.data.status===403){debugger;// window.location.href = "/403";
return;}_this.setState({// detailInfoList:result.data,
tags:result.data.tags,progress:result.data.progress,members:result.data.members,items:getItems(result.data.members.length),team_title:result.data.team_title});}).catch(function(error){console.log(error);});}else if(i===3){_this.setState({modify:false});}};_this.maincontent=function(){return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:"sandianbox"},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{onClick:function onClick(){return _this.modifysy(1);}},'\u91CD\u547D\u540D'));};_this.state={progress:undefined,tags:undefined,members:undefined,detailInfoList:undefined,clickdetailInfoListtype:false,Modalstype:false,Modalstopval:undefined,Modalsbottomval:undefined,cardsModalcancel:_this.cardsModalcancel,cardsModalsave:_this.cardsModalsave,user_id:undefined,loadtype:false,courses:undefined,items:getItems(10),pathtopskey:1,dataquerys:{},MenuItemsindex:1,MenuItemsindextype:0,qrcode_img:null,team_title:"教学团队",modify:false};_this.onDragEnd=_this.onDragEnd.bind(_this);return _this;}_createClass(PathDetailIndex,[{key:'onDragEnd',value:function onDragEnd(result){// dropped outside the list
if(!result.destination){return;}try{}catch(e){}var items=reorder(this.state.members,result.source.index,result.destination.index);this.setState({detailInfoList:this.state.detailInfoList,members:items,items:items});console.log(this.state.members);console.log("items 数组数组数组数组");console.log(items);}// 加载markdown
},{key:'componentDidMount',value:function componentDidMount(){this.getlistdatas();}//截取url 数据的
//上移
//下移
},{key:'setteam_title',value:function setteam_title(name){this.setState({team_title:name});}},{key:'render',value:function render(){var _this2=this;this.updatamakedown("shixuns_propaedeutics");this.updatamakedown("subject_learning_notes");var _state=this.state,detailInfoList=_state.detailInfoList,clickdetailInfoListtype=_state.clickdetailInfoListtype,Modalstype=_state.Modalstype,Modalstopval=_state.Modalstopval,Modalsbottomval=_state.Modalsbottomval,cardsModalcancel=_state.cardsModalcancel,cardsModalsave=_state.cardsModalsave,loadtype=_state.loadtype,progress=_state.progress,members=_state.members,tags=_state.tags,qrcode_img=_state.qrcode_img,MenuItemsindex=_state.MenuItemsindex,MenuItemsindextype=_state.MenuItemsindextype,team_title=_state.team_title,modify=_state.modify;// console.log(MenuItemsindex)
// console.log(MenuItemsindextype===2&&detailInfoList&&detailInfoList.allow_statistics===false)
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'newContainer'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t\t.head-right{\n \t\t\t\t\t\tline-height: 30px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.padding40-20-30{\n\t\t\t\t\t\t\t padding:40px 20px 30px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.pathDetailIndex .markdown-body > p {\n\t\t\t\t\t\t\t\tline-height: 28px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_15__modals_Modals__["a" /* default */],{modalsType:Modalstype,modalsTopval:Modalstopval,modalsBottomval:Modalsbottomval,modalCancel:cardsModalcancel,modalSave:cardsModalsave,loadtype:loadtype}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'newMain clearfix pathDetailIndex'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__DetailTop_js__["a" /* default */],Object.assign({},this.state,this.props,{getdatasindex:function getdatasindex(key){return _this2.getdatasindex(key);},getMenuItemsindex:function getMenuItemsindex(key,status){return _this2.getMenuItemsindex(key,status);},getlistdatas:function getlistdatas(){return _this2.getlistdatas();}})),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'educontent clearfix mb80'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'with65 fl'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'produce-content mb10'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'clearfix mb20'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'fl font-18 font-bd'},'\u7B80\u4ECB')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'color-grey-6 clearfix'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{id:'shixuns_propaedeutics',className:'new_li fl',style:{"padding":" 0px","textAlign":"justify;"}},detailInfoList===undefined?"":detailInfoList.description===null?"":__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:"markdown-body font-14",dangerouslySetInnerHTML:{__html:Object(__WEBPACK_IMPORTED_MODULE_7_educoder__["X" /* markdownToHTML */])(detailInfoList.description).replace(/▁/g,"▁▁▁")}})))),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__DetailCards_js__["a" /* default */],Object.assign({},this.props,this.state,{updatadetailInfoLists:this.updatadetailInfoList}))),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'with35 fr pl20'},qrcode_img===null?"":__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'edu-back-white newmustlearn mb10'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('img',{src:''+qrcode_img}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'font-16 color181818'},'\u4F18\u60E0\u62A5\u540D\uFF0C\u626B\u7801\u5165\u7FA4')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'edu-back-white mustlearn mb10'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'clearfix mb30'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'font-16 '},'\u8BFE\u7A0B\u987B\u77E5')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{id:'subject_learning_notes',className:'color-grey-6 new_li markdown-body editormd-html-preview justify'},detailInfoList===undefined?"":detailInfoList.learning_notes===null?"":__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:"markdown-body font-14",dangerouslySetInnerHTML:{__html:Object(__WEBPACK_IMPORTED_MODULE_7_educoder__["X" /* markdownToHTML */])(detailInfoList.learning_notes).replace(/▁/g,"▁▁▁")}}))),tags===undefined?"":tags===null?"":__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'edu-back-white padding40-20 mb10 relative'},__WEBPACK_IMPORTED_MODULE_6_re
/***/ }),
/***/ 4519:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_dropdown_style_css__ = __webpack_require__(985);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_dropdown_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_dropdown_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_dropdown__ = __webpack_require__(982);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_dropdown___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_dropdown__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_icon_style_css__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_icon_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_icon_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_icon__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_icon___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_icon__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_tooltip__);
/* 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_radio_style_css__ = __webpack_require__(177);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_radio_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_antd_lib_radio_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_radio__ = __webpack_require__(175);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_antd_lib_radio__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_input_style_css__ = __webpack_require__(68);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_input_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_antd_lib_input_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_input__ = __webpack_require__(69);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_antd_lib_input__);
/* 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__sendPanel_js__ = __webpack_require__(4520);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__modals_Modals__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__OpenCourse__ = __webpack_require__(4521);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__modals_Jointheclass__ = __webpack_require__(1653);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__DetailTop_css__ = __webpack_require__(4522);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__DetailTop_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_20__DetailTop_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 Search=__WEBPACK_IMPORTED_MODULE_11_antd_lib_input___default.a.Search;var RadioGroup=__WEBPACK_IMPORTED_MODULE_9_antd_lib_radio___default.a.Group;var DetailTop=function(_Component){_inherits(DetailTop,_Component);function DetailTop(props){_classCallCheck(this,DetailTop);var _this=_possibleConstructorReturn(this,(DetailTop.__proto__||Object.getPrototypeOf(DetailTop)).call(this,props));_this.getdatalist=function(){var courseslist=[];var keys=1;var listtype=false;if(_this.props.courses!=undefined&&_this.props.courses.length!=0){if(_this.props.detailInfoList.has_start===true){_this.props.courses.map(function(item,key){if(item.course_status.status===1){keys=key+1;return courseslist.push(item);}});}else{var type=undefined;_this.props.courses.map(function(item,key){var arr=[];keys=key+1;if(item.course_status.status===2){type=key+1;arr.push(item);}courseslist=arr;});_this.props.courses.map(function(item,key){var arr=[];if(listtype===false){keys=key+1;if(item.course_status.status===0){listtype=true;// courseslist.push(item)
arr.push(item);courseslist=arr;}}});console.log(courseslist);}if(courseslist.length!=0){_this.props.getMenuItemsindex(keys,courseslist[0].course_status.status);}}_this.setState({courseslist:courseslist,MenuItemskey:keys});};_this.componentDidUpdate=function(prevProps){if(prevProps.courses!=_this.props.courses){_this.getdatalist();}};_this.allow_deletepath=function(){_this.setState({Modalstype:true,Modalstopval:"是否删除路径?",deletepathtype:true});};_this.applyissuePath=function(){_this.setState({Modalstype:true,Modalstopval:"发布申请已提交,请等待管理员的审核",Modalsbottomval:"• 我们将在1-2个工作日内完成审核",loadtype:true});};_this.cancelissuePath=function(){var pathId=_this.props.match.params.pathId;var url="/paths/"+pathId+"/cancel_publish.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(url).then(function(result){if(result.status===200){if(result.data.status===0){}else if(result.data.status===1){window.location.href="/paths/"+result.data.subject_id;}}}).catch(function(error){console.log(error);});};_this.reovkissuePath=function(){_this.setState({Modalstype:true,Modalstopval:"是否确认撤销发布",Modalsbottomval:"确认后,回退到编辑状态",cardsModalsavetype:true});};_this.reovkissuePaths=function(){var pathId=_this.props.match.params.pathId;var url="/paths/"+pathId+"/cancel_has_publish.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(url).then(function(result){if(result.status===200){if(result.data.status===0){}else if(result.data.status===1){_this.setState({cardsModalsavetype:false,loadtype:false,deletepathtype:false});window.location.href="/paths/"+result.data.subject_id;}}}).catch(function(error){console.log(error);});};_this.cardsModalcancel=function(){_this.setState({Modalstype:false,Modalsbottomval:'',loadtype:false,deletepathtype:false,putappointmenttype:false});};_this.cardsModalsave=function(){var _this$state=_this.state,loadtype=_this$state.loadtype,deletepathtype=_this$state.deletepathtype;//删除路径
if(deletepathtype===true){var pathid=_this.props.match.params.pathId;var deleteUrl="/paths/"+pathid+".json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.delete(deleteUrl).then(function(response){var status=response.data.status;if(status===1){window.location.href="/paths";}}).catch(function(error){console.log(error);});}//申请发布
if(loadtype===true){var _pathid=_this.props.match.params.pathId;var url="/paths/"+_pathid+"/publish.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.get(url).then(function(result){if(result.status===200){if(result.data.status===0){_this.setState({Modalstype:true,Modalstopval:result.data.message});}else if(result.data.status===1){window.location.reload();}}}).catch(function(error){console.log(error);});}_this.setState({Modalstype:false,Modalsbottomval:''});};_this.onVisibleChanges=function(type){_this.setState({onVisibleChangestype:type});};_this.MenuItems=function(keys){var courseslist=[];_this.props.courses.map(function(item,key){if(keys===key+1){return courseslist.push(item);}});_this.props.getMenuItemsindex(keys,courseslist[0].course_status.status);_this.setState({MenuItemskey:keys,courseslist:courseslist,onVisibleChangestype:!_this.state.onVisibleChangestype});};_this.JoinnowCourse=function(id,typeid){if(_this.props.checkIfLogin()===false){_this.props.showLoginDialog();return;}if(_this.props.checkIfProfileCompleted()===false){_this.props.showProfileCompleteDialog();return;}_this.setState({yslJointhe:true,Pathcourseid:id,pathcousestypeid:typeid});};_this.putappointment=function(){if(_this.props.checkIfLogin()===false){_this.props.showLoginDialog();return;}if(_this.props.checkIfProfileCompleted()===false){_this.props.showProfileCompleteDialog();return;}_this.setState({Modalstype:true,Modalstopval:"是否确认立即预约?",Modalsbottomval:"",cardsModalcancel:function cardsModalcancel(){return _this.cardsModalcancel();},putappointmenttype:true,loadtype:false});};_this.ysljoinmodalCancel=function(){_this.setState({yslJointhe:false});};_this.ysljoinmodalCanceltwo=function(key){_this.setState({yslJointhe:false});_this.props.getdatasindex(key);};_this.OpenCoursefun=function(){_this.setState({OpenCourseTypes:true});};_this.OpenCourseCancel=function(){_this.setState({OpenCourseTypes:false});};_this.getappointment=function(){var pathid=_this.props.match.params.pathId;var url="/paths/"+pathid+"/appointment.json";__WEBPACK_IMPORTED_MODULE_16_axios___default.a.post(url).then(function(response){if(response.status===200){if(response.data.status===0){_this.setState({getappointmenttype:true});_this.cardsModalcancel();// this.props.getlistdatas()
_this.props.showNotification(response.data.message);}else{_this.props.showNotification(response.data.message);}}}).catch(function(error){console.log(error);_this.cardsModalcancel();});};_this.state={cardsModalcancel:_this.cardsModalcancel,cardsModalsave:_this.cardsModalsave,Modalstype:false,Modalstopval:"",Modalsbottomval:'',loadtype:false,deletepathtype:false,cardsModalsavetype:false,MenuItemskey:1,courseslist:[],Pathcourseid:undefined,OpenCourseTypes:false,putappointmenttype:false,getappointmenttype:false};return _this;}_createClass(DetailTop,[{key:"componentDidMount",value:function componentDidMount(){this.getdatalist();}},{key:"render",value:function render(){var _this2=this;var detailInfoList=this.props.detailInfoList;var _state=this.state,Modalstype=_state.Modalstype,Modalstopval=_state.Modalstopval,cardsModalcancel=_state.cardsModalcancel,putappointmenttype=_state.putappointmenttype,Modalsbottomval=_state.Modalsbottomval,cardsModalsavetype=_state.cardsModalsavetype,loadtype=_state.loadtype,getappointmenttype=_state.getappointmenttype;var radioStyle={display:'block',height:'30px',lineHeight:'30px'};var menu=__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a,null,this.props.courses===undefined||this.props.courses.length===0?"":this.props.courses.map(function(item,key){return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a.Item,null,__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("a",{rel:"noopener noreferrer",onClick:function onClick(){return _this2.MenuItems(key+1);}},"\u7B2C",key+1,"\u6B21\u5F00\u8BFE"));}));var applypath=this.props.detailInfoList&&this.props.detailInfoList.participant_count!=undefined&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false;var coursestypes=this.props.courses!=undefined&&this.props.courses.length===0;var isadminallow_statistics=this.props.courses&&this.props.courses.length===0&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===true;return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:this.props.courses===undefined?"subhead":this.props.courses.length===0?applypath===true?"subhead mb100":"subhead":applypath===false?detailInfoList.name.length>40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_17__modals_Modals__["a" /* default */],{modalsType:Modalstype,modalsTopval:Modalstopval,modalsBottomval:Modalsbottomval,modalCancel:cardsModalcancel,modalSave:cardsModalsavetype===true?function(){return _this2.reovkissuePaths();}:putappointmenttype===true?function(){return _this2.getappointment();}:function(){return _this2.cardsModalsave();},loadtype:loadtype}),this.state.yslJointhe===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19__modals_Jointheclass__["a" /* default */],Object.assign({},this.props,this.state,{ysljoinmodalCancel:function ysljoinmodalCancel(){return _this2.ysljoinmodalCancel();},ysljoinmodalCanceltwo:function ysljoinmodalCanceltwo(){return _this2.ysljoinmodalCanceltwo(_this2.state.MenuItemskey);}})):"",this.state.OpenCourseTypes===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_18__OpenCourse__["a" /* default */],Object.assign({},this.props,this.state,{OpenCourseCancel:function OpenCourseCancel(){return _this2.OpenCourseCancel();}})):"",__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("style",null,"\n\t\t\t\t\t\t.subhead_content{\n\t\t\t\t\t\t position: relative;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.userNavs{\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\twidth: 1200px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t"),detailInfoList&&__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:this.props.courses===undefined?"subhead_content":this.props.courses
/***/ }),
/***/ 4520:
/***/ (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_antd_lib_row_style_css__ = __webpack_require__(1482);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_row_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_row_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_row__ = __webpack_require__(1483);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_row___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_row__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_col_style_css__ = __webpack_require__(1484);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_col_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_col_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_col__ = __webpack_require__(1485);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_col___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_col__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_tooltip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_checkbox_style_css__ = __webpack_require__(317);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_checkbox_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_antd_lib_checkbox_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_checkbox__ = __webpack_require__(314);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_checkbox___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_antd_lib_checkbox__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_select_style_css__ = __webpack_require__(318);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_select_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_antd_lib_select_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_select__ = __webpack_require__(315);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_antd_lib_select__);
/* 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_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_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_moment__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__modals_Modals__ = __webpack_require__(173);
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 Option=__WEBPACK_IMPORTED_MODULE_11_antd_lib_select___default.a.Option;var CheckboxGroup=__WEBPACK_IMPORTED_MODULE_9_antd_lib_checkbox___default.a.Group;var sendPanel=function(_Component){_inherits(sendPanel,_Component);function sendPanel(props){_classCallCheck(this,sendPanel);var _this=_possibleConstructorReturn(this,(sendPanel.__proto__||Object.getPrototypeOf(sendPanel)).call(this,props));_this.SentToLesson=function(){var id=_this.props.detailInfoList.id;var url="/paths/"+id+"/choose_course.json";__WEBPACK_IMPORTED_MODULE_13_axios___default.a.get(url).then(function(result){if(result.status==200){if(result.data.status===403||result.data.status===402||result.data.status===407||result.data.status===408){}else{_this.setState({sendToCourseList:result.data,sentShixunPath:true});}}}).catch(function(error){console.log(error);});// this.setState({
// sentShixunPath:true
// })
};_this.hideSenttothevalue=function(){_this.setState({sentShixunPath:false,sendToShixunArray:[],sendToCourseId:undefined});};_this.openList=function(){_this.setState({openSearch:true});};_this.closeList=function(){_this.setState({openSearch:false});};_this.selectCloseList=function(e){_this.setState({openSearch:false,sendToCourseId:e});};_this.changeCheckBoxs=function(list){_this.setState({sendToShixunArray:list// shixunNum:list.length
});};_this.submitInfo=function(){var _this$state=_this.state,sendToCourseId=_this$state.sendToCourseId,sendToShixunArray=_this$state.sendToShixunArray;if(sendToCourseId===undefined){_this.props.showSnackbar("您还未选择发送的课堂");}else if(parseInt(sendToShixunArray.length)==0){_this.props.showSnackbar("您还未选择实训");}else{var id=_this.props.detailInfoList.id;var url="/paths/"+id+"/send_to_course.json";__WEBPACK_IMPORTED_MODULE_13_axios___default.a.post(url,{shixun_ids:sendToShixunArray,course_id:sendToCourseId}).then(function(result){if(result.data.status===1){_this.setState({Modalstype:true,sentShixunPath:false,Modalstopval:result.data.message,courseurl:result.data.url,sendToShixunArray:[],sendToCourseId:undefined});}}).catch(function(error){console.log(error);});}};_this.cardsModalcancel=function(){_this.setState({Modalstype:false});};_this.cardsModalsave=function(){var courseurl=_this.state.courseurl;window.location.href=courseurl;};_this.allChange=function(e){if(e.target.checked===false){_this.setState({sendToShixunArray:[]});}else{var sendToCourseList=_this.state.sendToCourseList;var newlist=[];sendToCourseList.stages.map(function(item,key){item.shixuns.map(function(items,keys){newlist.push(items.shixun_id);});});_this.setState({sendToShixunArray:newlist});}};_this.state={sentShixunPath:false,sendToCourseList:undefined,openSearch:false,sendToCourseId:undefined,sendToShixunArray:[],Modalstype:false,cardsModalcancel:_this.cardsModalcancel,cardsModalsave:_this.cardsModalsave,modalsTopval:'',Modalsbottomval:'',courseurl:''};return _this;}//发送至
//隐藏发送至弹框
//打开课堂列表下拉框
//关闭课堂列表下拉框
// 选择课堂获取选中的Id
//选择checkbox
//确认提交
_createClass(sendPanel,[{key:"componentDidMount",value:function componentDidMount(){// let id=this.props.detailInfoList.id;
// let url="/paths/"+id+"/choose_course.json";
// axios.get(url).then((result)=>{
// if(result.status==200){
// this.setState({
// sendToCourseList:result.data
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
}},{key:"render",value:function render(){var _this2=this;var _state=this.state,sentShixunPath=_state.sentShixunPath,sendToCourseList=_state.sendToCourseList,Modalstype=_state.Modalstype,Modalstopval=_state.Modalstopval,Modalsbottomval=_state.Modalsbottomval,cardsModalcancel=_state.cardsModalcancel,cardsModalsave=_state.cardsModalsave;return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",null,__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_16__modals_Modals__["a" /* default */],{modalsType:Modalstype,modalsTopval:Modalstopval,modalsBottomval:Modalsbottomval,modalCancel:cardsModalcancel,modalSave:cardsModalsave}),this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_send===true?__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_tooltip___default.a,{placement:"bottom",title:"\u4EE5\u5B9E\u8BAD\u4F5C\u4E1A\u7684\u5F62\u5F0F\u53D1\u9001\u5230\u6211\u7684\u8BFE\u5802"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("a",{onClick:this.SentToLesson,className:"fr font-18 color-white kaike mr20 kkbths"},"\u53D1\u9001\u81F3")):'',__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_modal___default.a,{keyboard:false,title:"\u53D1\u9001\u81F3\u8BFE\u5802",visible:sentShixunPath,closable:false,footer:null,destroyOnClose:true},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:"newupload_conbox"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:"mb20"// onMouseLeave={this.closeList}
},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11_antd_lib_select___default.a,{placeholder:"\u8BF7\u9009\u62E9\u60A8\u8981\u53D1\u9001\u7684\u8BFE\u5802",style:{"width":"100%"},onSelect:this.selectCloseList// onMouseEnter={this.openList}
,defaultOpen:false// open={openSearch}
,optionLabelProp:"name"},sendToCourseList===undefined?"":sendToCourseList.courses.map(function(item,key){return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(Option,{key:item.course_id,id:key,name:item.course_name},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_row___default.a,null,__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_col___default.a,{className:"fl with70 task-hide"},item.course_name),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_col___default.a,{className:"fl color-grey-9 with30 edu-txt-center"},__WEBPACK_IMPORTED_MODULE_15_moment___default()(item.created_at).format('YYYY-MM-DD HH:mm'))));}))),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:"edu-back-skyblue pl15 pr15 clearfix over280 pt5"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(CheckboxGroup,{onChange:this.changeCheckBoxs,value:this.state.sendToShixunArray},sendToCourseList&&sendToCourseList.stages.map(function(item,key){return item.shixuns.map(function(items,keys){return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:"mt5",key:keys},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9_antd_lib_checkbox___default.a,{name:key,value:items.shixun_id,key:items.shixun_id},items.shixun_name));});}))),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:"mt10 clearfix"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("span",{className:"fl ml15"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9_antd_lib_checkbox___default.a,{className:"fl",onChange:function onChange(e){return _this2.allChange(e);}},"\u5168\u9009"))),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("p",{className:"color-grey-9 pl15 font-12 mt10"},"\u5DF2\u9009\u62E9 ",this.state.sendToShixunArray.length," \u4E2A\u5B9E\u8BAD"),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("div",{className:"mt20 clearfix edu-txt-center"},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("a",{onClick:this.hideSenttothevalue,className:"pop_close task-btn mr30"},"\u53D6\u6D88"),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement("a",{className:"task-btn task-btn-orange",onClick:this.submitInfo},"\u786E\u5B9A")))));}}]);return sendPanel;}(__WEBPACK_IMPORTED_MODULE_12_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_14_educoder__["w" /* SnackbarHOC */])()(sendPanel));
/***/ }),
/***/ 4521:
/***/ (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_antd_lib_radio_style_css__ = __webpack_require__(177);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_radio_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_radio_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_radio__ = __webpack_require__(175);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_radio__);
/* 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_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_axios__);
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 OpenCourse=function(_Component){_inherits(OpenCourse,_Component);function OpenCourse(props){_classCallCheck(this,OpenCourse);var _this=_possibleConstructorReturn(this,(OpenCourse.__proto__||Object.getPrototypeOf(OpenCourse)).call(this,props));_this.modalCancel=function(){_this.props.OpenCourseCancel();};_this.setDownload=function(){var value=_this.state.value;console.log(_this.props.match.params.pathId);if(value===0){window.open('/courses/news/'+_this.props.match.params.pathId+'/newgold/0 ');}else{window.open('/courses/news/'+_this.props.match.params.pathId+'/newgold/1');}_this.props.OpenCourseCancel();};_this.setpathradioChange=function(e){_this.setState({value:e.target.value});};_this.state={value:1};return _this;}_createClass(OpenCourse,[{key:'componentDidMount',value:function componentDidMount(){// console.log("加入精品课堂");
// console.log(this.props);
}},{key:'render',value:function render(){var _this2=this;// console.log("加入精品课堂2");
//console.log(this.props.Pathcourseid);
var pathradioStyle={display:'block',height:'30px',lineHeight:'30px',color:'#05101A',textAlign:'left',fontSize:'16px'};var pathradioStyles={color:'#999999'};return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_modal___default.a,{keyboard:false,closable:false,footer:null,destroyOnClose:true,title:'\u9009\u62E9\u8BFE\u5802\u6027\u8D28',centered:true,visible:this.props.OpenCourseTypes===undefined?false:this.props.OpenCourseTypes,width:'600px'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'educouddiv'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:"tabeltext-alignleft"},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('p',{className:"mt20 mb20 font-16"},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_radio___default.a.Group,{onChange:this.setpathradioChange,value:this.state.value},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_radio___default.a,{style:pathradioStyle,value:1,className:"mt10"},'\u5F00\u653E\u8BFE\u5802\uFF1A',__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{style:pathradioStyles},'\u6240\u6709\u7528\u6237\u53EF\u4EE5\u968F\u65F6\u8BBF\u95EE')),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_radio___default.a,{style:pathradioStyle,value:0,className:"mt10"},'\u79C1\u6709\u8BFE\u5802\uFF1A',__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{style:pathradioStyles},'\u4EC5\u62A5\u540D\u53C2\u4E0E\u7684\u8BFE\u5802\u6210\u5458\u53EF\u4EE5\u8BBF\u95EE'))))),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t\ta:hover {\n\t\t\t\t\t\t\t\t\tcolor: #fff !important;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t'),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'clearfix edu-txt-center mt20'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('a',{className:'task-btn mr30',onClick:function onClick(){return _this2.modalCancel();}},'\u53D6\u6D88'),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('a',{className:'task-btn task-btn-orange',onClick:function onClick(){return _this2.setDownload();}},'\u786E\u8BA4'))));}}]);return OpenCourse;}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (OpenCourse);
/***/ }),
/***/ 4522:
/***/ (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__(4523);
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;
/***/ }),
/***/ 4523:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".userbluebgfont{color:#fff!important}.kaike{border:1px solid #fff;padding:0 10px;cursor:pointer;font-size:14px;display:block;width:120px;text-align:center;height:40px;line-height:40px!important;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.userNavs{line-height:75px;height:96px;background:#fff;-webkit-box-shadow:3px 5px 11px 1px hsla(0,0%,90%,.5);box-shadow:3px 5px 11px 1px hsla(0,0%,90%,.5);border-radius:4px}.userNavs li{display:inline-block;padding:0 30px;-webkit-box-sizing:border-box;box-sizing:border-box}.newbianji1{font-size:16px!important;margin-right:10px;color:#4cacff;margin-bottom:3px;display:inline-block}.solidright{border-right:1px solid #cdcdcd;height:42px}.ant-modal-title{height:38px;line-height:38px!important;font-size:16px;font-weight:500!important;color:#333;text-align:center}.pd4020{padding:0 40px 0 20px!important}.bannername780{max-width:780px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;height:40px}.mb100{margin-bottom:100px!important}.task-btn-28BE6C{background:#28be6c!important;color:#fff!important}.mt43{margin-top:43px}.mb120{margin-bottom:120px!important}.mb80{margin-bottom:80px!important}", "", {"version":3,"sources":["/Users/hs/edu/educoder/public/react/src/modules/paths/PathDetail/DetailTop.css"],"names":[],"mappings":"AAAA,gBACI,oBAAsB,CACzB,AAED,OAEI,sBAAoC,AACpC,eAAkB,AAClB,eAAgB,AAChB,eAAgB,AAChB,cAAe,AACf,YAAa,AACb,kBAAmB,AACnB,YAAa,AACb,2BAA4B,AAC5B,kBAAmB,AACnB,8BAA+B,AACvB,qBAAuB,CAClC,AACD,UACI,iBAAkB,AAElB,YAAY,AACZ,gBAA+B,AAC/B,sDAA0D,AAClD,8CAAkD,AAC1D,iBAAkB,CACrB,AAED,aACI,qBAAsB,AACtB,eAAgB,AAChB,8BAA+B,AAC/B,qBAAuB,CAC1B,AAED,YACI,yBAA2B,AAC3B,kBAAmB,AACnB,cAAe,AACf,kBAAmB,AACnB,oBAAsB,CACzB,AAED,YACI,+BAA+B,AAC/B,WAAa,CAChB,AACD,iBACI,YAAa,AACb,2BAA4B,AAG5B,eAAgB,AAChB,0BAA2B,AAC3B,WAAY,AACZ,iBAAmB,CALtB,AAQD,QACI,+BAAkC,CACrC,AAED,eACI,gBAAiB,AACjB,gBAAiB,AACjB,0BAA2B,AAC3B,uBAAwB,AACxB,mBAAoB,AACpB,WAAa,CAChB,AAED,OACI,6BAAgC,CACnC,AACD,iBACI,6BAA+B,AAC/B,oBAAsB,CACzB,AACD,MACI,eAAiB,CACpB,AAED,OACI,6BAAgC,CACnC,AAED,MACI,4BAA+B,CAClC","file":"DetailTop.css","sourcesContent":[".userbluebgfont{\n color:#fff !important;\n}\n\n.kaike{\n border-radius: 4px;\n border: 1px solid rgba(255,255,255);\n padding: 0px 10px;\n cursor: pointer;\n font-size: 14px;\n display: block;\n width: 120px;\n text-align: center;\n height: 40px;\n line-height: 40px!important;\n border-radius: 4px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.userNavs{\n line-height: 75px;\n background: #fff;\n height:96px;\n background:rgba(255,255,255,1);\n -webkit-box-shadow:3px 5px 11px 1px rgba(230,230,230,0.5);\n box-shadow:3px 5px 11px 1px rgba(230,230,230,0.5);\n border-radius:4px;\n}\n\n.userNavs li {\n display: inline-block;\n padding: 0 30px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.newbianji1{\n font-size: 16px !important;\n margin-right: 10px;\n color: #4CACFF;\n margin-bottom: 3px;\n display: inline-block;\n}\n\n.solidright{\n border-right:1px solid #CDCDCD;\n height: 42px;\n}\n.ant-modal-title {\n height: 38px;\n line-height:38px !important;\n}\n.ant-modal-title {\n font-size: 16px;\n font-weight: 500!important;\n color: #333;\n text-align: center;\n}\n\n.pd4020{\n padding: 0 40px 0 20px !important;\n}\n\n.bannername780{\n max-width: 780px;\n overflow: hidden;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 40px;\n}\n\n.mb100{\n margin-bottom: 100px !important;\n}\n.task-btn-28BE6C{\n background: #28BE6C !important;\n color: #fff!important;\n}\n.mt43{\n margin-top: 43px;\n}\n\n.mb120{\n margin-bottom: 120px !important;\n}\n\n.mb80{\n margin-bottom: 80px !important;\n}"],"sourceRoot":""}]);
// exports
/***/ }),
/***/ 4524:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_spin_style_css__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_spin_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_spin_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_spin__ = __webpack_require__(73);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_spin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_spin__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_modal_style_css__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_modal_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_modal_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_modal__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_modal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_modal__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_icon_style_css__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_icon_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_icon_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_icon__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_icon___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_icon__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_message_style_css__ = __webpack_require__(184);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_message_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_antd_lib_message_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_message__ = __webpack_require__(185);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_message___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_antd_lib_message__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_educoder__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__DetailCardsEditAndAdd__ = __webpack_require__(3207);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__DetailCardsEditAndEdit__ = __webpack_require__(3208);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_react_router_dom__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_react_beautiful_dnd__ = __webpack_require__(1537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__modals_Modals__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__paths_ShixunPaths_css__ = __webpack_require__(1900);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__paths_ShixunPaths_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18__paths_ShixunPaths_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 $=window.$;//
// //a little function to help us with reordering the result
// const reorder = (list, startIndex, endIndex) => {
// let newlist=list;
// const result = Array.from(newlist.shixuns_list);
// const [removed] = result.splice(startIndex, 1);
// result.splice(endIndex, 0, removed);
// newlist.shixuns_list=result;
// return newlist;
// };
//
var DetailCards=function(_Component){_inherits(DetailCards,_Component);function DetailCards(props){_classCallCheck(this,DetailCards);var _this=_possibleConstructorReturn(this,(DetailCards.__proto__||Object.getPrototypeOf(DetailCards)).call(this,props));_this.for_paragraph=function(index){$("#detail_for_paragraph_"+index).slideToggle(500);};_this.pathCardsedit=function(key,pathid){var url='/stages/'+pathid+'/edit.json';__WEBPACK_IMPORTED_MODULE_15_axios___default.a.get(url).then(function(result){if(result.status===200){_this.setState({idsum:key,pathCardsedittype:true,pathlistedit:result.data,editbuttomtype:true,editbuttomtypeadd:true});}}).catch(function(error){console.log(error);});};_this.updatapathCardsedit=function(){_this.setState({idsum:undefined,pathCardsedittype:false,editbuttomtype:false,editbuttomtypeadd:false});_this.getPathCardsList();_this.props.updatadetailInfoLists();};_this.delectpathCardsedit=function(id){_this.setState({Modalstype:true,Modalstopval:'是否删除该章节?',Modalsbottomval:'',editdelectid:id,delecttype:true});};_this.delectpathCardseditfun=function(){var _this$state=_this.state,delecttype=_this$state.delecttype,editdelectid=_this$state.editdelectid;var id=editdelectid;if(delecttype===true){var url='/stages/'+id+'.json';__WEBPACK_IMPORTED_MODULE_15_axios___default.a.delete(url).then(function(response){if(response.data.status===1){// window.location.href = "/paths/" + response.data.subject_id
_this.setState({idsum:undefined,pathCardsedittype:false,Modalstype:false,Modalstopval:'',Modalsbottomval:'',cardsModalsave:_this.cardsModalsave,delecttype:false,editdelectid:undefined});// this.getPathCardsList();
_this.updatapathCardsedit();}}).catch(function(error){console.log(error);});}};_this.operations=function(url){var newurl=url+".json";__WEBPACK_IMPORTED_MODULE_15_axios___default.a.get(newurl).then(function(response){if(response.data.status===1){_this.getPathCardsList();}}).catch(function(error){console.log(error);});};_this.startgameid=function(id){if(_this.props.checkIfLogin()===false){_this.props.showLoginDialog();return;}if(_this.props.checkIfProfileCompleted()===false){_this.props.showProfileCompleteDialog();return;}// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
var url="/shixuns/"+id+"/shixun_exec.json";__WEBPACK_IMPORTED_MODULE_15_axios___default.a.get(url).then(function(response){if(response.data.status===-2){_this.setState({shixunsreplace:true,hidestartshixunsreplacevalue:response.data.message+".json"});}else if(response.data.status===-1){console.log(response);}else if(response.data.status===-3){_this.setState({shixunsmessage:response.data.message,startshixunCombattype:true});}else{// window.location.href = "/tasks/" + response.data.game_identifier;
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
window.open("/tasks/"+response.data.game_identifier);}}).catch(function(error){});};_this.hidestartshixunsreplace=function(url){_this.setState({isSpin:true});__WEBPACK_IMPORTED_MODULE_15_axios___default.a.get(url).then(function(response){// debugger
if(response.status===200){// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
__WEBPACK_IMPORTED_MODULE_9_antd_lib_message___default.a.success('重置成功,正在进入实训!');_this.startgameid(response.data.shixun_identifier);_this.setState({shixunsreplace:false,isSpin:false,startbtn:false});// message.success('重置成功,正在进入实训!');
// this.startshixunCombat();
}}).catch(function(error){});};_this.cardsModalcancel=function(){_this.setState({Modalstype:false,Modalstopval:'',Modalsbottomval:'',editdelectid:undefined});};_this.cardsModalsave=function(){_this.setState({Modalstype:false,Modalstopval:'',Modalsbottomval:'',editdelectid:undefined});};_this.editeditbuttomtypecanle=function(){_this.setState({editbuttomtype:true,editbuttomtypeadd:false});};_this.showparagraph=function(key,index){_this.setState({showparagraph:true,showparagraphkey:key,showparagraphindex:index});};_this.hideparagraph=function(){_this.setState({showparagraph:false});};_this.hidestartshixunCombattype=function(){_this.setState({startshixunCombattype:false});};_this.Pathlisteditundefined=function(){_this.setState({pathlistedit:undefined});};_this.state={pathCardsList:undefined,dropid:undefined,dropidtype:false,idsum:undefined,pathCardsedittype:false,pathlistedit:undefined,pathid:undefined,Modalstype:false,Modalstopval:'',Modalsbottomval:'',cardsModalsave:_this.cardsModalsave,cardsModalcancel:_this.cardsModalcancel,delecttype:false,editdelectid:undefined,editbuttomtype:false,editbuttomtypeadd:false,showparagraph:false,showparagraphkey:"",showparagraphindex:"",isSpin:false// this.onDragEnd = this.onDragEnd.bind(this);
};return _this;}_createClass(DetailCards,[{key:'getPathCardsList',value:function getPathCardsList(){var _this2=this;var pathid=this.props.match.params.pathId;var url='/stages.json?subject_id='+pathid;__WEBPACK_IMPORTED_MODULE_15_axios___default.a.get(url).then(function(result){if(result.status===200){_this2.setState({pathCardsList:result.data.stages});}}).catch(function(error){console.log(error);});}},{key:'componentDidMount',value:function componentDidMount(){var pathid=this.props.match.params.pathId;this.setState({pathid:pathid});this.getPathCardsList();}// onDragStart = () => {
// /*...*/
// };
// onDragUpdate = () => {
// /*...*/
// }
//
// onDragEnd (result) {
//
// let{pathCardsList}=this.state;
// // dropped outside the list
// let newpathCardsList=pathCardsList;
// if(!result.destination) {
// return;
// }
// var sum=result.source.droppableId.replace('ids','')
// sum=parseInt(sum)
//
// const items = reorder(
// newpathCardsList[sum],
// result.source.index,
// result.destination.index
// );
// newpathCardsList[sum]=items
// this.setState({
// pathCardsList:newpathCardsList
// })
// }
// 关卡的上移下移操作
},{key:'render',value:function render(){var _this3=this;var _state=this.state,pathCardsList=_state.pathCardsList,dropid=_state.dropid,idsum=_state.idsum,pathCardsedittype=_state.pathCardsedittype,pathlistedit=_state.pathlistedit,pathid=_state.pathid,Modalstype=_state.Modalstype,Modalstopval=_state.Modalstopval,Modalsbottomval=_state.Modalsbottomval,cardsModalsave=_state.cardsModalsave,cardsModalcancel=_state.cardsModalcancel,delecttype=_state.delecttype,hidestartshixunsreplacevalue=_state.hidestartshixunsreplacevalue,editbuttomtype=_state.editbuttomtype,editbuttomtypeadd=_state.editbuttomtypeadd,showparagraph=_state.showparagraph,showparagraphkey=_state.showparagraphkey,showparagraphindex=_state.showparagraphindex;var antIcon=__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_icon___default.a,{type:'loading',style:{fontSize:24},spin:true});// console.log("zzz"+this.props.MenuItemsindextype)
// console.log(this.props.detailInfoList&&this.props.detailInfoList.allow_visit)
return __WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_17__modals_Modals__["a" /* default */],{modalsType:Modalstype,modalsTopval:Modalstopval,modalsBottomval:Modalsbottomval,modalCancel:cardsModalcancel,modalSave:delecttype===true?this.delectpathCardseditfun:cardsModalsave}),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_modal___default.a,{keyboard:false,title:'\u63D0\u793A',visible:this.state.startshixunCombattype,closable:false,footer:null},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'task-popup-content'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('p',{className:'task-popup-text-center font-16 pb20'},'\u76EE\u524D\u8BE5\u5B9E\u8BAD\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E',this.state.shixunsmessage,'\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01')),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'task-popup-submit clearfix'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',{className:'task-btn task-btn-orange fr',style:{marginRight:'51px'},onClick:this.hidestartshixunCombattype},'\u77E5\u9053\u4E86'))),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_modal___default.a,{keyboard:false,title:'\u63D0\u793A',visible:this.state.shixunsreplace,closable:false,footer:null},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_spin___default.a,{indicator:antIcon,spinning:this.state.isSpin},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'task-popup-content'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('p',{className:'task-popup-text-center font-16 pb20'},'\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!')),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'task-popup-submit clearfix'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',{className:'task-btn task-btn-orange fr',style:{marginRight:'51px'},onClick:function onClick(){return _this3.hidestartshixunsreplace(hidestartshixunsreplacevalue);}},'\u77E5\u9053\u4E86')))),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('style',null,'\n\t\t\t\t\t\t .lessonvalue{\n\t\t\t\t\t\t\t\tmax-width: 556px;\n\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\t\t\t\t\twhite-space: nowrap;\n\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t'),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'lesson-saved-list'},pathCardsList&&pathCardsList.map(function(item,key){return __WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:"lesson-saved-list-item",id:"stage_div_"+key},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('p',{className:'clearfix title-line'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',{className:'fl ring-blue mr10 mt2'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('img',{src:Object(__WEBPACK_IMPORTED_MODULE_11_educoder__["M" /* getImageUrl */])("images/educoder/icon/charpter-white.svg"),className:'fl ml3 mt3'})),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('span',{className:'font-18 font-bd lessonvalue',title:item.stage_name},item.stage_name),idsum===key&&pathCardsedittype===true?'':_this3.props.detailInfoList===undefined?"":_this3.props.current_user&&_this3.props.current_user.admin===true||_this3.props.current_user&&_this3.props.current_user.business===true?__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',null,__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',{className:'fr mtf3'},editbuttomtype===true?'':__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip___default.a,{placement:'bottom',title:'\u7F16\u8F91',onClick:functio
// idsum===key&&pathCardsedittype===true?'':
// <div className="detail_for_paragraph clearfix" id={"detail_for_paragraph_"+key}>
// <p className="color-dark-grey mt20 mb25 ml20 mr20 pl28 justify font-15">{item.stage_description}</p>
//
//
// <DragDropContext onDragEnd={this.onDragEnd}>
// <Droppable
// droppableId={'ids'+key}
// >
// {(provided, snapshot) => (
//
// <div
// ref={provided.innerRef}
// {...provided.droppableProps}
// >
//
// {
// item.shixuns_list && item.shixuns_list.map((line,index)=>{
// return(
// <Draggable
// key={'id'+index}
// draggableId={'id'+index}
// index={index}
// >
// {(provided, snapshot) => (
// <div className="clearfix paragraph lineh-30"
// ref={provided.innerRef}
// {...provided.draggableProps}
// {...provided.dragHandleProps}
// >
//
// <li className="fl li-width63">
//
// <span className="progressRing mr10">
// {
// line.complete_status === 1 ?<i className="iconfont icon-wancheng progressRing-over font-18 mt10"></i>
// :<i className="iconfont icon-bofang progressRing-part font-18 mt10"></i>
// }
//
// </span>
//
// <span className={line.shixun_status==="暂未公开"?"paragraph_name color204":"paragraph_name color-grey3"}>
// <span className="subject_stage_shixun_index">{key+1}</span>-{index+1}&nbsp;&nbsp;{line.shixun_name}
// </span>
//
// </li>
// {
// line.shixun_status==="暂未公开"?
// <li className="fr status_li"><span className="fr color204">暂未公开</span></li>
// :
// <li className="fr status_li">
// <a href={line.shixun_path} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</a>
// <a href={line.tpi_path} class="btn_auto user_bluebg_btn fl" id="shixun_operation" target="_blank">开始实战</a>
// </li>
// }
// {provided.placeholder}
// </div>
// )}
// </Draggable>
// )
// })
// }
// </div>
// )}
// </Droppable>
// </DragDropContext>
// </div>
// }
/***/ }),
/***/ 4525:
/***/ (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_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_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_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_axios__);
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 Search=__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a.Search;var CheckboxGroup=__WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox___default.a.Group;var addCollaborators=function(_Component){_inherits(addCollaborators,_Component);function addCollaborators(props){_classCallCheck(this,addCollaborators);var _this=_possibleConstructorReturn(this,(addCollaborators.__proto__||Object.getPrototypeOf(addCollaborators)).call(this,props));_this.addBox=function(){_this.setState({addPartner:true,search:"",page:1,partnerList:undefined,optionss:[]});_this.searchList("");};_this.hideAddBox=function(){_this.setState({addPartner:false,optionss:[],partnerListid:[]});};_this.changeSearchValue=function(e){_this.setState({search:e.target.value});};_this.searchList=function(){var id=_this.props.match.params.pathId;var _this$state=_this.state,search=_this$state.search,page=_this$state.page;var url='/paths/'+id+'/search_members.json?search='+search+"&page="+page;__WEBPACK_IMPORTED_MODULE_7_axios___default.a.post(url).then(function(result){if(result.status==200){var list=result.data.users;var optionss=[];for(var i=0;i<list.length;i++){optionss.push(list[i].user_id);}_this.setState({partnerList:result.data.users,page:1,optionss:optionss});}}).catch(function(error){console.log(error);});};_this.SaveAddBox=function(){var partnerListid=_this.state.partnerListid;var id=_this.props.match.params.pathId;var url="/paths/"+id+"/add_subject_members.json";if(partnerListid.length===0){_this.setState({useristrue:true});return;}__WEBPACK_IMPORTED_MODULE_7_axios___default.a.post(url,{user_ids:partnerListid}).then(function(response){if(response.status==200){_this.setState({addPartner:false,optionss:[],partnerListid:[]});_this.props.updatadetailInfoLists();}}).catch(function(error){console.log(error);});};_this.addCollaboratorsid=function(id){if(id.length===0){_this.setState({partnerListid:id});}else{_this.setState({partnerListid:id,useristrue:false});}};_this.onCheckAllChange=function(e){var optionss=_this.state.optionss;if(e.target.checked===true){_this.setState({checkAll:e.target.checked,partnerListid:optionss});}else{_this.setState({checkAll:e.target.checked,partnerListid:[]});}};_this.contentViewScroll=function(e){//滑动到底判断
var newscrollTop=parseInt(e.currentTarget.scrollTop);var allclientHeight=e.currentTarget.clientHeight+newscrollTop;if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){// console.log("到达底部");
var id=_this.props.match.params.pathId;var _this$state2=_this.state,search=_this$state2.search,page=_this$state2.page,partnerList=_this$state2.partnerList,optionss=_this$state2.optionss;var newpage=page+1;var url='/paths/'+id+'/search_members.json?search='+search+"&page="+newpage;__WEBPACK_IMPORTED_MODULE_7_axios___default.a.post(url).then(function(result){if(result){var list=result.data.users;var newlist=partnerList;for(var j=0;j<list.length;j++){newlist.push(list[j]);}var newoptionss=optionss;for(var i=0;i<list.length;i++){newoptionss.push(list[i].user_id);}_this.setState({partnerList:newlist,page:newpage,optionss:optionss});}}).catch(function(error){console.log(error);});}};_this.state={addPartner:false,page:1,partnerList:undefined,search:'',partnerListid:[],checkAll:false,optionss:[],useristrue:false};return _this;}// 搜索框输入
// 回车搜索--搜索成功后page为1
_createClass(addCollaborators,[{key:'render',value:function render(){var _this2=this;var _state=this.state,addPartner=_state.addPartner,search=_state.search,partnerList=_state.partnerList,optionss=_state.optionss,checkAll=_state.checkAll,partnerListid=_state.partnerListid,useristrue=_state.useristrue;return this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true?__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'edu-back-white bor-top-greyE addTeamMember'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('a',{onClick:this.addBox,className:'color-blue'},'+ \u6DFB\u52A0\u5408\u4F5C\u8005'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_modal___default.a,{keyboard:false,title:'\u6DFB\u52A0\u5408\u4F5C\u8005',visible:addPartner,closable:false,footer:null,destroyOnClose:true},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'newupload_conbox clearfix'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'mb20'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Search,{placeholder:'\u8F93\u5165\u7528\u6237\u7684\u771F\u5B9E\u59D3\u540D\u8FDB\u884C\u641C\u7D22',id:'search_not_collaborators',style:{"width":"100%"},autocomplete:'off',value:search,onInput:this.changeSearchValue,onSearch:function onSearch(search){return _this2.searchList(search);}})),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'clearfix pt10 pl10 pr10',style:{"background":"#F4FAFF","marginBottom":"0px"}},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox___default.a,{className:'fl',onChange:this.onCheckAllChange,checked:this.state.checkAll}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'span1 fl edu-txt-w80 task-hide font-bd'},'\u59D3\u540D'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'span3 fl edu-txt-w80 task-hide font-bd'},'\u6635\u79F0'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'span2 fl edu-txt-w80 task-hide font-bd'},'\u804C\u4F4D'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'span3 fl edu-txt-w260 task-hide font-bd'},'\u5355\u4F4D')),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('ul',{className:'upload_select_box fl clearfix mb15',style:{"overflow-y":"auto"},id:'search_not_members_list',onScroll:this.contentViewScroll},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(CheckboxGroup,{style:{width:'100%'},value:checkAll===true?optionss:partnerListid,onChange:this.addCollaboratorsid},partnerList&&partnerList.map(function(item,key){return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('li',{className:'clearfix',key:key},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox___default.a,{value:item.user_id,key:item.user_id,className:'fl'}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('a',{target:'_blank',className:'task-hide color-grey3 fl span1 edu-txt-w80'},item.user_name),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'task-hide fl color-grey edu-txt-w80 span2'},item.nickname),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'task-hide fl color-grey edu-txt-w80 span2'},item.identity),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:'span3 color-grey fl edu-txt-w260 task-hide'},item.school_name));}))),useristrue===true?__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span',{className:"color-red"},'\u8BF7\u5148\u9009\u62E9\u7528\u6237'):"",__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'mt20 marginauto clearfix edu-txt-center'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('a',{onClick:this.hideAddBox,className:'pop_close task-btn mr30'},'\u53D6\u6D88'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('a
/***/ }),
/***/ 4526:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process, module) {/* unused harmony export createGlobalStyle */
/* unused harmony export css */
/* unused harmony export isStyledComponent */
/* unused harmony export keyframes */
/* unused harmony export ServerStyleSheet */
/* unused harmony export StyleSheetConsumer */
/* unused harmony export StyleSheetContext */
/* unused harmony export StyleSheetManager */
/* unused harmony export ThemeConsumer */
/* unused harmony export ThemeContext */
/* unused harmony export ThemeProvider */
/* unused harmony export withTheme */
/* unused harmony export __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis_stylis_min__ = __webpack_require__(4527);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis_stylis_min___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_stylis_stylis_min__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_stylis_rule_sheet__ = __webpack_require__(4528);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_stylis_rule_sheet___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_stylis_rule_sheet__);
/* 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__emotion_unitless__ = __webpack_require__(4529);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react_is__ = __webpack_require__(1004);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react_is___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react_is__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_memoize_one__ = __webpack_require__(1584);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_dom__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__emotion_is_prop_valid__ = __webpack_require__(4530);
//
var interleave = (function (strings, interpolations) {
var result = [strings[0]];
for (var i = 0, len = interpolations.length; i < len; i += 1) {
result.push(interpolations[i], strings[i + 1]);
}
return result;
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
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;
};
}();
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
var possibleConstructorReturn = function (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;
};
//
var isPlainObject = (function (x) {
return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
});
//
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});
//
function isFunction(test) {
return typeof test === 'function';
}
//
function getComponentName(target) {
return ( false ? typeof target === 'string' && target : false) || target.displayName || target.name || 'Component';
}
//
function isStatelessFunction(test) {
return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
}
//
function isStyledComponent(target) {
return target && typeof target.styledComponentId === 'string';
}
//
var SC_ATTR = typeof process !== 'undefined' && Object({"NODE_ENV":"production","PUBLIC_URL":"/react/build/."}).SC_ATTR || 'data-styled';
var SC_VERSION_ATTR = 'data-styled-version';
var SC_STREAM_ATTR = 'data-styled-streamed';
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
var DISABLE_SPEEDY = typeof SC_DISABLE_SPEEDY === 'boolean' && SC_DISABLE_SPEEDY || "production" !== 'production';
// Shared empty execution context when generating static styles
var STATIC_EXECUTION_CONTEXT = {};
//
/**
* Parse errors.md and turn it into a simple hash of code: message
*/
var ERRORS = false ? {
"1": "Cannot create styled-component for component: %s.\n\n",
"2": "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",
"3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
"4": "The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",
"5": "The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",
"6": "Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",
"7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
"8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
"9": "Missing document `<head>`\n\n",
"10": "Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",
"11": "_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",
"12": "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper (see https://www.styled-components.com/docs/api#css), which ensures the styles are injected correctly.\n\n",
"13": "%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n"
} : {};
/**
* super basic version of sprintf
*/
function format() {
var a = arguments.length <= 0 ? undefined : arguments[0];
var b = [];
for (var c = 1, len = arguments.length; c < len; c += 1) {
b.push(arguments.length <= c ? undefined : arguments[c]);
}
b.forEach(function (d) {
a = a.replace(/%[a-z]/, d);
});
return a;
}
/**
* Create an error file out of errors.md for development and a simple web link to the full errors
* in production mode.
*/
var StyledComponentsError = function (_Error) {
inherits(StyledComponentsError, _Error);
function StyledComponentsError(code) {
classCallCheck(this, StyledComponentsError);
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
if (true) {
var _this = possibleConstructorReturn(this, _Error.call(this, 'An error occurred. See https://github.com/styled-components/styled-components/blob/master/packages/styled-components/src/utils/errors.md#' + code + ' for more information. ' + (interpolations ? 'Additional arguments: ' + interpolations.join(', ') : '')));
} else {
var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));
}
return possibleConstructorReturn(_this);
}
return StyledComponentsError;
}(Error);
//
var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;
var extractComps = (function (maybeCSS) {
var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
var existingComponents = [];
css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
return match;
});
return existingComponents.map(function (_ref, i) {
var componentId = _ref.componentId,
matchIndex = _ref.matchIndex;
var nextComp = existingComponents[i + 1];
var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
return { componentId: componentId, cssFromDOM: cssFromDOM };
});
});
//
var COMMENT_REGEX = /^\s*\/\/.*$/gm;
// NOTE: This stylis instance is only used to split rules from SSR'd style tags
var stylisSplitter = new __WEBPACK_IMPORTED_MODULE_0_stylis_stylis_min___default.a({
global: false,
cascade: true,
keyframe: false,
prefix: false,
compress: false,
semicolon: true
});
var stylis = new __WEBPACK_IMPORTED_MODULE_0_stylis_stylis_min___default.a({
global: false,
cascade: true,
keyframe: false,
prefix: true,
compress: false,
semicolon: false // NOTE: This means "autocomplete missing semicolons"
});
// Wrap `insertRulePlugin to build a list of rules,
// and then make our own plugin to return the rules. This
// makes it easier to hook into the existing SSR architecture
var parsingRules = [];
// eslint-disable-next-line consistent-return
var returnRulesPlugin = function returnRulesPlugin(context) {
if (context === -2) {
var parsedRules = parsingRules;
parsingRules = [];
return parsedRules;
}
};
var parseRulesPlugin = __WEBPACK_IMPORTED_MODULE_1_stylis_rule_sheet___default()(function (rule) {
parsingRules.push(rule);
});
var _componentId = void 0;
var _selector = void 0;
var _selectorRegexp = void 0;
var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
if (
// the first self-ref is always untouched
offset > 0 &&
// there should be at least two self-refs to do a replacement (.b > .b)
string.slice(0, offset).indexOf(_selector) !== -1 &&
// no consecutive self refs (.b.b); that is a precedence boost and treated differently
string.slice(offset - _selector.length, offset) !== _selector) {
return '.' + _componentId;
}
return match;
};
/**
* When writing a style like
*
* & + & {
* color: red;
* }
*
* The second ampersand should be a reference to the static component class. stylis
* has no knowledge of static class so we have to intelligently replace the base selector.
*/
var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
// eslint-disable-next-line no-param-reassign
selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
}
};
stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);
stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);
var splitByRules = function splitByRules(css) {
return stylisSplitter('', css);
};
function stringifyRules(rules, selector, prefix) {
var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';
var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments
var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
// stylis has no concept of state to be passed to plugins
// but since JS is single=threaded, we can rely on that to ensure
// these properties stay in sync with the current stylis run
_componentId = componentId;
_selector = selector;
_selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g');
return stylis(prefix || !selector ? '' : selector, cssStr);
}
//
/* eslint-disable camelcase, no-undef */
var getNonce = (function () {
return true ? __webpack_require__.nc : null;
});
//
/* These are helpers for the StyleTags to keep track of the injected
* rule names for each (component) ID that they're keeping track of.
* They're crucial for detecting whether a name has already been
* injected.
* (This excludes rehydrated names) */
/* adds a new ID:name pairing to a names dictionary */
var addNameForId = function addNameForId(names, id, name) {
if (name) {
// eslint-disable-next-line no-param-reassign
var namesForId = names[id] || (names[id] = Object.create(null));
namesForId[name] = true;
}
};
/* resets an ID entirely by overwriting it in the dictionary */
var resetIdNames = function resetIdNames(names, id) {
// eslint-disable-next-line no-param-reassign
names[id] = Object.create(null);
};
/* factory for a names dictionary checking the existance of an ID:name pairing */
var hasNameForId = function hasNameForId(names) {
return function (id, name) {
return names[id] !== undefined && names[id][name];
};
};
/* stringifies names for the html/element output */
var stringifyNames = function stringifyNames(names) {
var str = '';
// eslint-disable-next-line guard-for-in
for (var id in names) {
str += Object.keys(names[id]).join(' ') + ' ';
}
return str.trim();
};
/* clones the nested names dictionary */
var cloneNames = function cloneNames(names) {
var clone = Object.create(null);
// eslint-disable-next-line guard-for-in
for (var id in names) {
clone[id] = _extends({}, names[id]);
}
return clone;
};
//
/* These are helpers that deal with the insertRule (aka speedy) API
* They are used in the StyleTags and specifically the speedy tag
*/
/* retrieve a sheet for a given style tag */
var sheetForTag = function sheetForTag(tag) {
// $FlowFixMe
if (tag.sheet) return tag.sheet;
/* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
var size = document.styleSheets.length;
for (var i = 0; i < size; i += 1) {
var sheet = document.styleSheets[i];
// $FlowFixMe
if (sheet.ownerNode === tag) return sheet;
}
/* we should always be able to find a tag */
throw new StyledComponentsError(10);
};
/* insert a rule safely and return whether it was actually injected */
var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
/* abort early if cssRule string is falsy */
if (!cssRule) return false;
var maxIndex = sheet.cssRules.length;
try {
/* use insertRule and cap passed index with maxIndex (no of cssRules) */
sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
} catch (err) {
/* any error indicates an invalid rule */
return false;
}
return true;
};
/* deletes `size` rules starting from `removalIndex` */
var deleteRules = function deleteRules(sheet, removalIndex, size) {
var lowerBound = removalIndex - size;
for (var i = removalIndex; i > lowerBound; i -= 1) {
sheet.deleteRule(i);
}
};
//
/* this marker separates component styles and is important for rehydration */
var makeTextMarker = function makeTextMarker(id) {
return '\n/* sc-component-id: ' + id + ' */\n';
};
/* add up all numbers in array up until and including the index */
var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
var totalUpToIndex = 0;
for (var i = 0; i <= index; i += 1) {
totalUpToIndex += sizes[i];
}
return totalUpToIndex;
};
/* create a new style tag after lastEl */
var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
var el = document.createElement('style');
el.setAttribute(SC_ATTR, '');
el.setAttribute(SC_VERSION_ATTR, "4.2.0");
var nonce = getNonce();
if (nonce) {
el.setAttribute('nonce', nonce);
}
/* Work around insertRule quirk in EdgeHTML */
el.appendChild(document.createTextNode(''));
if (target && !tagEl) {
/* Append to target when no previous element was passed */
target.appendChild(el);
} else {
if (!tagEl || !target || !tagEl.parentNode) {
throw new StyledComponentsError(6);
}
/* Insert new style tag after the previous one */
tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
}
return el;
};
/* takes a css factory function and outputs an html styled tag factory */
var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
return function (additionalAttrs) {
var nonce = getNonce();
var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', SC_VERSION_ATTR + '="' + "4.2.0" + '"', additionalAttrs];
var htmlAttr = attrs.filter(Boolean).join(' ');
return '<style ' + htmlAttr + '>' + css() + '</style>';
};
};
/* takes a css factory function and outputs an element factory */
var wrapAsElement = function wrapAsElement(css, names) {
return function () {
var _props;
var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = "4.2.0", _props);
var nonce = getNonce();
if (nonce) {
// $FlowFixMe
props.nonce = nonce;
}
// eslint-disable-next-line react/no-danger
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
};
};
var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
return function () {
return Object.keys(markers);
};
};
/* speedy tags utilise insertRule */
var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
var names = Object.create(null);
var markers = Object.create(null);
var sizes = [];
var extractImport = getImportRuleTag !== undefined;
/* indicates whether getImportRuleTag was called */
var usedImportRuleTag = false;
var insertMarker = function insertMarker(id) {
var prev = markers[id];
if (prev !== undefined) {
return prev;
}
markers[id] = sizes.length;
sizes.push(0);
resetIdNames(names, id);
return markers[id];
};
var insertRules = function insertRules(id, cssRules, name) {
var marker = insertMarker(id);
var sheet = sheetForTag(el);
var insertIndex = addUpUntilIndex(sizes, marker);
var injectedRules = 0;
var importRules = [];
var cssRulesSize = cssRules.length;
for (var i = 0; i < cssRulesSize; i += 1) {
var cssRule = cssRules[i];
var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
importRules.push(cssRule);
} else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
mayHaveImport = false;
injectedRules += 1;
}
}
if (extractImport && importRules.length > 0) {
usedImportRuleTag = true;
// $FlowFixMe
getImportRuleTag().insertRules(id + '-import', importRules);
}
sizes[marker] += injectedRules; /* add up no of injected rules */
addNameForId(names, id, name);
};
var removeRules = function removeRules(id) {
var marker = markers[id];
if (marker === undefined) return;
var size = sizes[marker];
var sheet = sheetForTag(el);
var removalIndex = addUpUntilIndex(sizes, marker) - 1;
deleteRules(sheet, removalIndex, size);
sizes[marker] = 0;
resetIdNames(names, id);
if (extractImport && usedImportRuleTag) {
// $FlowFixMe
getImportRuleTag().removeRules(id + '-import');
}
};
var css = function css() {
var _sheetForTag = sheetForTag(el),
cssRules = _sheetForTag.cssRules;
var str = '';
// eslint-disable-next-line guard-for-in
for (var id in markers) {
str += makeTextMarker(id);
var marker = markers[id];
var end = addUpUntilIndex(sizes, marker);
var size = sizes[marker];
for (var i = end - size; i < end; i += 1) {
var rule = cssRules[i];
if (rule !== undefined) {
str += rule.cssText;
}
}
}
return str;
};
return {
clone: function clone() {
throw new StyledComponentsError(5);
},
css: css,
getIds: getIdsFromMarkersFactory(markers),
hasNameForId: hasNameForId(names),
insertMarker: insertMarker,
insertRules: insertRules,
removeRules: removeRules,
sealed: false,
styleTag: el,
toElement: wrapAsElement(css, names),
toHTML: wrapAsHtmlTag(css, names)
};
};
var makeTextNode = function makeTextNode(id) {
return document.createTextNode(makeTextMarker(id));
};
var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
var names = Object.create(null);
var markers = Object.create(null);
var extractImport = getImportRuleTag !== undefined;
/* indicates whether getImportRuleTag was called */
var usedImportRuleTag = false;
var insertMarker = function insertMarker(id) {
var prev = markers[id];
if (prev !== undefined) {
return prev;
}
markers[id] = makeTextNode(id);
el.appendChild(markers[id]);
names[id] = Object.create(null);
return markers[id];
};
var insertRules = function insertRules(id, cssRules, name) {
var marker = insertMarker(id);
var importRules = [];
var cssRulesSize = cssRules.length;
for (var i = 0; i < cssRulesSize; i += 1) {
var rule = cssRules[i];
var mayHaveImport = extractImport;
if (mayHaveImport && rule.indexOf('@import') !== -1) {
importRules.push(rule);
} else {
mayHaveImport = false;
var separator = i === cssRulesSize - 1 ? '' : ' ';
marker.appendData('' + rule + separator);
}
}
addNameForId(names, id, name);
if (extractImport && importRules.length > 0) {
usedImportRuleTag = true;
// $FlowFixMe
getImportRuleTag().insertRules(id + '-import', importRules);
}
};
var removeRules = function removeRules(id) {
var marker = markers[id];
if (marker === undefined) return;
/* create new empty text node and replace the current one */
var newMarker = makeTextNode(id);
el.replaceChild(newMarker, marker);
markers[id] = newMarker;
resetIdNames(names, id);
if (extractImport && usedImportRuleTag) {
// $FlowFixMe
getImportRuleTag().removeRules(id + '-import');
}
};
var css = function css() {
var str = '';
// eslint-disable-next-line guard-for-in
for (var id in markers) {
str += markers[id].data;
}
return str;
};
return {
clone: function clone() {
throw new StyledComponentsError(5);
},
css: css,
getIds: getIdsFromMarkersFactory(markers),
hasNameForId: hasNameForId(names),
insertMarker: insertMarker,
insertRules: insertRules,
removeRules: removeRules,
sealed: false,
styleTag: el,
toElement: wrapAsElement(css, names),
toHTML: wrapAsHtmlTag(css, names)
};
};
var makeServerTag = function makeServerTag(namesArg, markersArg) {
var names = namesArg === undefined ? Object.create(null) : namesArg;
var markers = markersArg === undefined ? Object.create(null) : markersArg;
var insertMarker = function insertMarker(id) {
var prev = markers[id];
if (prev !== undefined) {
return prev;
}
return markers[id] = [''];
};
var insertRules = function insertRules(id, cssRules, name) {
var marker = insertMarker(id);
marker[0] += cssRules.join(' ');
addNameForId(names, id, name);
};
var removeRules = function removeRules(id) {
var marker = markers[id];
if (marker === undefined) return;
marker[0] = '';
resetIdNames(names, id);
};
var css = function css() {
var str = '';
// eslint-disable-next-line guard-for-in
for (var id in markers) {
var cssForId = markers[id][0];
if (cssForId) {
str += makeTextMarker(id) + cssForId;
}
}
return str;
};
var clone = function clone() {
var namesClone = cloneNames(names);
var markersClone = Object.create(null);
// eslint-disable-next-line guard-for-in
for (var id in markers) {
markersClone[id] = [markers[id][0]];
}
return makeServerTag(namesClone, markersClone);
};
var tag = {
clone: clone,
css: css,
getIds: getIdsFromMarkersFactory(markers),
hasNameForId: hasNameForId(names),
insertMarker: insertMarker,
insertRules: insertRules,
removeRules: removeRules,
sealed: false,
styleTag: null,
toElement: wrapAsElement(css, names),
toHTML: wrapAsHtmlTag(css, names)
};
return tag;
};
var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
if (IS_BROWSER && !forceServer) {
var el = makeStyleTag(target, tagEl, insertBefore);
if (DISABLE_SPEEDY) {
return makeBrowserTag(el, getImportRuleTag);
} else {
return makeSpeedyTag(el, getImportRuleTag);
}
}
return makeServerTag();
};
var rehydrate = function rehydrate(tag, els, extracted) {
/* add all extracted components to the new tag */
for (var i = 0, len = extracted.length; i < len; i += 1) {
var _extracted$i = extracted[i],
componentId = _extracted$i.componentId,
cssFromDOM = _extracted$i.cssFromDOM;
var cssRules = splitByRules(cssFromDOM);
tag.insertRules(componentId, cssRules);
}
/* remove old HTMLStyleElements, since they have been rehydrated */
for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
var el = els[_i];
if (el.parentNode) {
el.parentNode.removeChild(el);
}
}
};
//
var SPLIT_REGEX = /\s+/;
/* determine the maximum number of components before tags are sharded */
var MAX_SIZE = void 0;
if (IS_BROWSER) {
/* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
} else {
/* for servers we do not need to shard at all */
MAX_SIZE = -1;
}
var sheetRunningId = 0;
var master = void 0;
var StyleSheet = function () {
/* a map from ids to tags */
/* deferred rules for a given id */
/* this is used for not reinjecting rules via hasNameForId() */
/* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
/* a list of tags belonging to this StyleSheet */
/* a tag for import rules */
/* current capacity until a new tag must be created */
/* children (aka clones) of this StyleSheet inheriting all and future injections */
function StyleSheet() {
var _this = this;
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
classCallCheck(this, StyleSheet);
this.getImportRuleTag = function () {
var importRuleTag = _this.importRuleTag;
if (importRuleTag !== undefined) {
return importRuleTag;
}
var firstTag = _this.tags[0];
var insertBefore = true;
return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
};
sheetRunningId += 1;
this.id = sheetRunningId;
this.forceServer = forceServer;
this.target = forceServer ? null : target;
this.tagMap = {};
this.deferred = {};
this.rehydratedNames = {};
this.ignoreRehydratedNames = {};
this.tags = [];
this.capacity = 1;
this.clones = [];
}
/* rehydrate all SSR'd style tags */
StyleSheet.prototype.rehydrate = function rehydrate$$1() {
if (!IS_BROWSER || this.forceServer) return this;
var els = [];
var extracted = [];
var isStreamed = false;
/* retrieve all of our SSR style elements from the DOM */
var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '="' + "4.2.0" + '"]');
var nodesSize = nodes.length;
/* abort rehydration if no previous style tags were found */
if (!nodesSize) return this;
for (var i = 0; i < nodesSize; i += 1) {
var el = nodes[i];
/* check if style tag is a streamed tag */
if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);
/* retrieve all component names */
var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
var elNamesSize = elNames.length;
for (var j = 0, name; j < elNamesSize; j += 1) {
name = elNames[j];
/* add rehydrated name to sheet to avoid re-adding styles */
this.rehydratedNames[name] = true;
}
/* extract all components and their CSS */
extracted.push.apply(extracted, extractComps(el.textContent));
/* store original HTMLStyleElement */
els.push(el);
}
/* abort rehydration if nothing was extracted */
var extractedSize = extracted.length;
if (!extractedSize) return this;
/* create a tag to be used for rehydration */
var tag = this.makeTag(null);
rehydrate(tag, els, extracted);
/* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
this.capacity = Math.max(1, MAX_SIZE - extractedSize);
this.tags.push(tag);
/* retrieve all component ids */
for (var _j = 0; _j < extractedSize; _j += 1) {
this.tagMap[extracted[_j].componentId] = tag;
}
return this;
};
/* retrieve a "master" instance of StyleSheet which is typically used when no other is available
* The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any
* StyleSheetManager's context */
/* reset the internal "master" instance */
StyleSheet.reset = function reset() {
var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
master = new StyleSheet(undefined, forceServer).rehydrate();
};
/* adds "children" to the StyleSheet that inherit all of the parents' rules
* while their own rules do not affect the parent */
StyleSheet.prototype.clone = function clone() {
var sheet = new StyleSheet(this.target, this.forceServer);
/* add to clone array */
this.clones.push(sheet);
/* clone all tags */
sheet.tags = this.tags.map(function (tag) {
var ids = tag.getIds();
var newTag = tag.clone();
/* reconstruct tagMap */
for (var i = 0; i < ids.length; i += 1) {
sheet.tagMap[ids[i]] = newTag;
}
return newTag;
});
/* clone other maps */
sheet.rehydratedNames = _extends({}, this.rehydratedNames);
sheet.deferred = _extends({}, this.deferred);
return sheet;
};
/* force StyleSheet to create a new tag on the next injection */
StyleSheet.prototype.sealAllTags = function sealAllTags() {
this.capacity = 1;
this.tags.forEach(function (tag) {
// eslint-disable-next-line no-param-reassign
tag.sealed = true;
});
};
StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
var lastEl = tag ? tag.styleTag : null;
var insertBefore = false;
return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
};
/* get a tag for a given componentId, assign the componentId to one, or shard */
StyleSheet.prototype.getTagForId = function getTagForId(id) {
/* simply return a tag, when the componentId was already assigned one */
var prev = this.tagMap[id];
if (prev !== undefined && !prev.sealed) {
return prev;
}
var tag = this.tags[this.tags.length - 1];
/* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
this.capacity -= 1;
if (this.capacity === 0) {
this.capacity = MAX_SIZE;
tag = this.makeTag(tag);
this.tags.push(tag);
}
return this.tagMap[id] = tag;
};
/* mainly for createGlobalStyle to check for its id */
StyleSheet.prototype.hasId = function hasId(id) {
return this.tagMap[id] !== undefined;
};
/* caching layer checking id+name to already have a corresponding tag and injected rules */
StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
/* exception for rehydrated names which are checked separately */
if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
return true;
}
var tag = this.tagMap[id];
return tag !== undefined && tag.hasNameForId(id, name);
};
/* registers a componentId and registers it on its tag */
StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
/* don't inject when the id is already registered */
if (this.tagMap[id] !== undefined) return;
var clones = this.clones;
for (var i = 0; i < clones.length; i += 1) {
clones[i].deferredInject(id, cssRules);
}
this.getTagForId(id).insertMarker(id);
this.deferred[id] = cssRules;
};
/* injects rules for a given id with a name that will need to be cached */
StyleSheet.prototype.inject = function inject(id, cssRules, name) {
var clones = this.clones;
for (var i = 0; i < clones.length; i += 1) {
clones[i].inject(id, cssRules, name);
}
var tag = this.getTagForId(id);
/* add deferred rules for component */
if (this.deferred[id] !== undefined) {
// Combine passed cssRules with previously deferred CSS rules
// NOTE: We cannot mutate the deferred array itself as all clones
// do the same (see clones[i].inject)
var rules = this.deferred[id].concat(cssRules);
tag.insertRules(id, rules, name);
this.deferred[id] = undefined;
} else {
tag.insertRules(id, cssRules, name);
}
};
/* removes all rules for a given id, which doesn't remove its marker but resets it */
StyleSheet.prototype.remove = function remove(id) {
var tag = this.tagMap[id];
if (tag === undefined) return;
var clones = this.clones;
for (var i = 0; i < clones.length; i += 1) {
clones[i].remove(id);
}
/* remove all rules from the tag */
tag.removeRules(id);
/* ignore possible rehydrated names */
this.ignoreRehydratedNames[id] = true;
/* delete possible deferred rules */
this.deferred[id] = undefined;
};
StyleSheet.prototype.toHTML = function toHTML() {
return this.tags.map(function (tag) {
return tag.toHTML();
}).join('');
};
StyleSheet.prototype.toReactElements = function toReactElements() {
var id = this.id;
return this.tags.map(function (tag, i) {
var key = 'sc-' + id + '-' + i;
return Object(__WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"])(tag.toElement(), { key: key });
});
};
createClass(StyleSheet, null, [{
key: 'master',
get: function get$$1() {
return master || (master = new StyleSheet().rehydrate());
}
/* NOTE: This is just for backwards-compatibility with jest-styled-components */
}, {
key: 'instance',
get: function get$$1() {
return StyleSheet.master;
}
}]);
return StyleSheet;
}();
//
var Keyframes = function () {
function Keyframes(name, rules) {
var _this = this;
classCallCheck(this, Keyframes);
this.inject = function (styleSheet) {
if (!styleSheet.hasNameForId(_this.id, _this.name)) {
styleSheet.inject(_this.id, _this.rules, _this.name);
}
};
this.toString = function () {
throw new StyledComponentsError(12, String(_this.name));
};
this.name = name;
this.rules = rules;
this.id = 'sc-keyframes-' + name;
}
Keyframes.prototype.getName = function getName() {
return this.name;
};
return Keyframes;
}();
//
/**
* inlined version of
* https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
*/
var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;
/**
* Hyphenates a camelcased CSS property name, for example:
*
* > hyphenateStyleName('backgroundColor')
* < "background-color"
* > hyphenateStyleName('MozTransition')
* < "-moz-transition"
* > hyphenateStyleName('msTransition')
* < "-ms-transition"
*
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
* is converted to `-ms-`.
*
* @param {string} string
* @return {string}
*/
function hyphenateStyleName(string) {
return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}
//
// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
function addUnitIfNeeded(name, value) {
// https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
// $FlowFixMe
if (value == null || typeof value === 'boolean' || value === '') {
return '';
}
if (typeof value === 'number' && value !== 0 && !(name in __WEBPACK_IMPORTED_MODULE_3__emotion_unitless__["a" /* default */])) {
return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
}
return String(value).trim();
}
//
/**
* It's falsish not falsy because 0 is allowed.
*/
var isFalsish = function isFalsish(chunk) {
return chunk === undefined || chunk === null || chunk === false || chunk === '';
};
var objToCss = function objToCss(obj, prevKey) {
var css = Object.keys(obj).filter(function (key) {
return !isFalsish(obj[key]);
}).map(function (key) {
if (isPlainObject(obj[key])) return objToCss(obj[key], key);
return hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
};
function flatten(chunk, executionContext, styleSheet) {
if (Array.isArray(chunk)) {
var ruleSet = [];
for (var i = 0, len = chunk.length, result; i < len; i += 1) {
result = flatten(chunk[i], executionContext, styleSheet);
if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
}
return ruleSet;
}
if (isFalsish(chunk)) {
return null;
}
/* Handle other components */
if (isStyledComponent(chunk)) {
return '.' + chunk.styledComponentId;
}
/* Either execute or defer the function */
if (isFunction(chunk)) {
if (isStatelessFunction(chunk) && executionContext) {
var _result = chunk(executionContext);
if (false) {
// eslint-disable-next-line no-console
console.warn(getComponentName(chunk) + ' is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.');
}
return flatten(_result, executionContext, styleSheet);
} else return chunk;
}
if (chunk instanceof Keyframes) {
if (styleSheet) {
chunk.inject(styleSheet);
return chunk.getName();
} else return chunk;
}
/* Handle objects */
return isPlainObject(chunk) ? objToCss(chunk) : chunk.toString();
}
//
function css(styles) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
if (isFunction(styles) || isPlainObject(styles)) {
// $FlowFixMe
return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
}
// $FlowFixMe
return flatten(interleave(styles, interpolations));
}
//
function constructWithOptions(componentConstructor, tag) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
if (!Object(__WEBPACK_IMPORTED_MODULE_4_react_is__["isValidElementType"])(tag)) {
throw new StyledComponentsError(1, String(tag));
}
/* This is callable directly as a template function */
// $FlowFixMe: Not typed to avoid destructuring arguments
var templateFunction = function templateFunction() {
return componentConstructor(tag, options, css.apply(undefined, arguments));
};
/* If config methods are called, wrap up a new template function and merge options */
templateFunction.withConfig = function (config) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
};
/* Modify/inject new props at runtime */
templateFunction.attrs = function (attrs) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, {
attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
}));
};
return templateFunction;
}
//
// Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
function murmurhash(c) {
for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {
b = c.charCodeAt(d) & 255 | (c.charCodeAt(++d) & 255) << 8 | (c.charCodeAt(++d) & 255) << 16 | (c.charCodeAt(++d) & 255) << 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), b ^= b >>> 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16) ^ b, e -= 4, ++d;
}
switch (e) {
case 3:
a ^= (c.charCodeAt(d + 2) & 255) << 16;
case 2:
a ^= (c.charCodeAt(d + 1) & 255) << 8;
case 1:
a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
}
a ^= a >>> 13;
a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
return (a ^ a >>> 15) >>> 0;
}
//
/* eslint-disable no-bitwise */
/* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
* counterparts */
var charsLength = 52;
/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
var getAlphabeticChar = function getAlphabeticChar(code) {
return String.fromCharCode(code + (code > 25 ? 39 : 97));
};
/* input a number, usually a hash and convert it to base-52 */
function generateAlphabeticName(code) {
var name = '';
var x = void 0;
/* get a char and divide by alphabet-length */
for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
name = getAlphabeticChar(x % charsLength) + name;
}
return getAlphabeticChar(x % charsLength) + name;
}
//
function hasFunctionObjectKey(obj) {
// eslint-disable-next-line guard-for-in, no-restricted-syntax
for (var key in obj) {
if (isFunction(obj[key])) {
return true;
}
}
return false;
}
function isStaticRules(rules, attrs) {
for (var i = 0; i < rules.length; i += 1) {
var rule = rules[i];
// recursive case
if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {
return false;
} else if (isFunction(rule) && !isStyledComponent(rule)) {
// functions are allowed to be static if they're just being
// used to get the classname of a nested styled component
return false;
}
}
if (attrs.some(function (x) {
return isFunction(x) || hasFunctionObjectKey(x);
})) return false;
return true;
}
//
var isHMREnabled = "production" !== 'production' && typeof module !== 'undefined' && module.hot;
/* combines hashStr (murmurhash) and nameGenerator for convenience */
var hasher = function hasher(str) {
return generateAlphabeticName(murmurhash(str));
};
/*
ComponentStyle is all the CSS-specific stuff, not
the React-specific stuff.
*/
var ComponentStyle = function () {
function ComponentStyle(rules, attrs, componentId) {
classCallCheck(this, ComponentStyle);
this.rules = rules;
this.isStatic = !isHMREnabled && isStaticRules(rules, attrs);
this.componentId = componentId;
if (!StyleSheet.master.hasId(componentId)) {
StyleSheet.master.deferredInject(componentId, []);
}
}
/*
* Flattens a rule set into valid CSS
* Hashes it, wraps the whole chunk in a .hash1234 {}
* Returns the hash to be injected on render()
* */
ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
var isStatic = this.isStatic,
componentId = this.componentId,
lastClassName = this.lastClassName;
if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {
return lastClassName;
}
var flatCSS = flatten(this.rules, executionContext, styleSheet);
var name = hasher(this.componentId + flatCSS.join(''));
if (!styleSheet.hasNameForId(componentId, name)) {
styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);
}
this.lastClassName = name;
return name;
};
ComponentStyle.generateName = function generateName(str) {
return hasher(str);
};
return ComponentStyle;
}();
//
var LIMIT = 200;
var createWarnTooManyClasses = (function (displayName) {
var generatedClasses = {};
var warningSeen = false;
return function (className) {
if (!warningSeen) {
generatedClasses[className] = true;
if (Object.keys(generatedClasses).length >= LIMIT) {
// Unable to find latestRule in test environment.
/* eslint-disable no-console, prefer-template */
console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\n' + 'Example:\n' + ' const Component = styled.div.attrs({\n' + ' style: ({ background }) => ({\n' + ' background,\n' + ' }),\n' + ' })`width: 100%;`\n\n' + ' <Component />');
warningSeen = true;
generatedClasses = {};
}
}
};
});
//
var determineTheme = (function (props, fallbackTheme) {
var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
/* eslint-disable react/prop-types, flowtype-errors/show-errors */
var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;
var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;
/* eslint-enable */
return theme;
});
//
var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
var dashesAtEnds = /(^-|-$)/g;
/**
* TODO: Explore using CSS.escape when it becomes more available
* in evergreen browsers.
*/
function escape(str) {
return str
// Replace all possible CSS selectors
.replace(escapeRegex, '-')
// Remove extraneous hyphens at the start and end
.replace(dashesAtEnds, '');
}
//
function isTag(target) {
return typeof target === 'string' && ( false ? target.charAt(0) === target.charAt(0).toLowerCase() : true);
}
//
function generateDisplayName(target) {
// $FlowFixMe
return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
}
var _TYPE_STATICS;
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDerivedStateFromProps: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[__WEBPACK_IMPORTED_MODULE_4_react_is__["ForwardRef"]] = {
$$typeof: true,
render: true
}, _TYPE_STATICS);
var defineProperty$1 = Object.defineProperty,
getOwnPropertyNames = Object.getOwnPropertyNames,
_Object$getOwnPropert = Object.getOwnPropertySymbols,
getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {
return [];
} : _Object$getOwnPropert,
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
getPrototypeOf = Object.getPrototypeOf,
objectPrototype = Object.prototype;
var arrayPrototype = Array.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent),
// $FlowFixMe
getOwnPropertySymbols(sourceComponent));
var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;
var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;
var i = keys.length;
var descriptor = void 0;
var key = void 0;
// eslint-disable-next-line no-plusplus
while (i--) {
key = keys[i];
if (
// $FlowFixMe
!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) &&
// $FlowFixMe
!(targetStatics && targetStatics[key])) {
descriptor = getOwnPropertyDescriptor(sourceComponent, key);
if (descriptor) {
try {
// Avoid failures from read-only properties
defineProperty$1(targetComponent, key, descriptor);
} catch (e) {
/* fail silently */
}
}
}
}
return targetComponent;
}
return targetComponent;
}
//
function isDerivedReactComponent(fn) {
return !!(fn && fn.prototype && fn.prototype.isReactComponent);
}
//
// Helper to call a given function, only once
var once = (function (cb) {
var called = false;
return function () {
if (!called) {
called = true;
cb.apply(undefined, arguments);
}
};
});
//
var ThemeContext = Object(__WEBPACK_IMPORTED_MODULE_2_react__["createContext"])();
var ThemeConsumer = ThemeContext.Consumer;
/**
* Provide a theme to an entire react component tree via context
*/
var ThemeProvider = function (_Component) {
inherits(ThemeProvider, _Component);
function ThemeProvider(props) {
classCallCheck(this, ThemeProvider);
var _this = possibleConstructorReturn(this, _Component.call(this, props));
_this.getContext = Object(__WEBPACK_IMPORTED_MODULE_5_memoize_one__["a" /* default */])(_this.getContext.bind(_this));
_this.renderInner = _this.renderInner.bind(_this);
return _this;
}
ThemeProvider.prototype.render = function render() {
if (!this.props.children) return null;
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
ThemeContext.Consumer,
null,
this.renderInner
);
};
ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {
var context = this.getContext(this.props.theme, outerTheme);
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
ThemeContext.Provider,
{ value: context },
__WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(this.props.children)
);
};
/**
* Get the theme from the props, supporting both (outerTheme) => {}
* as well as object notation
*/
ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {
if (isFunction(theme)) {
var mergedTheme = theme(outerTheme);
if (false) {
throw new StyledComponentsError(7);
}
return mergedTheme;
}
if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
throw new StyledComponentsError(8);
}
return _extends({}, outerTheme, theme);
};
ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {
return this.getTheme(theme, outerTheme);
};
return ThemeProvider;
}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
//
var CLOSING_TAG_R = /^\s*<\/[a-z]/i;
var ServerStyleSheet = function () {
function ServerStyleSheet() {
classCallCheck(this, ServerStyleSheet);
/* The master sheet might be reset, so keep a reference here */
this.masterSheet = StyleSheet.master;
this.instance = this.masterSheet.clone();
this.sealed = false;
}
/**
* Mark the ServerStyleSheet as being fully emitted and manually GC it from the
* StyleSheet singleton.
*/
ServerStyleSheet.prototype.seal = function seal() {
if (!this.sealed) {
/* Remove sealed StyleSheets from the master sheet */
var index = this.masterSheet.clones.indexOf(this.instance);
this.masterSheet.clones.splice(index, 1);
this.sealed = true;
}
};
ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
if (this.sealed) {
throw new StyledComponentsError(2);
}
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
StyleSheetManager,
{ sheet: this.instance },
children
);
};
ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
this.seal();
return this.instance.toHTML();
};
ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
this.seal();
return this.instance.toReactElements();
};
ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
var _this = this;
{
throw new StyledComponentsError(3);
}
/* the tag index keeps track of which tags have already been emitted */
var instance = this.instance;
var instanceTagIndex = 0;
var streamAttr = SC_STREAM_ATTR + '="true"';
var transformer = new stream.Transform({
transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
var tags = instance.tags;
var html = '';
/* retrieve html for each new style tag */
for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
var tag = tags[instanceTagIndex];
html += tag.toHTML(streamAttr);
}
/* force our StyleSheets to emit entirely new tags */
instance.sealAllTags();
var renderedHtml = chunk.toString();
/* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */
if (CLOSING_TAG_R.test(renderedHtml)) {
var endOfClosingTag = renderedHtml.indexOf('>');
this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));
} else this.push(html + renderedHtml);
callback();
}
});
readableStream.on('end', function () {
return _this.seal();
});
readableStream.on('error', function (err) {
_this.seal();
// forward the error to the transform stream
transformer.emit('error', err);
});
return readableStream.pipe(transformer);
};
return ServerStyleSheet;
}();
//
var StyleSheetContext = Object(__WEBPACK_IMPORTED_MODULE_2_react__["createContext"])();
var StyleSheetConsumer = StyleSheetContext.Consumer;
var StyleSheetManager = function (_Component) {
inherits(StyleSheetManager, _Component);
function StyleSheetManager(props) {
classCallCheck(this, StyleSheetManager);
var _this = possibleConstructorReturn(this, _Component.call(this, props));
_this.getContext = Object(__WEBPACK_IMPORTED_MODULE_5_memoize_one__["a" /* default */])(_this.getContext);
return _this;
}
StyleSheetManager.prototype.getContext = function getContext(sheet, target) {
if (sheet) {
return sheet;
} else if (target) {
return new StyleSheet(target);
} else {
throw new StyledComponentsError(4);
}
};
StyleSheetManager.prototype.render = function render() {
var _props = this.props,
children = _props.children,
sheet = _props.sheet,
target = _props.target;
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
StyleSheetContext.Provider,
{ value: this.getContext(sheet, target) },
false ? React.Children.only(children) : children
);
};
return StyleSheetManager;
}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
false ? StyleSheetManager.propTypes = {
sheet: PropTypes.oneOfType([PropTypes.instanceOf(StyleSheet), PropTypes.instanceOf(ServerStyleSheet)]),
target: PropTypes.shape({
appendChild: PropTypes.func.isRequired
})
} : void 0;
//
var didWarnAboutClassNameUsage = new Set();
var classNameUsageCheckInjector = (function (target) {
var elementClassName = '';
var targetCDM = target.componentDidMount;
// eslint-disable-next-line no-param-reassign
target.componentDidMount = function componentDidMount() {
if (typeof targetCDM === 'function') {
targetCDM.call(this);
}
var forwardTarget = this.props.forwardedComponent.target;
if (target.props && target.props.suppressClassNameWarning || target.attrs && target.attrs.suppressClassNameWarning || didWarnAboutClassNameUsage.has(forwardTarget)) {
return;
}
didWarnAboutClassNameUsage.add(forwardTarget);
var classNames = elementClassName.replace(/\s+/g, ' ').trim().split(' ');
// eslint-disable-next-line react/no-find-dom-node
var node = __WEBPACK_IMPORTED_MODULE_7_react_dom___default.a.findDOMNode(this);
var selector = classNames.map(function (s) {
return '.' + s;
}).join('');
if (node && node.nodeType === 1 && !classNames.every(function (className) {
return node.classList && node.classList.contains(className);
}) && !node.querySelector(selector)) {
// eslint-disable-next-line no-console
console.warn('It looks like you\'ve wrapped styled() around your React component (' + getComponentName(forwardTarget) + '), but the className prop is not being passed down to a child. No styles will be rendered unless className is composed within your React component.');
}
};
var prevRenderInner = target.renderInner;
// eslint-disable-next-line no-param-reassign
target.renderInner = function renderInner() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var element = prevRenderInner.apply(this, args);
elementClassName = element.props.className;
return element;
};
});
//
var identifiers = {};
/* We depend on components having unique IDs */
function generateId(_ComponentStyle, _displayName, parentComponentId) {
var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);
/**
* This ensures uniqueness if two components happen to share
* the same displayName.
*/
var nr = (identifiers[displayName] || 0) + 1;
identifiers[displayName] = nr;
var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);
return parentComponentId ? parentComponentId + '-' + componentId : componentId;
}
// $FlowFixMe
var StyledComponent = function (_Component) {
inherits(StyledComponent, _Component);
function StyledComponent() {
classCallCheck(this, StyledComponent);
var _this = possibleConstructorReturn(this, _Component.call(this));
_this.attrs = {};
_this.renderOuter = _this.renderOuter.bind(_this);
_this.renderInner = _this.renderInner.bind(_this);
if (false) {
_this.warnInnerRef = once(function (displayName) {
return (
// eslint-disable-next-line no-console
console.warn('The "innerRef" API has been removed in styled-components v4 in favor of React 16 ref forwarding, use "ref" instead like a typical component. "innerRef" was detected on component "' + displayName + '".')
);
});
_this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {
return (
// eslint-disable-next-line no-console
console.warn('Functions as object-form attrs({}) keys are now deprecated and will be removed in a future version of styled-components. Switch to the new attrs(props => ({})) syntax instead for easier and more powerful composition. The attrs key in question is "' + key + '" on component "' + displayName + '".')
);
});
_this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {
return (
// eslint-disable-next-line no-console
console.warn('It looks like you\'ve used a non styled-component as the value for the "' + key + '" prop in an object-form attrs constructor of "' + displayName + '".\n' + 'You should use the new function-form attrs constructor which avoids this issue: attrs(props => ({ yourStuff }))\n' + "To continue using the deprecated object syntax, you'll need to wrap your component prop in a function to make it available inside the styled component (you'll still get the deprecation warning though.)\n" + ('For example, { ' + key + ': () => InnerComponent } instead of { ' + key + ': InnerComponent }'))
);
});
}
if (false) {
classNameUsageCheckInjector(_this);
}
return _this;
}
StyledComponent.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
StyleSheetConsumer,
null,
this.renderOuter
);
};
StyledComponent.prototype.renderOuter = function renderOuter() {
var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;
this.styleSheet = styleSheet;
// No need to subscribe a static component to theme changes, it won't change anything
if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
ThemeConsumer,
null,
this.renderInner
);
};
StyledComponent.prototype.renderInner = function renderInner(theme) {
var _props$forwardedCompo = this.props.forwardedComponent,
componentStyle = _props$forwardedCompo.componentStyle,
defaultProps = _props$forwardedCompo.defaultProps,
displayName = _props$forwardedCompo.displayName,
foldedComponentIds = _props$forwardedCompo.foldedComponentIds,
styledComponentId = _props$forwardedCompo.styledComponentId,
target = _props$forwardedCompo.target;
var generatedClassName = void 0;
if (componentStyle.isStatic) {
generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);
} else if (theme !== undefined) {
generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps), this.props);
} else {
generatedClassName = this.generateAndInjectStyles(this.props.theme || EMPTY_OBJECT, this.props);
}
var elementToBeCreated = this.props.as || this.attrs.as || target;
var isTargetTag = isTag(elementToBeCreated);
var propsForElement = {};
var computedProps = _extends({}, this.attrs, this.props);
var key = void 0;
// eslint-disable-next-line guard-for-in
for (key in computedProps) {
if (false) {
this.warnInnerRef(displayName);
}
if (key === 'forwardedComponent' || key === 'as' || key === 'suppressClassNameWarning') {
continue;
} else if (key === 'forwardedRef') propsForElement.ref = computedProps[key];else if (!isTargetTag || Object(__WEBPACK_IMPORTED_MODULE_8__emotion_is_prop_valid__["a" /* default */])(key)) {
// Don't pass through non HTML tags through to HTML elements
propsForElement[key] = computedProps[key];
}
}
if (this.props.style && this.attrs.style) {
propsForElement.style = _extends({}, this.attrs.style, this.props.style);
}
propsForElement.className = Array.prototype.concat(foldedComponentIds, this.props.className, styledComponentId, this.attrs.className, generatedClassName).filter(Boolean).join(' ');
return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(elementToBeCreated, propsForElement);
};
StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
var _this2 = this;
var context = _extends({}, props, { theme: theme });
if (!attrs.length) return context;
this.attrs = {};
attrs.forEach(function (attrDef) {
var resolvedAttrDef = attrDef;
var attrDefWasFn = false;
var attr = void 0;
var key = void 0;
if (isFunction(resolvedAttrDef)) {
// $FlowFixMe
resolvedAttrDef = resolvedAttrDef(context);
attrDefWasFn = true;
}
/* eslint-disable guard-for-in */
// $FlowFixMe
for (key in resolvedAttrDef) {
attr = resolvedAttrDef[key];
if (!attrDefWasFn) {
if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {
if (false) {
_this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);
}
attr = attr(context);
if (false) {
_this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);
}
}
}
_this2.attrs[key] = attr;
context[key] = attr;
}
/* eslint-enable */
});
return context;
};
StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
var _props$forwardedCompo2 = props.forwardedComponent,
attrs = _props$forwardedCompo2.attrs,
componentStyle = _props$forwardedCompo2.componentStyle,
warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses;
// statically styled-components don't need to build an execution context object,
// and shouldn't be increasing the number of class names
if (componentStyle.isStatic && !attrs.length) {
return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);
}
var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);
if (false) warnTooManyClasses(className);
return className;
};
return StyledComponent;
}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
function createStyledComponent(target, options, rules) {
var isTargetStyledComp = isStyledComponent(target);
var isClass = !isTag(target);
var _options$displayName = options.displayName,
displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
_options$componentId = options.componentId,
componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
_options$ParentCompon = options.ParentComponent,
ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,
_options$attrs = options.attrs,
attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;
var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;
// fold the underlying StyledComponent attrs up (implicit extend)
var finalAttrs =
// $FlowFixMe
isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;
var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)
// $FlowFixMe
target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);
/**
* forwardRef creates a new interim component, which we'll take advantage of
* instead of extending ParentComponent to create _another_ interim class
*/
var WrappedStyledComponent = __WEBPACK_IMPORTED_MODULE_2_react___default.a.forwardRef(function (props, ref) {
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref }));
});
// $FlowFixMe
WrappedStyledComponent.attrs = finalAttrs;
// $FlowFixMe
WrappedStyledComponent.componentStyle = componentStyle;
WrappedStyledComponent.displayName = displayName;
// $FlowFixMe
WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe
Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY;
// $FlowFixMe
WrappedStyledComponent.styledComponentId = styledComponentId;
// fold the underlying StyledComponent target up since we folded the styles
// $FlowFixMe
WrappedStyledComponent.target = isTargetStyledComp ? target.target : target;
// $FlowFixMe
WrappedStyledComponent.withComponent = function withComponent(tag) {
var previousComponentId = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['componentId']);
var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));
var newOptions = _extends({}, optionsToCopy, {
attrs: finalAttrs,
componentId: newComponentId,
ParentComponent: ParentComponent
});
return createStyledComponent(tag, newOptions, rules);
};
if (false) {
// $FlowFixMe
WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
}
// $FlowFixMe
WrappedStyledComponent.toString = function () {
return '.' + WrappedStyledComponent.styledComponentId;
};
if (isClass) {
hoistNonReactStatics(WrappedStyledComponent, target, {
// all SC-specific things should not be hoisted
attrs: true,
componentStyle: true,
displayName: true,
foldedComponentIds: true,
styledComponentId: true,
target: true,
withComponent: true
});
}
return WrappedStyledComponent;
}
//
// Thanks to ReactDOMFactories for this handy list!
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',
// SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
//
var styled = function styled(tag) {
return constructWithOptions(createStyledComponent, tag);
};
// Shorthands for all valid HTML Elements
domElements.forEach(function (domElement) {
styled[domElement] = styled(domElement);
});
//
var GlobalStyle = function () {
function GlobalStyle(rules, componentId) {
classCallCheck(this, GlobalStyle);
this.rules = rules;
this.componentId = componentId;
this.isStatic = isStaticRules(rules, EMPTY_ARRAY);
if (!StyleSheet.master.hasId(componentId)) {
StyleSheet.master.deferredInject(componentId, []);
}
}
GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {
var flatCSS = flatten(this.rules, executionContext, styleSheet);
var css = stringifyRules(flatCSS, '');
styleSheet.inject(this.componentId, css);
};
GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {
var componentId = this.componentId;
if (styleSheet.hasId(componentId)) {
styleSheet.remove(componentId);
}
};
// TODO: overwrite in-place instead of remove+create?
GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {
this.removeStyles(styleSheet);
this.createStyles(executionContext, styleSheet);
};
return GlobalStyle;
}();
//
// place our cache into shared context so it'll persist between HMRs
if (IS_BROWSER) {
window.scCGSHMRCache = {};
}
function createGlobalStyle(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var id = 'sc-global-' + murmurhash(JSON.stringify(rules));
var style = new GlobalStyle(rules, id);
var GlobalStyleComponent = function (_React$Component) {
inherits(GlobalStyleComponent, _React$Component);
function GlobalStyleComponent(props) {
classCallCheck(this, GlobalStyleComponent);
var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
var _this$constructor = _this.constructor,
globalStyle = _this$constructor.globalStyle,
styledComponentId = _this$constructor.styledComponentId;
if (IS_BROWSER) {
window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;
}
/**
* This fixes HMR compatibility. Don't ask me why, but this combination of
* caching the closure variables via statics and then persisting the statics in
* state works across HMR where no other combination did. ¯\_()_/¯
*/
_this.state = {
globalStyle: globalStyle,
styledComponentId: styledComponentId
};
return _this;
}
GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {
if (window.scCGSHMRCache[this.state.styledComponentId]) {
window.scCGSHMRCache[this.state.styledComponentId] -= 1;
}
/**
* Depending on the order "render" is called this can cause the styles to be lost
* until the next render pass of the remaining instance, which may
* not be immediate.
*/
if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {
this.state.globalStyle.removeStyles(this.styleSheet);
}
};
GlobalStyleComponent.prototype.render = function render() {
var _this2 = this;
if (false) {
// eslint-disable-next-line no-console
console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');
}
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
StyleSheetConsumer,
null,
function (styleSheet) {
_this2.styleSheet = styleSheet || StyleSheet.master;
var globalStyle = _this2.state.globalStyle;
if (globalStyle.isStatic) {
globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);
return null;
} else {
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
ThemeConsumer,
null,
function (theme) {
// $FlowFixMe
var defaultProps = _this2.constructor.defaultProps;
var context = _extends({}, _this2.props);
if (typeof theme !== 'undefined') {
context.theme = determineTheme(_this2.props, theme, defaultProps);
}
globalStyle.renderStyles(context, _this2.styleSheet);
return null;
}
);
}
}
);
};
return GlobalStyleComponent;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
GlobalStyleComponent.globalStyle = style;
GlobalStyleComponent.styledComponentId = id;
return GlobalStyleComponent;
}
//
var replaceWhitespace = function replaceWhitespace(str) {
return str.replace(/\s|\\n/g, '');
};
function keyframes(strings) {
/* Warning if you've used keyframes on React Native */
if (false) {
// eslint-disable-next-line no-console
console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');
}
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));
return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));
}
//
var withTheme = (function (Component$$1) {
var WithTheme = __WEBPACK_IMPORTED_MODULE_2_react___default.a.forwardRef(function (props, ref) {
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
ThemeConsumer,
null,
function (theme) {
// $FlowFixMe
var defaultProps = Component$$1.defaultProps;
var themeProp = determineTheme(props, theme, defaultProps);
if (false) {
// eslint-disable-next-line no-console
console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "' + getComponentName(Component$$1) + '"');
}
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref }));
}
);
});
hoistNonReactStatics(WithTheme, Component$$1);
WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
return WithTheme;
});
//
/* eslint-disable */
var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
StyleSheet: StyleSheet
};
//
/* Warning if you've imported this file on React Native */
if (false) {
// eslint-disable-next-line no-console
console.warn("It looks like you've imported 'styled-components' on React Native.\n" + "Perhaps you're looking to import 'styled-components/native'?\n" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native');
}
/* Warning if there are several instances of styled-components */
if (false) {
window['__styled-components-init__'] = window['__styled-components-init__'] || 0;
if (window['__styled-components-init__'] === 1) {
// eslint-disable-next-line no-console
console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' + 'and makes your application bigger without a good reason.\n\n' + 'See https://s-c.sh/2BAXzed for more info.');
}
window['__styled-components-init__'] += 1;
}
//
/* harmony default export */ __webpack_exports__["a"] = (styled);
//# sourceMappingURL=styled-components.browser.esm.js.map
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(110), __webpack_require__(370)(module)))
/***/ }),
/***/ 4527:
/***/ (function(module, exports, __webpack_require__) {
!function(e){ true?module.exports=e(null):"function"==typeof define&&define.amd?define(e(null)):window.stylis=e(null)}(function e(a){"use strict";var r=/^\0+/g,c=/[\0\r\f]/g,s=/: */g,t=/zoo|gra/,i=/([,: ])(transform)/g,f=/,+\s*(?![^(]*[)])/g,n=/ +\s*(?![^(]*[)])/g,l=/ *[\0] */g,o=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,u=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,b=/@(k\w+)\s*(\S*)\s*/,p=/::(place)/g,k=/:(read-only)/g,g=/\s+(?=[{\];=:>])/g,A=/([[}=:>])\s+/g,C=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,v=/([^\(])(:+) */g,m=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,$=/([\s\S]*?);/g,y=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,j=/stretch|:\s*\w+\-(?:conte|avail)/,z=/([^-])(image-set\()/,N="-webkit-",S="-moz-",F="-ms-",W=59,q=125,B=123,D=40,E=41,G=91,H=93,I=10,J=13,K=9,L=64,M=32,P=38,Q=45,R=95,T=42,U=44,V=58,X=39,Y=34,Z=47,_=62,ee=43,ae=126,re=0,ce=12,se=11,te=107,ie=109,fe=115,ne=112,le=111,oe=105,he=99,ue=100,de=112,be=1,pe=1,ke=0,ge=1,Ae=1,Ce=1,we=0,ve=0,me=0,xe=[],$e=[],ye=0,Oe=null,je=-2,ze=-1,Ne=0,Se=1,Fe=2,We=3,qe=0,Be=1,De="",Ee="",Ge="";function He(e,a,s,t,i){for(var f,n,o=0,h=0,u=0,d=0,g=0,A=0,C=0,w=0,m=0,$=0,y=0,O=0,j=0,z=0,R=0,we=0,$e=0,Oe=0,je=0,ze=s.length,Je=ze-1,Re="",Te="",Ue="",Ve="",Xe="",Ye="";R<ze;){if(C=s.charCodeAt(R),R===Je)if(h+d+u+o!==0){if(0!==h)C=h===Z?I:Z;d=u=o=0,ze++,Je++}if(h+d+u+o===0){if(R===Je){if(we>0)Te=Te.replace(c,"");if(Te.trim().length>0){switch(C){case M:case K:case W:case J:case I:break;default:Te+=s.charAt(R)}C=W}}if(1===$e)switch(C){case B:case q:case W:case Y:case X:case D:case E:case U:$e=0;case K:case J:case I:case M:break;default:for($e=0,je=R,g=C,R--,C=W;je<ze;)switch(s.charCodeAt(je++)){case I:case J:case W:++R,C=g,je=ze;break;case V:if(we>0)++R,C=g;case B:je=ze}}switch(C){case B:for(g=(Te=Te.trim()).charCodeAt(0),y=1,je=++R;R<ze;){switch(C=s.charCodeAt(R)){case B:y++;break;case q:y--;break;case Z:switch(A=s.charCodeAt(R+1)){case T:case Z:R=Qe(A,R,Je,s)}break;case G:C++;case D:C++;case Y:case X:for(;R++<Je&&s.charCodeAt(R)!==C;);}if(0===y)break;R++}if(Ue=s.substring(je,R),g===re)g=(Te=Te.replace(r,"").trim()).charCodeAt(0);switch(g){case L:if(we>0)Te=Te.replace(c,"");switch(A=Te.charCodeAt(1)){case ue:case ie:case fe:case Q:f=a;break;default:f=xe}if(je=(Ue=He(a,f,Ue,A,i+1)).length,me>0&&0===je)je=Te.length;if(ye>0)if(f=Ie(xe,Te,Oe),n=Pe(We,Ue,f,a,pe,be,je,A,i,t),Te=f.join(""),void 0!==n)if(0===(je=(Ue=n.trim()).length))A=0,Ue="";if(je>0)switch(A){case fe:Te=Te.replace(x,Me);case ue:case ie:case Q:Ue=Te+"{"+Ue+"}";break;case te:if(Ue=(Te=Te.replace(b,"$1 $2"+(Be>0?De:"")))+"{"+Ue+"}",1===Ae||2===Ae&&Le("@"+Ue,3))Ue="@"+N+Ue+"@"+Ue;else Ue="@"+Ue;break;default:if(Ue=Te+Ue,t===de)Ve+=Ue,Ue=""}else Ue="";break;default:Ue=He(a,Ie(a,Te,Oe),Ue,t,i+1)}Xe+=Ue,O=0,$e=0,z=0,we=0,Oe=0,j=0,Te="",Ue="",C=s.charCodeAt(++R);break;case q:case W:if((je=(Te=(we>0?Te.replace(c,""):Te).trim()).length)>1){if(0===z)if((g=Te.charCodeAt(0))===Q||g>96&&g<123)je=(Te=Te.replace(" ",":")).length;if(ye>0)if(void 0!==(n=Pe(Se,Te,a,e,pe,be,Ve.length,t,i,t)))if(0===(je=(Te=n.trim()).length))Te="\0\0";switch(g=Te.charCodeAt(0),A=Te.charCodeAt(1),g){case re:break;case L:if(A===oe||A===he){Ye+=Te+s.charAt(R);break}default:if(Te.charCodeAt(je-1)===V)break;Ve+=Ke(Te,g,A,Te.charCodeAt(2))}}O=0,$e=0,z=0,we=0,Oe=0,Te="",C=s.charCodeAt(++R)}}switch(C){case J:case I:if(h+d+u+o+ve===0)switch($){case E:case X:case Y:case L:case ae:case _:case T:case ee:case Z:case Q:case V:case U:case W:case B:case q:break;default:if(z>0)$e=1}if(h===Z)h=0;else if(ge+O===0&&t!==te&&Te.length>0)we=1,Te+="\0";if(ye*qe>0)Pe(Ne,Te,a,e,pe,be,Ve.length,t,i,t);be=1,pe++;break;case W:case q:if(h+d+u+o===0){be++;break}default:switch(be++,Re=s.charAt(R),C){case K:case M:if(d+o+h===0)switch(w){case U:case V:case K:case M:Re="";break;default:if(C!==M)Re=" "}break;case re:Re="\\0";break;case ce:Re="\\f";break;case se:Re="\\v";break;case P:if(d+h+o===0&&ge>0)Oe=1,we=1,Re="\f"+Re;break;case 108:if(d+h+o+ke===0&&z>0)switch(R-z){case 2:if(w===ne&&s.charCodeAt(R-3)===V)ke=w;case 8:if(m===le)ke=m}break;case V:if(d+h+o===0)z=R;break;case U:if(h+u+d+o==
//# sourceMappingURL=stylis.min.js.map
/***/ }),
/***/ 4528:
/***/ (function(module, exports, __webpack_require__) {
(function (factory) {
true ? (module['exports'] = factory()) :
typeof define === 'function' && define['amd'] ? define(factory()) :
(window['stylisRuleSheet'] = factory())
}(function () {
'use strict'
return function (insertRule) {
var delimiter = '/*|*/'
var needle = delimiter+'}'
function toSheet (block) {
if (block)
try {
insertRule(block + '}')
} catch (e) {}
}
return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
switch (context) {
// property
case 1:
// @import
if (depth === 0 && content.charCodeAt(0) === 64)
return insertRule(content+';'), ''
break
// selector
case 2:
if (ns === 0)
return content + delimiter
break
// at-rule
case 3:
switch (ns) {
// @font-face, @page
case 102:
case 112:
return insertRule(selectors[0]+content), ''
default:
return content + (at === 0 ? delimiter : '')
}
case -2:
content.split(needle).forEach(toSheet)
}
}
}
}))
/***/ }),
/***/ 4529:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
/* harmony default export */ __webpack_exports__["a"] = (unitlessKeys);
/***/ }),
/***/ 4530:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__emotion_memoize__ = __webpack_require__(4531);
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
var index = Object(__WEBPACK_IMPORTED_MODULE_0__emotion_memoize__["a" /* default */])(function (prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
/* o */
&& prop.charCodeAt(1) === 110
/* n */
&& prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
/* harmony default export */ __webpack_exports__["a"] = (index);
/***/ }),
/***/ 4531:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function memoize(fn) {
var cache = {};
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
/* harmony default export */ __webpack_exports__["a"] = (memoize);
/***/ }),
/***/ 4532:
/***/ (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_form_style_css__ = __webpack_require__(953);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_form_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_form_style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_form__ = __webpack_require__(954);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form__);
/* 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_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_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_axios__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_educoder__ = __webpack_require__(5);
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 Modifytext=function(_Component){_inherits(Modifytext,_Component);function Modifytext(props){_classCallCheck(this,Modifytext);var _this=_possibleConstructorReturn(this,(Modifytext.__proto__||Object.getPrototypeOf(Modifytext)).call(this,props));_this.Modifytext=function(){_this.props.form.validateFieldsAndScroll(function(err,values){if(!err){var url='/paths/'+_this.props.pathid+'/update_team_title.json';__WEBPACK_IMPORTED_MODULE_7_axios___default.a.post(url,{team_title:values.teachingteam}).then(function(response){console.log(response);if(response){if(response.data){if(response.data.status===0){try{_this.props.showNotification("修改成功!");}catch(e){}try{_this.props.modifysy(2);}catch(e){}}}}}).catch(function(error){console.log(error);});}});};_this.hideUpdating=function(){_this.props.modifysy(3);};_this.state={};return _this;}_createClass(Modifytext,[{key:'componentDidMount',value:function componentDidMount(){}//重新输入教学模式
//取消
},{key:'render',value:function render(){var _this2=this;var getFieldDecorator=this.props.form.getFieldDecorator;return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'ml38'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('style',null,'\n\n .flexRow {\n padding: 20px 0;\n }\n .flexRow .name {\n margin-left: 12px;\n color: #666666;\n\n text-align: center;\n flex: 0 0 100px;\n }\n .flexRow .description {\n margin-left: 10px;\n flex: 1;\n color: #CDCDCD;\n }\n .description span {\n margin-right: 20px;\n color: #05101A;\n }\n .flexRow .status {\n width: 100px;\n color: #28AC7F;\n text-align: right;\n }\n .flexTable .flexTable {\n border-bottom: 1px solid #EBEBEB;\n }\n \n .settingFormsy label{\n color: #666666;\n font-size: 14px !important ; \n \n }\n .settingFormsy input {\n width: 200px;\n height: 32px;\n }\n .settingFormsy input.validateInput {\n width: 220px;\n }\n .settingFormsy .formItemInline button {\n width: 110px;\n margin-left: 10px;\n }\n .settingFormsy .ant-form-item-label {\n width: 60px;\n text-align: left;\n }\n .formItemInline .ant-form-explain{\n position:absolute;\n bottom:-22px;\n left:0px;\n width:100%;\n }\n .yslzxueshi .ant-input{\n\t\t\t\t\t\t\t\t\t\t\theight: 40px !important;\n\t\t\t\t\t\t\t\t\t\t\twidth: 276px !important\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// class="ant-col ant-form-item-label"\n '),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'settingFormsy'},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Fragment,null,__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a,null,__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{style:{display:"flex",flexDirection:"initial",lineHeight:" 51px"}},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a.Item,{label:'',className:'formItemInline hideRequireTag mb20 mt20'},getFieldDecorator('teachingteam',{rules:[{// initialValue: this.state.cityDefaultValue,
required:true,message:'请输入模式'}]})(__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a,{placeholder:'\u4F8B\u5982\uFF1A\u6559\u5B66\u56E2\u961F'}))),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:'flexdirections yslzxueshi ml38 '},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('p',{className:'fontcolorsyslhui1 font-14 myysllineheight myyslminwidth'}),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div',{className:' flexdirections ml10',style:{display:"flex",flexDirection:"initial",marginTop:"24px"}},__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{style:{border:"0.5px solid #C9C9C9",background:"#C9C9C9",color:"#fff"},type:'primary ',onClick:function onClick(){return _this2.hideUpdating();}},'\u53D6\u6D88'),__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{style:{marginLeft:"10px"},type:'primary',onClick:function onClick(){return _this2.Modifytext();}},'\u786E\u5B9A')))))))));}}]);return Modifytext;}(__WEBPACK_IMPORTED_MODULE_6_react__["Component"]);var Modifytexts=__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a.create({name:'Modifytext'})(Modifytext);/* harmony default export */ __webpack_exports__["a"] = (Modifytexts);
/***/ }),
/***/ 874:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.convertFieldsError = convertFieldsError;
exports.format = format;
exports.isEmptyValue = isEmptyValue;
exports.isEmptyObject = isEmptyObject;
exports.asyncMap = asyncMap;
exports.complementError = complementError;
exports.deepMerge = deepMerge;
/* eslint no-console:0 */
var formatRegExp = /%[sdj%]/g;
var warning = exports.warning = function warning() {};
// don't print warning message when in production env or node runtime
if (false) {
exports.warning = warning = function warning(type, errors) {
if (typeof console !== 'undefined' && console.warn) {
if (errors.every(function (e) {
return typeof e === 'string';
})) {
console.warn(type, errors);
}
}
};
}
function convertFieldsError(errors) {
if (!errors || !errors.length) return null;
var fields = {};
errors.forEach(function (error) {
var field = error.field;
fields[field] = fields[field] || [];
fields[field].push(error);
});
return fields;
}
function format() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var i = 1;
var f = args[0];
var len = args.length;
if (typeof f === 'function') {
return f.apply(null, args.slice(1));
}
if (typeof f === 'string') {
var str = String(f).replace(formatRegExp, function (x) {
if (x === '%%') {
return '%';
}
if (i >= len) {
return x;
}
switch (x) {
case '%s':
return String(args[i++]);
case '%d':
return Number(args[i++]);
case '%j':
try {
return JSON.stringify(args[i++]);
} catch (_) {
return '[Circular]';
}
break;
default:
return x;
}
});
for (var arg = args[i]; i < len; arg = args[++i]) {
str += ' ' + arg;
}
return str;
}
return f;
}
function isNativeStringType(type) {
return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
}
function isEmptyValue(value, type) {
if (value === undefined || value === null) {
return true;
}
if (type === 'array' && Array.isArray(value) && !value.length) {
return true;
}
if (isNativeStringType(type) && typeof value === 'string' && !value) {
return true;
}
return false;
}
function isEmptyObject(obj) {
return Object.keys(obj).length === 0;
}
function asyncParallelArray(arr, func, callback) {
var results = [];
var total = 0;
var arrLength = arr.length;
function count(errors) {
results.push.apply(results, errors);
total++;
if (total === arrLength) {
callback(results);
}
}
arr.forEach(function (a) {
func(a, count);
});
}
function asyncSerialArray(arr, func, callback) {
var index = 0;
var arrLength = arr.length;
function next(errors) {
if (errors && errors.length) {
callback(errors);
return;
}
var original = index;
index = index + 1;
if (original < arrLength) {
func(arr[original], next);
} else {
callback([]);
}
}
next([]);
}
function flattenObjArr(objArr) {
var ret = [];
Object.keys(objArr).forEach(function (k) {
ret.push.apply(ret, objArr[k]);
});
return ret;
}
function asyncMap(objArr, option, func, callback) {
if (option.first) {
var flattenArr = flattenObjArr(objArr);
return asyncSerialArray(flattenArr, func, callback);
}
var firstFields = option.firstFields || [];
if (firstFields === true) {
firstFields = Object.keys(objArr);
}
var objArrKeys = Object.keys(objArr);
var objArrLength = objArrKeys.length;
var total = 0;
var results = [];
var pending = new Promise(function (resolve, reject) {
var next = function next(errors) {
results.push.apply(results, errors);
total++;
if (total === objArrLength) {
callback(results);
return results.length ? reject({ errors: results, fields: convertFieldsError(results) }) : resolve();
}
};
objArrKeys.forEach(function (key) {
var arr = objArr[key];
if (firstFields.indexOf(key) !== -1) {
asyncSerialArray(arr, func, next);
} else {
asyncParallelArray(arr, func, next);
}
});
});
pending['catch'](function (e) {
return e;
});
return pending;
}
function complementError(rule) {
return function (oe) {
if (oe && oe.message) {
oe.field = oe.field || rule.fullField;
return oe;
}
return {
message: typeof oe === 'function' ? oe() : oe,
field: oe.field || rule.fullField
};
};
}
function deepMerge(target, source) {
if (source) {
for (var s in source) {
if (source.hasOwnProperty(s)) {
var value = source[s];
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(target[s]) === 'object') {
target[s] = _extends({}, target[s], value);
} else {
target[s] = value;
}
}
}
}
return target;
}
/***/ }),
/***/ 875:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _required = __webpack_require__(927);
var _required2 = _interopRequireDefault(_required);
var _whitespace = __webpack_require__(1042);
var _whitespace2 = _interopRequireDefault(_whitespace);
var _type = __webpack_require__(1043);
var _type2 = _interopRequireDefault(_type);
var _range = __webpack_require__(1044);
var _range2 = _interopRequireDefault(_range);
var _enum = __webpack_require__(1045);
var _enum2 = _interopRequireDefault(_enum);
var _pattern = __webpack_require__(1046);
var _pattern2 = _interopRequireDefault(_pattern);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = {
required: _required2['default'],
whitespace: _whitespace2['default'],
type: _type2['default'],
range: _range2['default'],
'enum': _enum2['default'],
pattern: _pattern2['default']
};
/***/ }),
/***/ 877:
/***/ (function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/***/ 878:
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(960),
getValue = __webpack_require__(963);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ }),
/***/ 879:
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(884);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ }),
/***/ 880:
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(878);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/***/ 881:
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(972);
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ }),
/***/ 882:
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(322);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;
/***/ }),
/***/ 884:
/***/ (function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
/***/ }),
/***/ 887:
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(877),
isKey = __webpack_require__(900),
stringToPath = __webpack_require__(977),
toString = __webpack_require__(950);
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
/***/ }),
/***/ 888:
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(955),
listCacheDelete = __webpack_require__(956),
listCacheGet = __webpack_require__(957),
listCacheHas = __webpack_require__(958),
listCacheSet = __webpack_require__(959);
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/***/ 890:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
ZERO: 48,
NINE: 57,
NUMPAD_ZERO: 96,
NUMPAD_NINE: 105,
BACKSPACE: 8,
DELETE: 46,
ENTER: 13,
ARROW_UP: 38,
ARROW_DOWN: 40
});
/***/ }),
/***/ 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
/***/ }),
/***/ 894:
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
/***/ }),
/***/ 896:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(18);
var _extends3 = _interopRequireDefault(_extends2);
exports.argumentContainer = argumentContainer;
exports.identity = identity;
exports.flattenArray = flattenArray;
exports.treeTraverse = treeTraverse;
exports.flattenFields = flattenFields;
exports.normalizeValidateRules = normalizeValidateRules;
exports.getValidateTriggers = getValidateTriggers;
exports.getValueFromEvent = getValueFromEvent;
exports.getErrorStrs = getErrorStrs;
exports.getParams = getParams;
exports.isEmptyObject = isEmptyObject;
exports.hasRules = hasRules;
exports.startsWith = startsWith;
var _hoistNonReactStatics = __webpack_require__(1013);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _warning = __webpack_require__(324);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'WrappedComponent';
}
function argumentContainer(Container, WrappedComponent) {
/* eslint no-param-reassign:0 */
Container.displayName = 'Form(' + getDisplayName(WrappedComponent) + ')';
Container.WrappedComponent = WrappedComponent;
return (0, _hoistNonReactStatics2['default'])(Container, WrappedComponent);
}
function identity(obj) {
return obj;
}
function flattenArray(arr) {
return Array.prototype.concat.apply([], arr);
}
function treeTraverse() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var tree = arguments[1];
var isLeafNode = arguments[2];
var errorMessage = arguments[3];
var callback = arguments[4];
if (isLeafNode(path, tree)) {
callback(path, tree);
} else if (tree === undefined || tree === null) {
// Do nothing
} else if (Array.isArray(tree)) {
tree.forEach(function (subTree, index) {
return treeTraverse(path + '[' + index + ']', subTree, isLeafNode, errorMessage, callback);
});
} else {
// It's object and not a leaf node
if (typeof tree !== 'object') {
(0, _warning2['default'])(false, errorMessage);
return;
}
Object.keys(tree).forEach(function (subTreeKey) {
var subTree = tree[subTreeKey];
treeTraverse('' + path + (path ? '.' : '') + subTreeKey, subTree, isLeafNode, errorMessage, callback);
});
}
}
function flattenFields(maybeNestedFields, isLeafNode, errorMessage) {
var fields = {};
treeTraverse(undefined, maybeNestedFields, isLeafNode, errorMessage, function (path, node) {
fields[path] = node;
});
return fields;
}
function normalizeValidateRules(validate, rules, validateTrigger) {
var validateRules = validate.map(function (item) {
var newItem = (0, _extends3['default'])({}, item, {
trigger: item.trigger || []
});
if (typeof newItem.trigger === 'string') {
newItem.trigger = [newItem.trigger];
}
return newItem;
});
if (rules) {
validateRules.push({
trigger: validateTrigger ? [].concat(validateTrigger) : [],
rules: rules
});
}
return validateRules;
}
function getValidateTriggers(validateRules) {
return validateRules.filter(function (item) {
return !!item.rules && item.rules.length;
}).map(function (item) {
return item.trigger;
}).reduce(function (pre, curr) {
return pre.concat(curr);
}, []);
}
function getValueFromEvent(e) {
// To support custom element
if (!e || !e.target) {
return e;
}
var target = e.target;
return target.type === 'checkbox' ? target.checked : target.value;
}
function getErrorStrs(errors) {
if (errors) {
return errors.map(function (e) {
if (e && e.message) {
return e.message;
}
return e;
});
}
return errors;
}
function getParams(ns, opt, cb) {
var names = ns;
var options = opt;
var callback = cb;
if (cb === undefined) {
if (typeof names === 'function') {
callback = names;
options = {};
names = undefined;
} else if (Array.isArray(names)) {
if (typeof options === 'function') {
callback = options;
options = {};
} else {
options = options || {};
}
} else {
callback = options;
options = names || {};
names = undefined;
}
}
return {
names: names,
options: options,
callback: callback
};
}
function isEmptyObject(obj) {
return Object.keys(obj).length === 0;
}
function hasRules(validate) {
if (validate) {
return validate.some(function (item) {
return item.rules && item.rules.length;
});
}
return false;
}
function startsWith(str, prefix) {
return str.lastIndexOf(prefix, 0) === 0;
}
/***/ }),
/***/ 897:
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(878),
root = __webpack_require__(167);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/***/ 898:
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(964),
mapCacheDelete = __webpack_require__(971),
mapCacheGet = __webpack_require__(973),
mapCacheHas = __webpack_require__(974),
mapCacheSet = __webpack_require__(975);
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/***/ 899:
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ }),
/***/ 900:
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(877),
isSymbol = __webpack_require__(322);
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
module.exports = isKey;
/***/ }),
/***/ 905:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(933);
__webpack_require__(318);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 906:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _Pagination = _interopRequireDefault(__webpack_require__(938));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = _Pagination["default"];
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 907:
/***/ (function(module, exports) {
/**
* Helper function for iterating over a collection
*
* @param collection
* @param fn
*/
function each(collection, fn) {
var i = 0,
length = collection.length,
cont;
for(i; i < length; i++) {
cont = fn(collection[i], i);
if(cont === false) {
break; //allow early exit
}
}
}
/**
* Helper function for determining whether target object is an array
*
* @param target the object under test
* @return {Boolean} true if array, false otherwise
*/
function isArray(target) {
return Object.prototype.toString.apply(target) === '[object Array]';
}
/**
* Helper function for determining whether target object is a function
*
* @param target the object under test
* @return {Boolean} true if function, false otherwise
*/
function isFunction(target) {
return typeof target === 'function';
}
module.exports = {
isFunction : isFunction,
isArray : isArray,
each : each
};
/***/ }),
/***/ 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
/***/ }),
/***/ 909:
/***/ (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 RowContext = (0, _createReactContext["default"])({});
var _default = RowContext;
exports["default"] = _default;
//# sourceMappingURL=RowContext.js.map
/***/ }),
/***/ 910:
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(319),
isObject = __webpack_require__(171);
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ }),
/***/ 911:
/***/ (function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ }),
/***/ 912:
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(976),
isObjectLike = __webpack_require__(320);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ }),
/***/ 913:
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(887),
toKey = __webpack_require__(882);
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
module.exports = baseGet;
/***/ }),
/***/ 922:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _rcDropdown = _interopRequireDefault(__webpack_require__(1089));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _configProvider = __webpack_require__(12);
var _warning = _interopRequireDefault(__webpack_require__(40));
var _icon = _interopRequireDefault(__webpack_require__(26));
var _type = __webpack_require__(70);
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 Placements = (0, _type.tuple)('topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight');
var Dropdown =
/*#__PURE__*/
function (_React$Component) {
_inherits(Dropdown, _React$Component);
function Dropdown() {
var _this;
_classCallCheck(this, Dropdown);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Dropdown).apply(this, arguments));
_this.renderOverlay = function (prefixCls) {
// rc-dropdown already can process the function of overlay, but we have check logic here.
// So we need render the element to check and pass back to rc-dropdown.
var overlay = _this.props.overlay;
var overlayNode;
if (typeof overlay === 'function') {
overlayNode = overlay();
} else {
overlayNode = overlay;
}
overlayNode = React.Children.only(overlayNode);
var overlayProps = overlayNode.props; // Warning if use other mode
(0, _warning["default"])(!overlayProps.mode || overlayProps.mode === 'vertical', 'Dropdown', "mode=\"".concat(overlayProps.mode, "\" is not supported for Dropdown's Menu.")); // menu cannot be selectable in dropdown defaultly
// menu should be focusable in dropdown defaultly
var _overlayProps$selecta = overlayProps.selectable,
selectable = _overlayProps$selecta === void 0 ? false : _overlayProps$selecta,
_overlayProps$focusab = overlayProps.focusable,
focusable = _overlayProps$focusab === void 0 ? true : _overlayProps$focusab;
var expandIcon = React.createElement("span", {
className: "".concat(prefixCls, "-menu-submenu-arrow")
}, React.createElement(_icon["default"], {
type: "right",
className: "".concat(prefixCls, "-menu-submenu-arrow-icon")
}));
var fixedModeOverlay = typeof overlayNode.type === 'string' ? overlay : React.cloneElement(overlayNode, {
mode: 'vertical',
selectable: selectable,
focusable: focusable,
expandIcon: expandIcon
});
return fixedModeOverlay;
};
_this.renderDropDown = function (_ref) {
var getContextPopupContainer = _ref.getPopupContainer,
getPrefixCls = _ref.getPrefixCls;
var _this$props = _this.props,
customizePrefixCls = _this$props.prefixCls,
children = _this$props.children,
trigger = _this$props.trigger,
disabled = _this$props.disabled,
getPopupContainer = _this$props.getPopupContainer;
var prefixCls = getPrefixCls('dropdown', customizePrefixCls);
var child = React.Children.only(children);
var dropdownTrigger = React.cloneElement(child, {
className: (0, _classnames["default"])(child.props.className, "".concat(prefixCls, "-trigger")),
disabled: disabled
});
var triggerActions = disabled ? [] : trigger;
var alignPoint;
if (triggerActions && triggerActions.indexOf('contextMenu') !== -1) {
alignPoint = true;
}
return React.createElement(_rcDropdown["default"], _extends({
alignPoint: alignPoint
}, _this.props, {
prefixCls: prefixCls,
getPopupContainer: getPopupContainer || getContextPopupContainer,
transitionName: _this.getTransitionName(),
trigger: triggerActions,
overlay: function overlay() {
return _this.renderOverlay(prefixCls);
}
}), dropdownTrigger);
};
return _this;
}
_createClass(Dropdown, [{
key: "getTransitionName",
value: function getTransitionName() {
var _this$props2 = this.props,
_this$props2$placemen = _this$props2.placement,
placement = _this$props2$placemen === void 0 ? '' : _this$props2$placemen,
transitionName = _this$props2.transitionName;
if (transitionName !== undefined) {
return transitionName;
}
if (placement.indexOf('top') >= 0) {
return 'slide-down';
}
return 'slide-up';
}
}, {
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderDropDown);
}
}]);
return Dropdown;
}(React.Component);
exports["default"] = Dropdown;
Dropdown.defaultProps = {
mouseEnterDelay: 0.15,
mouseLeaveDelay: 0.1,
placement: 'bottomLeft'
};
//# sourceMappingURL=dropdown.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
/***/ }),
/***/ 926:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _objectWithoutProperties2 = __webpack_require__(75);
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _defineProperty2 = __webpack_require__(59);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _extends5 = __webpack_require__(18);
var _extends6 = _interopRequireDefault(_extends5);
var _toConsumableArray2 = __webpack_require__(1008);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(1009);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _unsafeLifecyclesPolyfill = __webpack_require__(1038);
var _unsafeLifecyclesPolyfill2 = _interopRequireDefault(_unsafeLifecyclesPolyfill);
var _asyncValidator = __webpack_require__(1039);
var _asyncValidator2 = _interopRequireDefault(_asyncValidator);
var _warning = __webpack_require__(324);
var _warning2 = _interopRequireDefault(_warning);
var _get = __webpack_require__(934);
var _get2 = _interopRequireDefault(_get);
var _set = __webpack_require__(928);
var _set2 = _interopRequireDefault(_set);
var _eq = __webpack_require__(884);
var _eq2 = _interopRequireDefault(_eq);
var _createFieldsStore = __webpack_require__(1065);
var _createFieldsStore2 = _interopRequireDefault(_createFieldsStore);
var _utils = __webpack_require__(896);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/* eslint-disable react/prefer-es6-class */
/* eslint-disable prefer-promise-reject-errors */
var DEFAULT_TRIGGER = 'onChange';
function createBaseForm() {
var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var mixins = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var validateMessages = option.validateMessages,
onFieldsChange = option.onFieldsChange,
onValuesChange = option.onValuesChange,
_option$mapProps = option.mapProps,
mapProps = _option$mapProps === undefined ? _utils.identity : _option$mapProps,
mapPropsToFields = option.mapPropsToFields,
fieldNameProp = option.fieldNameProp,
fieldMetaProp = option.fieldMetaProp,
fieldDataProp = option.fieldDataProp,
_option$formPropName = option.formPropName,
formPropName = _option$formPropName === undefined ? 'form' : _option$formPropName,
formName = option.name,
withRef = option.withRef;
return function decorate(WrappedComponent) {
var Form = (0, _createReactClass2['default'])({
displayName: 'Form',
mixins: mixins,
getInitialState: function getInitialState() {
var _this = this;
var fields = mapPropsToFields && mapPropsToFields(this.props);
this.fieldsStore = (0, _createFieldsStore2['default'])(fields || {});
this.instances = {};
this.cachedBind = {};
this.clearedFieldMetaCache = {};
this.renderFields = {};
this.domFields = {};
// HACK: https://github.com/ant-design/ant-design/issues/6406
['getFieldsValue', 'getFieldValue', 'setFieldsInitialValue', 'getFieldsError', 'getFieldError', 'isFieldValidating', 'isFieldsValidating', 'isFieldsTouched', 'isFieldTouched'].forEach(function (key) {
_this[key] = function () {
var _fieldsStore;
if (false) {
(0, _warning2['default'])(false, 'you should not use `ref` on enhanced form, please use `wrappedComponentRef`. ' + 'See: https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140');
}
return (_fieldsStore = _this.fieldsStore)[key].apply(_fieldsStore, arguments);
};
});
return {
submitting: false
};
},
componentDidMount: function componentDidMount() {
this.cleanUpUselessFields();
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if (mapPropsToFields) {
this.fieldsStore.updateFields(mapPropsToFields(nextProps));
}
},
componentDidUpdate: function componentDidUpdate() {
this.cleanUpUselessFields();
},
onCollectCommon: function onCollectCommon(name, action, args) {
var fieldMeta = this.fieldsStore.getFieldMeta(name);
if (fieldMeta[action]) {
fieldMeta[action].apply(fieldMeta, (0, _toConsumableArray3['default'])(args));
} else if (fieldMeta.originalProps && fieldMeta.originalProps[action]) {
var _fieldMeta$originalPr;
(_fieldMeta$originalPr = fieldMeta.originalProps)[action].apply(_fieldMeta$originalPr, (0, _toConsumableArray3['default'])(args));
}
var value = fieldMeta.getValueFromEvent ? fieldMeta.getValueFromEvent.apply(fieldMeta, (0, _toConsumableArray3['default'])(args)) : _utils.getValueFromEvent.apply(undefined, (0, _toConsumableArray3['default'])(args));
if (onValuesChange && value !== this.fieldsStore.getFieldValue(name)) {
var valuesAll = this.fieldsStore.getAllValues();
var valuesAllSet = {};
valuesAll[name] = value;
Object.keys(valuesAll).forEach(function (key) {
return (0, _set2['default'])(valuesAllSet, key, valuesAll[key]);
});
onValuesChange((0, _extends6['default'])((0, _defineProperty3['default'])({}, formPropName, this.getForm()), this.props), (0, _set2['default'])({}, name, value), valuesAllSet);
}
var field = this.fieldsStore.getField(name);
return { name: name, field: (0, _extends6['default'])({}, field, { value: value, touched: true }), fieldMeta: fieldMeta };
},
onCollect: function onCollect(name_, action) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
var _onCollectCommon = this.onCollectCommon(name_, action, args),
name = _onCollectCommon.name,
field = _onCollectCommon.field,
fieldMeta = _onCollectCommon.fieldMeta;
var validate = fieldMeta.validate;
this.fieldsStore.setFieldsAsDirty();
var newField = (0, _extends6['default'])({}, field, {
dirty: (0, _utils.hasRules)(validate)
});
this.setFields((0, _defineProperty3['default'])({}, name, newField));
},
onCollectValidate: function onCollectValidate(name_, action) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
var _onCollectCommon2 = this.onCollectCommon(name_, action, args),
field = _onCollectCommon2.field,
fieldMeta = _onCollectCommon2.fieldMeta;
var newField = (0, _extends6['default'])({}, field, {
dirty: true
});
this.fieldsStore.setFieldsAsDirty();
this.validateFieldsInternal([newField], {
action: action,
options: {
firstFields: !!fieldMeta.validateFirst
}
});
},
getCacheBind: function getCacheBind(name, action, fn) {
if (!this.cachedBind[name]) {
this.cachedBind[name] = {};
}
var cache = this.cachedBind[name];
if (!cache[action] || cache[action].oriFn !== fn) {
cache[action] = {
fn: fn.bind(this, name, action),
oriFn: fn
};
}
return cache[action].fn;
},
getFieldDecorator: function getFieldDecorator(name, fieldOption) {
var _this2 = this;
var props = this.getFieldProps(name, fieldOption);
return function (fieldElem) {
// We should put field in record if it is rendered
_this2.renderFields[name] = true;
var fieldMeta = _this2.fieldsStore.getFieldMeta(name);
var originalProps = fieldElem.props;
if (false) {
var valuePropName = fieldMeta.valuePropName;
(0, _warning2['default'])(!(valuePropName in originalProps), '`getFieldDecorator` will override `' + valuePropName + '`, ' + ('so please don\'t set `' + valuePropName + '` directly ') + 'and use `setFieldsValue` to set it.');
var defaultValuePropName = 'default' + valuePropName[0].toUpperCase() + valuePropName.slice(1);
(0, _warning2['default'])(!(defaultValuePropName in originalProps), '`' + defaultValuePropName + '` is invalid ' + ('for `getFieldDecorator` will set `' + valuePropName + '`,') + ' please use `option.initialValue` instead.');
}
fieldMeta.originalProps = originalProps;
fieldMeta.ref = fieldElem.ref;
return _react2['default'].cloneElement(fieldElem, (0, _extends6['default'])({}, props, _this2.fieldsStore.getFieldValuePropValue(fieldMeta)));
};
},
getFieldProps: function getFieldProps(name) {
var _this3 = this;
var usersFieldOption = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!name) {
throw new Error('Must call `getFieldProps` with valid name string!');
}
if (false) {
(0, _warning2['default'])(this.fieldsStore.isValidNestedFieldName(name), 'One field name cannot be part of another, e.g. `a` and `a.b`. Check field: ' + name);
(0, _warning2['default'])(!('exclusive' in usersFieldOption), '`option.exclusive` of `getFieldProps`|`getFieldDecorator` had been remove.');
}
delete this.clearedFieldMetaCache[name];
var fieldOption = (0, _extends6['default'])({
name: name,
trigger: DEFAULT_TRIGGER,
valuePropName: 'value',
validate: []
}, usersFieldOption);
var rules = fieldOption.rules,
trigger = fieldOption.trigger,
_fieldOption$validate = fieldOption.validateTrigger,
validateTrigger = _fieldOption$validate === undefined ? trigger : _fieldOption$validate,
validate = fieldOption.validate;
var fieldMeta = this.fieldsStore.getFieldMeta(name);
if ('initialValue' in fieldOption) {
fieldMeta.initialValue = fieldOption.initialValue;
}
var inputProps = (0, _extends6['default'])({}, this.fieldsStore.getFieldValuePropValue(fieldOption), {
ref: this.getCacheBind(name, name + '__ref', this.saveRef)
});
if (fieldNameProp) {
inputProps[fieldNameProp] = formName ? formName + '_' + name : name;
}
var validateRules = (0, _utils.normalizeValidateRules)(validate, rules, validateTrigger);
var validateTriggers = (0, _utils.getValidateTriggers)(validateRules);
validateTriggers.forEach(function (action) {
if (inputProps[action]) return;
inputProps[action] = _this3.getCacheBind(name, action, _this3.onCollectValidate);
});
// make sure that the value will be collect
if (trigger && validateTriggers.indexOf(trigger) === -1) {
inputProps[trigger] = this.getCacheBind(name, trigger, this.onCollect);
}
var meta = (0, _extends6['default'])({}, fieldMeta, fieldOption, {
validate: validateRules
});
this.fieldsStore.setFieldMeta(name, meta);
if (fieldMetaProp) {
inputProps[fieldMetaProp] = meta;
}
if (fieldDataProp) {
inputProps[fieldDataProp] = this.fieldsStore.getField(name);
}
// This field is rendered, record it
this.renderFields[name] = true;
return inputProps;
},
getFieldInstance: function getFieldInstance(name) {
return this.instances[name];
},
getRules: function getRules(fieldMeta, action) {
var actionRules = fieldMeta.validate.filter(function (item) {
return !action || item.trigger.indexOf(action) >= 0;
}).map(function (item) {
return item.rules;
});
return (0, _utils.flattenArray)(actionRules);
},
setFields: function setFields(maybeNestedFields, callback) {
var _this4 = this;
var fields = this.fieldsStore.flattenRegisteredFields(maybeNestedFields);
this.fieldsStore.setFields(fields);
if (onFieldsChange) {
var changedFields = Object.keys(fields).reduce(function (acc, name) {
return (0, _set2['default'])(acc, name, _this4.fieldsStore.getField(name));
}, {});
onFieldsChange((0, _extends6['default'])((0, _defineProperty3['default'])({}, formPropName, this.getForm()), this.props), changedFields, this.fieldsStore.getNestedAllFields());
}
this.forceUpdate(callback);
},
setFieldsValue: function setFieldsValue(changedValues, callback) {
var fieldsMeta = this.fieldsStore.fieldsMeta;
var values = this.fieldsStore.flattenRegisteredFields(changedValues);
var newFields = Object.keys(values).reduce(function (acc, name) {
var isRegistered = fieldsMeta[name];
if (false) {
(0, _warning2['default'])(isRegistered, 'Cannot use `setFieldsValue` until ' + 'you use `getFieldDecorator` or `getFieldProps` to register it.');
}
if (isRegistered) {
var value = values[name];
acc[name] = {
value: value
};
}
return acc;
}, {});
this.setFields(newFields, callback);
if (onValuesChange) {
var allValues = this.fieldsStore.getAllValues();
onValuesChange((0, _extends6['default'])((0, _defineProperty3['default'])({}, formPropName, this.getForm()), this.props), changedValues, allValues);
}
},
saveRef: function saveRef(name, _, component) {
if (!component) {
var _fieldMeta = this.fieldsStore.getFieldMeta(name);
if (!_fieldMeta.preserve) {
// after destroy, delete data
this.clearedFieldMetaCache[name] = {
field: this.fieldsStore.getField(name),
meta: _fieldMeta
};
this.clearField(name);
}
delete this.domFields[name];
return;
}
this.domFields[name] = true;
this.recoverClearedField(name);
var fieldMeta = this.fieldsStore.getFieldMeta(name);
if (fieldMeta) {
var ref = fieldMeta.ref;
if (ref) {
if (typeof ref === 'string') {
throw new Error('can not set ref string for ' + name);
} else if (typeof ref === 'function') {
ref(component);
} else if (Object.prototype.hasOwnProperty.call(ref, 'current')) {
ref.current = component;
}
}
}
this.instances[name] = component;
},
cleanUpUselessFields: function cleanUpUselessFields() {
var _this5 = this;
var fieldList = this.fieldsStore.getAllFieldsName();
var removedList = fieldList.filter(function (field) {
var fieldMeta = _this5.fieldsStore.getFieldMeta(field);
return !_this5.renderFields[field] && !_this5.domFields[field] && !fieldMeta.preserve;
});
if (removedList.length) {
removedList.forEach(this.clearField);
}
this.renderFields = {};
},
clearField: function clearField(name) {
this.fieldsStore.clearField(name);
delete this.instances[name];
delete this.cachedBind[name];
},
resetFields: function resetFields(ns) {
var _this6 = this;
var newFields = this.fieldsStore.resetFields(ns);
if (Object.keys(newFields).length > 0) {
this.setFields(newFields);
}
if (ns) {
var names = Array.isArray(ns) ? ns : [ns];
names.forEach(function (name) {
return delete _this6.clearedFieldMetaCache[name];
});
} else {
this.clearedFieldMetaCache = {};
}
},
recoverClearedField: function recoverClearedField(name) {
if (this.clearedFieldMetaCache[name]) {
this.fieldsStore.setFields((0, _defineProperty3['default'])({}, name, this.clearedFieldMetaCache[name].field));
this.fieldsStore.setFieldMeta(name, this.clearedFieldMetaCache[name].meta);
delete this.clearedFieldMetaCache[name];
}
},
validateFieldsInternal: function validateFieldsInternal(fields, _ref, callback) {
var _this7 = this;
var fieldNames = _ref.fieldNames,
action = _ref.action,
_ref$options = _ref.options,
options = _ref$options === undefined ? {} : _ref$options;
var allRules = {};
var allValues = {};
var allFields = {};
var alreadyErrors = {};
fields.forEach(function (field) {
var name = field.name;
if (options.force !== true && field.dirty === false) {
if (field.errors) {
(0, _set2['default'])(alreadyErrors, name, { errors: field.errors });
}
return;
}
var fieldMeta = _this7.fieldsStore.getFieldMeta(name);
var newField = (0, _extends6['default'])({}, field);
newField.errors = undefined;
newField.validating = true;
newField.dirty = true;
allRules[name] = _this7.getRules(fieldMeta, action);
allValues[name] = newField.value;
allFields[name] = newField;
});
this.setFields(allFields);
// in case normalize
Object.keys(allValues).forEach(function (f) {
allValues[f] = _this7.fieldsStore.getFieldValue(f);
});
if (callback && (0, _utils.isEmptyObject)(allFields)) {
callback((0, _utils.isEmptyObject)(alreadyErrors) ? null : alreadyErrors, this.fieldsStore.getFieldsValue(fieldNames));
return;
}
var validator = new _asyncValidator2['default'](allRules);
if (validateMessages) {
validator.messages(validateMessages);
}
validator.validate(allValues, options, function (errors) {
var errorsGroup = (0, _extends6['default'])({}, alreadyErrors);
if (errors && errors.length) {
errors.forEach(function (e) {
var errorFieldName = e.field;
var fieldName = errorFieldName;
// Handle using array validation rule.
// ref: https://github.com/ant-design/ant-design/issues/14275
Object.keys(allRules).some(function (ruleFieldName) {
var rules = allRules[ruleFieldName] || [];
// Exist if match rule
if (ruleFieldName === errorFieldName) {
fieldName = ruleFieldName;
return true;
}
// Skip if not match array type
if (rules.every(function (_ref2) {
var type = _ref2.type;
return type !== 'array';
}) || errorFieldName.indexOf(ruleFieldName + '.') !== 0) {
return false;
}
// Exist if match the field name
var restPath = errorFieldName.slice(ruleFieldName.length + 1);
if (/^\d+$/.test(restPath)) {
fieldName = ruleFieldName;
return true;
}
return false;
});
var field = (0, _get2['default'])(errorsGroup, fieldName);
if (typeof field !== 'object' || Array.isArray(field)) {
(0, _set2['default'])(errorsGroup, fieldName, { errors: [] });
}
var fieldErrors = (0, _get2['default'])(errorsGroup, fieldName.concat('.errors'));
fieldErrors.push(e);
});
}
var expired = [];
var nowAllFields = {};
Object.keys(allRules).forEach(function (name) {
var fieldErrors = (0, _get2['default'])(errorsGroup, name);
var nowField = _this7.fieldsStore.getField(name);
// avoid concurrency problems
if (!(0, _eq2['default'])(nowField.value, allValues[name])) {
expired.push({
name: name
});
} else {
nowField.errors = fieldErrors && fieldErrors.errors;
nowField.value = allValues[name];
nowField.validating = false;
nowField.dirty = false;
nowAllFields[name] = nowField;
}
});
_this7.setFields(nowAllFields);
if (callback) {
if (expired.length) {
expired.forEach(function (_ref3) {
var name = _ref3.name;
var fieldErrors = [{
message: name + ' need to revalidate',
field: name
}];
(0, _set2['default'])(errorsGroup, name, {
expired: true,
errors: fieldErrors
});
});
}
callback((0, _utils.isEmptyObject)(errorsGroup) ? null : errorsGroup, _this7.fieldsStore.getFieldsValue(fieldNames));
}
});
},
validateFields: function validateFields(ns, opt, cb) {
var _this8 = this;
var pending = new Promise(function (resolve, reject) {
var _getParams = (0, _utils.getParams)(ns, opt, cb),
names = _getParams.names,
options = _getParams.options;
var _getParams2 = (0, _utils.getParams)(ns, opt, cb),
callback = _getParams2.callback;
if (!callback || typeof callback === 'function') {
var oldCb = callback;
callback = function callback(errors, values) {
if (oldCb) {
oldCb(errors, values);
}
if (errors) {
reject({ errors: errors, values: values });
} else {
resolve(values);
}
};
}
var fieldNames = names ? _this8.fieldsStore.getValidFieldsFullName(names) : _this8.fieldsStore.getValidFieldsName();
var fields = fieldNames.filter(function (name) {
var fieldMeta = _this8.fieldsStore.getFieldMeta(name);
return (0, _utils.hasRules)(fieldMeta.validate);
}).map(function (name) {
var field = _this8.fieldsStore.getField(name);
field.value = _this8.fieldsStore.getFieldValue(name);
return field;
});
if (!fields.length) {
callback(null, _this8.fieldsStore.getFieldsValue(fieldNames));
return;
}
if (!('firstFields' in options)) {
options.firstFields = fieldNames.filter(function (name) {
var fieldMeta = _this8.fieldsStore.getFieldMeta(name);
return !!fieldMeta.validateFirst;
});
}
_this8.validateFieldsInternal(fields, {
fieldNames: fieldNames,
options: options
}, callback);
});
pending['catch'](function (e) {
// eslint-disable-next-line no-console
if (console.error && "production" !== 'production') {
// eslint-disable-next-line no-console
console.error(e);
}
return e;
});
return pending;
},
isSubmitting: function isSubmitting() {
if (false) {
(0, _warning2['default'])(false, '`isSubmitting` is deprecated. ' + "Actually, it's more convenient to handle submitting status by yourself.");
}
return this.state.submitting;
},
submit: function submit(callback) {
var _this9 = this;
if (false) {
(0, _warning2['default'])(false, '`submit` is deprecated. ' + "Actually, it's more convenient to handle submitting status by yourself.");
}
var fn = function fn() {
_this9.setState({
submitting: false
});
};
this.setState({
submitting: true
});
callback(fn);
},
render: function render() {
var _props = this.props,
wrappedComponentRef = _props.wrappedComponentRef,
restProps = (0, _objectWithoutProperties3['default'])(_props, ['wrappedComponentRef']); // eslint-disable-line
var formProps = (0, _defineProperty3['default'])({}, formPropName, this.getForm());
if (withRef) {
if (false) {
(0, _warning2['default'])(false, '`withRef` is deprecated, please use `wrappedComponentRef` instead. ' + 'See: https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140');
}
formProps.ref = 'wrappedComponent';
} else if (wrappedComponentRef) {
formProps.ref = wrappedComponentRef;
}
var props = mapProps.call(this, (0, _extends6['default'])({}, formProps, restProps));
return _react2['default'].createElement(WrappedComponent, props);
}
});
return (0, _utils.argumentContainer)((0, _unsafeLifecyclesPolyfill2['default'])(Form), WrappedComponent);
};
}
exports['default'] = createBaseForm;
module.exports = exports['default'];
/***/ }),
/***/ 927:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(874);
var util = _interopRequireWildcard(_util);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
/**
* Rule for validating required fields.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function required(rule, value, source, errors, options, type) {
if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {
errors.push(util.format(options.messages.required, rule.fullField));
}
}
exports['default'] = required;
/***/ }),
/***/ 928:
/***/ (function(module, exports, __webpack_require__) {
var baseSet = __webpack_require__(1061);
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
module.exports = set;
/***/ }),
/***/ 929:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(18);
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = __webpack_require__(9);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
exports.isFormField = isFormField;
exports["default"] = createFormField;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var Field = function Field(fields) {
(0, _classCallCheck3["default"])(this, Field);
(0, _extends3["default"])(this, fields);
};
function isFormField(obj) {
return obj instanceof Field;
}
function createFormField(field) {
if (isFormField(field)) {
return field;
}
return new Field(field);
}
/***/ }),
/***/ 930:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FIELD_DATA_PROP = exports.FIELD_META_PROP = void 0;
var FIELD_META_PROP = 'data-__meta';
exports.FIELD_META_PROP = FIELD_META_PROP;
var FIELD_DATA_PROP = 'data-__field';
exports.FIELD_DATA_PROP = FIELD_DATA_PROP;
//# sourceMappingURL=constants.js.map
/***/ }),
/***/ 931:
/***/ (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 FormContext = (0, _createReactContext["default"])({
labelAlign: 'right',
vertical: false
});
var _default = FormContext;
exports["default"] = _default;
//# sourceMappingURL=context.js.map
/***/ }),
/***/ 932:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validProgress = validProgress;
// eslint-disable-next-line import/prefer-default-export
function validProgress(progress) {
if (!progress || progress < 0) {
return 0;
}
if (progress > 100) {
return 100;
}
return progress;
}
//# sourceMappingURL=utils.js.map
/***/ }),
/***/ 933:
/***/ (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__(937);
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;
/***/ }),
/***/ 934:
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(913);
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ }),
/***/ 935:
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(887),
isArguments = __webpack_require__(912),
isArray = __webpack_require__(877),
isIndex = __webpack_require__(894),
isLength = __webpack_require__(899),
toKey = __webpack_require__(882);
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
module.exports = hasPath;
/***/ }),
/***/ 937:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(312)(true);
// imports
// module
exports.push([module.i, ".ant-pagination{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\"}.ant-pagination,.ant-pagination ol,.ant-pagination ul{margin:0;padding:0;list-style:none}.ant-pagination:after{display:block;clear:both;height:0;overflow:hidden;visibility:hidden;content:\" \"}.ant-pagination-item,.ant-pagination-total-text{display:inline-block;height:32px;margin-right:8px;line-height:30px;vertical-align:middle}.ant-pagination-item{min-width:32px;font-family:Arial;text-align:center;list-style:none;background-color:#fff;border:1px solid #d9d9d9;border-radius:4px;outline:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-item a{display:block;padding:0 6px;color:rgba(0,0,0,.65);-webkit-transition:none;-o-transition:none;transition:none}.ant-pagination-item a:hover{text-decoration:none}.ant-pagination-item:focus,.ant-pagination-item:hover{border-color:#1890ff;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-pagination-item:focus a,.ant-pagination-item:hover a{color:#1890ff}.ant-pagination-item-active{font-weight:500;background:#fff;border-color:#1890ff}.ant-pagination-item-active a{color:#1890ff}.ant-pagination-item-active:focus,.ant-pagination-item-active:hover{border-color:#40a9ff}.ant-pagination-item-active:focus a,.ant-pagination-item-active:hover a{color:#40a9ff}.ant-pagination-jump-next,.ant-pagination-jump-prev{outline:0}.ant-pagination-jump-next .ant-pagination-item-container,.ant-pagination-jump-prev .ant-pagination-item-container{position:relative}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon{display:inline-block;font-size:12px;font-size:12px\\9;-webkit-transform:scale(1) rotate(0deg);-ms-transform:scale(1) rotate(0deg);transform:scale(1) rotate(0deg);color:#1890ff;letter-spacing:-1px;opacity:0;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}:root .ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon,:root .ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon{font-size:12px}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon-svg,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon-svg{top:0;right:0;bottom:0;left:0;margin:auto}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis{position:absolute;top:0;right:0;bottom:0;left:0;display:block;margin:auto;color:rgba(0,0,0,.25);letter-spacing:2px;text-align:center;text-indent:.13em;opacity:1;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.ant-pagination-jump-next:focus .ant-pagination-item-link-icon,.ant-pagination-jump-next:hover .ant-pagination-item-link-icon,.ant-pagination-jump-prev:focus .ant-pagination-item-link-icon,.ant-pagination-jump-prev:hover .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:focus .ant-pagination-item-ellipsis,.ant-pagination-jump-next:hover .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:focus .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:hover .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-prev{margin-right:8px}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-next,.ant-pagination-prev{display:inline-block;min-width:32px;height:32px;color:rgba(0,0,0,.65);font-family:Arial;line-height:32px;text-align:center;vertical-align:middle;list-style:none;border-radius:4px;cursor:pointer;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.ant-pagination-next,.ant-pagination-prev{outline:0}.ant-pagination-next a,.ant-pagination-prev a{color:rgba(0,0,0,.65);-
// exports
/***/ }),
/***/ 938:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _rcPagination = _interopRequireDefault(__webpack_require__(939));
var _en_US = _interopRequireDefault(__webpack_require__(332));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _MiniSelect = _interopRequireDefault(__webpack_require__(944));
var _icon = _interopRequireDefault(__webpack_require__(26));
var _select = _interopRequireDefault(__webpack_require__(315));
var _LocaleReceiver = _interopRequireDefault(__webpack_require__(71));
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 _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 Pagination =
/*#__PURE__*/
function (_React$Component) {
_inherits(Pagination, _React$Component);
function Pagination() {
var _this;
_classCallCheck(this, Pagination);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Pagination).apply(this, arguments));
_this.getIconsProps = function (prefixCls) {
var prevIcon = React.createElement("a", {
className: "".concat(prefixCls, "-item-link")
}, React.createElement(_icon["default"], {
type: "left"
}));
var nextIcon = React.createElement("a", {
className: "".concat(prefixCls, "-item-link")
}, React.createElement(_icon["default"], {
type: "right"
}));
var jumpPrevIcon = React.createElement("a", {
className: "".concat(prefixCls, "-item-link")
}, React.createElement("div", {
className: "".concat(prefixCls, "-item-container")
}, React.createElement(_icon["default"], {
className: "".concat(prefixCls, "-item-link-icon"),
type: "double-left"
}), React.createElement("span", {
className: "".concat(prefixCls, "-item-ellipsis")
}, "\u2022\u2022\u2022")));
var jumpNextIcon = React.createElement("a", {
className: "".concat(prefixCls, "-item-link")
}, React.createElement("div", {
className: "".concat(prefixCls, "-item-container")
}, React.createElement(_icon["default"], {
className: "".concat(prefixCls, "-item-link-icon"),
type: "double-right"
}), React.createElement("span", {
className: "".concat(prefixCls, "-item-ellipsis")
}, "\u2022\u2022\u2022")));
return {
prevIcon: prevIcon,
nextIcon: nextIcon,
jumpPrevIcon: jumpPrevIcon,
jumpNextIcon: jumpNextIcon
};
};
_this.renderPagination = function (contextLocale) {
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
customizeSelectPrefixCls = _a.selectPrefixCls,
className = _a.className,
size = _a.size,
customLocale = _a.locale,
restProps = __rest(_a, ["prefixCls", "selectPrefixCls", "className", "size", "locale"]);
var locale = _extends(_extends({}, contextLocale), customLocale);
var isSmall = size === 'small';
return React.createElement(_configProvider.ConfigConsumer, null, function (_ref) {
var getPrefixCls = _ref.getPrefixCls;
var prefixCls = getPrefixCls('pagination', customizePrefixCls);
var selectPrefixCls = getPrefixCls('select', customizeSelectPrefixCls);
return React.createElement(_rcPagination["default"], _extends({}, restProps, {
prefixCls: prefixCls,
selectPrefixCls: selectPrefixCls
}, _this.getIconsProps(prefixCls), {
className: (0, _classnames["default"])(className, {
mini: isSmall
}),
selectComponentClass: isSmall ? _MiniSelect["default"] : _select["default"],
locale: locale
}));
});
};
return _this;
}
_createClass(Pagination, [{
key: "render",
value: function render() {
return React.createElement(_LocaleReceiver["default"], {
componentName: "Pagination",
defaultLocale: _en_US["default"]
}, this.renderPagination);
}
}]);
return Pagination;
}(React.Component);
exports["default"] = Pagination;
//# sourceMappingURL=Pagination.js.map
/***/ }),
/***/ 939:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Pagination__ = __webpack_require__(940);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__Pagination__["a"]; });
/***/ }),
/***/ 940:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* 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_babel_runtime_helpers_extends__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
/* 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_classnames__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_classnames__);
/* 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__Pager__ = __webpack_require__(941);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Options__ = __webpack_require__(942);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__KeyCode__ = __webpack_require__(890);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__locale_zh_CN__ = __webpack_require__(943);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_react_lifecycles_compat__ = __webpack_require__(7);
function noop() {}
function isInteger(value) {
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
}
function defaultItemRender(page, type, element) {
return element;
}
function calculatePage(p, state, props) {
var pageSize = p;
if (typeof pageSize === 'undefined') {
pageSize = state.pageSize;
}
return Math.floor((props.total - 1) / pageSize) + 1;
}
var Pagination = function (_React$Component) {
__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default()(Pagination, _React$Component);
function Pagination(props) {
__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Pagination);
var _this = __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Pagination.__proto__ || Object.getPrototypeOf(Pagination)).call(this, props));
_initialiseProps.call(_this);
var hasOnChange = props.onChange !== noop;
var hasCurrent = 'current' in props;
if (hasCurrent && !hasOnChange) {
console.warn('Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.'); // eslint-disable-line
}
var current = props.defaultCurrent;
if ('current' in props) {
current = props.current;
}
var pageSize = props.defaultPageSize;
if ('pageSize' in props) {
pageSize = props.pageSize;
}
current = Math.min(current, calculatePage(pageSize, undefined, props));
_this.state = {
current: current,
currentInputValue: current,
pageSize: pageSize
};
return _this;
}
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass___default()(Pagination, [{
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps, prevState) {
// When current page change, fix focused style of prev item
// A hacky solution of https://github.com/ant-design/ant-design/issues/8948
var prefixCls = this.props.prefixCls;
if (prevState.current !== this.state.current && this.paginationNode) {
var lastCurrentNode = this.paginationNode.querySelector('.' + prefixCls + '-item-' + prevState.current);
if (lastCurrentNode && document.activeElement === lastCurrentNode) {
lastCurrentNode.blur();
}
}
}
}, {
key: 'getValidValue',
value: function getValidValue(e) {
var inputValue = e.target.value;
var allPages = calculatePage(undefined, this.state, this.props);
var currentInputValue = this.state.currentInputValue;
var value = void 0;
if (inputValue === '') {
value = inputValue;
} else if (isNaN(Number(inputValue))) {
value = currentInputValue;
} else if (inputValue >= allPages) {
value = allPages;
} else {
value = Number(inputValue);
}
return value;
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
prefixCls = _props.prefixCls,
className = _props.className,
disabled = _props.disabled;
// When hideOnSinglePage is true and there is only 1 page, hide the pager
if (this.props.hideOnSinglePage === true && this.props.total <= this.state.pageSize) {
return null;
}
var props = this.props;
var locale = props.locale;
var allPages = calculatePage(undefined, this.state, this.props);
var pagerList = [];
var jumpPrev = null;
var jumpNext = null;
var firstPager = null;
var lastPager = null;
var gotoButton = null;
var goButton = props.showQuickJumper && props.showQuickJumper.goButton;
var pageBufferSize = props.showLessItems ? 1 : 2;
var _state = this.state,
current = _state.current,
pageSize = _state.pageSize;
var prevPage = current - 1 > 0 ? current - 1 : 0;
var nextPage = current + 1 < allPages ? current + 1 : allPages;
var dataOrAriaAttributeProps = Object.keys(props).reduce(function (prev, key) {
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
prev[key] = props[key];
}
return prev;
}, {});
if (props.simple) {
if (goButton) {
if (typeof goButton === 'boolean') {
gotoButton = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'button',
{
type: 'button',
onClick: this.handleGoTO,
onKeyUp: this.handleGoTO
},
locale.jump_to_confirm
);
} else {
gotoButton = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'span',
{
onClick: this.handleGoTO,
onKeyUp: this.handleGoTO
},
goButton
);
}
gotoButton = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? '' + locale.jump_to + this.state.current + '/' + allPages : null,
className: prefixCls + '-simple-pager'
},
gotoButton
);
}
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'ul',
__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({
className: prefixCls + ' ' + prefixCls + '-simple ' + props.className,
style: props.style,
ref: this.savePaginationNode
}, dataOrAriaAttributeProps),
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? locale.prev_page : null,
onClick: this.prev,
tabIndex: this.hasPrev() ? 0 : null,
onKeyPress: this.runIfEnterPrev,
className: (this.hasPrev() ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-prev',
'aria-disabled': !this.hasPrev()
},
props.itemRender(prevPage, 'prev', this.getItemIcon(props.prevIcon))
),
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? this.state.current + '/' + allPages : null,
className: prefixCls + '-simple-pager'
},
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('input', {
type: 'text',
value: this.state.currentInputValue,
onKeyDown: this.handleKeyDown,
onKeyUp: this.handleKeyUp,
onChange: this.handleKeyUp,
size: '3'
}),
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'span',
{ className: prefixCls + '-slash' },
'/'
),
allPages
),
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? locale.next_page : null,
onClick: this.next,
tabIndex: this.hasPrev() ? 0 : null,
onKeyPress: this.runIfEnterNext,
className: (this.hasNext() ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-next',
'aria-disabled': !this.hasNext()
},
props.itemRender(nextPage, 'next', this.getItemIcon(props.nextIcon))
),
gotoButton
);
}
if (allPages <= 5 + pageBufferSize * 2) {
var pagerProps = {
locale: locale,
rootPrefixCls: prefixCls,
onClick: this.handleChange,
onKeyPress: this.runIfEnter,
showTitle: props.showTitle,
itemRender: props.itemRender
};
if (!allPages) {
pagerList.push(__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Pager__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, pagerProps, {
key: 'noPager',
page: allPages,
className: prefixCls + '-disabled'
})));
}
for (var i = 1; i <= allPages; i++) {
var active = this.state.current === i;
pagerList.push(__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Pager__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, pagerProps, {
key: i,
page: i,
active: active
})));
}
} else {
var prevItemTitle = props.showLessItems ? locale.prev_3 : locale.prev_5;
var nextItemTitle = props.showLessItems ? locale.next_3 : locale.next_5;
if (props.showPrevNextJumpers) {
var jumpPrevClassString = prefixCls + '-jump-prev';
if (props.jumpPrevIcon) {
jumpPrevClassString += ' ' + prefixCls + '-jump-prev-custom-icon';
}
jumpPrev = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? prevItemTitle : null,
key: 'prev',
onClick: this.jumpPrev,
tabIndex: '0',
onKeyPress: this.runIfEnterJumpPrev,
className: jumpPrevClassString
},
props.itemRender(this.getJumpPrevPage(), 'jump-prev', this.getItemIcon(props.jumpPrevIcon))
);
var jumpNextClassString = prefixCls + '-jump-next';
if (props.jumpNextIcon) {
jumpNextClassString += ' ' + prefixCls + '-jump-next-custom-icon';
}
jumpNext = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? nextItemTitle : null,
key: 'next',
tabIndex: '0',
onClick: this.jumpNext,
onKeyPress: this.runIfEnterJumpNext,
className: jumpNextClassString
},
props.itemRender(this.getJumpNextPage(), 'jump-next', this.getItemIcon(props.jumpNextIcon))
);
}
lastPager = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Pager__["a" /* default */], {
locale: props.locale,
last: true,
rootPrefixCls: prefixCls,
onClick: this.handleChange,
onKeyPress: this.runIfEnter,
key: allPages,
page: allPages,
active: false,
showTitle: props.showTitle,
itemRender: props.itemRender
});
firstPager = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Pager__["a" /* default */], {
locale: props.locale,
rootPrefixCls: prefixCls,
onClick: this.handleChange,
onKeyPress: this.runIfEnter,
key: 1,
page: 1,
active: false,
showTitle: props.showTitle,
itemRender: props.itemRender
});
var left = Math.max(1, current - pageBufferSize);
var right = Math.min(current + pageBufferSize, allPages);
if (current - 1 <= pageBufferSize) {
right = 1 + pageBufferSize * 2;
}
if (allPages - current <= pageBufferSize) {
left = allPages - pageBufferSize * 2;
}
for (var _i = left; _i <= right; _i++) {
var _active = current === _i;
pagerList.push(__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Pager__["a" /* default */], {
locale: props.locale,
rootPrefixCls: prefixCls,
onClick: this.handleChange,
onKeyPress: this.runIfEnter,
key: _i,
page: _i,
active: _active,
showTitle: props.showTitle,
itemRender: props.itemRender
}));
}
if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) {
pagerList[0] = __WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(pagerList[0], {
className: prefixCls + '-item-after-jump-prev'
});
pagerList.unshift(jumpPrev);
}
if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) {
pagerList[pagerList.length - 1] = __WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(pagerList[pagerList.length - 1], {
className: prefixCls + '-item-before-jump-next'
});
pagerList.push(jumpNext);
}
if (left !== 1) {
pagerList.unshift(firstPager);
}
if (right !== allPages) {
pagerList.push(lastPager);
}
}
var totalText = null;
if (props.showTotal) {
totalText = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{ className: prefixCls + '-total-text' },
props.showTotal(props.total, [props.total === 0 ? 0 : (current - 1) * pageSize + 1, current * pageSize > props.total ? props.total : current * pageSize])
);
}
var prevDisabled = !this.hasPrev() || !allPages;
var nextDisabled = !this.hasNext() || !allPages;
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'ul',
__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({
className: __WEBPACK_IMPORTED_MODULE_7_classnames___default()(prefixCls, className, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()({}, prefixCls + '-disabled', disabled)),
style: props.style,
unselectable: 'unselectable',
ref: this.savePaginationNode
}, dataOrAriaAttributeProps),
totalText,
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? locale.prev_page : null,
onClick: this.prev,
tabIndex: prevDisabled ? null : 0,
onKeyPress: this.runIfEnterPrev,
className: (!prevDisabled ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-prev',
'aria-disabled': prevDisabled
},
props.itemRender(prevPage, 'prev', this.getItemIcon(props.prevIcon))
),
pagerList,
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
'li',
{
title: props.showTitle ? locale.next_page : null,
onClick: this.next,
tabIndex: nextDisabled ? null : 0,
onKeyPress: this.runIfEnterNext,
className: (!nextDisabled ? '' : prefixCls + '-disabled') + ' ' + prefixCls + '-next',
'aria-disabled': nextDisabled
},
props.itemRender(nextPage, 'next', this.getItemIcon(props.nextIcon))
),
__WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__Options__["a" /* default */], {
disabled: disabled,
locale: props.locale,
rootPrefixCls: prefixCls,
selectComponentClass: props.selectComponentClass,
selectPrefixCls: props.selectPrefixCls,
changeSize: this.props.showSizeChanger ? this.changePageSize : null,
current: this.state.current,
pageSize: this.state.pageSize,
pageSizeOptions: this.props.pageSizeOptions,
quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null,
goButton: goButton
})
);
}
}], [{
key: 'getDerivedStateFromProps',
value: function getDerivedStateFromProps(props, prevState) {
var newState = {};
if ('current' in props) {
newState.current = props.current;
if (props.current !== prevState.current) {
newState.currentInputValue = newState.current;
}
}
if ('pageSize' in props && props.pageSize !== prevState.pageSize) {
var current = prevState.current;
var newCurrent = calculatePage(props.pageSize, prevState, props);
current = current > newCurrent ? newCurrent : current;
if (!('current' in props)) {
newState.current = current;
newState.currentInputValue = current;
}
newState.pageSize = props.pageSize;
}
return newState;
}
/**
* computed icon node that need to be rendered.
* @param {React.ReactNode | React.ComponentType<PaginationProps>} icon received icon.
* @returns {React.ReactNode}
*/
}]);
return Pagination;
}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
Pagination.propTypes = {
disabled: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
prefixCls: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
className: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
current: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
defaultCurrent: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
total: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
pageSize: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
defaultPageSize: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
onChange: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
hideOnSinglePage: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
showSizeChanger: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
showLessItems: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
onShowSizeChange: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
selectComponentClass: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
showPrevNextJumpers: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
showQuickJumper: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object]),
showTitle: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
pageSizeOptions: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string),
showTotal: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
locale: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object,
style: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object,
itemRender: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
prevIcon: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node]),
nextIcon: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node]),
jumpPrevIcon: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node]),
jumpNextIcon: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node])
};
Pagination.defaultProps = {
defaultCurrent: 1,
total: 0,
defaultPageSize: 10,
onChange: noop,
className: '',
selectPrefixCls: 'rc-select',
prefixCls: 'rc-pagination',
selectComponentClass: null,
hideOnSinglePage: false,
showPrevNextJumpers: true,
showQuickJumper: false,
showSizeChanger: false,
showLessItems: false,
showTitle: true,
onShowSizeChange: noop,
locale: __WEBPACK_IMPORTED_MODULE_12__locale_zh_CN__["a" /* default */],
style: {},
itemRender: defaultItemRender
};
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.getJumpPrevPage = function () {
return Math.max(1, _this2.state.current - (_this2.props.showLessItems ? 3 : 5));
};
this.getJumpNextPage = function () {
return Math.min(calculatePage(undefined, _this2.state, _this2.props), _this2.state.current + (_this2.props.showLessItems ? 3 : 5));
};
this.getItemIcon = function (icon) {
var prefixCls = _this2.props.prefixCls;
var iconNode = icon || __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('a', { className: prefixCls + '-item-link' });
if (typeof icon === 'function') {
iconNode = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(icon, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, _this2.props));
}
return iconNode;
};
this.savePaginationNode = function (node) {
_this2.paginationNode = node;
};
this.isValid = function (page) {
return isInteger(page) && page !== _this2.state.current;
};
this.shouldDisplayQuickJumper = function () {
var _props2 = _this2.props,
showQuickJumper = _props2.showQuickJumper,
pageSize = _props2.pageSize,
total = _props2.total;
if (total <= pageSize) {
return false;
}
return showQuickJumper;
};
this.handleKeyDown = function (e) {
if (e.keyCode === __WEBPACK_IMPORTED_MODULE_11__KeyCode__["a" /* default */].ARROW_UP || e.keyCode === __WEBPACK_IMPORTED_MODULE_11__KeyCode__["a" /* default */].ARROW_DOWN) {
e.preventDefault();
}
};
this.handleKeyUp = function (e) {
var value = _this2.getValidValue(e);
var currentInputValue = _this2.state.currentInputValue;
if (value !== currentInputValue) {
_this2.setState({
currentInputValue: value
});
}
if (e.keyCode === __WEBPACK_IMPORTED_MODULE_11__KeyCode__["a" /* default */].ENTER) {
_this2.handleChange(value);
} else if (e.keyCode === __WEBPACK_IMPORTED_MODULE_11__KeyCode__["a" /* default */].ARROW_UP) {
_this2.handleChange(value - 1);
} else if (e.keyCode === __WEBPACK_IMPORTED_MODULE_11__KeyCode__["a" /* default */].ARROW_DOWN) {
_this2.handleChange(value + 1);
}
};
this.changePageSize = function (size) {
var current = _this2.state.current;
var newCurrent = calculatePage(size, _this2.state, _this2.props);
current = current > newCurrent ? newCurrent : current;
// fix the issue:
// Once 'total' is 0, 'current' in 'onShowSizeChange' is 0, which is not correct.
if (newCurrent === 0) {
current = _this2.state.current;
}
if (typeof size === 'number') {
if (!('pageSize' in _this2.props)) {
_this2.setState({
pageSize: size
});
}
if (!('current' in _this2.props)) {
_this2.setState({
current: current,
currentInputValue: current
});
}
}
_this2.props.onShowSizeChange(current, size);
};
this.handleChange = function (p) {
var disabled = _this2.props.disabled;
var page = p;
if (_this2.isValid(page) && !disabled) {
var currentPage = calculatePage(undefined, _this2.state, _this2.props);
if (page > currentPage) {
page = currentPage;
} else if (page < 1) {
page = 1;
}
if (!('current' in _this2.props)) {
_this2.setState({
current: page,
currentInputValue: page
});
}
var pageSize = _this2.state.pageSize;
_this2.props.onChange(page, pageSize);
return page;
}
return _this2.state.current;
};
this.prev = function () {
if (_this2.hasPrev()) {
_this2.handleChange(_this2.state.current - 1);
}
};
this.next = function () {
if (_this2.hasNext()) {
_this2.handleChange(_this2.state.current + 1);
}
};
this.jumpPrev = function () {
_this2.handleChange(_this2.getJumpPrevPage());
};
this.jumpNext = function () {
_this2.handleChange(_this2.getJumpNextPage());
};
this.hasPrev = function () {
return _this2.state.current > 1;
};
this.hasNext = function () {
return _this2.state.current < calculatePage(undefined, _this2.state, _this2.props);
};
this.runIfEnter = function (event, callback) {
for (var _len = arguments.length, restParams = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
restParams[_key - 2] = arguments[_key];
}
if (event.key === 'Enter' || event.charCode === 13) {
callback.apply(undefined, restParams);
}
};
this.runIfEnterPrev = function (e) {
_this2.runIfEnter(e, _this2.prev);
};
this.runIfEnterNext = function (e) {
_this2.runIfEnter(e, _this2.next);
};
this.runIfEnterJumpPrev = function (e) {
_this2.runIfEnter(e, _this2.jumpPrev);
};
this.runIfEnterJumpNext = function (e) {
_this2.runIfEnter(e, _this2.jumpNext);
};
this.handleGoTO = function (e) {
if (e.keyCode === __WEBPACK_IMPORTED_MODULE_11__KeyCode__["a" /* default */].ENTER || e.type === 'click') {
_this2.handleChange(_this2.state.currentInputValue);
}
};
};
Object(__WEBPACK_IMPORTED_MODULE_13_react_lifecycles_compat__["polyfill"])(Pagination);
/* harmony default export */ __webpack_exports__["a"] = (Pagination);
/***/ }),
/***/ 941:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* 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__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_classnames__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_classnames__);
var Pager = function Pager(props) {
var _classNames;
var prefixCls = props.rootPrefixCls + '-item';
var cls = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(prefixCls, prefixCls + '-' + props.page, (_classNames = {}, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-active', props.active), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, props.className, !!props.className), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-disabled', !props.page), _classNames));
var handleClick = function handleClick() {
props.onClick(props.page);
};
var handleKeyPress = function handleKeyPress(e) {
props.onKeyPress(e, props.onClick, props.page);
};
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(
'li',
{
title: props.showTitle ? props.page : null,
className: cls,
onClick: handleClick,
onKeyPress: handleKeyPress,
tabIndex: '0'
},
props.itemRender(props.page, 'page', __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(
'a',
null,
props.page
))
);
};
Pager.propTypes = {
page: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,
active: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
last: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
locale: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object,
className: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
showTitle: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
rootPrefixCls: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
onClick: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
onKeyPress: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
itemRender: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func
};
/* harmony default export */ __webpack_exports__["a"] = (Pager);
/***/ }),
/***/ 942:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* 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__KeyCode__ = __webpack_require__(890);
var Options = function (_React$Component) {
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Options, _React$Component);
function Options() {
var _ref;
var _temp, _this, _ret;
__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, Options);
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 = Options.__proto__ || Object.getPrototypeOf(Options)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
goInputText: ''
}, _this.buildOptionText = function (value) {
return value + ' ' + _this.props.locale.items_per_page;
}, _this.changeSize = function (value) {
_this.props.changeSize(Number(value));
}, _this.handleChange = function (e) {
_this.setState({
goInputText: e.target.value
});
}, _this.handleBlur = function (e) {
var _this$props = _this.props,
goButton = _this$props.goButton,
quickGo = _this$props.quickGo,
rootPrefixCls = _this$props.rootPrefixCls;
if (goButton) {
return;
}
if (e.relatedTarget && (e.relatedTarget.className.indexOf(rootPrefixCls + '-prev') >= 0 || e.relatedTarget.className.indexOf(rootPrefixCls + '-next') >= 0)) {
return;
}
quickGo(_this.getValidValue());
}, _this.go = function (e) {
var goInputText = _this.state.goInputText;
if (goInputText === '') {
return;
}
if (e.keyCode === __WEBPACK_IMPORTED_MODULE_6__KeyCode__["a" /* default */].ENTER || e.type === 'click') {
_this.setState({
goInputText: ''
});
_this.props.quickGo(_this.getValidValue());
}
}, _temp), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
}
__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(Options, [{
key: 'getValidValue',
value: function getValidValue() {
var _state = this.state,
goInputText = _state.goInputText,
current = _state.current;
return !goInputText || isNaN(goInputText) ? current : Number(goInputText);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
pageSize = _props.pageSize,
pageSizeOptions = _props.pageSizeOptions,
locale = _props.locale,
rootPrefixCls = _props.rootPrefixCls,
changeSize = _props.changeSize,
quickGo = _props.quickGo,
goButton = _props.goButton,
selectComponentClass = _props.selectComponentClass,
buildOptionText = _props.buildOptionText,
selectPrefixCls = _props.selectPrefixCls,
disabled = _props.disabled;
var goInputText = this.state.goInputText;
var prefixCls = rootPrefixCls + '-options';
var Select = selectComponentClass;
var changeSelect = null;
var goInput = null;
var gotoButton = null;
if (!changeSize && !quickGo) {
return null;
}
if (changeSize && Select) {
var options = pageSizeOptions.map(function (opt, i) {
return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
Select.Option,
{ key: i, value: opt },
(buildOptionText || _this2.buildOptionText)(opt)
);
});
changeSelect = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
Select,
{
disabled: disabled,
prefixCls: selectPrefixCls,
showSearch: false,
className: prefixCls + '-size-changer',
optionLabelProp: 'children',
dropdownMatchSelectWidth: false,
value: (pageSize || pageSizeOptions[0]).toString(),
onChange: this.changeSize,
getPopupContainer: function getPopupContainer(triggerNode) {
return triggerNode.parentNode;
}
},
options
);
}
if (quickGo) {
if (goButton) {
gotoButton = typeof goButton === 'boolean' ? __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
'button',
{
type: 'button',
onClick: this.go,
onKeyUp: this.go,
disabled: disabled
},
locale.jump_to_confirm
) : __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
'span',
{
onClick: this.go,
onKeyUp: this.go
},
goButton
);
}
goInput = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
'div',
{ className: prefixCls + '-quick-jumper' },
locale.jump_to,
__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('input', {
disabled: disabled,
type: 'text',
value: goInputText,
onChange: this.handleChange,
onKeyUp: this.go,
onBlur: this.handleBlur
}),
locale.page,
gotoButton
);
}
return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
'li',
{ className: '' + prefixCls },
changeSelect,
goInput
);
}
}]);
return Options;
}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
Options.propTypes = {
disabled: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
changeSize: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
quickGo: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
selectComponentClass: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
current: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
pageSizeOptions: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string),
pageSize: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
buildOptionText: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
locale: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
rootPrefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
selectPrefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
goButton: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.node])
};
Options.defaultProps = {
pageSizeOptions: ['10', '20', '30', '40']
};
/* harmony default export */ __webpack_exports__["a"] = (Options);
/***/ }),
/***/ 943:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
// Options.jsx
items_per_page: '条/页',
jump_to: '跳至',
jump_to_confirm: '确定',
page: '页',
// Pagination.jsx
prev_page: '上一页',
next_page: '下一页',
prev_5: '向前 5 页',
next_5: '向后 5 页',
prev_3: '向前 3 页',
next_3: '向后 3 页'
});
/***/ }),
/***/ 944:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _select = _interopRequireDefault(__webpack_require__(315));
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 MiniSelect =
/*#__PURE__*/
function (_React$Component) {
_inherits(MiniSelect, _React$Component);
function MiniSelect() {
_classCallCheck(this, MiniSelect);
return _possibleConstructorReturn(this, _getPrototypeOf(MiniSelect).apply(this, arguments));
}
_createClass(MiniSelect, [{
key: "render",
value: function render() {
return React.createElement(_select["default"], _extends({
size: "small"
}, this.props));
}
}]);
return MiniSelect;
}(React.Component);
exports["default"] = MiniSelect;
MiniSelect.Option = _select["default"].Option;
//# sourceMappingURL=MiniSelect.js.map
/***/ }),
/***/ 949:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(999);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 950:
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(951);
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
/***/ }),
/***/ 951:
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(179),
arrayMap = __webpack_require__(952),
isArray = __webpack_require__(877),
isSymbol = __webpack_require__(322);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
/***/ }),
/***/ 952:
/***/ (function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ }),
/***/ 953:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(1032);
__webpack_require__(949);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 954:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _Form = _interopRequireDefault(__webpack_require__(1034));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = _Form["default"];
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 955:
/***/ (function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ }),
/***/ 956:
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(879);
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
/***/ }),
/***/ 957:
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(879);
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
/***/ }),
/***/ 958:
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(879);
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
/***/ }),
/***/ 959:
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(879);
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ }),
/***/ 960:
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(910),
isMasked = __webpack_require__(961),
isObject = __webpack_require__(171),
toSource = __webpack_require__(911);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ }),
/***/ 961:
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(962);
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
/***/ }),
/***/ 962:
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(167);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/***/ 963:
/***/ (function(module, exports) {
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
/***/ }),
/***/ 964:
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(965),
ListCache = __webpack_require__(888),
Map = __webpack_require__(897);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ }),
/***/ 965:
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(966),
hashDelete = __webpack_require__(967),
hashGet = __webpack_require__(968),
hashHas = __webpack_require__(969),
hashSet = __webpack_require__(970);
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ }),
/***/ 966:
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(880);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ }),
/***/ 967:
/***/ (function(module, exports) {
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
/***/ }),
/***/ 968:
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(880);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
/***/ }),
/***/ 969:
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(880);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
/***/ }),
/***/ 970:
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(880);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ }),
/***/ 971:
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(881);
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
/***/ }),
/***/ 972:
/***/ (function(module, exports) {
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
/***/ }),
/***/ 973:
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(881);
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
/***/ }),
/***/ 974:
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(881);
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
/***/ }),
/***/ 975:
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(881);
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
/***/ }),
/***/ 976:
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(319),
isObjectLike = __webpack_require__(320);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
/***/ }),
/***/ 977:
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(978);
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46 /* . */) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ }),
/***/ 978:
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(979);
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
/***/ }),
/***/ 979:
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(898);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ }),
/***/ 982:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _dropdown = _interopRequireDefault(__webpack_require__(922));
var _dropdownButton = _interopRequireDefault(__webpack_require__(1106));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
_dropdown["default"].Button = _dropdownButton["default"];
var _default = _dropdown["default"];
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 985:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(28);
__webpack_require__(1085);
__webpack_require__(87);
//# sourceMappingURL=css.js.map
/***/ }),
/***/ 986:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(__webpack_require__(0));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var PropTypes = _interopRequireWildcard(__webpack_require__(1));
var _configProvider = __webpack_require__(12);
var _RowContext = _interopRequireDefault(__webpack_require__(909));
var _type = __webpack_require__(70);
var _responsiveObserve = _interopRequireWildcard(__webpack_require__(1001));
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 __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 RowAligns = (0, _type.tuple)('top', 'middle', 'bottom', 'stretch');
var RowJustify = (0, _type.tuple)('start', 'end', 'center', 'space-around', 'space-between');
var Row =
/*#__PURE__*/
function (_React$Component) {
_inherits(Row, _React$Component);
function Row() {
var _this;
_classCallCheck(this, Row);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Row).apply(this, arguments));
_this.state = {
screens: {}
};
_this.renderRow = function (_ref) {
var _classNames;
var getPrefixCls = _ref.getPrefixCls;
var _a = _this.props,
customizePrefixCls = _a.prefixCls,
type = _a.type,
justify = _a.justify,
align = _a.align,
className = _a.className,
style = _a.style,
children = _a.children,
others = __rest(_a, ["prefixCls", "type", "justify", "align", "className", "style", "children"]);
var prefixCls = getPrefixCls('row', customizePrefixCls);
var gutter = _this.getGutter();
var classes = (0, _classnames["default"])((_classNames = {}, _defineProperty(_classNames, prefixCls, !type), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(type), type), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(type, "-").concat(justify), type && justify), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(type, "-").concat(align), type && align), _classNames), className);
var rowStyle = _extends(_extends(_extends({}, gutter[0] > 0 ? {
marginLeft: gutter[0] / -2,
marginRight: gutter[0] / -2
} : {}), gutter[1] > 0 ? {
marginTop: gutter[1] / -2,
marginBottom: gutter[1] / -2
} : {}), style);
var otherProps = _extends({}, others);
delete otherProps.gutter;
return React.createElement(_RowContext["default"].Provider, {
value: {
gutter: gutter
}
}, React.createElement("div", _extends({}, otherProps, {
className: classes,
style: rowStyle
}), children));
};
return _this;
}
_createClass(Row, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
this.token = _responsiveObserve["default"].subscribe(function (screens) {
var gutter = _this2.props.gutter;
if (_typeof(gutter) === 'object' || Array.isArray(gutter) && (_typeof(gutter[0]) === 'object' || _typeof(gutter[1]) === 'object')) {
_this2.setState({
screens: screens
});
}
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
_responsiveObserve["default"].unsubscribe(this.token);
}
}, {
key: "getGutter",
value: function getGutter() {
var results = [0, 0];
var gutter = this.props.gutter;
var screens = this.state.screens;
var normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, 0];
normalizedGutter.forEach(function (g, index) {
if (_typeof(g) === 'object') {
for (var i = 0; i < _responsiveObserve.responsiveArray.length; i++) {
var breakpoint = _responsiveObserve.responsiveArray[i];
if (screens[breakpoint] && g[breakpoint] !== undefined) {
results[index] = g[breakpoint];
break;
}
}
} else {
results[index] = g || 0;
}
});
return results;
}
}, {
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderRow);
}
}]);
return Row;
}(React.Component);
exports["default"] = Row;
Row.defaultProps = {
gutter: 0
};
Row.propTypes = {
type: PropTypes.oneOf(['flex']),
align: PropTypes.oneOf(RowAligns),
justify: PropTypes.oneOf(RowJustify),
className: PropTypes.string,
children: PropTypes.node,
gutter: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
prefixCls: PropTypes.string
};
//# sourceMappingURL=row.js.map
/***/ }),
/***/ 987:
/***/ (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 _classnames = _interopRequireDefault(__webpack_require__(3));
var _RowContext = _interopRequireDefault(__webpack_require__(909));
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 _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 _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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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 objectOrNumber = PropTypes.oneOfType([PropTypes.object, PropTypes.number]);
var Col =
/*#__PURE__*/
function (_React$Component) {
_inherits(Col, _React$Component);
function Col() {
var _this;
_classCallCheck(this, Col);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Col).apply(this, arguments));
_this.renderCol = function (_ref) {
var _classNames;
var getPrefixCls = _ref.getPrefixCls;
var _assertThisInitialize = _assertThisInitialized(_this),
props = _assertThisInitialize.props;
var customizePrefixCls = props.prefixCls,
span = props.span,
order = props.order,
offset = props.offset,
push = props.push,
pull = props.pull,
className = props.className,
children = props.children,
others = __rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children"]);
var prefixCls = getPrefixCls('col', customizePrefixCls);
var sizeClassObj = {};
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach(function (size) {
var _extends2;
var sizeProps = {};
var propSize = props[size];
if (typeof propSize === 'number') {
sizeProps.span = propSize;
} else if (_typeof(propSize) === 'object') {
sizeProps = propSize || {};
}
delete others[size];
sizeClassObj = _extends(_extends({}, sizeClassObj), (_extends2 = {}, _defineProperty(_extends2, "".concat(prefixCls, "-").concat(size, "-").concat(sizeProps.span), sizeProps.span !== undefined), _defineProperty(_extends2, "".concat(prefixCls, "-").concat(size, "-order-").concat(sizeProps.order), sizeProps.order || sizeProps.order === 0), _defineProperty(_extends2, "".concat(prefixCls, "-").concat(size, "-offset-").concat(sizeProps.offset), sizeProps.offset || sizeProps.offset === 0), _defineProperty(_extends2, "".concat(prefixCls, "-").concat(size, "-push-").concat(sizeProps.push), sizeProps.push || sizeProps.push === 0), _defineProperty(_extends2, "".concat(prefixCls, "-").concat(size, "-pull-").concat(sizeProps.pull), sizeProps.pull || sizeProps.pull === 0), _extends2));
});
var classes = (0, _classnames["default"])(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(span), span !== undefined), _defineProperty(_classNames, "".concat(prefixCls, "-order-").concat(order), order), _defineProperty(_classNames, "".concat(prefixCls, "-offset-").concat(offset), offset), _defineProperty(_classNames, "".concat(prefixCls, "-push-").concat(push), push), _defineProperty(_classNames, "".concat(prefixCls, "-pull-").concat(pull), pull), _classNames), className, sizeClassObj);
return React.createElement(_RowContext["default"].Consumer, null, function (_ref2) {
var gutter = _ref2.gutter;
var style = others.style;
if (gutter) {
style = _extends(_extends(_extends({}, gutter[0] > 0 ? {
paddingLeft: gutter[0] / 2,
paddingRight: gutter[0] / 2
} : {}), gutter[1] > 0 ? {
paddingTop: gutter[1] / 2,
paddingBottom: gutter[1] / 2
} : {}), style);
}
return React.createElement("div", _extends({}, others, {
style: style,
className: classes
}), children);
});
};
return _this;
}
_createClass(Col, [{
key: "render",
value: function render() {
return React.createElement(_configProvider.ConfigConsumer, null, this.renderCol);
}
}]);
return Col;
}(React.Component);
exports["default"] = Col;
Col.propTypes = {
span: PropTypes.number,
order: PropTypes.number,
offset: PropTypes.number,
push: PropTypes.number,
pull: PropTypes.number,
className: PropTypes.string,
children: PropTypes.node,
xs: objectOrNumber,
sm: objectOrNumber,
md: objectOrNumber,
lg: objectOrNumber,
xl: objectOrNumber,
xxl: objectOrNumber
};
//# sourceMappingURL=col.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
/***/ }),
/***/ 990:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
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 _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
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 enhancer = function enhancer(WrappedComponent) {
return (
/*#__PURE__*/
function (_WrappedComponent) {
_inherits(Progress, _WrappedComponent);
function Progress() {
_classCallCheck(this, Progress);
return _possibleConstructorReturn(this, _getPrototypeOf(Progress).apply(this, arguments));
}
_createClass(Progress, [{
key: "componentDidUpdate",
value: function componentDidUpdate() {
var _this = this;
var now = Date.now();
var updated = false;
Object.keys(this.paths).forEach(function (key) {
var path = _this.paths[key];
if (!path) {
return;
}
updated = true;
var pathStyle = path.style;
pathStyle.transitionDuration = '.3s, .3s, .3s, .06s';
if (_this.prevTimeStamp && now - _this.prevTimeStamp < 100) {
pathStyle.transitionDuration = '0s, 0s';
}
});
if (updated) {
this.prevTimeStamp = Date.now();
}
}
}, {
key: "render",
value: function render() {
return _get(_getPrototypeOf(Progress.prototype), "render", this).call(this);
}
}]);
return Progress;
}(WrappedComponent)
);
};
/* harmony default export */ __webpack_exports__["a"] = (enhancer);
/***/ }),
/***/ 991:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return defaultProps; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return propTypes; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
var defaultProps = {
className: '',
percent: 0,
prefixCls: 'rc-progress',
strokeColor: '#2db7f5',
strokeLinecap: 'round',
strokeWidth: 1,
style: {},
trailColor: '#D9D9D9',
trailWidth: 1
};
var mixedType = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string]);
var propTypes = {
className: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string,
percent: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOfType([mixedType, __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.arrayOf(mixedType)]),
prefixCls: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string,
strokeColor: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.object])), __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.object]),
strokeLinecap: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOf(['butt', 'round', 'square']),
strokeWidth: mixedType,
style: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.object,
trailColor: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string,
trailWidth: mixedType
};
/***/ }),
/***/ 993:
/***/ (function(module, exports, __webpack_require__) {
var MediaQueryDispatch = __webpack_require__(994);
module.exports = new MediaQueryDispatch();
/***/ }),
/***/ 994:
/***/ (function(module, exports, __webpack_require__) {
var MediaQuery = __webpack_require__(995);
var Util = __webpack_require__(907);
var each = Util.each;
var isFunction = Util.isFunction;
var isArray = Util.isArray;
/**
* Allows for registration of query handlers.
* Manages the query handler's state and is responsible for wiring up browser events
*
* @constructor
*/
function MediaQueryDispatch () {
if(!window.matchMedia) {
throw new Error('matchMedia not present, legacy browsers require a polyfill');
}
this.queries = {};
this.browserIsIncapable = !window.matchMedia('only all').matches;
}
MediaQueryDispatch.prototype = {
constructor : MediaQueryDispatch,
/**
* Registers a handler for the given media query
*
* @param {string} q the media query
* @param {object || Array || Function} options either a single query handler object, a function, or an array of query handlers
* @param {function} options.match fired when query matched
* @param {function} [options.unmatch] fired when a query is no longer matched
* @param {function} [options.setup] fired when handler first triggered
* @param {boolean} [options.deferSetup=false] whether setup should be run immediately or deferred until query is first matched
* @param {boolean} [shouldDegrade=false] whether this particular media query should always run on incapable browsers
*/
register : function(q, options, shouldDegrade) {
var queries = this.queries,
isUnconditional = shouldDegrade && this.browserIsIncapable;
if(!queries[q]) {
queries[q] = new MediaQuery(q, isUnconditional);
}
//normalise to object in an array
if(isFunction(options)) {
options = { match : options };
}
if(!isArray(options)) {
options = [options];
}
each(options, function(handler) {
if (isFunction(handler)) {
handler = { match : handler };
}
queries[q].addHandler(handler);
});
return this;
},
/**
* unregisters a query and all it's handlers, or a specific handler for a query
*
* @param {string} q the media query to target
* @param {object || function} [handler] specific handler to unregister
*/
unregister : function(q, handler) {
var query = this.queries[q];
if(query) {
if(handler) {
query.removeHandler(handler);
}
else {
query.clear();
delete this.queries[q];
}
}
return this;
}
};
module.exports = MediaQueryDispatch;
/***/ }),
/***/ 995:
/***/ (function(module, exports, __webpack_require__) {
var QueryHandler = __webpack_require__(996);
var each = __webpack_require__(907).each;
/**
* Represents a single media query, manages it's state and registered handlers for this query
*
* @constructor
* @param {string} query the media query string
* @param {boolean} [isUnconditional=false] whether the media query should run regardless of whether the conditions are met. Primarily for helping older browsers deal with mobile-first design
*/
function MediaQuery(query, isUnconditional) {
this.query = query;
this.isUnconditional = isUnconditional;
this.handlers = [];
this.mql = window.matchMedia(query);
var self = this;
this.listener = function(mql) {
// Chrome passes an MediaQueryListEvent object, while other browsers pass MediaQueryList directly
self.mql = mql.currentTarget || mql;
self.assess();
};
this.mql.addListener(this.listener);
}
MediaQuery.prototype = {
constuctor : MediaQuery,
/**
* add a handler for this query, triggering if already active
*
* @param {object} handler
* @param {function} handler.match callback for when query is activated
* @param {function} [handler.unmatch] callback for when query is deactivated
* @param {function} [handler.setup] callback for immediate execution when a query handler is registered
* @param {boolean} [handler.deferSetup=false] should the setup callback be deferred until the first time the handler is matched?
*/
addHandler : function(handler) {
var qh = new QueryHandler(handler);
this.handlers.push(qh);
this.matches() && qh.on();
},
/**
* removes the given handler from the collection, and calls it's destroy methods
*
* @param {object || function} handler the handler to remove
*/
removeHandler : function(handler) {
var handlers = this.handlers;
each(handlers, function(h, i) {
if(h.equals(handler)) {
h.destroy();
return !handlers.splice(i,1); //remove from array and exit each early
}
});
},
/**
* Determine whether the media query should be considered a match
*
* @return {Boolean} true if media query can be considered a match, false otherwise
*/
matches : function() {
return this.mql.matches || this.isUnconditional;
},
/**
* Clears all handlers and unbinds events
*/
clear : function() {
each(this.handlers, function(handler) {
handler.destroy();
});
this.mql.removeListener(this.listener);
this.handlers.length = 0; //clear array
},
/*
* Assesses the query, turning on all handlers if it matches, turning them off if it doesn't match
*/
assess : function() {
var action = this.matches() ? 'on' : 'off';
each(this.handlers, function(handler) {
handler[action]();
});
}
};
module.exports = MediaQuery;
/***/ }),
/***/ 996:
/***/ (function(module, exports) {
/**
* Delegate to handle a media query being matched and unmatched.
*
* @param {object} options
* @param {function} options.match callback for when the media query is matched
* @param {function} [options.unmatch] callback for when the media query is unmatched
* @param {function} [options.setup] one-time callback triggered the first time a query is matched
* @param {boolean} [options.deferSetup=false] should the setup callback be run immediately, rather than first time query is matched?
* @constructor
*/
function QueryHandler(options) {
this.options = options;
!options.deferSetup && this.setup();
}
QueryHandler.prototype = {
constructor : QueryHandler,
/**
* coordinates setup of the handler
*
* @function
*/
setup : function() {
if(this.options.setup) {
this.options.setup();
}
this.initialised = true;
},
/**
* coordinates setup and triggering of the handler
*
* @function
*/
on : function() {
!this.initialised && this.setup();
this.options.match && this.options.match();
},
/**
* coordinates the unmatch event for the handler
*
* @function
*/
off : function() {
this.options.unmatch && this.options.unmatch();
},
/**
* called when a handler is to be destroyed.
* delegates to the destroy or unmatch callbacks, depending on availability.
*
* @function
*/
destroy : function() {
this.options.destroy ? this.options.destroy() : this.off();
},
/**
* determines equality by reference.
* if object is supplied compare options, if function, compare match callback
*
* @function
* @param {object || function} [target] the target for comparison
*/
equals : function(target) {
return this.options === target || this.options.match === target;
}
};
module.exports = QueryHandler;
/***/ }),
/***/ 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
/***/ }),
/***/ 999:
/***/ (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__(1000);
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;
/***/ })
});