Latest updates from IceHrmPro

This commit is contained in:
Thilina Pituwala
2020-05-20 18:47:29 +02:00
parent 60c92d7935
commit 7453a58aad
18012 changed files with 2089245 additions and 10173 deletions

63
web/node_modules/rc-tabs/es/InkTabBar.js generated vendored Executable file
View File

@@ -0,0 +1,63 @@
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); }
/* eslint-disable react/prefer-stateless-function */
import React from 'react';
import InkTabBarNode from './InkTabBarNode';
import TabBarTabsNode from './TabBarTabsNode';
import TabBarRootNode from './TabBarRootNode';
import SaveRef from './SaveRef';
var InkTabBar = /*#__PURE__*/function (_React$Component) {
_inherits(InkTabBar, _React$Component);
function InkTabBar() {
_classCallCheck(this, InkTabBar);
return _possibleConstructorReturn(this, _getPrototypeOf(InkTabBar).apply(this, arguments));
}
_createClass(InkTabBar, [{
key: "render",
value: function render() {
var _this = this;
return React.createElement(SaveRef, null, function (saveRef, getRef) {
return React.createElement(TabBarRootNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props), React.createElement(TabBarTabsNode, _extends({
onTabClick: _this.props.onTabClick,
saveRef: saveRef
}, _this.props)), React.createElement(InkTabBarNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props)));
});
}
}]);
return InkTabBar;
}(React.Component);
export { InkTabBar as default };
InkTabBar.defaultProps = {
onTabClick: function onTabClick() {}
};

173
web/node_modules/rc-tabs/es/InkTabBarNode.js generated vendored Normal file
View File

@@ -0,0 +1,173 @@
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 _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); }
import React from 'react';
import classnames from 'classnames';
import { setTransform, isTransform3dSupported, getLeft, getStyle, getTop, getActiveIndex } from './utils';
function _componentDidUpdate(component, init) {
var _component$props = component.props,
styles = _component$props.styles,
panels = _component$props.panels,
activeKey = _component$props.activeKey,
direction = _component$props.direction;
var rootNode = component.props.getRef('root');
var wrapNode = component.props.getRef('nav') || rootNode;
var inkBarNode = component.props.getRef('inkBar');
var activeTab = component.props.getRef('activeTab');
var inkBarNodeStyle = inkBarNode.style;
var tabBarPosition = component.props.tabBarPosition;
var activeIndex = getActiveIndex(panels, activeKey);
if (init) {
// prevent mount animation
inkBarNodeStyle.display = 'none';
}
if (activeTab) {
var tabNode = activeTab;
var transformSupported = isTransform3dSupported(inkBarNodeStyle); // Reset current style
setTransform(inkBarNodeStyle, '');
inkBarNodeStyle.width = '';
inkBarNodeStyle.height = '';
inkBarNodeStyle.left = '';
inkBarNodeStyle.top = '';
inkBarNodeStyle.bottom = '';
inkBarNodeStyle.right = '';
if (tabBarPosition === 'top' || tabBarPosition === 'bottom') {
var left = getLeft(tabNode, wrapNode);
var width = tabNode.offsetWidth; // If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom
// It means no css working, then ink bar should not have width until css is loaded
// Fix https://github.com/ant-design/ant-design/issues/7564
if (width === rootNode.offsetWidth) {
width = 0;
} else if (styles.inkBar && styles.inkBar.width !== undefined) {
width = parseFloat(styles.inkBar.width, 10);
if (width) {
left += (tabNode.offsetWidth - width) / 2;
}
}
if (direction === 'rtl') {
left = getStyle(tabNode, 'margin-left') - left;
} // use 3d gpu to optimize render
if (transformSupported) {
setTransform(inkBarNodeStyle, "translate3d(".concat(left, "px,0,0)"));
} else {
inkBarNodeStyle.left = "".concat(left, "px");
}
inkBarNodeStyle.width = "".concat(width, "px");
} else {
var top = getTop(tabNode, wrapNode, true);
var height = tabNode.offsetHeight;
if (styles.inkBar && styles.inkBar.height !== undefined) {
height = parseFloat(styles.inkBar.height, 10);
if (height) {
top += (tabNode.offsetHeight - height) / 2;
}
}
if (transformSupported) {
setTransform(inkBarNodeStyle, "translate3d(0,".concat(top, "px,0)"));
inkBarNodeStyle.top = '0';
} else {
inkBarNodeStyle.top = "".concat(top, "px");
}
inkBarNodeStyle.height = "".concat(height, "px");
}
}
inkBarNodeStyle.display = activeIndex !== -1 ? 'block' : 'none';
}
var InkTabBarNode = /*#__PURE__*/function (_React$Component) {
_inherits(InkTabBarNode, _React$Component);
function InkTabBarNode() {
_classCallCheck(this, InkTabBarNode);
return _possibleConstructorReturn(this, _getPrototypeOf(InkTabBarNode).apply(this, arguments));
}
_createClass(InkTabBarNode, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this = this;
// ref https://github.com/ant-design/ant-design/issues/8678
// ref https://github.com/react-component/tabs/issues/135
// InkTabBarNode need parent/root ref for calculating position
// since parent componentDidMount triggered after child componentDidMount
// we're doing a quick fix here to use setTimeout to calculate position
// after parent/root component mounted
this.timeout = setTimeout(function () {
_componentDidUpdate(_this, true);
}, 0);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
_componentDidUpdate(this);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
clearTimeout(this.timeout);
}
}, {
key: "render",
value: function render() {
var _classnames;
var _this$props = this.props,
prefixCls = _this$props.prefixCls,
styles = _this$props.styles,
inkBarAnimated = _this$props.inkBarAnimated;
var className = "".concat(prefixCls, "-ink-bar");
var classes = classnames((_classnames = {}, _defineProperty(_classnames, className, true), _defineProperty(_classnames, inkBarAnimated ? "".concat(className, "-animated") : "".concat(className, "-no-animated"), true), _classnames));
return React.createElement("div", {
style: styles.inkBar,
className: classes,
key: "inkBar",
ref: this.props.saveRef('inkBar')
});
}
}]);
return InkTabBarNode;
}(React.Component);
export { InkTabBarNode as default };
InkTabBarNode.defaultProps = {
prefixCls: '',
inkBarAnimated: true,
styles: {},
saveRef: function saveRef() {}
};

25
web/node_modules/rc-tabs/es/KeyCode.js generated vendored Executable file
View File

@@ -0,0 +1,25 @@
export default {
/**
* LEFT
*/
LEFT: 37,
// also NUM_WEST
/**
* UP
*/
UP: 38,
// also NUM_NORTH
/**
* RIGHT
*/
RIGHT: 39,
// also NUM_EAST
/**
* DOWN
*/
DOWN: 40 // also NUM_SOUTH
};

67
web/node_modules/rc-tabs/es/SaveRef.js generated vendored Normal file
View File

@@ -0,0 +1,67 @@
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); }
import React from 'react';
var SaveRef = /*#__PURE__*/function (_React$Component) {
_inherits(SaveRef, _React$Component);
function SaveRef() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, SaveRef);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SaveRef)).call.apply(_getPrototypeOf2, [this].concat(args)));
_this.getRef = function (name) {
return _this[name];
};
_this.saveRef = function (name) {
return function (node) {
if (node) {
_this[name] = node;
}
};
};
return _this;
}
_createClass(SaveRef, [{
key: "render",
value: function render() {
return this.props.children(this.saveRef, this.getRef);
}
}]);
return SaveRef;
}(React.Component);
export { SaveRef as default };
SaveRef.defaultProps = {
children: function children() {
return null;
}
};

70
web/node_modules/rc-tabs/es/ScrollableInkTabBar.js generated vendored Executable file
View File

@@ -0,0 +1,70 @@
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 _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); }
/* eslint-disable react/prefer-stateless-function */
import React from 'react';
import InkTabBarNode from './InkTabBarNode';
import TabBarTabsNode from './TabBarTabsNode';
import TabBarRootNode from './TabBarRootNode';
import ScrollableTabBarNode from './ScrollableTabBarNode';
import SaveRef from './SaveRef';
var ScrollableInkTabBar = /*#__PURE__*/function (_React$Component) {
_inherits(ScrollableInkTabBar, _React$Component);
function ScrollableInkTabBar() {
_classCallCheck(this, ScrollableInkTabBar);
return _possibleConstructorReturn(this, _getPrototypeOf(ScrollableInkTabBar).apply(this, arguments));
}
_createClass(ScrollableInkTabBar, [{
key: "render",
value: function render() {
var _this$props = this.props,
renderTabBarNode = _this$props.children,
restProps = _objectWithoutProperties(_this$props, ["children"]);
return React.createElement(SaveRef, null, function (saveRef, getRef) {
return React.createElement(TabBarRootNode, _extends({
saveRef: saveRef,
getRef: getRef
}, restProps), React.createElement(ScrollableTabBarNode, _extends({
saveRef: saveRef,
getRef: getRef
}, restProps), React.createElement(TabBarTabsNode, _extends({
saveRef: saveRef,
renderTabBarNode: renderTabBarNode
}, restProps)), React.createElement(InkTabBarNode, _extends({
saveRef: saveRef,
getRef: getRef
}, restProps))));
});
}
}]);
return ScrollableInkTabBar;
}(React.Component);
export { ScrollableInkTabBar as default };

59
web/node_modules/rc-tabs/es/ScrollableTabBar.js generated vendored Executable file
View File

@@ -0,0 +1,59 @@
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); }
/* eslint-disable react/prefer-stateless-function */
import React from 'react';
import ScrollableTabBarNode from './ScrollableTabBarNode';
import TabBarRootNode from './TabBarRootNode';
import TabBarTabsNode from './TabBarTabsNode';
import SaveRef from './SaveRef';
var ScrollableTabBar = /*#__PURE__*/function (_React$Component) {
_inherits(ScrollableTabBar, _React$Component);
function ScrollableTabBar() {
_classCallCheck(this, ScrollableTabBar);
return _possibleConstructorReturn(this, _getPrototypeOf(ScrollableTabBar).apply(this, arguments));
}
_createClass(ScrollableTabBar, [{
key: "render",
value: function render() {
var _this = this;
return React.createElement(SaveRef, null, function (saveRef, getRef) {
return React.createElement(TabBarRootNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props), React.createElement(ScrollableTabBarNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props), React.createElement(TabBarTabsNode, _extends({
saveRef: saveRef
}, _this.props))));
});
}
}]);
return ScrollableTabBar;
}(React.Component);
export { ScrollableTabBar as default };

389
web/node_modules/rc-tabs/es/ScrollableTabBarNode.js generated vendored Executable file
View File

@@ -0,0 +1,389 @@
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 _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); }
import React from 'react';
import classnames from 'classnames';
import debounce from 'lodash/debounce';
import ResizeObserver from 'resize-observer-polyfill';
import { setTransform, isTransform3dSupported } from './utils';
var ScrollableTabBarNode = /*#__PURE__*/function (_React$Component) {
_inherits(ScrollableTabBarNode, _React$Component);
function ScrollableTabBarNode(props) {
var _this;
_classCallCheck(this, ScrollableTabBarNode);
_this = _possibleConstructorReturn(this, _getPrototypeOf(ScrollableTabBarNode).call(this, props));
_this.prevTransitionEnd = function (e) {
if (e.propertyName !== 'opacity') {
return;
}
var container = _this.props.getRef('container');
_this.scrollToActiveTab({
target: container,
currentTarget: container
});
};
_this.scrollToActiveTab = function (e) {
var activeTab = _this.props.getRef('activeTab');
var navWrap = _this.props.getRef('navWrap');
if (e && e.target !== e.currentTarget || !activeTab) {
return;
} // when not scrollable or enter scrollable first time, don't emit scrolling
var needToSroll = _this.isNextPrevShown() && _this.lastNextPrevShown;
_this.lastNextPrevShown = _this.isNextPrevShown();
if (!needToSroll) {
return;
}
var activeTabWH = _this.getScrollWH(activeTab);
var navWrapNodeWH = _this.getOffsetWH(navWrap);
var _assertThisInitialize = _assertThisInitialized(_this),
offset = _assertThisInitialize.offset;
var wrapOffset = _this.getOffsetLT(navWrap);
var activeTabOffset = _this.getOffsetLT(activeTab);
if (wrapOffset > activeTabOffset) {
offset += wrapOffset - activeTabOffset;
_this.setOffset(offset);
} else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) {
offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH);
_this.setOffset(offset);
}
};
_this.prev = function (e) {
_this.props.onPrevClick(e);
var navWrapNode = _this.props.getRef('navWrap');
var navWrapNodeWH = _this.getOffsetWH(navWrapNode);
var _assertThisInitialize2 = _assertThisInitialized(_this),
offset = _assertThisInitialize2.offset;
_this.setOffset(offset + navWrapNodeWH);
};
_this.next = function (e) {
_this.props.onNextClick(e);
var navWrapNode = _this.props.getRef('navWrap');
var navWrapNodeWH = _this.getOffsetWH(navWrapNode);
var _assertThisInitialize3 = _assertThisInitialized(_this),
offset = _assertThisInitialize3.offset;
_this.setOffset(offset - navWrapNodeWH);
};
_this.offset = 0;
_this.state = {
next: false,
prev: false
};
return _this;
}
_createClass(ScrollableTabBarNode, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
this.componentDidUpdate();
this.debouncedResize = debounce(function () {
_this2.setNextPrev();
_this2.scrollToActiveTab();
}, 200);
this.resizeObserver = new ResizeObserver(this.debouncedResize);
this.resizeObserver.observe(this.props.getRef('container'));
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var props = this.props;
if (prevProps && prevProps.tabBarPosition !== props.tabBarPosition) {
this.setOffset(0);
return;
}
var nextPrev = this.setNextPrev(); // wait next, prev show hide
/* eslint react/no-did-update-set-state:0 */
if (this.isNextPrevShown(this.state) !== this.isNextPrevShown(nextPrev)) {
this.setState({}, this.scrollToActiveTab);
} else if (!prevProps || props.activeKey !== prevProps.activeKey) {
// can not use props.activeKey
this.scrollToActiveTab();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.resizeObserver) {
this.resizeObserver.disconnect();
}
if (this.debouncedResize && this.debouncedResize.cancel) {
this.debouncedResize.cancel();
}
}
}, {
key: "setNextPrev",
value: function setNextPrev() {
var navNode = this.props.getRef('nav');
var navTabsContainer = this.props.getRef('navTabsContainer');
var navNodeWH = this.getScrollWH(navTabsContainer || navNode); // Add 1px to fix `offsetWidth` with decimal in Chrome not correct handle
// https://github.com/ant-design/ant-design/issues/13423
var containerWH = this.getOffsetWH(this.props.getRef('container')) + 1;
var navWrapNodeWH = this.getOffsetWH(this.props.getRef('navWrap'));
var offset = this.offset;
var minOffset = containerWH - navNodeWH;
var _this$state = this.state,
next = _this$state.next,
prev = _this$state.prev;
if (minOffset >= 0) {
next = false;
this.setOffset(0, false);
offset = 0;
} else if (minOffset < offset) {
next = true;
} else {
next = false; // Fix https://github.com/ant-design/ant-design/issues/8861
// Test with container offset which is stable
// and set the offset of the nav wrap node
var realOffset = navWrapNodeWH - navNodeWH;
this.setOffset(realOffset, false);
offset = realOffset;
}
if (offset < 0) {
prev = true;
} else {
prev = false;
}
this.setNext(next);
this.setPrev(prev);
return {
next: next,
prev: prev
};
}
}, {
key: "getOffsetWH",
value: function getOffsetWH(node) {
var tabBarPosition = this.props.tabBarPosition;
var prop = 'offsetWidth';
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
prop = 'offsetHeight';
}
return node[prop];
}
}, {
key: "getScrollWH",
value: function getScrollWH(node) {
var tabBarPosition = this.props.tabBarPosition;
var prop = 'scrollWidth';
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
prop = 'scrollHeight';
}
return node[prop];
}
}, {
key: "getOffsetLT",
value: function getOffsetLT(node) {
var tabBarPosition = this.props.tabBarPosition;
var prop = 'left';
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
prop = 'top';
}
return node.getBoundingClientRect()[prop];
}
}, {
key: "setOffset",
value: function setOffset(offset) {
var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var target = Math.min(0, offset);
if (this.offset !== target) {
this.offset = target;
var navOffset = {};
var tabBarPosition = this.props.tabBarPosition;
var navStyle = this.props.getRef('nav').style;
var transformSupported = isTransform3dSupported(navStyle);
if (tabBarPosition === 'left' || tabBarPosition === 'right') {
if (transformSupported) {
navOffset = {
value: "translate3d(0,".concat(target, "px,0)")
};
} else {
navOffset = {
name: 'top',
value: "".concat(target, "px")
};
}
} else if (transformSupported) {
if (this.props.direction === 'rtl') {
target = -target;
}
navOffset = {
value: "translate3d(".concat(target, "px,0,0)")
};
} else {
navOffset = {
name: 'left',
value: "".concat(target, "px")
};
}
if (transformSupported) {
setTransform(navStyle, navOffset.value);
} else {
navStyle[navOffset.name] = navOffset.value;
}
if (checkNextPrev) {
this.setNextPrev();
}
}
}
}, {
key: "setPrev",
value: function setPrev(v) {
if (this.state.prev !== v) {
this.setState({
prev: v
});
}
}
}, {
key: "setNext",
value: function setNext(v) {
if (this.state.next !== v) {
this.setState({
next: v
});
}
}
}, {
key: "isNextPrevShown",
value: function isNextPrevShown(state) {
if (state) {
return state.next || state.prev;
}
return this.state.next || this.state.prev;
}
}, {
key: "render",
value: function render() {
var _classnames, _classnames2, _classnames3, _classnames4;
var _this$state2 = this.state,
next = _this$state2.next,
prev = _this$state2.prev;
var _this$props = this.props,
prefixCls = _this$props.prefixCls,
scrollAnimated = _this$props.scrollAnimated,
navWrapper = _this$props.navWrapper,
prevIcon = _this$props.prevIcon,
nextIcon = _this$props.nextIcon;
var showNextPrev = prev || next;
var prevButton = React.createElement("span", {
onClick: prev ? this.prev : null,
unselectable: "unselectable",
className: classnames((_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-tab-prev"), 1), _defineProperty(_classnames, "".concat(prefixCls, "-tab-btn-disabled"), !prev), _defineProperty(_classnames, "".concat(prefixCls, "-tab-arrow-show"), showNextPrev), _classnames)),
onTransitionEnd: this.prevTransitionEnd
}, prevIcon || React.createElement("span", {
className: "".concat(prefixCls, "-tab-prev-icon")
}));
var nextButton = React.createElement("span", {
onClick: next ? this.next : null,
unselectable: "unselectable",
className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefixCls, "-tab-next"), 1), _defineProperty(_classnames2, "".concat(prefixCls, "-tab-btn-disabled"), !next), _defineProperty(_classnames2, "".concat(prefixCls, "-tab-arrow-show"), showNextPrev), _classnames2))
}, nextIcon || React.createElement("span", {
className: "".concat(prefixCls, "-tab-next-icon")
}));
var navClassName = "".concat(prefixCls, "-nav");
var navClasses = classnames((_classnames3 = {}, _defineProperty(_classnames3, navClassName, true), _defineProperty(_classnames3, scrollAnimated ? "".concat(navClassName, "-animated") : "".concat(navClassName, "-no-animated"), true), _classnames3));
return React.createElement("div", {
className: classnames((_classnames4 = {}, _defineProperty(_classnames4, "".concat(prefixCls, "-nav-container"), 1), _defineProperty(_classnames4, "".concat(prefixCls, "-nav-container-scrolling"), showNextPrev), _classnames4)),
key: "container",
ref: this.props.saveRef('container')
}, prevButton, nextButton, React.createElement("div", {
className: "".concat(prefixCls, "-nav-wrap"),
ref: this.props.saveRef('navWrap')
}, React.createElement("div", {
className: "".concat(prefixCls, "-nav-scroll")
}, React.createElement("div", {
className: navClasses,
ref: this.props.saveRef('nav')
}, navWrapper(this.props.children)))));
}
}]);
return ScrollableTabBarNode;
}(React.Component);
export { ScrollableTabBarNode as default };
ScrollableTabBarNode.defaultProps = {
tabBarPosition: 'left',
prefixCls: '',
scrollAnimated: true,
onPrevClick: function onPrevClick() {},
onNextClick: function onNextClick() {},
navWrapper: function navWrapper(ele) {
return ele;
}
};

63
web/node_modules/rc-tabs/es/SwipeableInkTabBar.js generated vendored Executable file
View File

@@ -0,0 +1,63 @@
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); }
/* eslint-disable react/prefer-stateless-function */
import React from 'react';
import SwipeableTabBarNode from './SwipeableTabBarNode';
import TabBarSwipeableTabs from './TabBarSwipeableTabs';
import TabBarRootNode from './TabBarRootNode';
import InkTabBarNode from './InkTabBarNode';
import SaveRef from './SaveRef';
var SwipeableInkTabBar = /*#__PURE__*/function (_React$Component) {
_inherits(SwipeableInkTabBar, _React$Component);
function SwipeableInkTabBar() {
_classCallCheck(this, SwipeableInkTabBar);
return _possibleConstructorReturn(this, _getPrototypeOf(SwipeableInkTabBar).apply(this, arguments));
}
_createClass(SwipeableInkTabBar, [{
key: "render",
value: function render() {
var _this = this;
return React.createElement(SaveRef, null, function (saveRef, getRef) {
return React.createElement(TabBarRootNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props), React.createElement(SwipeableTabBarNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props), React.createElement(TabBarSwipeableTabs, _extends({
saveRef: saveRef
}, _this.props)), React.createElement(InkTabBarNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props))));
});
}
}]);
return SwipeableInkTabBar;
}(React.Component);
export { SwipeableInkTabBar as default };

290
web/node_modules/rc-tabs/es/SwipeableTabBarNode.js generated vendored Executable file
View File

@@ -0,0 +1,290 @@
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 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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(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 _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); }
import React from 'react';
import classnames from 'classnames';
import Hammer from 'rc-hammerjs';
import ReactDOM from 'react-dom';
import { isVertical, getStyle, setPxStyle } from './utils';
var SwipeableTabBarNode = /*#__PURE__*/function (_React$Component) {
_inherits(SwipeableTabBarNode, _React$Component);
function SwipeableTabBarNode(props) {
var _this;
_classCallCheck(this, SwipeableTabBarNode);
_this = _possibleConstructorReturn(this, _getPrototypeOf(SwipeableTabBarNode).call(this, props));
_this.onPan = function (e) {
var _this$cache = _this.cache,
vertical = _this$cache.vertical,
totalAvaliableDelta = _this$cache.totalAvaliableDelta,
totalDelta = _this$cache.totalDelta;
var speed = _this.props.speed; // calculate touch distance
var nowDelta = vertical ? e.deltaY : e.deltaX;
nowDelta *= speed / 10; // calculate distance dom need transform
var _nextDelta = nowDelta + totalDelta;
if (_this.isRtl()) {
// calculate distance from right when direction is right-to-left
if (_nextDelta <= 0) {
_nextDelta = 0;
} else if (_nextDelta >= totalAvaliableDelta) {
_nextDelta = totalAvaliableDelta;
}
} // calculate distance from left when direction is left-to-right
else if (_nextDelta >= 0) {
_nextDelta = 0;
} else if (_nextDelta <= -totalAvaliableDelta) {
_nextDelta = -totalAvaliableDelta;
}
_this.cache.totalDelta = _nextDelta;
_this.setSwipePosition(); // calculate pagination display
var _this$checkPagination = _this.checkPaginationByDelta(_this.cache.totalDelta),
hasPrevPage = _this$checkPagination.hasPrevPage,
hasNextPage = _this$checkPagination.hasNextPage;
if (hasPrevPage !== _this.state.hasPrevPage || hasNextPage !== _this.state.hasNextPage) {
_this.setState({
hasPrevPage: hasPrevPage,
hasNextPage: hasNextPage
});
}
};
var _this$checkPagination2 = _this.checkPaginationByKey(_this.props.activeKey),
_hasPrevPage = _this$checkPagination2.hasPrevPage,
_hasNextPage = _this$checkPagination2.hasNextPage;
_this.state = {
hasPrevPage: _hasPrevPage,
hasNextPage: _hasNextPage
};
return _this;
}
_createClass(SwipeableTabBarNode, [{
key: "componentDidMount",
value: function componentDidMount() {
var swipe = this.props.getRef('swipe');
var nav = this.props.getRef('nav');
var activeKey = this.props.activeKey;
this.swipeNode = ReactDOM.findDOMNode(swipe); // dom which scroll (9999px)
this.realNode = ReactDOM.findDOMNode(nav); // dom which visiable in screen (viewport)
this.setCache();
this.setSwipePositionByKey(activeKey);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
this.setCache();
if (this.props.activeKey && this.props.activeKey !== prevProps.activeKey || this.props.panels.length !== prevProps.panels.length || this.props.pageSize !== prevProps.pageSize) {
this.setSwipePositionByKey(this.props.activeKey);
}
}
}, {
key: "setCache",
value: function setCache() {
var _this$props = this.props,
tabBarPosition = _this$props.tabBarPosition,
pageSize = _this$props.pageSize,
panels = _this$props.panels;
var _isVertical = isVertical(tabBarPosition);
var _viewSize = getStyle(this.realNode, _isVertical ? 'height' : 'width');
var _tabWidth = _viewSize / pageSize;
this.cache = _objectSpread({}, this.cache, {
vertical: _isVertical,
totalAvaliableDelta: _tabWidth * panels.length - _viewSize,
tabWidth: _tabWidth
});
}
/**
* used for props.activeKey setting, not for swipe callback
*/
}, {
key: "getDeltaByKey",
value: function getDeltaByKey(activeKey) {
var pageSize = this.props.pageSize;
var index = this.getIndexByKey(activeKey);
var centerTabCount = Math.floor(pageSize / 2);
var tabWidth = this.cache.tabWidth;
var delta = (index - centerTabCount) * tabWidth; // in rtl direction tabs are ordered from right to left, so delta should be positive in order to
// push swiped element to righ side (start of view)
if (!this.isRtl()) {
delta *= -1;
}
return delta;
}
}, {
key: "getIndexByKey",
value: function getIndexByKey(activeKey) {
var panels = this.props.panels;
var length = panels.length;
for (var i = 0; i < length; i++) {
if (panels[i].key === activeKey) {
return i;
}
}
return -1;
}
}, {
key: "setSwipePositionByKey",
value: function setSwipePositionByKey(activeKey) {
var _this$checkPagination3 = this.checkPaginationByKey(activeKey),
hasPrevPage = _this$checkPagination3.hasPrevPage,
hasNextPage = _this$checkPagination3.hasNextPage;
var totalAvaliableDelta = this.cache.totalAvaliableDelta;
this.setState({
hasPrevPage: hasPrevPage,
hasNextPage: hasNextPage
});
var delta;
if (!hasPrevPage) {
// the first page
delta = 0;
} else if (!hasNextPage) {
// the last page
delta = this.isRtl() ? totalAvaliableDelta : -totalAvaliableDelta;
} else if (hasNextPage) {
// the middle page
delta = this.getDeltaByKey(activeKey);
}
this.cache.totalDelta = delta;
this.setSwipePosition();
}
}, {
key: "setSwipePosition",
value: function setSwipePosition() {
var _this$cache2 = this.cache,
totalDelta = _this$cache2.totalDelta,
vertical = _this$cache2.vertical;
setPxStyle(this.swipeNode, totalDelta, vertical);
}
}, {
key: "checkPaginationByKey",
value: function checkPaginationByKey(activeKey) {
var _this$props2 = this.props,
panels = _this$props2.panels,
pageSize = _this$props2.pageSize;
var index = this.getIndexByKey(activeKey);
var centerTabCount = Math.floor(pageSize / 2); // the basic rule is to make activeTab be shown in the center of TabBar viewport
return {
hasPrevPage: index - centerTabCount > 0,
hasNextPage: index + centerTabCount < panels.length
};
}
}, {
key: "checkPaginationByDelta",
value: function checkPaginationByDelta(delta) {
var totalAvaliableDelta = this.cache.totalAvaliableDelta;
return {
hasPrevPage: delta < 0,
hasNextPage: -delta < totalAvaliableDelta
};
}
}, {
key: "isRtl",
value: function isRtl() {
return this.props.direction === 'rtl';
}
}, {
key: "render",
value: function render() {
var _classnames2;
var _this$props3 = this.props,
prefixCls = _this$props3.prefixCls,
hammerOptions = _this$props3.hammerOptions,
tabBarPosition = _this$props3.tabBarPosition;
var _this$state = this.state,
hasPrevPage = _this$state.hasPrevPage,
hasNextPage = _this$state.hasNextPage;
var navClassName = "".concat(prefixCls, "-nav");
var navClasses = classnames(_defineProperty({}, navClassName, true));
var events = {
onPan: this.onPan
};
return React.createElement("div", {
className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefixCls, "-nav-container"), 1), _defineProperty(_classnames2, "".concat(prefixCls, "-nav-swipe-container"), 1), _defineProperty(_classnames2, "".concat(prefixCls, "-prevpage"), hasPrevPage), _defineProperty(_classnames2, "".concat(prefixCls, "-nextpage"), hasNextPage), _classnames2)),
key: "container",
ref: this.props.saveRef('container')
}, React.createElement("div", {
className: "".concat(prefixCls, "-nav-wrap"),
ref: this.props.saveRef('navWrap')
}, React.createElement(Hammer, _extends({}, events, {
direction: isVertical(tabBarPosition) ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL',
options: hammerOptions
}), React.createElement("div", {
className: "".concat(prefixCls, "-nav-swipe"),
ref: this.props.saveRef('swipe')
}, React.createElement("div", {
className: navClasses,
ref: this.props.saveRef('nav')
}, this.props.children)))));
}
}]);
return SwipeableTabBarNode;
}(React.Component);
export { SwipeableTabBarNode as default };
SwipeableTabBarNode.defaultProps = {
panels: null,
tabBarPosition: 'top',
prefixCls: '',
children: null,
hammerOptions: {},
pageSize: 5,
// per page show how many tabs
speed: 7,
// swipe speed, 1 to 10, more bigger more faster
saveRef: function saveRef() {},
getRef: function getRef() {}
};

230
web/node_modules/rc-tabs/es/SwipeableTabContent.js generated vendored Executable file
View File

@@ -0,0 +1,230 @@
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 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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(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 _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); }
import React from 'react';
import Hammer from 'rc-hammerjs';
import ReactDOM from 'react-dom';
import TabContent from './TabContent';
import { isVertical, getActiveIndex, getTransformByIndex, setTransform, getActiveKey, toArray, setTransition } from './utils';
var RESISTANCE_COEF = 0.6;
function computeIndex(_ref) {
var maxIndex = _ref.maxIndex,
startIndex = _ref.startIndex,
delta = _ref.delta,
viewSize = _ref.viewSize;
var index = startIndex + -delta / viewSize;
if (index < 0) {
index = Math.exp(index * RESISTANCE_COEF) - 1;
} else if (index > maxIndex) {
index = maxIndex + 1 - Math.exp((maxIndex - index) * RESISTANCE_COEF);
}
return index;
}
function getIndexByDelta(e) {
var delta = isVertical(this.props.tabBarPosition) ? e.deltaY : e.deltaX;
var otherDelta = isVertical(this.props.tabBarPosition) ? e.deltaX : e.deltaY;
if (Math.abs(delta) < Math.abs(otherDelta)) {
return undefined;
}
var currentIndex = computeIndex({
maxIndex: this.maxIndex,
viewSize: this.viewSize,
startIndex: this.startIndex,
delta: delta
});
var showIndex = delta < 0 ? Math.floor(currentIndex + 1) : Math.floor(currentIndex);
if (showIndex < 0) {
showIndex = 0;
} else if (showIndex > this.maxIndex) {
showIndex = this.maxIndex;
}
if (this.children[showIndex].props.disabled) {
return undefined;
}
return currentIndex;
}
var SwipeableTabContent = /*#__PURE__*/function (_React$Component) {
_inherits(SwipeableTabContent, _React$Component);
function SwipeableTabContent() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, SwipeableTabContent);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SwipeableTabContent)).call.apply(_getPrototypeOf2, [this].concat(args)));
_this.onPanStart = function () {
var _this$props = _this.props,
tabBarPosition = _this$props.tabBarPosition,
children = _this$props.children,
activeKey = _this$props.activeKey,
animated = _this$props.animated;
_this.startIndex = getActiveIndex(children, activeKey);
var _assertThisInitialize = _assertThisInitialized(_this),
startIndex = _assertThisInitialize.startIndex;
if (startIndex === -1) {
return;
}
if (animated) {
setTransition(_this.rootNode.style, 'none');
}
_this.startDrag = true;
_this.children = toArray(children);
_this.maxIndex = _this.children.length - 1;
_this.viewSize = isVertical(tabBarPosition) ? _this.rootNode.offsetHeight : _this.rootNode.offsetWidth;
};
_this.onPan = function (e) {
if (!_this.startDrag) {
return;
}
var tabBarPosition = _this.props.tabBarPosition;
var currentIndex = getIndexByDelta.call(_assertThisInitialized(_this), e);
if (currentIndex !== undefined) {
setTransform(_this.rootNode.style, getTransformByIndex(currentIndex, tabBarPosition));
}
};
_this.onPanEnd = function (e) {
if (!_this.startDrag) {
return;
}
_this.end(e);
};
_this.onSwipe = function (e) {
_this.end(e, true);
};
_this.end = function (e, swipe) {
var _this$props2 = _this.props,
tabBarPosition = _this$props2.tabBarPosition,
animated = _this$props2.animated;
_this.startDrag = false;
if (animated) {
setTransition(_this.rootNode.style, '');
}
var currentIndex = getIndexByDelta.call(_assertThisInitialized(_this), e);
var finalIndex = _this.startIndex;
if (currentIndex !== undefined) {
if (currentIndex < 0) {
finalIndex = 0;
} else if (currentIndex > _this.maxIndex) {
finalIndex = _this.maxIndex;
} else if (swipe) {
var delta = isVertical(tabBarPosition) ? e.deltaY : e.deltaX;
finalIndex = delta < 0 ? Math.ceil(currentIndex) : Math.floor(currentIndex);
} else {
var floorIndex = Math.floor(currentIndex);
if (currentIndex - floorIndex > 0.6) {
finalIndex = floorIndex + 1;
} else {
finalIndex = floorIndex;
}
}
}
if (_this.children[finalIndex].props.disabled) {
return;
}
if (_this.startIndex === finalIndex) {
if (animated) {
setTransform(_this.rootNode.style, getTransformByIndex(finalIndex, _this.props.tabBarPosition));
}
} else {
_this.props.onChange(getActiveKey(_this.props.children, finalIndex));
}
};
return _this;
}
_createClass(SwipeableTabContent, [{
key: "componentDidMount",
value: function componentDidMount() {
this.rootNode = ReactDOM.findDOMNode(this);
}
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
tabBarPosition = _this$props3.tabBarPosition,
hammerOptions = _this$props3.hammerOptions,
animated = _this$props3.animated;
var events = {
onSwipe: this.onSwipe,
onPanStart: this.onPanStart
};
if (animated !== false) {
events = _objectSpread({}, events, {
onPan: this.onPan,
onPanEnd: this.onPanEnd
});
}
return React.createElement(Hammer, _extends({}, events, {
direction: isVertical(tabBarPosition) ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL',
options: hammerOptions
}), React.createElement(TabContent, this.props));
}
}]);
return SwipeableTabContent;
}(React.Component);
export { SwipeableTabContent as default };
SwipeableTabContent.defaultProps = {
animated: true
};

55
web/node_modules/rc-tabs/es/TabBar.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
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); }
/* eslint-disable react/prefer-stateless-function */
import React from 'react';
import TabBarRootNode from './TabBarRootNode';
import TabBarTabsNode from './TabBarTabsNode';
import SaveRef from './SaveRef';
var TabBar = /*#__PURE__*/function (_React$Component) {
_inherits(TabBar, _React$Component);
function TabBar() {
_classCallCheck(this, TabBar);
return _possibleConstructorReturn(this, _getPrototypeOf(TabBar).apply(this, arguments));
}
_createClass(TabBar, [{
key: "render",
value: function render() {
var _this = this;
return React.createElement(SaveRef, null, function (saveRef, getRef) {
return React.createElement(TabBarRootNode, _extends({
saveRef: saveRef,
getRef: getRef
}, _this.props), React.createElement(TabBarTabsNode, _extends({
saveRef: saveRef
}, _this.props)));
});
}
}]);
return TabBar;
}(React.Component);
export { TabBar as default };

128
web/node_modules/rc-tabs/es/TabBarRootNode.js generated vendored Normal file
View File

@@ -0,0 +1,128 @@
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 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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(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 _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); }
import React, { cloneElement } from 'react';
import classnames from 'classnames';
import { getDataAttr } from './utils';
var TabBarRootNode = /*#__PURE__*/function (_React$Component) {
_inherits(TabBarRootNode, _React$Component);
function TabBarRootNode() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, TabBarRootNode);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(TabBarRootNode)).call.apply(_getPrototypeOf2, [this].concat(args)));
_this.getExtraContentStyle = function () {
var _this$props = _this.props,
tabBarPosition = _this$props.tabBarPosition,
direction = _this$props.direction;
var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom';
if (direction === 'rtl') {
return topOrBottom ? {
float: 'left'
} : {};
}
return topOrBottom ? {
float: 'right'
} : {};
};
return _this;
}
_createClass(TabBarRootNode, [{
key: "render",
value: function render() {
var _this$props2 = this.props,
prefixCls = _this$props2.prefixCls,
onKeyDown = _this$props2.onKeyDown,
className = _this$props2.className,
extraContent = _this$props2.extraContent,
style = _this$props2.style,
tabBarPosition = _this$props2.tabBarPosition,
children = _this$props2.children,
direction = _this$props2.direction,
restProps = _objectWithoutProperties(_this$props2, ["prefixCls", "onKeyDown", "className", "extraContent", "style", "tabBarPosition", "children", "direction"]);
var cls = classnames("".concat(prefixCls, "-bar"), _defineProperty({}, className, !!className));
var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom';
var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {};
var newChildren = children;
if (extraContent) {
newChildren = [cloneElement(extraContent, {
key: 'extra',
onKeyDown: function onKeyDown(e) {
return e.stopPropagation();
},
style: _objectSpread({}, this.getExtraContentStyle(topOrBottom, direction), {}, extraContentStyle)
}), cloneElement(children, {
key: 'content'
})];
newChildren = topOrBottom ? newChildren : newChildren.reverse();
}
return React.createElement("div", _extends({
role: "tablist",
tabIndex: -1,
className: cls,
ref: this.props.saveRef('root'),
onKeyDown: onKeyDown,
style: style
}, getDataAttr(restProps)), newChildren);
}
}]);
return TabBarRootNode;
}(React.Component);
export { TabBarRootNode as default };
TabBarRootNode.defaultProps = {
prefixCls: '',
className: '',
style: {},
tabBarPosition: 'top',
extraContent: null,
children: null,
onKeyDown: function onKeyDown() {},
saveRef: function saveRef() {},
getRef: function getRef() {}
};

101
web/node_modules/rc-tabs/es/TabBarSwipeableTabs.js generated vendored Normal file
View File

@@ -0,0 +1,101 @@
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); }
import React from 'react';
import classnames from 'classnames';
var TabBarSwipeableTabs = /*#__PURE__*/function (_React$Component) {
_inherits(TabBarSwipeableTabs, _React$Component);
function TabBarSwipeableTabs() {
_classCallCheck(this, TabBarSwipeableTabs);
return _possibleConstructorReturn(this, _getPrototypeOf(TabBarSwipeableTabs).apply(this, arguments));
}
_createClass(TabBarSwipeableTabs, [{
key: "render",
value: function render() {
var _this = this;
var props = this.props;
var children = props.panels;
var activeKey = props.activeKey;
var rst = [];
var prefixCls = props.prefixCls;
var _flexWidth = "".concat(1 / props.pageSize * 100, "%");
var tabStyle = {
WebkitFlexBasis: _flexWidth,
flexBasis: _flexWidth
};
React.Children.forEach(children, function (child) {
var _classnames;
if (!child) {
return;
}
var key = child.key;
var cls = classnames("".concat(prefixCls, "-tab"), (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-tab-active"), activeKey === key), _defineProperty(_classnames, "".concat(prefixCls, "-tab-disabled"), child.props.disabled), _classnames));
var events = {};
if (!child.props.disabled) {
events = {
onClick: _this.props.onTabClick.bind(_this, key)
};
}
var refProps = {};
if (activeKey === key) {
refProps.ref = _this.props.saveRef('activeTab');
}
var id = _this.props.id ? "".concat(key, "-").concat(_this.props.id) : key;
rst.push(React.createElement("div", _extends({
role: "tab",
style: tabStyle,
"aria-disabled": child.props.disabled ? 'true' : 'false',
"aria-selected": activeKey === key ? 'true' : 'false',
tabIndex: activeKey === key ? 0 : -1
}, events, {
className: cls,
key: key,
id: "tab-".concat(id),
"aria-controls": "tabpane-".concat(id)
}, refProps), child.props.tab));
});
return rst;
}
}]);
return TabBarSwipeableTabs;
}(React.Component);
export { TabBarSwipeableTabs as default };
TabBarSwipeableTabs.defaultProps = {
pageSize: 5,
onTabClick: function onTabClick() {},
saveRef: function saveRef() {}
};

117
web/node_modules/rc-tabs/es/TabBarTabsNode.js generated vendored Normal file
View File

@@ -0,0 +1,117 @@
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); }
import React from 'react';
import warning from 'warning';
import { isVertical } from './utils';
var TabBarTabsNode = /*#__PURE__*/function (_React$Component) {
_inherits(TabBarTabsNode, _React$Component);
function TabBarTabsNode() {
_classCallCheck(this, TabBarTabsNode);
return _possibleConstructorReturn(this, _getPrototypeOf(TabBarTabsNode).apply(this, arguments));
}
_createClass(TabBarTabsNode, [{
key: "render",
value: function render() {
var _this = this;
var _this$props = this.props,
children = _this$props.panels,
activeKey = _this$props.activeKey,
prefixCls = _this$props.prefixCls,
tabBarGutter = _this$props.tabBarGutter,
saveRef = _this$props.saveRef,
tabBarPosition = _this$props.tabBarPosition,
renderTabBarNode = _this$props.renderTabBarNode,
direction = _this$props.direction;
var rst = [];
React.Children.forEach(children, function (child, index) {
if (!child) {
return;
}
var key = child.key;
var cls = activeKey === key ? "".concat(prefixCls, "-tab-active") : '';
cls += " ".concat(prefixCls, "-tab");
var events = {};
if (child.props.disabled) {
cls += " ".concat(prefixCls, "-tab-disabled");
} else {
events = {
onClick: _this.props.onTabClick.bind(_this, key)
};
}
var ref = {};
if (activeKey === key) {
ref.ref = saveRef('activeTab');
}
var gutter = tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter;
var marginProperty = direction === 'rtl' ? 'marginLeft' : 'marginRight';
var style = _defineProperty({}, isVertical(tabBarPosition) ? 'marginBottom' : marginProperty, gutter);
warning('tab' in child.props, 'There must be `tab` property on children of Tabs.');
var id = _this.props.id ? "".concat(key, "-").concat(_this.props.id) : key;
var node = React.createElement("div", _extends({
role: "tab",
"aria-disabled": child.props.disabled ? 'true' : 'false',
"aria-selected": activeKey === key ? 'true' : 'false',
tabIndex: activeKey === key ? 0 : -1
}, events, {
className: cls,
key: key,
style: style,
id: "tab-".concat(id),
"aria-controls": "tabpane-".concat(id)
}, ref), child.props.tab);
if (renderTabBarNode) {
node = renderTabBarNode(node);
}
rst.push(node);
});
return React.createElement("div", {
ref: saveRef('navTabsContainer')
}, rst);
}
}]);
return TabBarTabsNode;
}(React.Component);
export { TabBarTabsNode as default };
TabBarTabsNode.defaultProps = {
panels: [],
prefixCls: [],
tabBarGutter: null,
onTabClick: function onTabClick() {},
saveRef: function saveRef() {}
};

104
web/node_modules/rc-tabs/es/TabContent.js generated vendored Executable file
View File

@@ -0,0 +1,104 @@
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 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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(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 _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); }
import React from 'react';
import classnames from 'classnames';
import { getTransformByIndex, getActiveIndex, getTransformPropValue, getMarginStyle } from './utils';
var TabContent = /*#__PURE__*/function (_React$Component) {
_inherits(TabContent, _React$Component);
function TabContent() {
_classCallCheck(this, TabContent);
return _possibleConstructorReturn(this, _getPrototypeOf(TabContent).apply(this, arguments));
}
_createClass(TabContent, [{
key: "getTabPanes",
value: function getTabPanes() {
var props = this.props;
var activeKey = props.activeKey;
var children = props.children;
var newChildren = [];
React.Children.forEach(children, function (child) {
if (!child) {
return;
}
var key = child.key;
var active = activeKey === key;
newChildren.push(React.cloneElement(child, {
active: active,
destroyInactiveTabPane: props.destroyInactiveTabPane,
rootPrefixCls: props.prefixCls,
id: props.id
}));
});
return newChildren;
}
}, {
key: "render",
value: function render() {
var _classnames;
var props = this.props;
var prefixCls = props.prefixCls,
children = props.children,
activeKey = props.activeKey,
className = props.className,
tabBarPosition = props.tabBarPosition,
animated = props.animated,
animatedWithMargin = props.animatedWithMargin,
direction = props.direction;
var style = props.style;
var classes = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-content"), true), _defineProperty(_classnames, animated ? "".concat(prefixCls, "-content-animated") : "".concat(prefixCls, "-content-no-animated"), true), _classnames), className);
if (animated) {
var activeIndex = getActiveIndex(children, activeKey);
if (activeIndex !== -1) {
var animatedStyle = animatedWithMargin ? getMarginStyle(activeIndex, tabBarPosition, direction) : getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction));
style = _objectSpread({}, style, {}, animatedStyle);
} else {
style = _objectSpread({}, style, {
display: 'none'
});
}
}
return React.createElement("div", {
className: classes,
style: style
}, this.getTabPanes());
}
}]);
return TabContent;
}(React.Component);
export { TabContent as default };
TabContent.defaultProps = {
animated: true
};

89
web/node_modules/rc-tabs/es/TabPane.js generated vendored Executable file
View File

@@ -0,0 +1,89 @@
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 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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(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 _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); }
import React from 'react';
import classnames from 'classnames';
import { getDataAttr } from './utils';
var TabPane = /*#__PURE__*/function (_React$Component) {
_inherits(TabPane, _React$Component);
function TabPane() {
_classCallCheck(this, TabPane);
return _possibleConstructorReturn(this, _getPrototypeOf(TabPane).apply(this, arguments));
}
_createClass(TabPane, [{
key: "render",
value: function render() {
var _classnames;
var _this$props = this.props,
id = _this$props.id,
className = _this$props.className,
destroyInactiveTabPane = _this$props.destroyInactiveTabPane,
active = _this$props.active,
forceRender = _this$props.forceRender,
rootPrefixCls = _this$props.rootPrefixCls,
style = _this$props.style,
children = _this$props.children,
placeholder = _this$props.placeholder,
tabKey = _this$props.tabKey,
restProps = _objectWithoutProperties(_this$props, ["id", "className", "destroyInactiveTabPane", "active", "forceRender", "rootPrefixCls", "style", "children", "placeholder", "tabKey"]);
this._isActived = this._isActived || active;
var prefixCls = "".concat(rootPrefixCls, "-tabpane");
var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, "".concat(prefixCls, "-inactive"), !active), _defineProperty(_classnames, "".concat(prefixCls, "-active"), active), _defineProperty(_classnames, className, className), _classnames));
var isRender = destroyInactiveTabPane ? active : this._isActived;
var shouldRender = isRender || forceRender;
var tabKeyExists = tabKey && String(tabKey).length > 0;
var uuid = tabKeyExists && (id ? "".concat(tabKey, "-").concat(id) : "".concat(tabKey));
return React.createElement("div", _extends({
style: _objectSpread({}, style, {
visibility: active ? 'visible' : 'hidden'
}),
role: "tabpanel",
"aria-hidden": active ? 'false' : 'true',
tabIndex: active ? 0 : -1,
className: cls,
id: uuid && "tabpane-".concat(uuid),
"aria-labelledby": uuid && "tab-".concat(uuid)
}, getDataAttr(restProps)), shouldRender ? children : placeholder);
}
}]);
return TabPane;
}(React.Component);
export { TabPane as default };
TabPane.defaultProps = {
placeholder: null
};

257
web/node_modules/rc-tabs/es/Tabs.js generated vendored Executable file
View File

@@ -0,0 +1,257 @@
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 _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); }
import React from 'react';
import classnames from 'classnames';
import KeyCode from './KeyCode';
import TabPane from './TabPane';
import { getDataAttr } from './utils';
function noop() {}
function getDefaultActiveKey(props) {
var activeKey;
React.Children.forEach(props.children, function (child) {
if (child && !activeKey && !child.props.disabled) {
activeKey = child.key;
}
});
return activeKey;
}
function activeKeyIsValid(props, key) {
var keys = React.Children.map(props.children, function (child) {
return child && child.key;
});
return keys.indexOf(key) >= 0;
}
var Tabs = /*#__PURE__*/function (_React$Component) {
_inherits(Tabs, _React$Component);
function Tabs(props) {
var _this;
_classCallCheck(this, Tabs);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Tabs).call(this, props));
_this.onTabClick = function (activeKey, e) {
if (_this.tabBar.props.onTabClick) {
_this.tabBar.props.onTabClick(activeKey, e);
}
_this.setActiveKey(activeKey);
};
_this.onNavKeyDown = function (e) {
var keyboard = _this.props.keyboard;
if (!keyboard) {
return;
}
var eventKeyCode = e.keyCode;
if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) {
e.preventDefault();
var nextKey = _this.getNextActiveKey(true);
_this.onTabClick(nextKey);
} else if (eventKeyCode === KeyCode.LEFT || eventKeyCode === KeyCode.UP) {
e.preventDefault();
var previousKey = _this.getNextActiveKey(false);
_this.onTabClick(previousKey);
}
};
_this.onScroll = function (_ref) {
var target = _ref.target,
currentTarget = _ref.currentTarget;
if (target === currentTarget && target.scrollLeft > 0) {
target.scrollLeft = 0;
}
};
_this.setActiveKey = function (activeKey) {
if (_this.state.activeKey !== activeKey) {
if (!('activeKey' in _this.props)) {
_this.setState({
activeKey: activeKey
});
}
_this.props.onChange(activeKey);
}
};
_this.getNextActiveKey = function (next) {
var activeKey = _this.state.activeKey;
var children = [];
React.Children.forEach(_this.props.children, function (c) {
if (c && !c.props.disabled) {
if (next) {
children.push(c);
} else {
children.unshift(c);
}
}
});
var length = children.length;
var ret = length && children[0].key;
children.forEach(function (child, i) {
if (child.key === activeKey) {
if (i === length - 1) {
ret = children[0].key;
} else {
ret = children[i + 1].key;
}
}
});
return ret;
};
var _activeKey;
if ('activeKey' in props) {
_activeKey = props.activeKey;
} else if ('defaultActiveKey' in props) {
_activeKey = props.defaultActiveKey;
} else {
_activeKey = getDefaultActiveKey(props);
}
_this.state = {
activeKey: _activeKey
};
return _this;
}
_createClass(Tabs, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.destroy = true;
}
}, {
key: "render",
value: function render() {
var _classnames;
var props = this.props;
var prefixCls = props.prefixCls,
navWrapper = props.navWrapper,
tabBarPosition = props.tabBarPosition,
className = props.className,
renderTabContent = props.renderTabContent,
renderTabBar = props.renderTabBar,
destroyInactiveTabPane = props.destroyInactiveTabPane,
direction = props.direction,
id = props.id,
restProps = _objectWithoutProperties(props, ["prefixCls", "navWrapper", "tabBarPosition", "className", "renderTabContent", "renderTabBar", "destroyInactiveTabPane", "direction", "id"]);
var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, "".concat(prefixCls, "-").concat(tabBarPosition), 1), _defineProperty(_classnames, className, !!className), _defineProperty(_classnames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classnames));
this.tabBar = renderTabBar();
var tabBar = React.cloneElement(this.tabBar, {
prefixCls: prefixCls,
navWrapper: navWrapper,
key: 'tabBar',
onKeyDown: this.onNavKeyDown,
tabBarPosition: tabBarPosition,
onTabClick: this.onTabClick,
panels: props.children,
activeKey: this.state.activeKey,
direction: this.props.direction,
id: id
});
var tabContent = React.cloneElement(renderTabContent(), {
prefixCls: prefixCls,
tabBarPosition: tabBarPosition,
activeKey: this.state.activeKey,
destroyInactiveTabPane: destroyInactiveTabPane,
children: props.children,
onChange: this.setActiveKey,
key: 'tabContent',
direction: this.props.direction,
id: id
});
var contents = [];
if (tabBarPosition === 'bottom') {
contents.push(tabContent, tabBar);
} else {
contents.push(tabBar, tabContent);
}
return React.createElement("div", _extends({
className: cls,
style: props.style
}, getDataAttr(restProps), {
onScroll: this.onScroll,
id: id
}), contents);
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, state) {
var newState = {};
if ('activeKey' in props) {
newState.activeKey = props.activeKey;
} else if (!activeKeyIsValid(props, state.activeKey)) {
newState.activeKey = getDefaultActiveKey(props);
}
if (Object.keys(newState).length > 0) {
return newState;
}
return null;
}
}]);
return Tabs;
}(React.Component);
Tabs.defaultProps = {
prefixCls: 'rc-tabs',
destroyInactiveTabPane: false,
onChange: noop,
keyboard: true,
navWrapper: function navWrapper(arg) {
return arg;
},
tabBarPosition: 'top',
children: null,
style: {},
direction: 'ltr'
};
Tabs.TabPane = TabPane;
export default Tabs;

5
web/node_modules/rc-tabs/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,5 @@
import Tabs from './Tabs';
import TabPane from './TabPane';
import TabContent from './TabContent';
export default Tabs;
export { TabPane, TabContent };

129
web/node_modules/rc-tabs/es/utils.js generated vendored Executable file
View File

@@ -0,0 +1,129 @@
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; }
import React from 'react';
export function toArray(children) {
// allow [c,[a,b]]
var c = [];
React.Children.forEach(children, function (child) {
if (child) {
c.push(child);
}
});
return c;
}
export function getActiveIndex(children, activeKey) {
var c = toArray(children);
for (var i = 0; i < c.length; i++) {
if (c[i].key === activeKey) {
return i;
}
}
return -1;
}
export function getActiveKey(children, index) {
var c = toArray(children);
return c[index].key;
}
export function setTransform(style, v) {
style.transform = v;
style.webkitTransform = v;
style.mozTransform = v;
}
export function isTransform3dSupported(style) {
return ('transform' in style || 'webkitTransform' in style || 'MozTransform' in style) && window.atob;
}
export function setTransition(style, v) {
style.transition = v;
style.webkitTransition = v;
style.MozTransition = v;
}
export function getTransformPropValue(v) {
return {
transform: v,
WebkitTransform: v,
MozTransform: v
};
}
export function isVertical(tabBarPosition) {
return tabBarPosition === 'left' || tabBarPosition === 'right';
}
export function getTransformByIndex(index, tabBarPosition) {
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';
var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX';
if (!isVertical(tabBarPosition) && direction === 'rtl') {
return "".concat(translate, "(").concat(index * 100, "%) translateZ(0)");
}
return "".concat(translate, "(").concat(-index * 100, "%) translateZ(0)");
}
export function getMarginStyle(index, tabBarPosition) {
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';
var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft';
if (!isVertical(tabBarPosition) && direction === 'rtl') {
return _defineProperty({}, marginDirection, "".concat((index + 1) * 100, "%"));
}
return _defineProperty({}, marginDirection, "".concat(-index * 100, "%"));
}
export function getStyle(el, property) {
return +window.getComputedStyle(el).getPropertyValue(property).replace('px', '');
}
export function setPxStyle(el, value, vertical) {
value = vertical ? "0px, ".concat(value, "px, 0px") : "".concat(value, "px, 0px, 0px");
setTransform(el.style, "translate3d(".concat(value, ")"));
}
export function getDataAttr(props) {
return Object.keys(props).reduce(function (prev, key) {
if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {
prev[key] = props[key];
}
return prev;
}, {});
}
function toNum(style, property) {
return +style.getPropertyValue(property).replace('px', '');
}
function getTypeValue(start, current, end, tabNode, wrapperNode) {
var total = getStyle(wrapperNode, "padding-".concat(start));
if (!tabNode || !tabNode.parentNode) {
return total;
}
var childNodes = tabNode.parentNode.childNodes;
Array.prototype.some.call(childNodes, function (node) {
var style = window.getComputedStyle(node);
if (node !== tabNode) {
total += toNum(style, "margin-".concat(start));
total += node[current];
total += toNum(style, "margin-".concat(end));
if (style.boxSizing === 'content-box') {
total += toNum(style, "border-".concat(start, "-width")) + toNum(style, "border-".concat(end, "-width"));
}
return false;
} // We need count current node margin
// ref: https://github.com/react-component/tabs/pull/139#issuecomment-431005262
total += toNum(style, "margin-".concat(start));
return true;
});
return total;
}
export function getLeft(tabNode, wrapperNode) {
return getTypeValue('left', 'offsetWidth', 'right', tabNode, wrapperNode);
}
export function getTop(tabNode, wrapperNode) {
return getTypeValue('top', 'offsetHeight', 'bottom', tabNode, wrapperNode);
}