|
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[163,10],{
|
|
|
|
|
|
/***/ "+QRC":
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/copy-to-clipboard/index.js ***!
|
|
|
\*************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
var deselectCurrent = __webpack_require__(/*! toggle-selection */ "E9nw");
|
|
|
|
|
|
var clipboardToIE11Formatting = {
|
|
|
"text/plain": "Text",
|
|
|
"text/html": "Url",
|
|
|
"default": "Text"
|
|
|
}
|
|
|
|
|
|
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
|
|
|
|
function format(message) {
|
|
|
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
|
|
|
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
|
}
|
|
|
|
|
|
function copy(text, options) {
|
|
|
var debug,
|
|
|
message,
|
|
|
reselectPrevious,
|
|
|
range,
|
|
|
selection,
|
|
|
mark,
|
|
|
success = false;
|
|
|
if (!options) {
|
|
|
options = {};
|
|
|
}
|
|
|
debug = options.debug || false;
|
|
|
try {
|
|
|
reselectPrevious = deselectCurrent();
|
|
|
|
|
|
range = document.createRange();
|
|
|
selection = document.getSelection();
|
|
|
|
|
|
mark = document.createElement("span");
|
|
|
mark.textContent = text;
|
|
|
// reset user styles for span element
|
|
|
mark.style.all = "unset";
|
|
|
// prevents scrolling to the end of the page
|
|
|
mark.style.position = "fixed";
|
|
|
mark.style.top = 0;
|
|
|
mark.style.clip = "rect(0, 0, 0, 0)";
|
|
|
// used to preserve spaces and line breaks
|
|
|
mark.style.whiteSpace = "pre";
|
|
|
// do not inherit user-select (it may be `none`)
|
|
|
mark.style.webkitUserSelect = "text";
|
|
|
mark.style.MozUserSelect = "text";
|
|
|
mark.style.msUserSelect = "text";
|
|
|
mark.style.userSelect = "text";
|
|
|
mark.addEventListener("copy", function(e) {
|
|
|
e.stopPropagation();
|
|
|
if (options.format) {
|
|
|
e.preventDefault();
|
|
|
if (typeof e.clipboardData === "undefined") { // IE 11
|
|
|
debug && console.warn("unable to use e.clipboardData");
|
|
|
debug && console.warn("trying IE specific stuff");
|
|
|
window.clipboardData.clearData();
|
|
|
var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]
|
|
|
window.clipboardData.setData(format, text);
|
|
|
} else { // all other browsers
|
|
|
e.clipboardData.clearData();
|
|
|
e.clipboardData.setData(options.format, text);
|
|
|
}
|
|
|
}
|
|
|
if (options.onCopy) {
|
|
|
e.preventDefault();
|
|
|
options.onCopy(e.clipboardData);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
document.body.appendChild(mark);
|
|
|
|
|
|
range.selectNodeContents(mark);
|
|
|
selection.addRange(range);
|
|
|
|
|
|
var successful = document.execCommand("copy");
|
|
|
if (!successful) {
|
|
|
throw new Error("copy command was unsuccessful");
|
|
|
}
|
|
|
success = true;
|
|
|
} catch (err) {
|
|
|
debug && console.error("unable to copy using execCommand: ", err);
|
|
|
debug && console.warn("trying IE specific stuff");
|
|
|
try {
|
|
|
window.clipboardData.setData(options.format || "text", text);
|
|
|
options.onCopy && options.onCopy(window.clipboardData);
|
|
|
success = true;
|
|
|
} catch (err) {
|
|
|
debug && console.error("unable to copy using clipboardData: ", err);
|
|
|
debug && console.error("falling back to prompt");
|
|
|
message = format("message" in options ? options.message : defaultMessage);
|
|
|
window.prompt(message, text);
|
|
|
}
|
|
|
} finally {
|
|
|
if (selection) {
|
|
|
if (typeof selection.removeRange == "function") {
|
|
|
selection.removeRange(range);
|
|
|
} else {
|
|
|
selection.removeAllRanges();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (mark) {
|
|
|
document.body.removeChild(mark);
|
|
|
}
|
|
|
reselectPrevious();
|
|
|
}
|
|
|
|
|
|
return success;
|
|
|
}
|
|
|
|
|
|
module.exports = copy;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "7ixt":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/rc-tooltip/es/placements.js ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: placements, default */
|
|
|
/*! exports used: placements */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return placements; });
|
|
|
var autoAdjustOverflow = {
|
|
|
adjustX: 1,
|
|
|
adjustY: 1
|
|
|
};
|
|
|
var targetOffset = [0, 0];
|
|
|
var placements = {
|
|
|
left: {
|
|
|
points: ['cr', 'cl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [-4, 0],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
right: {
|
|
|
points: ['cl', 'cr'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [4, 0],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
top: {
|
|
|
points: ['bc', 'tc'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
bottom: {
|
|
|
points: ['tc', 'bc'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
topLeft: {
|
|
|
points: ['bl', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
leftTop: {
|
|
|
points: ['tr', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [-4, 0],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
topRight: {
|
|
|
points: ['br', 'tr'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
rightTop: {
|
|
|
points: ['tl', 'tr'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [4, 0],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
bottomRight: {
|
|
|
points: ['tr', 'br'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
rightBottom: {
|
|
|
points: ['bl', 'br'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [4, 0],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
bottomLeft: {
|
|
|
points: ['tl', 'bl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
leftBottom: {
|
|
|
points: ['br', 'bl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [-4, 0],
|
|
|
targetOffset: targetOffset
|
|
|
}
|
|
|
};
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (placements);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "BU3w":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: injectCSS, updateCSS */
|
|
|
/*! exports used: updateCSS */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* unused harmony export injectCSS */
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateCSS; });
|
|
|
/* harmony import */ var _canUseDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./canUseDom */ "MNnm");
|
|
|
|
|
|
var MARK_KEY = "rc-util-key";
|
|
|
|
|
|
function getContainer(option) {
|
|
|
if (option.attachTo) {
|
|
|
return option.attachTo;
|
|
|
}
|
|
|
|
|
|
var head = document.querySelector('head');
|
|
|
return head || document.body;
|
|
|
}
|
|
|
|
|
|
function injectCSS(css) {
|
|
|
var _option$csp;
|
|
|
|
|
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
|
|
|
|
if (!Object(_canUseDom__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
var styleNode = document.createElement('style');
|
|
|
|
|
|
if ((_option$csp = option.csp) === null || _option$csp === void 0 ? void 0 : _option$csp.nonce) {
|
|
|
var _option$csp2;
|
|
|
|
|
|
styleNode.nonce = (_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce;
|
|
|
}
|
|
|
|
|
|
styleNode.innerHTML = css;
|
|
|
var container = getContainer(option);
|
|
|
var firstChild = container.firstChild;
|
|
|
|
|
|
if (option.prepend && container.prepend) {
|
|
|
// Use `prepend` first
|
|
|
container.prepend(styleNode);
|
|
|
} else if (option.prepend && firstChild) {
|
|
|
// Fallback to `insertBefore` like IE not support `prepend`
|
|
|
container.insertBefore(styleNode, firstChild);
|
|
|
} else {
|
|
|
container.appendChild(styleNode);
|
|
|
}
|
|
|
|
|
|
return styleNode;
|
|
|
}
|
|
|
var containerCache = new Map();
|
|
|
function updateCSS(css, key) {
|
|
|
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
|
var container = getContainer(option); // Get real parent
|
|
|
|
|
|
if (!containerCache.has(container)) {
|
|
|
var placeholderStyle = injectCSS('', option);
|
|
|
var parentNode = placeholderStyle.parentNode;
|
|
|
containerCache.set(container, parentNode);
|
|
|
parentNode.removeChild(placeholderStyle);
|
|
|
}
|
|
|
|
|
|
var existNode = Array.from(containerCache.get(container).children).find(function (node) {
|
|
|
return node.tagName === 'STYLE' && node[MARK_KEY] === key;
|
|
|
});
|
|
|
|
|
|
if (existNode) {
|
|
|
var _option$csp3, _option$csp4;
|
|
|
|
|
|
if (((_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce) && existNode.nonce !== ((_option$csp4 = option.csp) === null || _option$csp4 === void 0 ? void 0 : _option$csp4.nonce)) {
|
|
|
var _option$csp5;
|
|
|
|
|
|
existNode.nonce = (_option$csp5 = option.csp) === null || _option$csp5 === void 0 ? void 0 : _option$csp5.nonce;
|
|
|
}
|
|
|
|
|
|
if (existNode.innerHTML !== css) {
|
|
|
existNode.innerHTML = css;
|
|
|
}
|
|
|
|
|
|
return existNode;
|
|
|
}
|
|
|
|
|
|
var newNode = injectCSS(css, option);
|
|
|
newNode[MARK_KEY] = key;
|
|
|
return newNode;
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "BdwD":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/button/style */ "+L6B");
|
|
|
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/button */ "2/Rp");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */ "0Owb");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "cDcd");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ "FOrL");
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
|
var _ref$buttonProps = _ref.buttonProps,
|
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
|
_ref$styles = _ref.styles,
|
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
|
customText = _ref.customText,
|
|
|
ButtonText = _ref.ButtonText,
|
|
|
ButtonClick = _ref.ButtonClick,
|
|
|
Buttonclass = _ref.Buttonclass,
|
|
|
ButtonTwo = _ref.ButtonTwo;
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("section", {
|
|
|
className: "tc animated fadeIn",
|
|
|
style: Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])({}, {
|
|
|
color: '#999',
|
|
|
margin: '200px auto'
|
|
|
}), styles)
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("img", {
|
|
|
src: _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_5___default.a
|
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("p", {
|
|
|
className: "mt20 font14"
|
|
|
}, customText || '暂时还没有相关数据哦!'), ButtonText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({
|
|
|
className: Buttonclass,
|
|
|
onClick: ButtonClick
|
|
|
}, buttonProps), ButtonText), ButtonTwo && ButtonTwo);
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "Bikx":
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./src/pages/Innovation/PublicProject/index.less?modules ***!
|
|
|
\***************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
module.exports = {"flex_box_center":"flex_box_center___YIXi2","flex_space_between":"flex_space_between___3OJ6f","flex_box_vertical_center":"flex_box_vertical_center___2hZim","flex_box_center_end":"flex_box_center_end___4t9Z7","flex_box_column":"flex_box_column___1_9mr","count":"count___3ufCd","header":"header___3KK0r","title":"title___3bwH_"};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "E9nw":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./node_modules/toggle-selection/index.js ***!
|
|
|
\************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
module.exports = function () {
|
|
|
var selection = document.getSelection();
|
|
|
if (!selection.rangeCount) {
|
|
|
return function () {};
|
|
|
}
|
|
|
var active = document.activeElement;
|
|
|
|
|
|
var ranges = [];
|
|
|
for (var i = 0; i < selection.rangeCount; i++) {
|
|
|
ranges.push(selection.getRangeAt(i));
|
|
|
}
|
|
|
|
|
|
switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML
|
|
|
case 'INPUT':
|
|
|
case 'TEXTAREA':
|
|
|
active.blur();
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
active = null;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
selection.removeAllRanges();
|
|
|
return function () {
|
|
|
selection.type === 'Caret' &&
|
|
|
selection.removeAllRanges();
|
|
|
|
|
|
if (!selection.rangeCount) {
|
|
|
ranges.forEach(function(range) {
|
|
|
selection.addRange(range);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
active &&
|
|
|
active.focus();
|
|
|
};
|
|
|
};
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "FOrL":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/assets/images/icons/nodata.png ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
module.exports = __webpack_require__.p + "static/nodata.a6b3f948.png";
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "Gytx":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/shallowequal/index.js ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
//
|
|
|
|
|
|
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
|
|
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
|
|
|
|
|
if (ret !== void 0) {
|
|
|
return !!ret;
|
|
|
}
|
|
|
|
|
|
if (objA === objB) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
var keysA = Object.keys(objA);
|
|
|
var keysB = Object.keys(objB);
|
|
|
|
|
|
if (keysA.length !== keysB.length) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
|
|
|
|
// Test for A's keys different from B.
|
|
|
for (var idx = 0; idx < keysA.length; idx++) {
|
|
|
var key = keysA[idx];
|
|
|
|
|
|
if (!bHasOwnProperty(key)) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
var valueA = objA[key];
|
|
|
var valueB = objB[key];
|
|
|
|
|
|
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
|
|
|
|
|
if (ret === false || (ret === void 0 && valueA !== valueB)) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
};
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "I8Z2":
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/mini-store/esm/index.js + 3 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: Provider, connect, create */
|
|
|
/*! exports used: Provider, connect, create */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ Provider_Provider; });
|
|
|
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ connect; });
|
|
|
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ create; });
|
|
|
|
|
|
// EXTERNAL MODULE: external "window.React"
|
|
|
var external_window_React_ = __webpack_require__("cDcd");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/mini-store/esm/Provider.js
|
|
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
var extendStatics = function (d, b) {
|
|
|
extendStatics = Object.setPrototypeOf ||
|
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
|
return extendStatics(d, b);
|
|
|
};
|
|
|
return function (d, b) {
|
|
|
extendStatics(d, b);
|
|
|
function __() { this.constructor = d; }
|
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
|
};
|
|
|
})();
|
|
|
|
|
|
var MiniStoreContext = external_window_React_["createContext"](null);
|
|
|
var Provider_Provider = /** @class */ (function (_super) {
|
|
|
__extends(Provider, _super);
|
|
|
function Provider() {
|
|
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
|
}
|
|
|
Provider.prototype.render = function () {
|
|
|
return (external_window_React_["createElement"](MiniStoreContext.Provider, { value: this.props.store }, this.props.children));
|
|
|
};
|
|
|
return Provider;
|
|
|
}(external_window_React_["Component"]));
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
|
|
|
var shallowequal = __webpack_require__("Gytx");
|
|
|
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
|
|
var hoist_non_react_statics_cjs = __webpack_require__("2mql");
|
|
|
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/mini-store/esm/connect.js
|
|
|
var connect_extends = (undefined && undefined.__extends) || (function () {
|
|
|
var extendStatics = function (d, b) {
|
|
|
extendStatics = Object.setPrototypeOf ||
|
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
|
return extendStatics(d, b);
|
|
|
};
|
|
|
return function (d, b) {
|
|
|
extendStatics(d, b);
|
|
|
function __() { this.constructor = d; }
|
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
|
};
|
|
|
})();
|
|
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
|
__assign = Object.assign || function(t) {
|
|
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
|
s = arguments[i];
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
|
t[p] = s[p];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
return __assign.apply(this, arguments);
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getDisplayName(WrappedComponent) {
|
|
|
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
|
}
|
|
|
var defaultMapStateToProps = function () { return ({}); };
|
|
|
function connect(mapStateToProps, options) {
|
|
|
if (options === void 0) { options = {}; }
|
|
|
var shouldSubscribe = !!mapStateToProps;
|
|
|
var finalMapStateToProps = mapStateToProps || defaultMapStateToProps;
|
|
|
return function wrapWithConnect(WrappedComponent) {
|
|
|
var Connect = /** @class */ (function (_super) {
|
|
|
connect_extends(Connect, _super);
|
|
|
function Connect(props, context) {
|
|
|
var _this = _super.call(this, props, context) || this;
|
|
|
_this.unsubscribe = null;
|
|
|
_this.handleChange = function () {
|
|
|
if (!_this.unsubscribe) {
|
|
|
return;
|
|
|
}
|
|
|
var nextState = finalMapStateToProps(_this.store.getState(), _this.props);
|
|
|
_this.setState({ subscribed: nextState });
|
|
|
};
|
|
|
_this.store = _this.context;
|
|
|
_this.state = {
|
|
|
subscribed: finalMapStateToProps(_this.store.getState(), props),
|
|
|
store: _this.store,
|
|
|
props: props,
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
Connect.getDerivedStateFromProps = function (props, prevState) {
|
|
|
// using ownProps
|
|
|
if (mapStateToProps && mapStateToProps.length === 2 && props !== prevState.props) {
|
|
|
return {
|
|
|
subscribed: finalMapStateToProps(prevState.store.getState(), props),
|
|
|
props: props,
|
|
|
};
|
|
|
}
|
|
|
return { props: props };
|
|
|
};
|
|
|
Connect.prototype.componentDidMount = function () {
|
|
|
this.trySubscribe();
|
|
|
};
|
|
|
Connect.prototype.componentWillUnmount = function () {
|
|
|
this.tryUnsubscribe();
|
|
|
};
|
|
|
Connect.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
|
return (!shallowequal_default()(this.props, nextProps) ||
|
|
|
!shallowequal_default()(this.state.subscribed, nextState.subscribed));
|
|
|
};
|
|
|
Connect.prototype.trySubscribe = function () {
|
|
|
if (shouldSubscribe) {
|
|
|
this.unsubscribe = this.store.subscribe(this.handleChange);
|
|
|
this.handleChange();
|
|
|
}
|
|
|
};
|
|
|
Connect.prototype.tryUnsubscribe = function () {
|
|
|
if (this.unsubscribe) {
|
|
|
this.unsubscribe();
|
|
|
this.unsubscribe = null;
|
|
|
}
|
|
|
};
|
|
|
Connect.prototype.render = function () {
|
|
|
var props = __assign(__assign(__assign({}, this.props), this.state.subscribed), { store: this.store });
|
|
|
return external_window_React_["createElement"](WrappedComponent, __assign({}, props, { ref: this.props.miniStoreForwardedRef }));
|
|
|
};
|
|
|
Connect.displayName = "Connect(" + getDisplayName(WrappedComponent) + ")";
|
|
|
Connect.contextType = MiniStoreContext;
|
|
|
return Connect;
|
|
|
}(external_window_React_["Component"]));
|
|
|
if (options.forwardRef) {
|
|
|
var forwarded = external_window_React_["forwardRef"](function (props, ref) {
|
|
|
return external_window_React_["createElement"](Connect, __assign({}, props, { miniStoreForwardedRef: ref }));
|
|
|
});
|
|
|
return hoist_non_react_statics_cjs_default()(forwarded, WrappedComponent);
|
|
|
}
|
|
|
return hoist_non_react_statics_cjs_default()(Connect, WrappedComponent);
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/mini-store/esm/create.js
|
|
|
var create_assign = (undefined && undefined.__assign) || function () {
|
|
|
create_assign = Object.assign || function(t) {
|
|
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
|
s = arguments[i];
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
|
t[p] = s[p];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
return create_assign.apply(this, arguments);
|
|
|
};
|
|
|
function create(initialState) {
|
|
|
var state = initialState;
|
|
|
var listeners = [];
|
|
|
function setState(partial) {
|
|
|
state = create_assign(create_assign({}, state), partial);
|
|
|
for (var i = 0; i < listeners.length; i++) {
|
|
|
listeners[i]();
|
|
|
}
|
|
|
}
|
|
|
function getState() {
|
|
|
return state;
|
|
|
}
|
|
|
function subscribe(listener) {
|
|
|
listeners.push(listener);
|
|
|
return function unsubscribe() {
|
|
|
var index = listeners.indexOf(listener);
|
|
|
listeners.splice(index, 1);
|
|
|
};
|
|
|
}
|
|
|
return {
|
|
|
setState: setState,
|
|
|
getState: getState,
|
|
|
subscribe: subscribe,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/mini-store/esm/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "OLES":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__("U8pU");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__("VTBJ");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__("Ff2n");
|
|
|
|
|
|
// EXTERNAL MODULE: external "window.React"
|
|
|
var external_window_React_ = __webpack_require__("cDcd");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-trigger/es/index.js + 5 modules
|
|
|
var es = __webpack_require__("uciX");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tooltip/es/placements.js
|
|
|
var placements = __webpack_require__("7ixt");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tooltip/es/Content.js
|
|
|
|
|
|
|
|
|
var Content_Content = function Content(props) {
|
|
|
var overlay = props.overlay,
|
|
|
prefixCls = props.prefixCls,
|
|
|
id = props.id,
|
|
|
overlayInnerStyle = props.overlayInnerStyle;
|
|
|
return external_window_React_["createElement"]("div", {
|
|
|
className: "".concat(prefixCls, "-inner"),
|
|
|
id: id,
|
|
|
role: "tooltip",
|
|
|
style: overlayInnerStyle
|
|
|
}, typeof overlay === 'function' ? overlay() : overlay);
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var es_Content = (Content_Content);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tooltip/es/Tooltip.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Tooltip_Tooltip = function Tooltip(props, ref) {
|
|
|
var overlayClassName = props.overlayClassName,
|
|
|
_props$trigger = props.trigger,
|
|
|
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
|
|
|
_props$mouseEnterDela = props.mouseEnterDelay,
|
|
|
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
|
|
|
_props$mouseLeaveDela = props.mouseLeaveDelay,
|
|
|
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
|
|
|
overlayStyle = props.overlayStyle,
|
|
|
_props$prefixCls = props.prefixCls,
|
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
|
|
|
children = props.children,
|
|
|
onVisibleChange = props.onVisibleChange,
|
|
|
afterVisibleChange = props.afterVisibleChange,
|
|
|
transitionName = props.transitionName,
|
|
|
animation = props.animation,
|
|
|
_props$placement = props.placement,
|
|
|
placement = _props$placement === void 0 ? 'right' : _props$placement,
|
|
|
_props$align = props.align,
|
|
|
align = _props$align === void 0 ? {} : _props$align,
|
|
|
_props$destroyTooltip = props.destroyTooltipOnHide,
|
|
|
destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
|
|
|
defaultVisible = props.defaultVisible,
|
|
|
getTooltipContainer = props.getTooltipContainer,
|
|
|
overlayInnerStyle = props.overlayInnerStyle,
|
|
|
restProps = Object(objectWithoutProperties["a" /* default */])(props, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle"]);
|
|
|
|
|
|
var domRef = Object(external_window_React_["useRef"])(null);
|
|
|
Object(external_window_React_["useImperativeHandle"])(ref, function () {
|
|
|
return domRef.current;
|
|
|
});
|
|
|
|
|
|
var extraProps = Object(objectSpread2["a" /* default */])({}, restProps);
|
|
|
|
|
|
if ('visible' in props) {
|
|
|
extraProps.popupVisible = props.visible;
|
|
|
}
|
|
|
|
|
|
var getPopupElement = function getPopupElement() {
|
|
|
var _props$arrowContent = props.arrowContent,
|
|
|
arrowContent = _props$arrowContent === void 0 ? null : _props$arrowContent,
|
|
|
overlay = props.overlay,
|
|
|
id = props.id;
|
|
|
return [external_window_React_["createElement"]("div", {
|
|
|
className: "".concat(prefixCls, "-arrow"),
|
|
|
key: "arrow"
|
|
|
}, arrowContent), external_window_React_["createElement"](es_Content, {
|
|
|
key: "content",
|
|
|
prefixCls: prefixCls,
|
|
|
id: id,
|
|
|
overlay: overlay,
|
|
|
overlayInnerStyle: overlayInnerStyle
|
|
|
})];
|
|
|
};
|
|
|
|
|
|
var destroyTooltip = false;
|
|
|
var autoDestroy = false;
|
|
|
|
|
|
if (typeof destroyTooltipOnHide === 'boolean') {
|
|
|
destroyTooltip = destroyTooltipOnHide;
|
|
|
} else if (destroyTooltipOnHide && Object(esm_typeof["a" /* default */])(destroyTooltipOnHide) === 'object') {
|
|
|
var keepParent = destroyTooltipOnHide.keepParent;
|
|
|
destroyTooltip = keepParent === true;
|
|
|
autoDestroy = keepParent === false;
|
|
|
}
|
|
|
|
|
|
return external_window_React_["createElement"](es["a" /* default */], Object.assign({
|
|
|
popupClassName: overlayClassName,
|
|
|
prefixCls: prefixCls,
|
|
|
popup: getPopupElement,
|
|
|
action: trigger,
|
|
|
builtinPlacements: placements["a" /* placements */],
|
|
|
popupPlacement: placement,
|
|
|
ref: domRef,
|
|
|
popupAlign: align,
|
|
|
getPopupContainer: getTooltipContainer,
|
|
|
onPopupVisibleChange: onVisibleChange,
|
|
|
afterPopupVisibleChange: afterVisibleChange,
|
|
|
popupTransitionName: transitionName,
|
|
|
popupAnimation: animation,
|
|
|
defaultPopupVisible: defaultVisible,
|
|
|
destroyPopupOnHide: destroyTooltip,
|
|
|
autoDestroy: autoDestroy,
|
|
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
|
popupStyle: overlayStyle,
|
|
|
mouseEnterDelay: mouseEnterDelay
|
|
|
}, extraProps), children);
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var es_Tooltip = (Object(external_window_React_["forwardRef"])(Tooltip_Tooltip));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tooltip/es/index.js
|
|
|
|
|
|
/* harmony default export */ var rc_tooltip_es = __webpack_exports__["a"] = (es_Tooltip);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "Y1PL":
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: ResizableTextArea, default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
// ESM COMPAT FLAG
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, "ResizableTextArea", function() { return /* reexport */ es_ResizableTextArea; });
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__("wx14");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
|
var classCallCheck = __webpack_require__("1OyB");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
|
var createClass = __webpack_require__("vuIU");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
|
var inherits = __webpack_require__("Ji7U");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
|
var createSuper = __webpack_require__("LK+K");
|
|
|
|
|
|
// EXTERNAL MODULE: external "window.React"
|
|
|
var external_window_React_ = __webpack_require__("cDcd");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__("VTBJ");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__("rePB");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
|
|
|
var toArray = __webpack_require__("Zm9Q");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
|
var warning = __webpack_require__("Kwbf");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
|
var ref = __webpack_require__("c+Xe");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
|
|
|
var findDOMNode = __webpack_require__("m+aA");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
|
|
|
var ResizeObserver_es = __webpack_require__("bdgK");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/utils/observerUtil.js
|
|
|
// =============================== Const ===============================
|
|
|
|
|
|
var elementListeners = new Map();
|
|
|
|
|
|
function observerUtil_onResize(entities) {
|
|
|
entities.forEach(function (entity) {
|
|
|
var _elementListeners$get;
|
|
|
|
|
|
var target = entity.target;
|
|
|
(_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function (listener) {
|
|
|
return listener(target);
|
|
|
});
|
|
|
});
|
|
|
} // Note: ResizeObserver polyfill not support option to measure border-box resize
|
|
|
|
|
|
|
|
|
var resizeObserver = new ResizeObserver_es["default"](observerUtil_onResize); // Dev env only
|
|
|
|
|
|
var _el = false ? undefined : null; // eslint-disable-line
|
|
|
|
|
|
var _rs = false ? undefined : null; // eslint-disable-line
|
|
|
// ============================== Observe ==============================
|
|
|
|
|
|
function observe(element, callback) {
|
|
|
if (!elementListeners.has(element)) {
|
|
|
elementListeners.set(element, new Set());
|
|
|
resizeObserver.observe(element);
|
|
|
}
|
|
|
|
|
|
elementListeners.get(element).add(callback);
|
|
|
}
|
|
|
function unobserve(element, callback) {
|
|
|
if (elementListeners.has(element)) {
|
|
|
elementListeners.get(element).delete(callback);
|
|
|
|
|
|
if (!elementListeners.get(element).size) {
|
|
|
resizeObserver.unobserve(element);
|
|
|
elementListeners.delete(element);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Fallback to findDOMNode if origin ref do not provide any dom element
|
|
|
*/
|
|
|
|
|
|
var DomWrapper_DomWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(DomWrapper, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(DomWrapper);
|
|
|
|
|
|
function DomWrapper() {
|
|
|
Object(classCallCheck["a" /* default */])(this, DomWrapper);
|
|
|
|
|
|
return _super.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(DomWrapper, [{
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
return this.props.children;
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return DomWrapper;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/Collection.js
|
|
|
|
|
|
var CollectionContext = /*#__PURE__*/external_window_React_["createContext"](null);
|
|
|
/**
|
|
|
* Collect all the resize event from children ResizeObserver
|
|
|
*/
|
|
|
|
|
|
function Collection(_ref) {
|
|
|
var children = _ref.children,
|
|
|
onBatchResize = _ref.onBatchResize;
|
|
|
var resizeIdRef = external_window_React_["useRef"](0);
|
|
|
var resizeInfosRef = external_window_React_["useRef"]([]);
|
|
|
var onCollectionResize = external_window_React_["useContext"](CollectionContext);
|
|
|
var onResize = external_window_React_["useCallback"](function (size, element, data) {
|
|
|
resizeIdRef.current += 1;
|
|
|
var currentId = resizeIdRef.current;
|
|
|
resizeInfosRef.current.push({
|
|
|
size: size,
|
|
|
element: element,
|
|
|
data: data
|
|
|
});
|
|
|
Promise.resolve().then(function () {
|
|
|
if (currentId === resizeIdRef.current) {
|
|
|
onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current);
|
|
|
resizeInfosRef.current = [];
|
|
|
}
|
|
|
}); // Continue bubbling if parent exist
|
|
|
|
|
|
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data);
|
|
|
}, [onBatchResize, onCollectionResize]);
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](CollectionContext.Provider, {
|
|
|
value: onResize
|
|
|
}, children);
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SingleObserver(props) {
|
|
|
var children = props.children,
|
|
|
disabled = props.disabled;
|
|
|
var elementRef = external_window_React_["useRef"](null);
|
|
|
var wrapperRef = external_window_React_["useRef"](null);
|
|
|
var onCollectionResize = external_window_React_["useContext"](CollectionContext); // ============================= Size =============================
|
|
|
|
|
|
var sizeRef = external_window_React_["useRef"]({
|
|
|
width: -1,
|
|
|
height: -1,
|
|
|
offsetWidth: -1,
|
|
|
offsetHeight: -1
|
|
|
}); // ============================= Ref ==============================
|
|
|
|
|
|
var canRef = /*#__PURE__*/external_window_React_["isValidElement"](children) && Object(ref["c" /* supportRef */])(children);
|
|
|
var originRef = canRef ? children.ref : null;
|
|
|
var mergedRef = external_window_React_["useMemo"](function () {
|
|
|
return Object(ref["a" /* composeRef */])(originRef, elementRef);
|
|
|
}, [originRef, elementRef]); // =========================== Observe ============================
|
|
|
|
|
|
var propsRef = external_window_React_["useRef"](props);
|
|
|
propsRef.current = props; // Handler
|
|
|
|
|
|
var onInternalResize = external_window_React_["useCallback"](function (target) {
|
|
|
var _propsRef$current = propsRef.current,
|
|
|
onResize = _propsRef$current.onResize,
|
|
|
data = _propsRef$current.data;
|
|
|
|
|
|
var _target$getBoundingCl = target.getBoundingClientRect(),
|
|
|
width = _target$getBoundingCl.width,
|
|
|
height = _target$getBoundingCl.height;
|
|
|
|
|
|
var offsetWidth = target.offsetWidth,
|
|
|
offsetHeight = target.offsetHeight;
|
|
|
/**
|
|
|
* Resize observer trigger when content size changed.
|
|
|
* In most case we just care about element size,
|
|
|
* let's use `boundary` instead of `contentRect` here to avoid shaking.
|
|
|
*/
|
|
|
|
|
|
var fixedWidth = Math.floor(width);
|
|
|
var fixedHeight = Math.floor(height);
|
|
|
|
|
|
if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
|
|
|
var size = {
|
|
|
width: fixedWidth,
|
|
|
height: fixedHeight,
|
|
|
offsetWidth: offsetWidth,
|
|
|
offsetHeight: offsetHeight
|
|
|
};
|
|
|
sizeRef.current = size; // IE is strange, right?
|
|
|
|
|
|
var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
|
|
|
var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
|
|
|
|
|
|
var sizeInfo = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, size), {}, {
|
|
|
offsetWidth: mergedOffsetWidth,
|
|
|
offsetHeight: mergedOffsetHeight
|
|
|
}); // Let collection know what happened
|
|
|
|
|
|
|
|
|
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data);
|
|
|
|
|
|
if (onResize) {
|
|
|
// defer the callback but not defer to next frame
|
|
|
Promise.resolve().then(function () {
|
|
|
onResize(sizeInfo, target);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}, []); // Dynamic observe
|
|
|
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
var currentElement = Object(findDOMNode["a" /* default */])(elementRef.current) || Object(findDOMNode["a" /* default */])(wrapperRef.current);
|
|
|
|
|
|
if (currentElement && !disabled) {
|
|
|
observe(currentElement, onInternalResize);
|
|
|
}
|
|
|
|
|
|
return function () {
|
|
|
return unobserve(currentElement, onInternalResize);
|
|
|
};
|
|
|
}, [elementRef.current, disabled]); // ============================ Render ============================
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](DomWrapper_DomWrapper, {
|
|
|
ref: wrapperRef
|
|
|
}, canRef ? /*#__PURE__*/external_window_React_["cloneElement"](children, {
|
|
|
ref: mergedRef
|
|
|
}) : children);
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var INTERNAL_PREFIX_KEY = 'rc-observer-key';
|
|
|
|
|
|
function ResizeObserver(props) {
|
|
|
var children = props.children;
|
|
|
var childNodes = Object(toArray["a" /* default */])(children);
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
return childNodes.map(function (child, index) {
|
|
|
var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](SingleObserver, Object(esm_extends["a" /* default */])({}, props, {
|
|
|
key: key
|
|
|
}), child);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
ResizeObserver.Collection = Collection;
|
|
|
/* harmony default export */ var es = (ResizeObserver);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
|
|
|
var omit = __webpack_require__("bT9E");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__("TSYQ");
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/calculateNodeHeight.js
|
|
|
// Thanks to https://github.com/andreypopp/react-textarea-autosize/
|
|
|
|
|
|
/**
|
|
|
* calculateNodeHeight(uiTextNode, useCache = false)
|
|
|
*/
|
|
|
var HIDDEN_TEXTAREA_STYLE = "\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n";
|
|
|
var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing', 'word-break'];
|
|
|
var computedStyleCache = {};
|
|
|
var hiddenTextarea;
|
|
|
function calculateNodeStyling(node) {
|
|
|
var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
|
var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
|
|
|
|
|
|
if (useCache && computedStyleCache[nodeRef]) {
|
|
|
return computedStyleCache[nodeRef];
|
|
|
}
|
|
|
|
|
|
var style = window.getComputedStyle(node);
|
|
|
var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
|
|
|
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
|
|
|
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
|
|
|
var sizingStyle = SIZING_STYLE.map(function (name) {
|
|
|
return "".concat(name, ":").concat(style.getPropertyValue(name));
|
|
|
}).join(';');
|
|
|
var nodeInfo = {
|
|
|
sizingStyle: sizingStyle,
|
|
|
paddingSize: paddingSize,
|
|
|
borderSize: borderSize,
|
|
|
boxSizing: boxSizing
|
|
|
};
|
|
|
|
|
|
if (useCache && nodeRef) {
|
|
|
computedStyleCache[nodeRef] = nodeInfo;
|
|
|
}
|
|
|
|
|
|
return nodeInfo;
|
|
|
}
|
|
|
function calculateNodeHeight(uiTextNode) {
|
|
|
var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
|
var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
|
var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
|
|
|
|
if (!hiddenTextarea) {
|
|
|
hiddenTextarea = document.createElement('textarea');
|
|
|
hiddenTextarea.setAttribute('tab-index', '-1');
|
|
|
hiddenTextarea.setAttribute('aria-hidden', 'true');
|
|
|
document.body.appendChild(hiddenTextarea);
|
|
|
} // Fix wrap="off" issue
|
|
|
// https://github.com/ant-design/ant-design/issues/6577
|
|
|
|
|
|
|
|
|
if (uiTextNode.getAttribute('wrap')) {
|
|
|
hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
|
|
|
} else {
|
|
|
hiddenTextarea.removeAttribute('wrap');
|
|
|
} // Copy all CSS properties that have an impact on the height of the content in
|
|
|
// the textbox
|
|
|
|
|
|
|
|
|
var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
|
|
|
paddingSize = _calculateNodeStyling.paddingSize,
|
|
|
borderSize = _calculateNodeStyling.borderSize,
|
|
|
boxSizing = _calculateNodeStyling.boxSizing,
|
|
|
sizingStyle = _calculateNodeStyling.sizingStyle; // Need to have the overflow attribute to hide the scrollbar otherwise
|
|
|
// text-lines will not calculated properly as the shadow will technically be
|
|
|
// narrower for content
|
|
|
|
|
|
|
|
|
hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
|
|
|
hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
|
|
|
var minHeight = Number.MIN_SAFE_INTEGER;
|
|
|
var maxHeight = Number.MAX_SAFE_INTEGER;
|
|
|
var height = hiddenTextarea.scrollHeight;
|
|
|
var overflowY;
|
|
|
|
|
|
if (boxSizing === 'border-box') {
|
|
|
// border-box: add border, since height = content + padding + border
|
|
|
height += borderSize;
|
|
|
} else if (boxSizing === 'content-box') {
|
|
|
// remove padding, since height = content
|
|
|
height -= paddingSize;
|
|
|
}
|
|
|
|
|
|
if (minRows !== null || maxRows !== null) {
|
|
|
// measure height of a textarea with a single row
|
|
|
hiddenTextarea.value = ' ';
|
|
|
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
|
|
|
|
|
|
if (minRows !== null) {
|
|
|
minHeight = singleRowHeight * minRows;
|
|
|
|
|
|
if (boxSizing === 'border-box') {
|
|
|
minHeight = minHeight + paddingSize + borderSize;
|
|
|
}
|
|
|
|
|
|
height = Math.max(minHeight, height);
|
|
|
}
|
|
|
|
|
|
if (maxRows !== null) {
|
|
|
maxHeight = singleRowHeight * maxRows;
|
|
|
|
|
|
if (boxSizing === 'border-box') {
|
|
|
maxHeight = maxHeight + paddingSize + borderSize;
|
|
|
}
|
|
|
|
|
|
overflowY = height > maxHeight ? '' : 'hidden';
|
|
|
height = Math.min(maxHeight, height);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
height: height,
|
|
|
minHeight: minHeight,
|
|
|
maxHeight: maxHeight,
|
|
|
overflowY: overflowY,
|
|
|
resize: 'none'
|
|
|
};
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
|
|
|
var shallowequal = __webpack_require__("Gytx");
|
|
|
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/ResizableTextArea.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
|
|
|
|
var RESIZE_STATUS;
|
|
|
|
|
|
(function (RESIZE_STATUS) {
|
|
|
RESIZE_STATUS[RESIZE_STATUS["NONE"] = 0] = "NONE";
|
|
|
RESIZE_STATUS[RESIZE_STATUS["RESIZING"] = 1] = "RESIZING";
|
|
|
RESIZE_STATUS[RESIZE_STATUS["RESIZED"] = 2] = "RESIZED";
|
|
|
})(RESIZE_STATUS || (RESIZE_STATUS = {}));
|
|
|
|
|
|
var ResizableTextArea_ResizableTextArea = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(ResizableTextArea, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(ResizableTextArea);
|
|
|
|
|
|
function ResizableTextArea(props) {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, ResizableTextArea);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
_this.nextFrameActionId = void 0;
|
|
|
_this.resizeFrameId = void 0;
|
|
|
_this.textArea = void 0;
|
|
|
|
|
|
_this.saveTextArea = function (textArea) {
|
|
|
_this.textArea = textArea;
|
|
|
};
|
|
|
|
|
|
_this.handleResize = function (size) {
|
|
|
var resizeStatus = _this.state.resizeStatus;
|
|
|
var _this$props = _this.props,
|
|
|
autoSize = _this$props.autoSize,
|
|
|
onResize = _this$props.onResize;
|
|
|
|
|
|
if (resizeStatus !== RESIZE_STATUS.NONE) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (typeof onResize === 'function') {
|
|
|
onResize(size);
|
|
|
}
|
|
|
|
|
|
if (autoSize) {
|
|
|
_this.resizeOnNextFrame();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.resizeOnNextFrame = function () {
|
|
|
cancelAnimationFrame(_this.nextFrameActionId);
|
|
|
_this.nextFrameActionId = requestAnimationFrame(_this.resizeTextarea);
|
|
|
};
|
|
|
|
|
|
_this.resizeTextarea = function () {
|
|
|
var autoSize = _this.props.autoSize;
|
|
|
|
|
|
if (!autoSize || !_this.textArea) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var minRows = autoSize.minRows,
|
|
|
maxRows = autoSize.maxRows;
|
|
|
var textareaStyles = calculateNodeHeight(_this.textArea, false, minRows, maxRows);
|
|
|
|
|
|
_this.setState({
|
|
|
textareaStyles: textareaStyles,
|
|
|
resizeStatus: RESIZE_STATUS.RESIZING
|
|
|
}, function () {
|
|
|
cancelAnimationFrame(_this.resizeFrameId);
|
|
|
_this.resizeFrameId = requestAnimationFrame(function () {
|
|
|
_this.setState({
|
|
|
resizeStatus: RESIZE_STATUS.RESIZED
|
|
|
}, function () {
|
|
|
_this.resizeFrameId = requestAnimationFrame(function () {
|
|
|
_this.setState({
|
|
|
resizeStatus: RESIZE_STATUS.NONE
|
|
|
});
|
|
|
|
|
|
_this.fixFirefoxAutoScroll();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.renderTextArea = function () {
|
|
|
var _this$props2 = _this.props,
|
|
|
_this$props2$prefixCl = _this$props2.prefixCls,
|
|
|
prefixCls = _this$props2$prefixCl === void 0 ? 'rc-textarea' : _this$props2$prefixCl,
|
|
|
autoSize = _this$props2.autoSize,
|
|
|
onResize = _this$props2.onResize,
|
|
|
className = _this$props2.className,
|
|
|
disabled = _this$props2.disabled;
|
|
|
var _this$state = _this.state,
|
|
|
textareaStyles = _this$state.textareaStyles,
|
|
|
resizeStatus = _this$state.resizeStatus;
|
|
|
var otherProps = Object(omit["a" /* default */])(_this.props, ['prefixCls', 'onPressEnter', 'autoSize', 'defaultValue', 'onResize']);
|
|
|
var cls = classnames_default()(prefixCls, className, Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-disabled"), disabled)); // Fix https://github.com/ant-design/ant-design/issues/6776
|
|
|
// Make sure it could be reset when using form.getFieldDecorator
|
|
|
|
|
|
if ('value' in otherProps) {
|
|
|
otherProps.value = otherProps.value || '';
|
|
|
}
|
|
|
|
|
|
var style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this.props.style), textareaStyles), resizeStatus === RESIZE_STATUS.RESIZING ? // React will warning when mix `overflow` & `overflowY`.
|
|
|
// We need to define this separately.
|
|
|
{
|
|
|
overflowX: 'hidden',
|
|
|
overflowY: 'hidden'
|
|
|
} : null);
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es, {
|
|
|
onResize: _this.handleResize,
|
|
|
disabled: !(autoSize || onResize)
|
|
|
}, /*#__PURE__*/external_window_React_["createElement"]("textarea", Object(esm_extends["a" /* default */])({}, otherProps, {
|
|
|
className: cls,
|
|
|
style: style,
|
|
|
ref: _this.saveTextArea
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
_this.state = {
|
|
|
textareaStyles: {},
|
|
|
resizeStatus: RESIZE_STATUS.NONE
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(ResizableTextArea, [{
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate(prevProps) {
|
|
|
// Re-render with the new content or new autoSize property then recalculate the height as required.
|
|
|
if (prevProps.value !== this.props.value || !shallowequal_default()(prevProps.autoSize, this.props.autoSize)) {
|
|
|
this.resizeTextarea();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
cancelAnimationFrame(this.nextFrameActionId);
|
|
|
cancelAnimationFrame(this.resizeFrameId);
|
|
|
} // https://github.com/ant-design/ant-design/issues/21870
|
|
|
|
|
|
}, {
|
|
|
key: "fixFirefoxAutoScroll",
|
|
|
value: function fixFirefoxAutoScroll() {
|
|
|
try {
|
|
|
if (document.activeElement === this.textArea) {
|
|
|
var currentStart = this.textArea.selectionStart;
|
|
|
var currentEnd = this.textArea.selectionEnd;
|
|
|
this.textArea.setSelectionRange(currentStart, currentEnd);
|
|
|
}
|
|
|
} catch (e) {// Fix error in Chrome:
|
|
|
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
|
|
|
// http://stackoverflow.com/q/21177489/3040605
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
return this.renderTextArea();
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return ResizableTextArea;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
/* harmony default export */ var es_ResizableTextArea = (ResizableTextArea_ResizableTextArea);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var es_TextArea = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(TextArea, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(TextArea);
|
|
|
|
|
|
function TextArea(props) {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, TextArea);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
_this.resizableTextArea = void 0;
|
|
|
|
|
|
_this.focus = function () {
|
|
|
_this.resizableTextArea.textArea.focus();
|
|
|
};
|
|
|
|
|
|
_this.saveTextArea = function (resizableTextArea) {
|
|
|
_this.resizableTextArea = resizableTextArea;
|
|
|
};
|
|
|
|
|
|
_this.handleChange = function (e) {
|
|
|
var onChange = _this.props.onChange;
|
|
|
|
|
|
_this.setValue(e.target.value, function () {
|
|
|
_this.resizableTextArea.resizeTextarea();
|
|
|
});
|
|
|
|
|
|
if (onChange) {
|
|
|
onChange(e);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.handleKeyDown = function (e) {
|
|
|
var _this$props = _this.props,
|
|
|
onPressEnter = _this$props.onPressEnter,
|
|
|
onKeyDown = _this$props.onKeyDown;
|
|
|
|
|
|
if (e.keyCode === 13 && onPressEnter) {
|
|
|
onPressEnter(e);
|
|
|
}
|
|
|
|
|
|
if (onKeyDown) {
|
|
|
onKeyDown(e);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;
|
|
|
_this.state = {
|
|
|
value: value
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(TextArea, [{
|
|
|
key: "setValue",
|
|
|
value: function setValue(value, callback) {
|
|
|
if (!('value' in this.props)) {
|
|
|
this.setState({
|
|
|
value: value
|
|
|
}, callback);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "blur",
|
|
|
value: function blur() {
|
|
|
this.resizableTextArea.textArea.blur();
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_ResizableTextArea, Object(esm_extends["a" /* default */])({}, this.props, {
|
|
|
value: this.state.value,
|
|
|
onKeyDown: this.handleKeyDown,
|
|
|
onChange: this.handleChange,
|
|
|
ref: this.saveTextArea
|
|
|
}));
|
|
|
}
|
|
|
}], [{
|
|
|
key: "getDerivedStateFromProps",
|
|
|
value: function getDerivedStateFromProps(nextProps) {
|
|
|
if ('value' in nextProps) {
|
|
|
return {
|
|
|
value: nextProps.value
|
|
|
};
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return TextArea;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_textarea_es = __webpack_exports__["default"] = (es_TextArea);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "bT9E":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/omit.js ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return omit; });
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "VTBJ");
|
|
|
|
|
|
function omit(obj, fields) {
|
|
|
var clone = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, obj);
|
|
|
|
|
|
if (Array.isArray(fields)) {
|
|
|
fields.forEach(function (key) {
|
|
|
delete clone[key];
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return clone;
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "k3GJ":
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/rc-tabs/es/index.js + 50 modules ***!
|
|
|
\*******************************************************/
|
|
|
/*! exports provided: TabPane, default */
|
|
|
/*! exports used: TabPane, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/mini-store/esm/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/raf/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-align/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-dropdown/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-resize-observer/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/addEventListener.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/canUseDom.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/contains.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Portal.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/createChainedFunction.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMergedState.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/raf.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.ReactDOM" (<- Module is not an ECMAScript module) */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ TabPane; });
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__("rePB");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__("ODXe");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__("Ff2n");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__("VTBJ");
|
|
|
|
|
|
// EXTERNAL MODULE: external "window.React"
|
|
|
var external_window_React_ = __webpack_require__("cDcd");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__("TSYQ");
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
|
|
|
var toArray = __webpack_require__("Zm9Q");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
var useMergedState = __webpack_require__("6cGi");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__("KQm4");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/raf/index.js
|
|
|
var raf = __webpack_require__("xEkU");
|
|
|
var raf_default = /*#__PURE__*/__webpack_require__.n(raf);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js
|
|
|
var es = __webpack_require__("t23M");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useRaf.js
|
|
|
|
|
|
|
|
|
|
|
|
function useRaf(callback) {
|
|
|
var rafRef = Object(external_window_React_["useRef"])();
|
|
|
var removedRef = Object(external_window_React_["useRef"])(false);
|
|
|
|
|
|
function trigger() {
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
if (!removedRef.current) {
|
|
|
raf_default.a.cancel(rafRef.current);
|
|
|
rafRef.current = raf_default()(function () {
|
|
|
callback.apply(void 0, args);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
return function () {
|
|
|
removedRef.current = true;
|
|
|
raf_default.a.cancel(rafRef.current);
|
|
|
};
|
|
|
}, []);
|
|
|
return trigger;
|
|
|
}
|
|
|
function useRafState(defaultState) {
|
|
|
var batchRef = Object(external_window_React_["useRef"])([]);
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])({}),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
forceUpdate = _useState2[1];
|
|
|
|
|
|
var state = Object(external_window_React_["useRef"])(typeof defaultState === 'function' ? defaultState() : defaultState);
|
|
|
var flushUpdate = useRaf(function () {
|
|
|
var current = state.current;
|
|
|
batchRef.current.forEach(function (callback) {
|
|
|
current = callback(current);
|
|
|
});
|
|
|
batchRef.current = [];
|
|
|
state.current = current;
|
|
|
forceUpdate({});
|
|
|
});
|
|
|
|
|
|
function updater(callback) {
|
|
|
batchRef.current.push(callback);
|
|
|
flushUpdate();
|
|
|
}
|
|
|
|
|
|
return [state.current, updater];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js
|
|
|
var KeyCode = __webpack_require__("4IlW");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/TabNode.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function TabNode(_ref, ref) {
|
|
|
var _classNames;
|
|
|
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
id = _ref.id,
|
|
|
active = _ref.active,
|
|
|
rtl = _ref.rtl,
|
|
|
_ref$tab = _ref.tab,
|
|
|
key = _ref$tab.key,
|
|
|
tab = _ref$tab.tab,
|
|
|
disabled = _ref$tab.disabled,
|
|
|
closeIcon = _ref$tab.closeIcon,
|
|
|
tabBarGutter = _ref.tabBarGutter,
|
|
|
tabPosition = _ref.tabPosition,
|
|
|
closable = _ref.closable,
|
|
|
renderWrapper = _ref.renderWrapper,
|
|
|
removeAriaLabel = _ref.removeAriaLabel,
|
|
|
editable = _ref.editable,
|
|
|
onClick = _ref.onClick,
|
|
|
onRemove = _ref.onRemove,
|
|
|
onFocus = _ref.onFocus;
|
|
|
var tabPrefix = "".concat(prefixCls, "-tab");
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
return onRemove;
|
|
|
}, []);
|
|
|
var nodeStyle = {};
|
|
|
|
|
|
if (tabPosition === 'top' || tabPosition === 'bottom') {
|
|
|
nodeStyle[rtl ? 'marginLeft' : 'marginRight'] = tabBarGutter;
|
|
|
} else {
|
|
|
nodeStyle.marginBottom = tabBarGutter;
|
|
|
}
|
|
|
|
|
|
var removable = editable && closable !== false && !disabled;
|
|
|
|
|
|
function onInternalClick(e) {
|
|
|
if (disabled) return;
|
|
|
onClick(e);
|
|
|
}
|
|
|
|
|
|
function onRemoveTab(event) {
|
|
|
event.preventDefault();
|
|
|
event.stopPropagation();
|
|
|
editable.onEdit('remove', {
|
|
|
key: key,
|
|
|
event: event
|
|
|
});
|
|
|
}
|
|
|
|
|
|
var node = external_window_React_["createElement"]("div", {
|
|
|
key: key,
|
|
|
ref: ref,
|
|
|
className: classnames_default()(tabPrefix, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(tabPrefix, "-with-remove"), removable), Object(defineProperty["a" /* default */])(_classNames, "".concat(tabPrefix, "-active"), active), Object(defineProperty["a" /* default */])(_classNames, "".concat(tabPrefix, "-disabled"), disabled), _classNames)),
|
|
|
style: nodeStyle,
|
|
|
onClick: onInternalClick
|
|
|
}, external_window_React_["createElement"]("div", {
|
|
|
role: "tab",
|
|
|
"aria-selected": active,
|
|
|
id: id && "".concat(id, "-tab-").concat(key),
|
|
|
className: "".concat(tabPrefix, "-btn"),
|
|
|
"aria-controls": id && "".concat(id, "-panel-").concat(key),
|
|
|
"aria-disabled": disabled,
|
|
|
tabIndex: disabled ? null : 0,
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
onInternalClick(e);
|
|
|
},
|
|
|
onKeyDown: function onKeyDown(e) {
|
|
|
if ([KeyCode["a" /* default */].SPACE, KeyCode["a" /* default */].ENTER].includes(e.which)) {
|
|
|
e.preventDefault();
|
|
|
onInternalClick(e);
|
|
|
}
|
|
|
},
|
|
|
onFocus: onFocus
|
|
|
}, tab), removable && external_window_React_["createElement"]("button", {
|
|
|
type: "button",
|
|
|
"aria-label": removeAriaLabel || 'remove',
|
|
|
tabIndex: 0,
|
|
|
className: "".concat(tabPrefix, "-remove"),
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
onRemoveTab(e);
|
|
|
}
|
|
|
}, closeIcon || editable.removeIcon || '×'));
|
|
|
|
|
|
if (renderWrapper) {
|
|
|
node = renderWrapper(node);
|
|
|
}
|
|
|
|
|
|
return node;
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var TabNavList_TabNode = (external_window_React_["forwardRef"](TabNode));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useOffsets.js
|
|
|
|
|
|
|
|
|
var DEFAULT_SIZE = {
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
left: 0,
|
|
|
top: 0
|
|
|
};
|
|
|
function useOffsets(tabs, tabSizes, holderScrollWidth) {
|
|
|
return Object(external_window_React_["useMemo"])(function () {
|
|
|
var _tabs$;
|
|
|
|
|
|
var map = new Map();
|
|
|
var lastOffset = tabSizes.get((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key) || DEFAULT_SIZE;
|
|
|
var rightOffset = lastOffset.left + lastOffset.width;
|
|
|
|
|
|
for (var i = 0; i < tabs.length; i += 1) {
|
|
|
var key = tabs[i].key;
|
|
|
var data = tabSizes.get(key); // Reuse last one when not exist yet
|
|
|
|
|
|
if (!data) {
|
|
|
var _tabs;
|
|
|
|
|
|
data = tabSizes.get((_tabs = tabs[i - 1]) === null || _tabs === void 0 ? void 0 : _tabs.key) || DEFAULT_SIZE;
|
|
|
}
|
|
|
|
|
|
var entity = map.get(key) || Object(objectSpread2["a" /* default */])({}, data); // Right
|
|
|
|
|
|
|
|
|
entity.right = rightOffset - entity.left - entity.width; // Update entity
|
|
|
|
|
|
map.set(key, entity);
|
|
|
}
|
|
|
|
|
|
return map;
|
|
|
}, [tabs.map(function (tab) {
|
|
|
return tab.key;
|
|
|
}).join('_'), tabSizes, holderScrollWidth]);
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useVisibleRange.js
|
|
|
|
|
|
var useVisibleRange_DEFAULT_SIZE = {
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
right: 0
|
|
|
};
|
|
|
function useVisibleRange(tabOffsets, containerSize, tabContentNodeSize, addNodeSize, _ref) {
|
|
|
var tabs = _ref.tabs,
|
|
|
tabPosition = _ref.tabPosition,
|
|
|
rtl = _ref.rtl;
|
|
|
var unit;
|
|
|
var position;
|
|
|
var transformSize;
|
|
|
|
|
|
if (['top', 'bottom'].includes(tabPosition)) {
|
|
|
unit = 'width';
|
|
|
position = rtl ? 'right' : 'left';
|
|
|
transformSize = Math.abs(containerSize.left);
|
|
|
} else {
|
|
|
unit = 'height';
|
|
|
position = 'top';
|
|
|
transformSize = -containerSize.top;
|
|
|
}
|
|
|
|
|
|
var basicSize = containerSize[unit];
|
|
|
var tabContentSize = tabContentNodeSize[unit];
|
|
|
var addSize = addNodeSize[unit];
|
|
|
var mergedBasicSize = basicSize;
|
|
|
|
|
|
if (tabContentSize + addSize > basicSize) {
|
|
|
mergedBasicSize = basicSize - addSize;
|
|
|
}
|
|
|
|
|
|
return Object(external_window_React_["useMemo"])(function () {
|
|
|
if (!tabs.length) {
|
|
|
return [0, 0];
|
|
|
}
|
|
|
|
|
|
var len = tabs.length;
|
|
|
var endIndex = len;
|
|
|
|
|
|
for (var i = 0; i < len; i += 1) {
|
|
|
var offset = tabOffsets.get(tabs[i].key) || useVisibleRange_DEFAULT_SIZE;
|
|
|
|
|
|
if (offset[position] + offset[unit] > transformSize + mergedBasicSize) {
|
|
|
endIndex = i - 1;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var startIndex = 0;
|
|
|
|
|
|
for (var _i = len - 1; _i >= 0; _i -= 1) {
|
|
|
var _offset = tabOffsets.get(tabs[_i].key) || useVisibleRange_DEFAULT_SIZE;
|
|
|
|
|
|
if (_offset[position] < transformSize) {
|
|
|
startIndex = _i + 1;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return [startIndex, endIndex];
|
|
|
}, [tabOffsets, transformSize, mergedBasicSize, tabPosition, tabs.map(function (tab) {
|
|
|
return tab.key;
|
|
|
}).join('_'), rtl]);
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__("wx14");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
|
var classCallCheck = __webpack_require__("1OyB");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
|
var createClass = __webpack_require__("vuIU");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
|
var assertThisInitialized = __webpack_require__("JX7q");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
|
var inherits = __webpack_require__("Ji7U");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
|
var createSuper = __webpack_require__("LK+K");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/mini-store/esm/index.js + 3 modules
|
|
|
var esm = __webpack_require__("I8Z2");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
|
|
|
var omit = __webpack_require__("bT9E");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/createChainedFunction.js
|
|
|
var createChainedFunction = __webpack_require__("2GS6");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
|
|
|
var shallowequal = __webpack_require__("Gytx");
|
|
|
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__("U8pU");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/utils/isMobile.js
|
|
|
|
|
|
|
|
|
// MIT License from https://github.com/kaimallea/isMobile
|
|
|
var applePhone = /iPhone/i;
|
|
|
var appleIpod = /iPod/i;
|
|
|
var appleTablet = /iPad/i;
|
|
|
var androidPhone = /\bAndroid(?:.+)Mobile\b/i; // Match 'Android' AND 'Mobile'
|
|
|
|
|
|
var androidTablet = /Android/i;
|
|
|
var amazonPhone = /\bAndroid(?:.+)SD4930UR\b/i;
|
|
|
var amazonTablet = /\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i;
|
|
|
var windowsPhone = /Windows Phone/i;
|
|
|
var windowsTablet = /\bWindows(?:.+)ARM\b/i; // Match 'Windows' AND 'ARM'
|
|
|
|
|
|
var otherBlackberry = /BlackBerry/i;
|
|
|
var otherBlackberry10 = /BB10/i;
|
|
|
var otherOpera = /Opera Mini/i;
|
|
|
var otherChrome = /\b(CriOS|Chrome)(?:.+)Mobile/i;
|
|
|
var otherFirefox = /Mobile(?:.+)Firefox\b/i; // Match 'Mobile' AND 'Firefox'
|
|
|
|
|
|
function match(regex, userAgent) {
|
|
|
return regex.test(userAgent);
|
|
|
}
|
|
|
|
|
|
function isMobile(userAgent) {
|
|
|
var ua = userAgent || (typeof navigator !== 'undefined' ? navigator.userAgent : ''); // Facebook mobile app's integrated browser adds a bunch of strings that
|
|
|
// match everything. Strip it out if it exists.
|
|
|
|
|
|
var tmp = (ua || '').split('[FBAN');
|
|
|
|
|
|
if (typeof tmp[1] !== 'undefined') {
|
|
|
var _tmp = tmp;
|
|
|
|
|
|
var _tmp2 = Object(slicedToArray["a" /* default */])(_tmp, 1);
|
|
|
|
|
|
ua = _tmp2[0];
|
|
|
} // Twitter mobile app's integrated browser on iPad adds a "Twitter for
|
|
|
// iPhone" string. Same probably happens on other tablet platforms.
|
|
|
// This will confuse detection so strip it out if it exists.
|
|
|
|
|
|
|
|
|
tmp = ua.split('Twitter');
|
|
|
|
|
|
if (typeof tmp[1] !== 'undefined') {
|
|
|
var _tmp3 = tmp;
|
|
|
|
|
|
var _tmp4 = Object(slicedToArray["a" /* default */])(_tmp3, 1);
|
|
|
|
|
|
ua = _tmp4[0];
|
|
|
}
|
|
|
|
|
|
var result = {
|
|
|
apple: {
|
|
|
phone: match(applePhone, ua) && !match(windowsPhone, ua),
|
|
|
ipod: match(appleIpod, ua),
|
|
|
tablet: !match(applePhone, ua) && match(appleTablet, ua) && !match(windowsPhone, ua),
|
|
|
device: (match(applePhone, ua) || match(appleIpod, ua) || match(appleTablet, ua)) && !match(windowsPhone, ua)
|
|
|
},
|
|
|
amazon: {
|
|
|
phone: match(amazonPhone, ua),
|
|
|
tablet: !match(amazonPhone, ua) && match(amazonTablet, ua),
|
|
|
device: match(amazonPhone, ua) || match(amazonTablet, ua)
|
|
|
},
|
|
|
android: {
|
|
|
phone: !match(windowsPhone, ua) && match(amazonPhone, ua) || !match(windowsPhone, ua) && match(androidPhone, ua),
|
|
|
tablet: !match(windowsPhone, ua) && !match(amazonPhone, ua) && !match(androidPhone, ua) && (match(amazonTablet, ua) || match(androidTablet, ua)),
|
|
|
device: !match(windowsPhone, ua) && (match(amazonPhone, ua) || match(amazonTablet, ua) || match(androidPhone, ua) || match(androidTablet, ua)) || match(/\bokhttp\b/i, ua)
|
|
|
},
|
|
|
windows: {
|
|
|
phone: match(windowsPhone, ua),
|
|
|
tablet: match(windowsTablet, ua),
|
|
|
device: match(windowsPhone, ua) || match(windowsTablet, ua)
|
|
|
},
|
|
|
other: {
|
|
|
blackberry: match(otherBlackberry, ua),
|
|
|
blackberry10: match(otherBlackberry10, ua),
|
|
|
opera: match(otherOpera, ua),
|
|
|
firefox: match(otherFirefox, ua),
|
|
|
chrome: match(otherChrome, ua),
|
|
|
device: match(otherBlackberry, ua) || match(otherBlackberry10, ua) || match(otherOpera, ua) || match(otherFirefox, ua) || match(otherChrome, ua)
|
|
|
},
|
|
|
// Additional
|
|
|
any: null,
|
|
|
phone: null,
|
|
|
tablet: null
|
|
|
};
|
|
|
result.any = result.apple.device || result.android.device || result.windows.device || result.other.device; // excludes 'other' devices and ipods, targeting touchscreen phones
|
|
|
|
|
|
result.phone = result.apple.phone || result.android.phone || result.windows.phone;
|
|
|
result.tablet = result.apple.tablet || result.android.tablet || result.windows.tablet;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
var defaultResult = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, isMobile()), {}, {
|
|
|
isMobile: isMobile
|
|
|
});
|
|
|
|
|
|
/* harmony default export */ var utils_isMobile = (defaultResult);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/util.js
|
|
|
|
|
|
|
|
|
|
|
|
function noop() {}
|
|
|
function getKeyFromChildrenIndex(child, menuEventKey, index) {
|
|
|
var prefix = menuEventKey || '';
|
|
|
return child.key || "".concat(prefix, "item_").concat(index);
|
|
|
}
|
|
|
function getMenuIdFromSubMenuEventKey(eventKey) {
|
|
|
return "".concat(eventKey, "-menu-");
|
|
|
}
|
|
|
function loopMenuItem(children, cb) {
|
|
|
var index = -1;
|
|
|
external_window_React_["Children"].forEach(children, function (c) {
|
|
|
index += 1;
|
|
|
|
|
|
if (c && c.type && c.type.isMenuItemGroup) {
|
|
|
external_window_React_["Children"].forEach(c.props.children, function (c2) {
|
|
|
index += 1;
|
|
|
cb(c2, index);
|
|
|
});
|
|
|
} else {
|
|
|
cb(c, index);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function loopMenuItemRecursively(children, keys, ret) {
|
|
|
/* istanbul ignore if */
|
|
|
if (!children || ret.find) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
external_window_React_["Children"].forEach(children, function (c) {
|
|
|
if (c) {
|
|
|
var construct = c.type;
|
|
|
|
|
|
if (!construct || !(construct.isSubMenu || construct.isMenuItem || construct.isMenuItemGroup)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (keys.indexOf(c.key) !== -1) {
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
ret.find = true;
|
|
|
} else if (c.props.children) {
|
|
|
loopMenuItemRecursively(c.props.children, keys, ret);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var menuAllProps = ['defaultSelectedKeys', 'selectedKeys', 'defaultOpenKeys', 'openKeys', 'mode', 'getPopupContainer', 'onSelect', 'onDeselect', 'onDestroy', 'openTransitionName', 'openAnimation', 'subMenuOpenDelay', 'subMenuCloseDelay', 'forceSubMenuRender', 'triggerSubMenuAction', 'level', 'selectable', 'multiple', 'onOpenChange', 'visible', 'focusable', 'defaultActiveFirst', 'prefixCls', 'inlineIndent', 'parentMenu', 'title', 'rootPrefixCls', 'eventKey', 'active', 'onItemHover', 'onTitleMouseEnter', 'onTitleMouseLeave', 'onTitleClick', 'popupAlign', 'popupOffset', 'isOpen', 'renderMenuItem', 'manualRef', 'subMenuKey', 'disabled', 'index', 'isSelected', 'store', 'activeKey', 'builtinPlacements', 'overflowedIndicator', 'motion', // the following keys found need to be removed from test regression
|
|
|
'attribute', 'value', 'popupClassName', 'inlineCollapsed', 'menu', 'theme', 'itemIcon', 'expandIcon']; // ref: https://github.com/ant-design/ant-design/issues/14007
|
|
|
// ref: https://bugs.chromium.org/p/chromium/issues/detail?id=360889
|
|
|
// getBoundingClientRect return the full precision value, which is
|
|
|
// not the same behavior as on chrome. Set the precision to 6 to
|
|
|
// unify their behavior
|
|
|
|
|
|
var getWidth = function getWidth(elem) {
|
|
|
var includeMargin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
|
var width = elem && typeof elem.getBoundingClientRect === 'function' && elem.getBoundingClientRect().width;
|
|
|
|
|
|
if (width) {
|
|
|
if (includeMargin) {
|
|
|
var _getComputedStyle = getComputedStyle(elem),
|
|
|
marginLeft = _getComputedStyle.marginLeft,
|
|
|
marginRight = _getComputedStyle.marginRight;
|
|
|
|
|
|
width += +marginLeft.replace('px', '') + +marginRight.replace('px', '');
|
|
|
}
|
|
|
|
|
|
width = +width.toFixed(6);
|
|
|
}
|
|
|
|
|
|
return width || 0;
|
|
|
};
|
|
|
var util_setStyle = function setStyle(elem, styleProperty, value) {
|
|
|
if (elem && Object(esm_typeof["a" /* default */])(elem.style) === 'object') {
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
elem.style[styleProperty] = value;
|
|
|
}
|
|
|
};
|
|
|
var util_isMobileDevice = function isMobileDevice() {
|
|
|
return utils_isMobile.any;
|
|
|
};
|
|
|
// EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
|
|
|
var ResizeObserver_es = __webpack_require__("bdgK");
|
|
|
|
|
|
// EXTERNAL MODULE: external "window.ReactDOM"
|
|
|
var external_window_ReactDOM_ = __webpack_require__("faye");
|
|
|
var external_window_ReactDOM_default = /*#__PURE__*/__webpack_require__.n(external_window_ReactDOM_);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/raf.js
|
|
|
var es_raf = __webpack_require__("wgJM");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/contains.js
|
|
|
var contains = __webpack_require__("l4aY");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
|
|
|
var findDOMNode = __webpack_require__("m+aA");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__("c+Xe");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/addEventListener.js
|
|
|
var addEventListener = __webpack_require__("zT1h");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Portal.js
|
|
|
var Portal = __webpack_require__("QC+M");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/utils/alignUtil.js
|
|
|
|
|
|
|
|
|
function isPointsEq(a1, a2, isAlignPoint) {
|
|
|
if (isAlignPoint) {
|
|
|
return a1[0] === a2[0];
|
|
|
}
|
|
|
|
|
|
return a1[0] === a2[0] && a1[1] === a2[1];
|
|
|
}
|
|
|
|
|
|
function getAlignFromPlacement(builtinPlacements, placementStr, align) {
|
|
|
var baseAlign = builtinPlacements[placementStr] || {};
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, baseAlign), align);
|
|
|
}
|
|
|
function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
|
|
|
var points = align.points;
|
|
|
var placements = Object.keys(builtinPlacements);
|
|
|
|
|
|
for (var i = 0; i < placements.length; i += 1) {
|
|
|
var placement = placements[i];
|
|
|
|
|
|
if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
|
|
|
return "".concat(prefixCls, "-placement-").concat(placement);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return '';
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-util/es/isMobile.js
|
|
|
/* harmony default export */ var es_isMobile = (function () {
|
|
|
if (typeof navigator === 'undefined' || typeof window === 'undefined') {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
var agent = navigator.userAgent || navigator.vendor || window.opera;
|
|
|
|
|
|
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4))) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js
|
|
|
var canUseDom = __webpack_require__("MNnm");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/util/motion.js
|
|
|
|
|
|
// ================= Transition =================
|
|
|
// Event wrapper. Copy from react source code
|
|
|
|
|
|
function makePrefixMap(styleProp, eventName) {
|
|
|
var prefixes = {};
|
|
|
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
|
prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName);
|
|
|
prefixes["Moz".concat(styleProp)] = "moz".concat(eventName);
|
|
|
prefixes["ms".concat(styleProp)] = "MS".concat(eventName);
|
|
|
prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase());
|
|
|
return prefixes;
|
|
|
}
|
|
|
|
|
|
function getVendorPrefixes(domSupport, win) {
|
|
|
var prefixes = {
|
|
|
animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
|
|
transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
|
|
};
|
|
|
|
|
|
if (domSupport) {
|
|
|
if (!('AnimationEvent' in win)) {
|
|
|
delete prefixes.animationend.animation;
|
|
|
}
|
|
|
|
|
|
if (!('TransitionEvent' in win)) {
|
|
|
delete prefixes.transitionend.transition;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return prefixes;
|
|
|
}
|
|
|
var vendorPrefixes = getVendorPrefixes(Object(canUseDom["a" /* default */])(), typeof window !== 'undefined' ? window : {});
|
|
|
var motion_style = {};
|
|
|
|
|
|
if (Object(canUseDom["a" /* default */])()) {
|
|
|
var _document$createEleme = document.createElement('div');
|
|
|
|
|
|
motion_style = _document$createEleme.style;
|
|
|
}
|
|
|
|
|
|
var prefixedEventNames = {};
|
|
|
function getVendorPrefixedEventName(eventName) {
|
|
|
if (prefixedEventNames[eventName]) {
|
|
|
return prefixedEventNames[eventName];
|
|
|
}
|
|
|
|
|
|
var prefixMap = vendorPrefixes[eventName];
|
|
|
|
|
|
if (prefixMap) {
|
|
|
var stylePropList = Object.keys(prefixMap);
|
|
|
var len = stylePropList.length;
|
|
|
|
|
|
for (var i = 0; i < len; i += 1) {
|
|
|
var styleProp = stylePropList[i];
|
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in motion_style) {
|
|
|
prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
|
return prefixedEventNames[eventName];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return '';
|
|
|
}
|
|
|
var internalAnimationEndName = getVendorPrefixedEventName('animationend');
|
|
|
var internalTransitionEndName = getVendorPrefixedEventName('transitionend');
|
|
|
var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
|
|
|
var animationEndName = internalAnimationEndName || 'animationend';
|
|
|
var transitionEndName = internalTransitionEndName || 'transitionend';
|
|
|
function getTransitionName(transitionName, transitionType) {
|
|
|
if (!transitionName) return null;
|
|
|
|
|
|
if (Object(esm_typeof["a" /* default */])(transitionName) === 'object') {
|
|
|
var type = transitionType.replace(/-\w/g, function (match) {
|
|
|
return match[1].toUpperCase();
|
|
|
});
|
|
|
return transitionName[type];
|
|
|
}
|
|
|
|
|
|
return "".concat(transitionName, "-").concat(transitionType);
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/interface.js
|
|
|
var STATUS_NONE = 'none';
|
|
|
var STATUS_APPEAR = 'appear';
|
|
|
var STATUS_ENTER = 'enter';
|
|
|
var STATUS_LEAVE = 'leave';
|
|
|
var STEP_NONE = 'none';
|
|
|
var STEP_PREPARE = 'prepare';
|
|
|
var STEP_START = 'start';
|
|
|
var STEP_ACTIVE = 'active';
|
|
|
var STEP_ACTIVATED = 'end';
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useState.js
|
|
|
|
|
|
|
|
|
function useMountStatus(defaultValue) {
|
|
|
var destroyRef = Object(external_window_React_["useRef"])(false);
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])(defaultValue),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
val = _useState2[0],
|
|
|
setVal = _useState2[1];
|
|
|
|
|
|
function setValue(next) {
|
|
|
if (!destroyRef.current) {
|
|
|
setVal(next);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
return function () {
|
|
|
destroyRef.current = true;
|
|
|
};
|
|
|
}, []);
|
|
|
return [val, setValue];
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js
|
|
|
|
|
|
// It's safe to use `useLayoutEffect` but the warning is annoying
|
|
|
|
|
|
var useIsomorphicLayoutEffect = Object(canUseDom["a" /* default */])() ? external_window_React_["useLayoutEffect"] : external_window_React_["useEffect"];
|
|
|
/* harmony default export */ var hooks_useIsomorphicLayoutEffect = (useIsomorphicLayoutEffect);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useNextFrame.js
|
|
|
|
|
|
|
|
|
/* harmony default export */ var useNextFrame = (function () {
|
|
|
var nextFrameRef = external_window_React_["useRef"](null);
|
|
|
|
|
|
function cancelNextFrame() {
|
|
|
es_raf["a" /* default */].cancel(nextFrameRef.current);
|
|
|
}
|
|
|
|
|
|
function nextFrame(callback) {
|
|
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
|
cancelNextFrame();
|
|
|
var nextFrameId = Object(es_raf["a" /* default */])(function () {
|
|
|
if (delay <= 1) {
|
|
|
callback({
|
|
|
isCanceled: function isCanceled() {
|
|
|
return nextFrameId !== nextFrameRef.current;
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
nextFrame(callback, delay - 1);
|
|
|
}
|
|
|
});
|
|
|
nextFrameRef.current = nextFrameId;
|
|
|
}
|
|
|
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
return function () {
|
|
|
cancelNextFrame();
|
|
|
};
|
|
|
}, []);
|
|
|
return [nextFrame, cancelNextFrame];
|
|
|
});
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useStepQueue.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
|
|
|
/** Skip current step */
|
|
|
|
|
|
var SkipStep = false;
|
|
|
/** Current step should be update in */
|
|
|
|
|
|
var DoStep = true;
|
|
|
function useStepQueue_isActive(step) {
|
|
|
return step === STEP_ACTIVE || step === STEP_ACTIVATED;
|
|
|
}
|
|
|
/* harmony default export */ var useStepQueue = (function (status, callback) {
|
|
|
var _React$useState = external_window_React_["useState"](STEP_NONE),
|
|
|
_React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2),
|
|
|
step = _React$useState2[0],
|
|
|
setStep = _React$useState2[1];
|
|
|
|
|
|
var _useNextFrame = useNextFrame(),
|
|
|
_useNextFrame2 = Object(slicedToArray["a" /* default */])(_useNextFrame, 2),
|
|
|
nextFrame = _useNextFrame2[0],
|
|
|
cancelNextFrame = _useNextFrame2[1];
|
|
|
|
|
|
function startQueue() {
|
|
|
setStep(STEP_PREPARE);
|
|
|
}
|
|
|
|
|
|
hooks_useIsomorphicLayoutEffect(function () {
|
|
|
if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
|
|
|
var index = STEP_QUEUE.indexOf(step);
|
|
|
var nextStep = STEP_QUEUE[index + 1];
|
|
|
var result = callback(step);
|
|
|
|
|
|
if (result === SkipStep) {
|
|
|
// Skip when no needed
|
|
|
setStep(nextStep);
|
|
|
} else {
|
|
|
// Do as frame for step update
|
|
|
nextFrame(function (info) {
|
|
|
function doNext() {
|
|
|
// Skip since current queue is ood
|
|
|
if (info.isCanceled()) return;
|
|
|
setStep(nextStep);
|
|
|
}
|
|
|
|
|
|
if (result === true) {
|
|
|
doNext();
|
|
|
} else {
|
|
|
// Only promise should be async
|
|
|
Promise.resolve(result).then(doNext);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}, [status, step]);
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
return function () {
|
|
|
cancelNextFrame();
|
|
|
};
|
|
|
}, []);
|
|
|
return [startQueue, step];
|
|
|
});
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useDomMotionEvents.js
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var useDomMotionEvents = (function (callback) {
|
|
|
var cacheElementRef = Object(external_window_React_["useRef"])(); // Cache callback
|
|
|
|
|
|
var callbackRef = Object(external_window_React_["useRef"])(callback);
|
|
|
callbackRef.current = callback; // Internal motion event handler
|
|
|
|
|
|
var onInternalMotionEnd = external_window_React_["useCallback"](function (event) {
|
|
|
callbackRef.current(event);
|
|
|
}, []); // Remove events
|
|
|
|
|
|
function removeMotionEvents(element) {
|
|
|
if (element) {
|
|
|
element.removeEventListener(transitionEndName, onInternalMotionEnd);
|
|
|
element.removeEventListener(animationEndName, onInternalMotionEnd);
|
|
|
}
|
|
|
} // Patch events
|
|
|
|
|
|
|
|
|
function patchMotionEvents(element) {
|
|
|
if (cacheElementRef.current && cacheElementRef.current !== element) {
|
|
|
removeMotionEvents(cacheElementRef.current);
|
|
|
}
|
|
|
|
|
|
if (element && element !== cacheElementRef.current) {
|
|
|
element.addEventListener(transitionEndName, onInternalMotionEnd);
|
|
|
element.addEventListener(animationEndName, onInternalMotionEnd); // Save as cache in case dom removed trigger by `motionDeadline`
|
|
|
|
|
|
cacheElementRef.current = element;
|
|
|
}
|
|
|
} // Clean up when removed
|
|
|
|
|
|
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
return function () {
|
|
|
removeMotionEvents(cacheElementRef.current);
|
|
|
};
|
|
|
}, []);
|
|
|
return [patchMotionEvents, removeMotionEvents];
|
|
|
});
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useStatus.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
var _ref$motionEnter = _ref.motionEnter,
|
|
|
motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter,
|
|
|
_ref$motionAppear = _ref.motionAppear,
|
|
|
motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear,
|
|
|
_ref$motionLeave = _ref.motionLeave,
|
|
|
motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave,
|
|
|
motionDeadline = _ref.motionDeadline,
|
|
|
motionLeaveImmediately = _ref.motionLeaveImmediately,
|
|
|
onAppearPrepare = _ref.onAppearPrepare,
|
|
|
onEnterPrepare = _ref.onEnterPrepare,
|
|
|
onLeavePrepare = _ref.onLeavePrepare,
|
|
|
onAppearStart = _ref.onAppearStart,
|
|
|
onEnterStart = _ref.onEnterStart,
|
|
|
onLeaveStart = _ref.onLeaveStart,
|
|
|
onAppearActive = _ref.onAppearActive,
|
|
|
onEnterActive = _ref.onEnterActive,
|
|
|
onLeaveActive = _ref.onLeaveActive,
|
|
|
onAppearEnd = _ref.onAppearEnd,
|
|
|
onEnterEnd = _ref.onEnterEnd,
|
|
|
onLeaveEnd = _ref.onLeaveEnd,
|
|
|
onVisibleChanged = _ref.onVisibleChanged;
|
|
|
|
|
|
// Used for outer render usage to avoid `visible: false & status: none` to render nothing
|
|
|
var _useState = useMountStatus(),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
asyncVisible = _useState2[0],
|
|
|
setAsyncVisible = _useState2[1];
|
|
|
|
|
|
var _useState3 = useMountStatus(STATUS_NONE),
|
|
|
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
|
|
status = _useState4[0],
|
|
|
setStatus = _useState4[1];
|
|
|
|
|
|
var _useState5 = useMountStatus(null),
|
|
|
_useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2),
|
|
|
style = _useState6[0],
|
|
|
setStyle = _useState6[1];
|
|
|
|
|
|
var mountedRef = Object(external_window_React_["useRef"])(false);
|
|
|
var deadlineRef = Object(external_window_React_["useRef"])(null);
|
|
|
var destroyedRef = Object(external_window_React_["useRef"])(false); // =========================== Dom Node ===========================
|
|
|
|
|
|
var cacheElementRef = Object(external_window_React_["useRef"])(null);
|
|
|
|
|
|
function getDomElement() {
|
|
|
var element = getElement();
|
|
|
return element || cacheElementRef.current;
|
|
|
} // ========================== Motion End ==========================
|
|
|
|
|
|
|
|
|
var activeRef = Object(external_window_React_["useRef"])(false);
|
|
|
|
|
|
function onInternalMotionEnd(event) {
|
|
|
var element = getDomElement();
|
|
|
|
|
|
if (event && !event.deadline && event.target !== element) {
|
|
|
// event exists
|
|
|
// not initiated by deadline
|
|
|
// transitionEnd not fired by inner elements
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var canEnd;
|
|
|
|
|
|
if (status === STATUS_APPEAR && activeRef.current) {
|
|
|
canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);
|
|
|
} else if (status === STATUS_ENTER && activeRef.current) {
|
|
|
canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);
|
|
|
} else if (status === STATUS_LEAVE && activeRef.current) {
|
|
|
canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);
|
|
|
} // Only update status when `canEnd` and not destroyed
|
|
|
|
|
|
|
|
|
if (canEnd !== false && !destroyedRef.current) {
|
|
|
setStatus(STATUS_NONE);
|
|
|
setStyle(null);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd),
|
|
|
_useDomMotionEvents2 = Object(slicedToArray["a" /* default */])(_useDomMotionEvents, 1),
|
|
|
patchMotionEvents = _useDomMotionEvents2[0]; // ============================= Step =============================
|
|
|
|
|
|
|
|
|
var eventHandlers = external_window_React_["useMemo"](function () {
|
|
|
var _ref2, _ref3, _ref4;
|
|
|
|
|
|
switch (status) {
|
|
|
case 'appear':
|
|
|
return _ref2 = {}, Object(defineProperty["a" /* default */])(_ref2, STEP_PREPARE, onAppearPrepare), Object(defineProperty["a" /* default */])(_ref2, STEP_START, onAppearStart), Object(defineProperty["a" /* default */])(_ref2, STEP_ACTIVE, onAppearActive), _ref2;
|
|
|
|
|
|
case 'enter':
|
|
|
return _ref3 = {}, Object(defineProperty["a" /* default */])(_ref3, STEP_PREPARE, onEnterPrepare), Object(defineProperty["a" /* default */])(_ref3, STEP_START, onEnterStart), Object(defineProperty["a" /* default */])(_ref3, STEP_ACTIVE, onEnterActive), _ref3;
|
|
|
|
|
|
case 'leave':
|
|
|
return _ref4 = {}, Object(defineProperty["a" /* default */])(_ref4, STEP_PREPARE, onLeavePrepare), Object(defineProperty["a" /* default */])(_ref4, STEP_START, onLeaveStart), Object(defineProperty["a" /* default */])(_ref4, STEP_ACTIVE, onLeaveActive), _ref4;
|
|
|
|
|
|
default:
|
|
|
return {};
|
|
|
}
|
|
|
}, [status]);
|
|
|
|
|
|
var _useStepQueue = useStepQueue(status, function (newStep) {
|
|
|
// Only prepare step can be skip
|
|
|
if (newStep === STEP_PREPARE) {
|
|
|
var onPrepare = eventHandlers[STEP_PREPARE];
|
|
|
|
|
|
if (!onPrepare) {
|
|
|
return SkipStep;
|
|
|
}
|
|
|
|
|
|
return onPrepare(getDomElement());
|
|
|
} // Rest step is sync update
|
|
|
|
|
|
|
|
|
// Rest step is sync update
|
|
|
if (step in eventHandlers) {
|
|
|
var _eventHandlers$step;
|
|
|
|
|
|
setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);
|
|
|
}
|
|
|
|
|
|
if (step === STEP_ACTIVE) {
|
|
|
// Patch events when motion needed
|
|
|
patchMotionEvents(getDomElement());
|
|
|
|
|
|
if (motionDeadline > 0) {
|
|
|
clearTimeout(deadlineRef.current);
|
|
|
deadlineRef.current = setTimeout(function () {
|
|
|
onInternalMotionEnd({
|
|
|
deadline: true
|
|
|
});
|
|
|
}, motionDeadline);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return DoStep;
|
|
|
}),
|
|
|
_useStepQueue2 = Object(slicedToArray["a" /* default */])(_useStepQueue, 2),
|
|
|
startStep = _useStepQueue2[0],
|
|
|
step = _useStepQueue2[1];
|
|
|
|
|
|
var active = useStepQueue_isActive(step);
|
|
|
activeRef.current = active; // ============================ Status ============================
|
|
|
// Update with new status
|
|
|
|
|
|
hooks_useIsomorphicLayoutEffect(function () {
|
|
|
setAsyncVisible(visible);
|
|
|
var isMounted = mountedRef.current;
|
|
|
mountedRef.current = true;
|
|
|
|
|
|
if (!supportMotion) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var nextStatus; // Appear
|
|
|
|
|
|
if (!isMounted && visible && motionAppear) {
|
|
|
nextStatus = STATUS_APPEAR;
|
|
|
} // Enter
|
|
|
|
|
|
|
|
|
if (isMounted && visible && motionEnter) {
|
|
|
nextStatus = STATUS_ENTER;
|
|
|
} // Leave
|
|
|
|
|
|
|
|
|
if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
|
|
|
nextStatus = STATUS_LEAVE;
|
|
|
} // Update to next status
|
|
|
|
|
|
|
|
|
if (nextStatus) {
|
|
|
setStatus(nextStatus);
|
|
|
startStep();
|
|
|
}
|
|
|
}, [visible]); // ============================ Effect ============================
|
|
|
// Reset when motion changed
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
if ( // Cancel appear
|
|
|
status === STATUS_APPEAR && !motionAppear || // Cancel enter
|
|
|
status === STATUS_ENTER && !motionEnter || // Cancel leave
|
|
|
status === STATUS_LEAVE && !motionLeave) {
|
|
|
setStatus(STATUS_NONE);
|
|
|
}
|
|
|
}, [motionAppear, motionEnter, motionLeave]);
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
return function () {
|
|
|
clearTimeout(deadlineRef.current);
|
|
|
destroyedRef.current = true;
|
|
|
};
|
|
|
}, []); // Trigger `onVisibleChanged`
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
if (asyncVisible !== undefined && status === STATUS_NONE) {
|
|
|
onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible);
|
|
|
}
|
|
|
}, [asyncVisible, status]); // ============================ Styles ============================
|
|
|
|
|
|
var mergedStyle = style;
|
|
|
|
|
|
if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
|
|
|
mergedStyle = Object(objectSpread2["a" /* default */])({
|
|
|
transition: 'none'
|
|
|
}, mergedStyle);
|
|
|
}
|
|
|
|
|
|
return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/DomWrapper.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DomWrapper_DomWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(DomWrapper, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(DomWrapper);
|
|
|
|
|
|
function DomWrapper() {
|
|
|
Object(classCallCheck["a" /* default */])(this, DomWrapper);
|
|
|
|
|
|
return _super.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(DomWrapper, [{
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
return this.props.children;
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return DomWrapper;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
/* harmony default export */ var es_DomWrapper = (DomWrapper_DomWrapper);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/CSSMotion.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* `transitionSupport` is used for none transition test case.
|
|
|
* Default we use browser transition event support check.
|
|
|
*/
|
|
|
|
|
|
function genCSSMotion(config) {
|
|
|
var transitionSupport = config;
|
|
|
|
|
|
if (Object(esm_typeof["a" /* default */])(config) === 'object') {
|
|
|
transitionSupport = config.transitionSupport;
|
|
|
}
|
|
|
|
|
|
function isSupportTransition(props) {
|
|
|
return !!(props.motionName && transitionSupport);
|
|
|
}
|
|
|
|
|
|
var CSSMotion = /*#__PURE__*/external_window_React_["forwardRef"](function (props, ref) {
|
|
|
var _props$visible = props.visible,
|
|
|
visible = _props$visible === void 0 ? true : _props$visible,
|
|
|
_props$removeOnLeave = props.removeOnLeave,
|
|
|
removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,
|
|
|
forceRender = props.forceRender,
|
|
|
children = props.children,
|
|
|
motionName = props.motionName,
|
|
|
leavedClassName = props.leavedClassName,
|
|
|
eventProps = props.eventProps;
|
|
|
var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement
|
|
|
|
|
|
var nodeRef = Object(external_window_React_["useRef"])(); // Ref to the dom wrapper in case ref can not pass to HTMLElement
|
|
|
|
|
|
var wrapperNodeRef = Object(external_window_React_["useRef"])();
|
|
|
|
|
|
function getDomElement() {
|
|
|
try {
|
|
|
return Object(findDOMNode["a" /* default */])(nodeRef.current || wrapperNodeRef.current);
|
|
|
} catch (e) {
|
|
|
// Only happen when `motionDeadline` trigger but element removed.
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var _useStatus = useStatus(supportMotion, visible, getDomElement, props),
|
|
|
_useStatus2 = Object(slicedToArray["a" /* default */])(_useStatus, 4),
|
|
|
status = _useStatus2[0],
|
|
|
statusStep = _useStatus2[1],
|
|
|
statusStyle = _useStatus2[2],
|
|
|
mergedVisible = _useStatus2[3]; // Record whether content has rended
|
|
|
// Will return null for un-rendered even when `removeOnLeave={false}`
|
|
|
|
|
|
|
|
|
var renderedRef = external_window_React_["useRef"](mergedVisible);
|
|
|
|
|
|
if (mergedVisible) {
|
|
|
renderedRef.current = true;
|
|
|
} // ====================== Refs ======================
|
|
|
|
|
|
|
|
|
var originRef = Object(external_window_React_["useRef"])(ref);
|
|
|
originRef.current = ref;
|
|
|
var setNodeRef = external_window_React_["useCallback"](function (node) {
|
|
|
nodeRef.current = node;
|
|
|
Object(es_ref["b" /* fillRef */])(originRef.current, node);
|
|
|
}, []); // ===================== Render =====================
|
|
|
|
|
|
var motionChildren;
|
|
|
|
|
|
var mergedProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, eventProps), {}, {
|
|
|
visible: visible
|
|
|
});
|
|
|
|
|
|
if (!children) {
|
|
|
// No children
|
|
|
motionChildren = null;
|
|
|
} else if (status === STATUS_NONE || !isSupportTransition(props)) {
|
|
|
// Stable children
|
|
|
if (mergedVisible) {
|
|
|
motionChildren = children(Object(objectSpread2["a" /* default */])({}, mergedProps), setNodeRef);
|
|
|
} else if (!removeOnLeave && renderedRef.current) {
|
|
|
motionChildren = children(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedProps), {}, {
|
|
|
className: leavedClassName
|
|
|
}), setNodeRef);
|
|
|
} else if (forceRender) {
|
|
|
motionChildren = children(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedProps), {}, {
|
|
|
style: {
|
|
|
display: 'none'
|
|
|
}
|
|
|
}), setNodeRef);
|
|
|
} else {
|
|
|
motionChildren = null;
|
|
|
}
|
|
|
} else {
|
|
|
var _classNames;
|
|
|
|
|
|
// In motion
|
|
|
var statusSuffix;
|
|
|
|
|
|
if (statusStep === STEP_PREPARE) {
|
|
|
statusSuffix = 'prepare';
|
|
|
} else if (useStepQueue_isActive(statusStep)) {
|
|
|
statusSuffix = 'active';
|
|
|
} else if (statusStep === STEP_START) {
|
|
|
statusSuffix = 'start';
|
|
|
}
|
|
|
|
|
|
motionChildren = children(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedProps), {}, {
|
|
|
className: classnames_default()(getTransitionName(motionName, status), (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix)), statusSuffix), Object(defineProperty["a" /* default */])(_classNames, motionName, typeof motionName === 'string'), _classNames)),
|
|
|
style: statusStyle
|
|
|
}), setNodeRef);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_DomWrapper, {
|
|
|
ref: wrapperNodeRef
|
|
|
}, motionChildren);
|
|
|
});
|
|
|
CSSMotion.displayName = 'CSSMotion';
|
|
|
return CSSMotion;
|
|
|
}
|
|
|
/* harmony default export */ var es_CSSMotion = (genCSSMotion(supportTransition));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/util/diff.js
|
|
|
|
|
|
|
|
|
var STATUS_ADD = 'add';
|
|
|
var STATUS_KEEP = 'keep';
|
|
|
var STATUS_REMOVE = 'remove';
|
|
|
var STATUS_REMOVED = 'removed';
|
|
|
function wrapKeyToObject(key) {
|
|
|
var keyObj;
|
|
|
|
|
|
if (key && Object(esm_typeof["a" /* default */])(key) === 'object' && 'key' in key) {
|
|
|
keyObj = key;
|
|
|
} else {
|
|
|
keyObj = {
|
|
|
key: key
|
|
|
};
|
|
|
}
|
|
|
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, keyObj), {}, {
|
|
|
key: String(keyObj.key)
|
|
|
});
|
|
|
}
|
|
|
function parseKeys() {
|
|
|
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
|
return keys.map(wrapKeyToObject);
|
|
|
}
|
|
|
function diffKeys() {
|
|
|
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
|
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
|
var list = [];
|
|
|
var currentIndex = 0;
|
|
|
var currentLen = currentKeys.length;
|
|
|
var prevKeyObjects = parseKeys(prevKeys);
|
|
|
var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep
|
|
|
|
|
|
prevKeyObjects.forEach(function (keyObj) {
|
|
|
var hit = false;
|
|
|
|
|
|
for (var i = currentIndex; i < currentLen; i += 1) {
|
|
|
var currentKeyObj = currentKeyObjects[i];
|
|
|
|
|
|
if (currentKeyObj.key === keyObj.key) {
|
|
|
// New added keys should add before current key
|
|
|
if (currentIndex < i) {
|
|
|
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, obj), {}, {
|
|
|
status: STATUS_ADD
|
|
|
});
|
|
|
}));
|
|
|
currentIndex = i;
|
|
|
}
|
|
|
|
|
|
list.push(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, currentKeyObj), {}, {
|
|
|
status: STATUS_KEEP
|
|
|
}));
|
|
|
currentIndex += 1;
|
|
|
hit = true;
|
|
|
break;
|
|
|
}
|
|
|
} // If not hit, it means key is removed
|
|
|
|
|
|
|
|
|
if (!hit) {
|
|
|
list.push(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, keyObj), {}, {
|
|
|
status: STATUS_REMOVE
|
|
|
}));
|
|
|
}
|
|
|
}); // Add rest to the list
|
|
|
|
|
|
if (currentIndex < currentLen) {
|
|
|
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, obj), {}, {
|
|
|
status: STATUS_ADD
|
|
|
});
|
|
|
}));
|
|
|
}
|
|
|
/**
|
|
|
* Merge same key when it remove and add again:
|
|
|
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
|
|
|
*/
|
|
|
|
|
|
|
|
|
var keys = {};
|
|
|
list.forEach(function (_ref) {
|
|
|
var key = _ref.key;
|
|
|
keys[key] = (keys[key] || 0) + 1;
|
|
|
});
|
|
|
var duplicatedKeys = Object.keys(keys).filter(function (key) {
|
|
|
return keys[key] > 1;
|
|
|
});
|
|
|
duplicatedKeys.forEach(function (matchKey) {
|
|
|
// Remove `STATUS_REMOVE` node.
|
|
|
list = list.filter(function (_ref2) {
|
|
|
var key = _ref2.key,
|
|
|
status = _ref2.status;
|
|
|
return key !== matchKey || status !== STATUS_REMOVE;
|
|
|
}); // Update `STATUS_ADD` to `STATUS_KEEP`
|
|
|
|
|
|
list.forEach(function (node) {
|
|
|
if (node.key === matchKey) {
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
node.status = STATUS_KEEP;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
return list;
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/CSSMotionList.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint react/prop-types: 0 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];
|
|
|
/**
|
|
|
* Generate a CSSMotionList component with config
|
|
|
* @param transitionSupport No need since CSSMotionList no longer depends on transition support
|
|
|
* @param CSSMotion CSSMotion component
|
|
|
*/
|
|
|
|
|
|
function genCSSMotionList(transitionSupport) {
|
|
|
var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : es_CSSMotion;
|
|
|
|
|
|
var CSSMotionList = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(CSSMotionList, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(CSSMotionList);
|
|
|
|
|
|
function CSSMotionList() {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, CSSMotionList);
|
|
|
|
|
|
_this = _super.apply(this, arguments);
|
|
|
_this.state = {
|
|
|
keyEntities: []
|
|
|
};
|
|
|
|
|
|
_this.removeKey = function (removeKey) {
|
|
|
_this.setState(function (_ref) {
|
|
|
var keyEntities = _ref.keyEntities;
|
|
|
return {
|
|
|
keyEntities: keyEntities.map(function (entity) {
|
|
|
if (entity.key !== removeKey) return entity;
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, entity), {}, {
|
|
|
status: STATUS_REMOVED
|
|
|
});
|
|
|
})
|
|
|
};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(CSSMotionList, [{
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _this2 = this;
|
|
|
|
|
|
var keyEntities = this.state.keyEntities;
|
|
|
|
|
|
var _this$props = this.props,
|
|
|
component = _this$props.component,
|
|
|
children = _this$props.children,
|
|
|
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
|
restProps = Object(objectWithoutProperties["a" /* default */])(_this$props, ["component", "children", "onVisibleChanged"]);
|
|
|
|
|
|
var Component = component || external_window_React_["Fragment"];
|
|
|
var motionProps = {};
|
|
|
MOTION_PROP_NAMES.forEach(function (prop) {
|
|
|
motionProps[prop] = restProps[prop];
|
|
|
delete restProps[prop];
|
|
|
});
|
|
|
delete restProps.keys;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](Component, restProps, keyEntities.map(function (_ref2) {
|
|
|
var status = _ref2.status,
|
|
|
eventProps = Object(objectWithoutProperties["a" /* default */])(_ref2, ["status"]);
|
|
|
|
|
|
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](CSSMotion, Object(esm_extends["a" /* default */])({}, motionProps, {
|
|
|
key: eventProps.key,
|
|
|
visible: visible,
|
|
|
eventProps: eventProps,
|
|
|
onVisibleChanged: function onVisibleChanged(changedVisible) {
|
|
|
_onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {
|
|
|
key: eventProps.key
|
|
|
});
|
|
|
|
|
|
if (!changedVisible) {
|
|
|
_this2.removeKey(eventProps.key);
|
|
|
}
|
|
|
}
|
|
|
}), children);
|
|
|
}));
|
|
|
}
|
|
|
}], [{
|
|
|
key: "getDerivedStateFromProps",
|
|
|
value: function getDerivedStateFromProps(_ref3, _ref4) {
|
|
|
var keys = _ref3.keys;
|
|
|
var keyEntities = _ref4.keyEntities;
|
|
|
var parsedKeyObjects = parseKeys(keys);
|
|
|
var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
|
|
|
return {
|
|
|
keyEntities: mixedKeyEntities.filter(function (entity) {
|
|
|
var prevEntity = keyEntities.find(function (_ref5) {
|
|
|
var key = _ref5.key;
|
|
|
return entity.key === key;
|
|
|
}); // Remove if already mark as removed
|
|
|
|
|
|
if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
})
|
|
|
};
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return CSSMotionList;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
CSSMotionList.defaultProps = {
|
|
|
component: 'div'
|
|
|
};
|
|
|
return CSSMotionList;
|
|
|
}
|
|
|
/* harmony default export */ var es_CSSMotionList = (genCSSMotionList(supportTransition));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_motion_es = (es_CSSMotion);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/utils/legacyUtil.js
|
|
|
function getMotion(_ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
motion = _ref.motion,
|
|
|
animation = _ref.animation,
|
|
|
transitionName = _ref.transitionName;
|
|
|
|
|
|
if (motion) {
|
|
|
return motion;
|
|
|
}
|
|
|
|
|
|
if (animation) {
|
|
|
return {
|
|
|
motionName: "".concat(prefixCls, "-").concat(animation)
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (transitionName) {
|
|
|
return {
|
|
|
motionName: transitionName
|
|
|
};
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/Mask.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Mask(props) {
|
|
|
var prefixCls = props.prefixCls,
|
|
|
visible = props.visible,
|
|
|
zIndex = props.zIndex,
|
|
|
mask = props.mask,
|
|
|
maskMotion = props.maskMotion,
|
|
|
maskAnimation = props.maskAnimation,
|
|
|
maskTransitionName = props.maskTransitionName;
|
|
|
|
|
|
if (!mask) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
var motion = {};
|
|
|
|
|
|
if (maskMotion || maskTransitionName || maskAnimation) {
|
|
|
motion = Object(objectSpread2["a" /* default */])({
|
|
|
motionAppear: true
|
|
|
}, getMotion({
|
|
|
motion: maskMotion,
|
|
|
prefixCls: prefixCls,
|
|
|
transitionName: maskTransitionName,
|
|
|
animation: maskAnimation
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({}, motion, {
|
|
|
visible: visible,
|
|
|
removeOnLeave: true
|
|
|
}), function (_ref) {
|
|
|
var className = _ref.className;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("div", {
|
|
|
style: {
|
|
|
zIndex: zIndex
|
|
|
},
|
|
|
className: classnames_default()("".concat(prefixCls, "-mask"), className)
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-align/es/index.js + 5 modules
|
|
|
var rc_align_es = __webpack_require__("9mu1");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
|
var regenerator = __webpack_require__("o0o1");
|
|
|
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__("HaE+");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/useVisibleStatus.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var StatusQueue = ['measure', 'align', null, 'motion'];
|
|
|
/* harmony default export */ var useVisibleStatus = (function (visible, doMeasure) {
|
|
|
var _useState = Object(external_window_React_["useState"])(null),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
status = _useState2[0],
|
|
|
setInternalStatus = _useState2[1];
|
|
|
|
|
|
var rafRef = Object(external_window_React_["useRef"])();
|
|
|
var destroyRef = Object(external_window_React_["useRef"])(false);
|
|
|
|
|
|
function setStatus(nextStatus) {
|
|
|
if (!destroyRef.current) {
|
|
|
setInternalStatus(nextStatus);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function cancelRaf() {
|
|
|
es_raf["a" /* default */].cancel(rafRef.current);
|
|
|
}
|
|
|
|
|
|
function goNextStatus(callback) {
|
|
|
cancelRaf();
|
|
|
rafRef.current = Object(es_raf["a" /* default */])(function () {
|
|
|
// Only align should be manually trigger
|
|
|
setStatus(function (prev) {
|
|
|
switch (status) {
|
|
|
case 'align':
|
|
|
return 'motion';
|
|
|
|
|
|
case 'motion':
|
|
|
return 'stable';
|
|
|
|
|
|
default:
|
|
|
}
|
|
|
|
|
|
return prev;
|
|
|
});
|
|
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
|
});
|
|
|
} // Init status
|
|
|
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
setStatus('measure');
|
|
|
}, [visible]); // Go next status
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
switch (status) {
|
|
|
case 'measure':
|
|
|
doMeasure();
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
}
|
|
|
|
|
|
if (status) {
|
|
|
rafRef.current = Object(es_raf["a" /* default */])( /*#__PURE__*/Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
|
|
|
var index, nextStatus;
|
|
|
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
|
while (1) {
|
|
|
switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
index = StatusQueue.indexOf(status);
|
|
|
nextStatus = StatusQueue[index + 1];
|
|
|
|
|
|
if (nextStatus && index !== -1) {
|
|
|
setStatus(nextStatus);
|
|
|
}
|
|
|
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}
|
|
|
}, _callee);
|
|
|
})));
|
|
|
}
|
|
|
}, [status]);
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
return function () {
|
|
|
destroyRef.current = true;
|
|
|
cancelRaf();
|
|
|
};
|
|
|
}, []);
|
|
|
return [status, goNextStatus];
|
|
|
});
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/useStretchStyle.js
|
|
|
|
|
|
|
|
|
/* harmony default export */ var useStretchStyle = (function (stretch) {
|
|
|
var _React$useState = external_window_React_["useState"]({
|
|
|
width: 0,
|
|
|
height: 0
|
|
|
}),
|
|
|
_React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2),
|
|
|
targetSize = _React$useState2[0],
|
|
|
setTargetSize = _React$useState2[1];
|
|
|
|
|
|
function measureStretch(element) {
|
|
|
setTargetSize({
|
|
|
width: element.offsetWidth,
|
|
|
height: element.offsetHeight
|
|
|
});
|
|
|
} // Merge stretch style
|
|
|
|
|
|
|
|
|
var style = external_window_React_["useMemo"](function () {
|
|
|
var sizeStyle = {};
|
|
|
|
|
|
if (stretch) {
|
|
|
var width = targetSize.width,
|
|
|
height = targetSize.height; // Stretch with target
|
|
|
|
|
|
if (stretch.indexOf('height') !== -1 && height) {
|
|
|
sizeStyle.height = height;
|
|
|
} else if (stretch.indexOf('minHeight') !== -1 && height) {
|
|
|
sizeStyle.minHeight = height;
|
|
|
}
|
|
|
|
|
|
if (stretch.indexOf('width') !== -1 && width) {
|
|
|
sizeStyle.width = width;
|
|
|
} else if (stretch.indexOf('minWidth') !== -1 && width) {
|
|
|
sizeStyle.minWidth = width;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return sizeStyle;
|
|
|
}, [stretch, targetSize]);
|
|
|
return [style, measureStretch];
|
|
|
});
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/PopupInner.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PopupInner = /*#__PURE__*/external_window_React_["forwardRef"](function (props, ref) {
|
|
|
var visible = props.visible,
|
|
|
prefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
style = props.style,
|
|
|
children = props.children,
|
|
|
zIndex = props.zIndex,
|
|
|
stretch = props.stretch,
|
|
|
destroyPopupOnHide = props.destroyPopupOnHide,
|
|
|
forceRender = props.forceRender,
|
|
|
align = props.align,
|
|
|
point = props.point,
|
|
|
getRootDomNode = props.getRootDomNode,
|
|
|
getClassNameFromAlign = props.getClassNameFromAlign,
|
|
|
onAlign = props.onAlign,
|
|
|
onMouseEnter = props.onMouseEnter,
|
|
|
onMouseLeave = props.onMouseLeave,
|
|
|
onMouseDown = props.onMouseDown,
|
|
|
onTouchStart = props.onTouchStart;
|
|
|
var alignRef = Object(external_window_React_["useRef"])();
|
|
|
var elementRef = Object(external_window_React_["useRef"])();
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])(),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
alignedClassName = _useState2[0],
|
|
|
setAlignedClassName = _useState2[1]; // ======================= Measure ========================
|
|
|
|
|
|
|
|
|
var _useStretchStyle = useStretchStyle(stretch),
|
|
|
_useStretchStyle2 = Object(slicedToArray["a" /* default */])(_useStretchStyle, 2),
|
|
|
stretchStyle = _useStretchStyle2[0],
|
|
|
measureStretchStyle = _useStretchStyle2[1];
|
|
|
|
|
|
function doMeasure() {
|
|
|
if (stretch) {
|
|
|
measureStretchStyle(getRootDomNode());
|
|
|
}
|
|
|
} // ======================== Status ========================
|
|
|
|
|
|
|
|
|
var _useVisibleStatus = useVisibleStatus(visible, doMeasure),
|
|
|
_useVisibleStatus2 = Object(slicedToArray["a" /* default */])(_useVisibleStatus, 2),
|
|
|
status = _useVisibleStatus2[0],
|
|
|
goNextStatus = _useVisibleStatus2[1]; // ======================== Aligns ========================
|
|
|
|
|
|
|
|
|
var prepareResolveRef = Object(external_window_React_["useRef"])(); // `target` on `rc-align` can accept as a function to get the bind element or a point.
|
|
|
// ref: https://www.npmjs.com/package/rc-align
|
|
|
|
|
|
function getAlignTarget() {
|
|
|
if (point) {
|
|
|
return point;
|
|
|
}
|
|
|
|
|
|
return getRootDomNode;
|
|
|
}
|
|
|
|
|
|
function forceAlign() {
|
|
|
var _alignRef$current;
|
|
|
|
|
|
(_alignRef$current = alignRef.current) === null || _alignRef$current === void 0 ? void 0 : _alignRef$current.forceAlign();
|
|
|
}
|
|
|
|
|
|
function onInternalAlign(popupDomNode, matchAlign) {
|
|
|
var nextAlignedClassName = getClassNameFromAlign(matchAlign);
|
|
|
|
|
|
if (alignedClassName !== nextAlignedClassName) {
|
|
|
setAlignedClassName(nextAlignedClassName);
|
|
|
}
|
|
|
|
|
|
if (status === 'align') {
|
|
|
// Repeat until not more align needed
|
|
|
if (alignedClassName !== nextAlignedClassName) {
|
|
|
Promise.resolve().then(function () {
|
|
|
forceAlign();
|
|
|
});
|
|
|
} else {
|
|
|
goNextStatus(function () {
|
|
|
var _prepareResolveRef$cu;
|
|
|
|
|
|
(_prepareResolveRef$cu = prepareResolveRef.current) === null || _prepareResolveRef$cu === void 0 ? void 0 : _prepareResolveRef$cu.call(prepareResolveRef);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign);
|
|
|
}
|
|
|
} // ======================== Motion ========================
|
|
|
|
|
|
|
|
|
var motion = Object(objectSpread2["a" /* default */])({}, getMotion(props));
|
|
|
|
|
|
['onAppearEnd', 'onEnterEnd', 'onLeaveEnd'].forEach(function (eventName) {
|
|
|
var originHandler = motion[eventName];
|
|
|
|
|
|
motion[eventName] = function (element, event) {
|
|
|
goNextStatus();
|
|
|
return originHandler === null || originHandler === void 0 ? void 0 : originHandler(element, event);
|
|
|
};
|
|
|
});
|
|
|
|
|
|
function onShowPrepare() {
|
|
|
return new Promise(function (resolve) {
|
|
|
prepareResolveRef.current = resolve;
|
|
|
});
|
|
|
} // Go to stable directly when motion not provided
|
|
|
|
|
|
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
if (!motion.motionName && status === 'motion') {
|
|
|
goNextStatus();
|
|
|
}
|
|
|
}, [motion.motionName, status]); // ========================= Refs =========================
|
|
|
|
|
|
external_window_React_["useImperativeHandle"](ref, function () {
|
|
|
return {
|
|
|
forceAlign: forceAlign,
|
|
|
getElement: function getElement() {
|
|
|
return elementRef.current;
|
|
|
}
|
|
|
};
|
|
|
}); // ======================== Render ========================
|
|
|
|
|
|
var mergedStyle = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, stretchStyle), {}, {
|
|
|
zIndex: zIndex,
|
|
|
opacity: status === 'motion' || status === 'stable' || !visible ? undefined : 0,
|
|
|
pointerEvents: status === 'stable' ? undefined : 'none'
|
|
|
}, style); // Align status
|
|
|
|
|
|
|
|
|
var alignDisabled = true;
|
|
|
|
|
|
if ((align === null || align === void 0 ? void 0 : align.points) && (status === 'align' || status === 'stable')) {
|
|
|
alignDisabled = false;
|
|
|
}
|
|
|
|
|
|
var childNode = children; // Wrapper when multiple children
|
|
|
|
|
|
if (external_window_React_["Children"].count(children) > 1) {
|
|
|
childNode = /*#__PURE__*/external_window_React_["createElement"]("div", {
|
|
|
className: "".concat(prefixCls, "-content")
|
|
|
}, children);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({
|
|
|
visible: visible,
|
|
|
ref: elementRef,
|
|
|
leavedClassName: "".concat(prefixCls, "-hidden")
|
|
|
}, motion, {
|
|
|
onAppearPrepare: onShowPrepare,
|
|
|
onEnterPrepare: onShowPrepare,
|
|
|
removeOnLeave: destroyPopupOnHide,
|
|
|
forceRender: forceRender
|
|
|
}), function (_ref, motionRef) {
|
|
|
var motionClassName = _ref.className,
|
|
|
motionStyle = _ref.style;
|
|
|
var mergedClassName = classnames_default()(prefixCls, className, alignedClassName, motionClassName);
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](rc_align_es["a" /* default */], {
|
|
|
target: getAlignTarget(),
|
|
|
key: "popup",
|
|
|
ref: alignRef,
|
|
|
monitorWindowResize: true,
|
|
|
disabled: alignDisabled,
|
|
|
align: align,
|
|
|
onAlign: onInternalAlign
|
|
|
}, /*#__PURE__*/external_window_React_["createElement"]("div", {
|
|
|
ref: motionRef,
|
|
|
className: mergedClassName,
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave,
|
|
|
onMouseDownCapture: onMouseDown,
|
|
|
onTouchStartCapture: onTouchStart,
|
|
|
style: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, motionStyle), mergedStyle)
|
|
|
}, childNode));
|
|
|
});
|
|
|
});
|
|
|
PopupInner.displayName = 'PopupInner';
|
|
|
/* harmony default export */ var Popup_PopupInner = (PopupInner);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/MobilePopupInner.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MobilePopupInner = /*#__PURE__*/external_window_React_["forwardRef"](function (props, ref) {
|
|
|
var prefixCls = props.prefixCls,
|
|
|
visible = props.visible,
|
|
|
zIndex = props.zIndex,
|
|
|
children = props.children,
|
|
|
_props$mobile = props.mobile;
|
|
|
_props$mobile = _props$mobile === void 0 ? {} : _props$mobile;
|
|
|
var popupClassName = _props$mobile.popupClassName,
|
|
|
popupStyle = _props$mobile.popupStyle,
|
|
|
_props$mobile$popupMo = _props$mobile.popupMotion,
|
|
|
popupMotion = _props$mobile$popupMo === void 0 ? {} : _props$mobile$popupMo,
|
|
|
popupRender = _props$mobile.popupRender;
|
|
|
var elementRef = external_window_React_["useRef"](); // ========================= Refs =========================
|
|
|
|
|
|
external_window_React_["useImperativeHandle"](ref, function () {
|
|
|
return {
|
|
|
forceAlign: function forceAlign() {},
|
|
|
getElement: function getElement() {
|
|
|
return elementRef.current;
|
|
|
}
|
|
|
};
|
|
|
}); // ======================== Render ========================
|
|
|
|
|
|
var mergedStyle = Object(objectSpread2["a" /* default */])({
|
|
|
zIndex: zIndex
|
|
|
}, popupStyle);
|
|
|
|
|
|
var childNode = children; // Wrapper when multiple children
|
|
|
|
|
|
if (external_window_React_["Children"].count(children) > 1) {
|
|
|
childNode = /*#__PURE__*/external_window_React_["createElement"]("div", {
|
|
|
className: "".concat(prefixCls, "-content")
|
|
|
}, children);
|
|
|
} // Mobile support additional render
|
|
|
|
|
|
|
|
|
if (popupRender) {
|
|
|
childNode = popupRender(childNode);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({
|
|
|
visible: visible,
|
|
|
ref: elementRef,
|
|
|
removeOnLeave: true
|
|
|
}, popupMotion), function (_ref, motionRef) {
|
|
|
var motionClassName = _ref.className,
|
|
|
motionStyle = _ref.style;
|
|
|
var mergedClassName = classnames_default()(prefixCls, popupClassName, motionClassName);
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("div", {
|
|
|
ref: motionRef,
|
|
|
className: mergedClassName,
|
|
|
style: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, motionStyle), mergedStyle)
|
|
|
}, childNode);
|
|
|
});
|
|
|
});
|
|
|
MobilePopupInner.displayName = 'MobilePopupInner';
|
|
|
/* harmony default export */ var Popup_MobilePopupInner = (MobilePopupInner);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["visible", "mobile"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Popup = /*#__PURE__*/external_window_React_["forwardRef"](function (_ref, ref) {
|
|
|
var visible = _ref.visible,
|
|
|
mobile = _ref.mobile,
|
|
|
props = Object(objectWithoutProperties["a" /* default */])(_ref, _excluded);
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])(visible),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
innerVisible = _useState2[0],
|
|
|
serInnerVisible = _useState2[1];
|
|
|
|
|
|
var _useState3 = Object(external_window_React_["useState"])(false),
|
|
|
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
|
|
inMobile = _useState4[0],
|
|
|
setInMobile = _useState4[1];
|
|
|
|
|
|
var cloneProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props), {}, {
|
|
|
visible: innerVisible
|
|
|
}); // We check mobile in visible changed here.
|
|
|
// And this also delay set `innerVisible` to avoid popup component render flash
|
|
|
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
serInnerVisible(visible);
|
|
|
|
|
|
if (visible && mobile) {
|
|
|
setInMobile(es_isMobile());
|
|
|
}
|
|
|
}, [visible, mobile]);
|
|
|
var popupNode = inMobile ? /*#__PURE__*/external_window_React_["createElement"](Popup_MobilePopupInner, Object(esm_extends["a" /* default */])({}, cloneProps, {
|
|
|
mobile: mobile,
|
|
|
ref: ref
|
|
|
})) : /*#__PURE__*/external_window_React_["createElement"](Popup_PopupInner, Object(esm_extends["a" /* default */])({}, cloneProps, {
|
|
|
ref: ref
|
|
|
})); // We can use fragment directly but this may failed some selector usage. Keep as origin logic
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("div", null, /*#__PURE__*/external_window_React_["createElement"](Mask, cloneProps), popupNode);
|
|
|
});
|
|
|
Popup.displayName = 'Popup';
|
|
|
/* harmony default export */ var es_Popup = (Popup);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/context.js
|
|
|
|
|
|
var TriggerContext = /*#__PURE__*/external_window_React_["createContext"](null);
|
|
|
/* harmony default export */ var context = (TriggerContext);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function es_noop() {}
|
|
|
|
|
|
function returnEmptyString() {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
function returnDocument(element) {
|
|
|
if (element) {
|
|
|
return element.ownerDocument;
|
|
|
}
|
|
|
|
|
|
return window.document;
|
|
|
}
|
|
|
|
|
|
var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu'];
|
|
|
/**
|
|
|
* Internal usage. Do not use in your code since this will be removed.
|
|
|
*/
|
|
|
|
|
|
function generateTrigger(PortalComponent) {
|
|
|
var Trigger = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(Trigger, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(Trigger);
|
|
|
|
|
|
function Trigger(props) {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, Trigger);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
_this.popupRef = /*#__PURE__*/external_window_React_["createRef"]();
|
|
|
_this.triggerRef = /*#__PURE__*/external_window_React_["createRef"]();
|
|
|
_this.attachId = void 0;
|
|
|
_this.clickOutsideHandler = void 0;
|
|
|
_this.touchOutsideHandler = void 0;
|
|
|
_this.contextMenuOutsideHandler1 = void 0;
|
|
|
_this.contextMenuOutsideHandler2 = void 0;
|
|
|
_this.mouseDownTimeout = void 0;
|
|
|
_this.focusTime = void 0;
|
|
|
_this.preClickTime = void 0;
|
|
|
_this.preTouchTime = void 0;
|
|
|
_this.delayTimer = void 0;
|
|
|
_this.hasPopupMouseDown = void 0;
|
|
|
|
|
|
_this.onMouseEnter = function (e) {
|
|
|
var mouseEnterDelay = _this.props.mouseEnterDelay;
|
|
|
|
|
|
_this.fireEvents('onMouseEnter', e);
|
|
|
|
|
|
_this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e);
|
|
|
};
|
|
|
|
|
|
_this.onMouseMove = function (e) {
|
|
|
_this.fireEvents('onMouseMove', e);
|
|
|
|
|
|
_this.setPoint(e);
|
|
|
};
|
|
|
|
|
|
_this.onMouseLeave = function (e) {
|
|
|
_this.fireEvents('onMouseLeave', e);
|
|
|
|
|
|
_this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);
|
|
|
};
|
|
|
|
|
|
_this.onPopupMouseEnter = function () {
|
|
|
_this.clearDelayTimer();
|
|
|
};
|
|
|
|
|
|
_this.onPopupMouseLeave = function (e) {
|
|
|
var _this$popupRef$curren;
|
|
|
|
|
|
// https://github.com/react-component/trigger/pull/13
|
|
|
// react bug?
|
|
|
if (e.relatedTarget && !e.relatedTarget.setTimeout && Object(contains["a" /* default */])((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e.relatedTarget)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
_this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);
|
|
|
};
|
|
|
|
|
|
_this.onFocus = function (e) {
|
|
|
_this.fireEvents('onFocus', e); // incase focusin and focusout
|
|
|
|
|
|
|
|
|
_this.clearDelayTimer();
|
|
|
|
|
|
if (_this.isFocusToShow()) {
|
|
|
_this.focusTime = Date.now();
|
|
|
|
|
|
_this.delaySetPopupVisible(true, _this.props.focusDelay);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onMouseDown = function (e) {
|
|
|
_this.fireEvents('onMouseDown', e);
|
|
|
|
|
|
_this.preClickTime = Date.now();
|
|
|
};
|
|
|
|
|
|
_this.onTouchStart = function (e) {
|
|
|
_this.fireEvents('onTouchStart', e);
|
|
|
|
|
|
_this.preTouchTime = Date.now();
|
|
|
};
|
|
|
|
|
|
_this.onBlur = function (e) {
|
|
|
_this.fireEvents('onBlur', e);
|
|
|
|
|
|
_this.clearDelayTimer();
|
|
|
|
|
|
if (_this.isBlurToHide()) {
|
|
|
_this.delaySetPopupVisible(false, _this.props.blurDelay);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onContextMenu = function (e) {
|
|
|
e.preventDefault();
|
|
|
|
|
|
_this.fireEvents('onContextMenu', e);
|
|
|
|
|
|
_this.setPopupVisible(true, e);
|
|
|
};
|
|
|
|
|
|
_this.onContextMenuClose = function () {
|
|
|
if (_this.isContextMenuToShow()) {
|
|
|
_this.close();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onClick = function (event) {
|
|
|
_this.fireEvents('onClick', event); // focus will trigger click
|
|
|
|
|
|
|
|
|
if (_this.focusTime) {
|
|
|
var preTime;
|
|
|
|
|
|
if (_this.preClickTime && _this.preTouchTime) {
|
|
|
preTime = Math.min(_this.preClickTime, _this.preTouchTime);
|
|
|
} else if (_this.preClickTime) {
|
|
|
preTime = _this.preClickTime;
|
|
|
} else if (_this.preTouchTime) {
|
|
|
preTime = _this.preTouchTime;
|
|
|
}
|
|
|
|
|
|
if (Math.abs(preTime - _this.focusTime) < 20) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
_this.focusTime = 0;
|
|
|
}
|
|
|
|
|
|
_this.preClickTime = 0;
|
|
|
_this.preTouchTime = 0; // Only prevent default when all the action is click.
|
|
|
// https://github.com/ant-design/ant-design/issues/17043
|
|
|
// https://github.com/ant-design/ant-design/issues/17291
|
|
|
|
|
|
if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) {
|
|
|
event.preventDefault();
|
|
|
}
|
|
|
|
|
|
var nextVisible = !_this.state.popupVisible;
|
|
|
|
|
|
if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) {
|
|
|
_this.setPopupVisible(!_this.state.popupVisible, event);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onPopupMouseDown = function () {
|
|
|
_this.hasPopupMouseDown = true;
|
|
|
clearTimeout(_this.mouseDownTimeout);
|
|
|
_this.mouseDownTimeout = window.setTimeout(function () {
|
|
|
_this.hasPopupMouseDown = false;
|
|
|
}, 0);
|
|
|
|
|
|
if (_this.context) {
|
|
|
var _this$context;
|
|
|
|
|
|
(_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onDocumentClick = function (event) {
|
|
|
if (_this.props.mask && !_this.props.maskClosable) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var target = event.target;
|
|
|
|
|
|
var root = _this.getRootDomNode();
|
|
|
|
|
|
var popupNode = _this.getPopupDomNode();
|
|
|
|
|
|
if ( // mousedown on the target should also close popup when action is contextMenu.
|
|
|
// https://github.com/ant-design/ant-design/issues/29853
|
|
|
(!Object(contains["a" /* default */])(root, target) || _this.isContextMenuOnly()) && !Object(contains["a" /* default */])(popupNode, target) && !_this.hasPopupMouseDown) {
|
|
|
_this.close();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.getRootDomNode = function () {
|
|
|
var getTriggerDOMNode = _this.props.getTriggerDOMNode;
|
|
|
|
|
|
if (getTriggerDOMNode) {
|
|
|
return getTriggerDOMNode(_this.triggerRef.current);
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
var domNode = Object(findDOMNode["a" /* default */])(_this.triggerRef.current);
|
|
|
|
|
|
if (domNode) {
|
|
|
return domNode;
|
|
|
}
|
|
|
} catch (err) {// Do nothing
|
|
|
}
|
|
|
|
|
|
return external_window_ReactDOM_default.a.findDOMNode(Object(assertThisInitialized["a" /* default */])(_this));
|
|
|
};
|
|
|
|
|
|
_this.getPopupClassNameFromAlign = function (align) {
|
|
|
var className = [];
|
|
|
var _this$props = _this.props,
|
|
|
popupPlacement = _this$props.popupPlacement,
|
|
|
builtinPlacements = _this$props.builtinPlacements,
|
|
|
prefixCls = _this$props.prefixCls,
|
|
|
alignPoint = _this$props.alignPoint,
|
|
|
getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign;
|
|
|
|
|
|
if (popupPlacement && builtinPlacements) {
|
|
|
className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint));
|
|
|
}
|
|
|
|
|
|
if (getPopupClassNameFromAlign) {
|
|
|
className.push(getPopupClassNameFromAlign(align));
|
|
|
}
|
|
|
|
|
|
return className.join(' ');
|
|
|
};
|
|
|
|
|
|
_this.getComponent = function () {
|
|
|
var _this$props2 = _this.props,
|
|
|
prefixCls = _this$props2.prefixCls,
|
|
|
destroyPopupOnHide = _this$props2.destroyPopupOnHide,
|
|
|
popupClassName = _this$props2.popupClassName,
|
|
|
onPopupAlign = _this$props2.onPopupAlign,
|
|
|
popupMotion = _this$props2.popupMotion,
|
|
|
popupAnimation = _this$props2.popupAnimation,
|
|
|
popupTransitionName = _this$props2.popupTransitionName,
|
|
|
popupStyle = _this$props2.popupStyle,
|
|
|
mask = _this$props2.mask,
|
|
|
maskAnimation = _this$props2.maskAnimation,
|
|
|
maskTransitionName = _this$props2.maskTransitionName,
|
|
|
maskMotion = _this$props2.maskMotion,
|
|
|
zIndex = _this$props2.zIndex,
|
|
|
popup = _this$props2.popup,
|
|
|
stretch = _this$props2.stretch,
|
|
|
alignPoint = _this$props2.alignPoint,
|
|
|
mobile = _this$props2.mobile,
|
|
|
forceRender = _this$props2.forceRender;
|
|
|
var _this$state = _this.state,
|
|
|
popupVisible = _this$state.popupVisible,
|
|
|
point = _this$state.point;
|
|
|
|
|
|
var align = _this.getPopupAlign();
|
|
|
|
|
|
var mouseProps = {};
|
|
|
|
|
|
if (_this.isMouseEnterToShow()) {
|
|
|
mouseProps.onMouseEnter = _this.onPopupMouseEnter;
|
|
|
}
|
|
|
|
|
|
if (_this.isMouseLeaveToHide()) {
|
|
|
mouseProps.onMouseLeave = _this.onPopupMouseLeave;
|
|
|
}
|
|
|
|
|
|
mouseProps.onMouseDown = _this.onPopupMouseDown;
|
|
|
mouseProps.onTouchStart = _this.onPopupMouseDown;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_Popup, Object(esm_extends["a" /* default */])({
|
|
|
prefixCls: prefixCls,
|
|
|
destroyPopupOnHide: destroyPopupOnHide,
|
|
|
visible: popupVisible,
|
|
|
point: alignPoint && point,
|
|
|
className: popupClassName,
|
|
|
align: align,
|
|
|
onAlign: onPopupAlign,
|
|
|
animation: popupAnimation,
|
|
|
getClassNameFromAlign: _this.getPopupClassNameFromAlign
|
|
|
}, mouseProps, {
|
|
|
stretch: stretch,
|
|
|
getRootDomNode: _this.getRootDomNode,
|
|
|
style: popupStyle,
|
|
|
mask: mask,
|
|
|
zIndex: zIndex,
|
|
|
transitionName: popupTransitionName,
|
|
|
maskAnimation: maskAnimation,
|
|
|
maskTransitionName: maskTransitionName,
|
|
|
maskMotion: maskMotion,
|
|
|
ref: _this.popupRef,
|
|
|
motion: popupMotion,
|
|
|
mobile: mobile,
|
|
|
forceRender: forceRender
|
|
|
}), typeof popup === 'function' ? popup() : popup);
|
|
|
};
|
|
|
|
|
|
_this.attachParent = function (popupContainer) {
|
|
|
es_raf["a" /* default */].cancel(_this.attachId);
|
|
|
var _this$props3 = _this.props,
|
|
|
getPopupContainer = _this$props3.getPopupContainer,
|
|
|
getDocument = _this$props3.getDocument;
|
|
|
|
|
|
var domNode = _this.getRootDomNode();
|
|
|
|
|
|
var mountNode;
|
|
|
|
|
|
if (!getPopupContainer) {
|
|
|
mountNode = getDocument(_this.getRootDomNode()).body;
|
|
|
} else if (domNode || getPopupContainer.length === 0) {
|
|
|
// Compatible for legacy getPopupContainer with domNode argument.
|
|
|
// If no need `domNode` argument, will call directly.
|
|
|
// https://codesandbox.io/s/eloquent-mclean-ss93m?file=/src/App.js
|
|
|
mountNode = getPopupContainer(domNode);
|
|
|
}
|
|
|
|
|
|
if (mountNode) {
|
|
|
mountNode.appendChild(popupContainer);
|
|
|
} else {
|
|
|
// Retry after frame render in case parent not ready
|
|
|
_this.attachId = Object(es_raf["a" /* default */])(function () {
|
|
|
_this.attachParent(popupContainer);
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.getContainer = function () {
|
|
|
var getDocument = _this.props.getDocument;
|
|
|
var popupContainer = getDocument(_this.getRootDomNode()).createElement('div'); // Make sure default popup container will never cause scrollbar appearing
|
|
|
// https://github.com/react-component/trigger/issues/41
|
|
|
|
|
|
popupContainer.style.position = 'absolute';
|
|
|
popupContainer.style.top = '0';
|
|
|
popupContainer.style.left = '0';
|
|
|
popupContainer.style.width = '100%';
|
|
|
|
|
|
_this.attachParent(popupContainer);
|
|
|
|
|
|
return popupContainer;
|
|
|
};
|
|
|
|
|
|
_this.setPoint = function (point) {
|
|
|
var alignPoint = _this.props.alignPoint;
|
|
|
if (!alignPoint || !point) return;
|
|
|
|
|
|
_this.setState({
|
|
|
point: {
|
|
|
pageX: point.pageX,
|
|
|
pageY: point.pageY
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.handlePortalUpdate = function () {
|
|
|
if (_this.state.prevPopupVisible !== _this.state.popupVisible) {
|
|
|
_this.props.afterPopupVisibleChange(_this.state.popupVisible);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.triggerContextValue = {
|
|
|
onPopupMouseDown: _this.onPopupMouseDown
|
|
|
};
|
|
|
|
|
|
var _popupVisible;
|
|
|
|
|
|
if ('popupVisible' in props) {
|
|
|
_popupVisible = !!props.popupVisible;
|
|
|
} else {
|
|
|
_popupVisible = !!props.defaultPopupVisible;
|
|
|
}
|
|
|
|
|
|
_this.state = {
|
|
|
prevPopupVisible: _popupVisible,
|
|
|
popupVisible: _popupVisible
|
|
|
};
|
|
|
ALL_HANDLERS.forEach(function (h) {
|
|
|
_this["fire".concat(h)] = function (e) {
|
|
|
_this.fireEvents(h, e);
|
|
|
};
|
|
|
});
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(Trigger, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
this.componentDidUpdate();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate() {
|
|
|
var props = this.props;
|
|
|
var state = this.state; // We must listen to `mousedown` or `touchstart`, edge case:
|
|
|
// https://github.com/ant-design/ant-design/issues/5804
|
|
|
// https://github.com/react-component/calendar/issues/250
|
|
|
// https://github.com/react-component/trigger/issues/50
|
|
|
|
|
|
if (state.popupVisible) {
|
|
|
var currentDocument;
|
|
|
|
|
|
if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {
|
|
|
currentDocument = props.getDocument(this.getRootDomNode());
|
|
|
this.clickOutsideHandler = Object(addEventListener["a" /* default */])(currentDocument, 'mousedown', this.onDocumentClick);
|
|
|
} // always hide on mobile
|
|
|
|
|
|
|
|
|
if (!this.touchOutsideHandler) {
|
|
|
currentDocument = currentDocument || props.getDocument(this.getRootDomNode());
|
|
|
this.touchOutsideHandler = Object(addEventListener["a" /* default */])(currentDocument, 'touchstart', this.onDocumentClick);
|
|
|
} // close popup when trigger type contains 'onContextMenu' and document is scrolling.
|
|
|
|
|
|
|
|
|
if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {
|
|
|
currentDocument = currentDocument || props.getDocument(this.getRootDomNode());
|
|
|
this.contextMenuOutsideHandler1 = Object(addEventListener["a" /* default */])(currentDocument, 'scroll', this.onContextMenuClose);
|
|
|
} // close popup when trigger type contains 'onContextMenu' and window is blur.
|
|
|
|
|
|
|
|
|
if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {
|
|
|
this.contextMenuOutsideHandler2 = Object(addEventListener["a" /* default */])(window, 'blur', this.onContextMenuClose);
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.clearOutsideHandler();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
this.clearDelayTimer();
|
|
|
this.clearOutsideHandler();
|
|
|
clearTimeout(this.mouseDownTimeout);
|
|
|
es_raf["a" /* default */].cancel(this.attachId);
|
|
|
}
|
|
|
}, {
|
|
|
key: "getPopupDomNode",
|
|
|
value: function getPopupDomNode() {
|
|
|
var _this$popupRef$curren2;
|
|
|
|
|
|
// for test
|
|
|
return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null;
|
|
|
}
|
|
|
}, {
|
|
|
key: "getPopupAlign",
|
|
|
value: function getPopupAlign() {
|
|
|
var props = this.props;
|
|
|
var popupPlacement = props.popupPlacement,
|
|
|
popupAlign = props.popupAlign,
|
|
|
builtinPlacements = props.builtinPlacements;
|
|
|
|
|
|
if (popupPlacement && builtinPlacements) {
|
|
|
return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);
|
|
|
}
|
|
|
|
|
|
return popupAlign;
|
|
|
}
|
|
|
}, {
|
|
|
key: "setPopupVisible",
|
|
|
value:
|
|
|
/**
|
|
|
* @param popupVisible Show or not the popup element
|
|
|
* @param event SyntheticEvent, used for `pointAlign`
|
|
|
*/
|
|
|
function setPopupVisible(popupVisible, event) {
|
|
|
var alignPoint = this.props.alignPoint;
|
|
|
var prevPopupVisible = this.state.popupVisible;
|
|
|
this.clearDelayTimer();
|
|
|
|
|
|
if (prevPopupVisible !== popupVisible) {
|
|
|
if (!('popupVisible' in this.props)) {
|
|
|
this.setState({
|
|
|
popupVisible: popupVisible,
|
|
|
prevPopupVisible: prevPopupVisible
|
|
|
});
|
|
|
}
|
|
|
|
|
|
this.props.onPopupVisibleChange(popupVisible);
|
|
|
} // Always record the point position since mouseEnterDelay will delay the show
|
|
|
|
|
|
|
|
|
if (alignPoint && event && popupVisible) {
|
|
|
this.setPoint(event);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "delaySetPopupVisible",
|
|
|
value: function delaySetPopupVisible(visible, delayS, event) {
|
|
|
var _this2 = this;
|
|
|
|
|
|
var delay = delayS * 1000;
|
|
|
this.clearDelayTimer();
|
|
|
|
|
|
if (delay) {
|
|
|
var point = event ? {
|
|
|
pageX: event.pageX,
|
|
|
pageY: event.pageY
|
|
|
} : null;
|
|
|
this.delayTimer = window.setTimeout(function () {
|
|
|
_this2.setPopupVisible(visible, point);
|
|
|
|
|
|
_this2.clearDelayTimer();
|
|
|
}, delay);
|
|
|
} else {
|
|
|
this.setPopupVisible(visible, event);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "clearDelayTimer",
|
|
|
value: function clearDelayTimer() {
|
|
|
if (this.delayTimer) {
|
|
|
clearTimeout(this.delayTimer);
|
|
|
this.delayTimer = null;
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "clearOutsideHandler",
|
|
|
value: function clearOutsideHandler() {
|
|
|
if (this.clickOutsideHandler) {
|
|
|
this.clickOutsideHandler.remove();
|
|
|
this.clickOutsideHandler = null;
|
|
|
}
|
|
|
|
|
|
if (this.contextMenuOutsideHandler1) {
|
|
|
this.contextMenuOutsideHandler1.remove();
|
|
|
this.contextMenuOutsideHandler1 = null;
|
|
|
}
|
|
|
|
|
|
if (this.contextMenuOutsideHandler2) {
|
|
|
this.contextMenuOutsideHandler2.remove();
|
|
|
this.contextMenuOutsideHandler2 = null;
|
|
|
}
|
|
|
|
|
|
if (this.touchOutsideHandler) {
|
|
|
this.touchOutsideHandler.remove();
|
|
|
this.touchOutsideHandler = null;
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "createTwoChains",
|
|
|
value: function createTwoChains(event) {
|
|
|
var childPros = this.props.children.props;
|
|
|
var props = this.props;
|
|
|
|
|
|
if (childPros[event] && props[event]) {
|
|
|
return this["fire".concat(event)];
|
|
|
}
|
|
|
|
|
|
return childPros[event] || props[event];
|
|
|
}
|
|
|
}, {
|
|
|
key: "isClickToShow",
|
|
|
value: function isClickToShow() {
|
|
|
var _this$props4 = this.props,
|
|
|
action = _this$props4.action,
|
|
|
showAction = _this$props4.showAction;
|
|
|
return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "isContextMenuOnly",
|
|
|
value: function isContextMenuOnly() {
|
|
|
var action = this.props.action;
|
|
|
return action === 'contextMenu' || action.length === 1 && action[0] === 'contextMenu';
|
|
|
}
|
|
|
}, {
|
|
|
key: "isContextMenuToShow",
|
|
|
value: function isContextMenuToShow() {
|
|
|
var _this$props5 = this.props,
|
|
|
action = _this$props5.action,
|
|
|
showAction = _this$props5.showAction;
|
|
|
return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "isClickToHide",
|
|
|
value: function isClickToHide() {
|
|
|
var _this$props6 = this.props,
|
|
|
action = _this$props6.action,
|
|
|
hideAction = _this$props6.hideAction;
|
|
|
return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "isMouseEnterToShow",
|
|
|
value: function isMouseEnterToShow() {
|
|
|
var _this$props7 = this.props,
|
|
|
action = _this$props7.action,
|
|
|
showAction = _this$props7.showAction;
|
|
|
return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "isMouseLeaveToHide",
|
|
|
value: function isMouseLeaveToHide() {
|
|
|
var _this$props8 = this.props,
|
|
|
action = _this$props8.action,
|
|
|
hideAction = _this$props8.hideAction;
|
|
|
return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "isFocusToShow",
|
|
|
value: function isFocusToShow() {
|
|
|
var _this$props9 = this.props,
|
|
|
action = _this$props9.action,
|
|
|
showAction = _this$props9.showAction;
|
|
|
return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "isBlurToHide",
|
|
|
value: function isBlurToHide() {
|
|
|
var _this$props10 = this.props,
|
|
|
action = _this$props10.action,
|
|
|
hideAction = _this$props10.hideAction;
|
|
|
return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;
|
|
|
}
|
|
|
}, {
|
|
|
key: "forcePopupAlign",
|
|
|
value: function forcePopupAlign() {
|
|
|
if (this.state.popupVisible) {
|
|
|
var _this$popupRef$curren3;
|
|
|
|
|
|
(_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "fireEvents",
|
|
|
value: function fireEvents(type, e) {
|
|
|
var childCallback = this.props.children.props[type];
|
|
|
|
|
|
if (childCallback) {
|
|
|
childCallback(e);
|
|
|
}
|
|
|
|
|
|
var callback = this.props[type];
|
|
|
|
|
|
if (callback) {
|
|
|
callback(e);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "close",
|
|
|
value: function close() {
|
|
|
this.setPopupVisible(false);
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var popupVisible = this.state.popupVisible;
|
|
|
var _this$props11 = this.props,
|
|
|
children = _this$props11.children,
|
|
|
forceRender = _this$props11.forceRender,
|
|
|
alignPoint = _this$props11.alignPoint,
|
|
|
className = _this$props11.className,
|
|
|
autoDestroy = _this$props11.autoDestroy;
|
|
|
var child = external_window_React_["Children"].only(children);
|
|
|
var newChildProps = {
|
|
|
key: 'trigger'
|
|
|
}; // ============================== Visible Handlers ==============================
|
|
|
// >>> ContextMenu
|
|
|
|
|
|
if (this.isContextMenuToShow()) {
|
|
|
newChildProps.onContextMenu = this.onContextMenu;
|
|
|
} else {
|
|
|
newChildProps.onContextMenu = this.createTwoChains('onContextMenu');
|
|
|
} // >>> Click
|
|
|
|
|
|
|
|
|
if (this.isClickToHide() || this.isClickToShow()) {
|
|
|
newChildProps.onClick = this.onClick;
|
|
|
newChildProps.onMouseDown = this.onMouseDown;
|
|
|
newChildProps.onTouchStart = this.onTouchStart;
|
|
|
} else {
|
|
|
newChildProps.onClick = this.createTwoChains('onClick');
|
|
|
newChildProps.onMouseDown = this.createTwoChains('onMouseDown');
|
|
|
newChildProps.onTouchStart = this.createTwoChains('onTouchStart');
|
|
|
} // >>> Hover(enter)
|
|
|
|
|
|
|
|
|
if (this.isMouseEnterToShow()) {
|
|
|
newChildProps.onMouseEnter = this.onMouseEnter; // Point align
|
|
|
|
|
|
if (alignPoint) {
|
|
|
newChildProps.onMouseMove = this.onMouseMove;
|
|
|
}
|
|
|
} else {
|
|
|
newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');
|
|
|
} // >>> Hover(leave)
|
|
|
|
|
|
|
|
|
if (this.isMouseLeaveToHide()) {
|
|
|
newChildProps.onMouseLeave = this.onMouseLeave;
|
|
|
} else {
|
|
|
newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');
|
|
|
} // >>> Focus
|
|
|
|
|
|
|
|
|
if (this.isFocusToShow() || this.isBlurToHide()) {
|
|
|
newChildProps.onFocus = this.onFocus;
|
|
|
newChildProps.onBlur = this.onBlur;
|
|
|
} else {
|
|
|
newChildProps.onFocus = this.createTwoChains('onFocus');
|
|
|
newChildProps.onBlur = this.createTwoChains('onBlur');
|
|
|
} // =================================== Render ===================================
|
|
|
|
|
|
|
|
|
var childrenClassName = classnames_default()(child && child.props && child.props.className, className);
|
|
|
|
|
|
if (childrenClassName) {
|
|
|
newChildProps.className = childrenClassName;
|
|
|
}
|
|
|
|
|
|
var cloneProps = Object(objectSpread2["a" /* default */])({}, newChildProps);
|
|
|
|
|
|
if (Object(es_ref["c" /* supportRef */])(child)) {
|
|
|
cloneProps.ref = Object(es_ref["a" /* composeRef */])(this.triggerRef, child.ref);
|
|
|
}
|
|
|
|
|
|
var trigger = /*#__PURE__*/external_window_React_["cloneElement"](child, cloneProps);
|
|
|
var portal; // prevent unmounting after it's rendered
|
|
|
|
|
|
if (popupVisible || this.popupRef.current || forceRender) {
|
|
|
portal = /*#__PURE__*/external_window_React_["createElement"](PortalComponent, {
|
|
|
key: "portal",
|
|
|
getContainer: this.getContainer,
|
|
|
didUpdate: this.handlePortalUpdate
|
|
|
}, this.getComponent());
|
|
|
}
|
|
|
|
|
|
if (!popupVisible && autoDestroy) {
|
|
|
portal = null;
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](context.Provider, {
|
|
|
value: this.triggerContextValue
|
|
|
}, trigger, portal);
|
|
|
}
|
|
|
}], [{
|
|
|
key: "getDerivedStateFromProps",
|
|
|
value: function getDerivedStateFromProps(_ref, prevState) {
|
|
|
var popupVisible = _ref.popupVisible;
|
|
|
var newState = {};
|
|
|
|
|
|
if (popupVisible !== undefined && prevState.popupVisible !== popupVisible) {
|
|
|
newState.popupVisible = popupVisible;
|
|
|
newState.prevPopupVisible = prevState.popupVisible;
|
|
|
}
|
|
|
|
|
|
return newState;
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return Trigger;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
Trigger.contextType = context;
|
|
|
Trigger.defaultProps = {
|
|
|
prefixCls: 'rc-trigger-popup',
|
|
|
getPopupClassNameFromAlign: returnEmptyString,
|
|
|
getDocument: returnDocument,
|
|
|
onPopupVisibleChange: es_noop,
|
|
|
afterPopupVisibleChange: es_noop,
|
|
|
onPopupAlign: es_noop,
|
|
|
popupClassName: '',
|
|
|
mouseEnterDelay: 0,
|
|
|
mouseLeaveDelay: 0.1,
|
|
|
focusDelay: 0,
|
|
|
blurDelay: 0.15,
|
|
|
popupStyle: {},
|
|
|
destroyPopupOnHide: false,
|
|
|
popupAlign: {},
|
|
|
defaultPopupVisible: false,
|
|
|
mask: false,
|
|
|
maskClosable: true,
|
|
|
action: [],
|
|
|
showAction: [],
|
|
|
hideAction: [],
|
|
|
autoDestroy: false
|
|
|
};
|
|
|
return Trigger;
|
|
|
}
|
|
|
/* harmony default export */ var rc_trigger_es = (generateTrigger(Portal["a" /* default */]));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/placements.js
|
|
|
var autoAdjustOverflow = {
|
|
|
adjustX: 1,
|
|
|
adjustY: 1
|
|
|
};
|
|
|
var placements = {
|
|
|
topLeft: {
|
|
|
points: ['bl', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -7]
|
|
|
},
|
|
|
bottomLeft: {
|
|
|
points: ['tl', 'bl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 7]
|
|
|
},
|
|
|
leftTop: {
|
|
|
points: ['tr', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [-4, 0]
|
|
|
},
|
|
|
rightTop: {
|
|
|
points: ['tl', 'tr'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [4, 0]
|
|
|
}
|
|
|
};
|
|
|
var placementsRtl = {
|
|
|
topLeft: {
|
|
|
points: ['bl', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -7]
|
|
|
},
|
|
|
bottomLeft: {
|
|
|
points: ['tl', 'bl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 7]
|
|
|
},
|
|
|
rightTop: {
|
|
|
points: ['tr', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [-4, 0]
|
|
|
},
|
|
|
leftTop: {
|
|
|
points: ['tl', 'tr'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [4, 0]
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var es_placements = (placements);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/SubMenu.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var guid = 0;
|
|
|
var popupPlacementMap = {
|
|
|
horizontal: 'bottomLeft',
|
|
|
vertical: 'rightTop',
|
|
|
'vertical-left': 'rightTop',
|
|
|
'vertical-right': 'leftTop'
|
|
|
};
|
|
|
|
|
|
var SubMenu_updateDefaultActiveFirst = function updateDefaultActiveFirst(store, eventKey, defaultActiveFirst) {
|
|
|
var menuId = getMenuIdFromSubMenuEventKey(eventKey);
|
|
|
var state = store.getState();
|
|
|
store.setState({
|
|
|
defaultActiveFirst: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, state.defaultActiveFirst), {}, Object(defineProperty["a" /* default */])({}, menuId, defaultActiveFirst))
|
|
|
});
|
|
|
};
|
|
|
|
|
|
var SubMenu_SubMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(SubMenu, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(SubMenu);
|
|
|
|
|
|
function SubMenu(props) {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, SubMenu);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
|
|
|
_this.onDestroy = function (key) {
|
|
|
_this.props.onDestroy(key);
|
|
|
};
|
|
|
/**
|
|
|
* note:
|
|
|
* This legacy code that `onKeyDown` is called by parent instead of dom self.
|
|
|
* which need return code to check if this event is handled
|
|
|
*/
|
|
|
|
|
|
|
|
|
_this.onKeyDown = function (e) {
|
|
|
var keyCode = e.keyCode;
|
|
|
var menu = _this.menuInstance;
|
|
|
var store = _this.props.store;
|
|
|
|
|
|
var visible = _this.getVisible();
|
|
|
|
|
|
if (keyCode === KeyCode["a" /* default */].ENTER) {
|
|
|
_this.onTitleClick(e);
|
|
|
|
|
|
SubMenu_updateDefaultActiveFirst(store, _this.props.eventKey, true);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
if (keyCode === KeyCode["a" /* default */].RIGHT) {
|
|
|
if (visible) {
|
|
|
menu.onKeyDown(e);
|
|
|
} else {
|
|
|
_this.triggerOpenChange(true); // need to update current menu's defaultActiveFirst value
|
|
|
|
|
|
|
|
|
SubMenu_updateDefaultActiveFirst(store, _this.props.eventKey, true);
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
if (keyCode === KeyCode["a" /* default */].LEFT) {
|
|
|
var handled;
|
|
|
|
|
|
if (visible) {
|
|
|
handled = menu.onKeyDown(e);
|
|
|
} else {
|
|
|
return undefined;
|
|
|
}
|
|
|
|
|
|
if (!handled) {
|
|
|
_this.triggerOpenChange(false);
|
|
|
|
|
|
handled = true;
|
|
|
}
|
|
|
|
|
|
return handled;
|
|
|
}
|
|
|
|
|
|
if (visible && (keyCode === KeyCode["a" /* default */].UP || keyCode === KeyCode["a" /* default */].DOWN)) {
|
|
|
return menu.onKeyDown(e);
|
|
|
}
|
|
|
|
|
|
return undefined;
|
|
|
};
|
|
|
|
|
|
_this.onOpenChange = function (e) {
|
|
|
_this.props.onOpenChange(e);
|
|
|
};
|
|
|
|
|
|
_this.onPopupVisibleChange = function (visible) {
|
|
|
_this.triggerOpenChange(visible, visible ? 'mouseenter' : 'mouseleave');
|
|
|
};
|
|
|
|
|
|
_this.onMouseEnter = function (e) {
|
|
|
var _this$props = _this.props,
|
|
|
key = _this$props.eventKey,
|
|
|
onMouseEnter = _this$props.onMouseEnter,
|
|
|
store = _this$props.store;
|
|
|
SubMenu_updateDefaultActiveFirst(store, _this.props.eventKey, false);
|
|
|
onMouseEnter({
|
|
|
key: key,
|
|
|
domEvent: e
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.onMouseLeave = function (e) {
|
|
|
var _this$props2 = _this.props,
|
|
|
parentMenu = _this$props2.parentMenu,
|
|
|
eventKey = _this$props2.eventKey,
|
|
|
onMouseLeave = _this$props2.onMouseLeave;
|
|
|
parentMenu.subMenuInstance = Object(assertThisInitialized["a" /* default */])(_this);
|
|
|
onMouseLeave({
|
|
|
key: eventKey,
|
|
|
domEvent: e
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.onTitleMouseEnter = function (domEvent) {
|
|
|
var _this$props3 = _this.props,
|
|
|
key = _this$props3.eventKey,
|
|
|
onItemHover = _this$props3.onItemHover,
|
|
|
onTitleMouseEnter = _this$props3.onTitleMouseEnter;
|
|
|
onItemHover({
|
|
|
key: key,
|
|
|
hover: true
|
|
|
});
|
|
|
onTitleMouseEnter({
|
|
|
key: key,
|
|
|
domEvent: domEvent
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.onTitleMouseLeave = function (e) {
|
|
|
var _this$props4 = _this.props,
|
|
|
parentMenu = _this$props4.parentMenu,
|
|
|
eventKey = _this$props4.eventKey,
|
|
|
onItemHover = _this$props4.onItemHover,
|
|
|
onTitleMouseLeave = _this$props4.onTitleMouseLeave;
|
|
|
parentMenu.subMenuInstance = Object(assertThisInitialized["a" /* default */])(_this);
|
|
|
onItemHover({
|
|
|
key: eventKey,
|
|
|
hover: false
|
|
|
});
|
|
|
onTitleMouseLeave({
|
|
|
key: eventKey,
|
|
|
domEvent: e
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.onTitleClick = function (e) {
|
|
|
var _assertThisInitialize = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
props = _assertThisInitialize.props;
|
|
|
|
|
|
props.onTitleClick({
|
|
|
key: props.eventKey,
|
|
|
domEvent: e
|
|
|
});
|
|
|
|
|
|
if (props.triggerSubMenuAction === 'hover') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
_this.triggerOpenChange(!_this.getVisible(), 'click');
|
|
|
|
|
|
SubMenu_updateDefaultActiveFirst(props.store, _this.props.eventKey, false);
|
|
|
};
|
|
|
|
|
|
_this.onSubMenuClick = function (info) {
|
|
|
// in the case of overflowed submenu
|
|
|
// onClick is not copied over
|
|
|
if (typeof _this.props.onClick === 'function') {
|
|
|
_this.props.onClick(_this.addKeyPath(info));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onSelect = function (info) {
|
|
|
_this.props.onSelect(info);
|
|
|
};
|
|
|
|
|
|
_this.onDeselect = function (info) {
|
|
|
_this.props.onDeselect(info);
|
|
|
};
|
|
|
|
|
|
_this.getPrefixCls = function () {
|
|
|
return "".concat(_this.props.rootPrefixCls, "-submenu");
|
|
|
};
|
|
|
|
|
|
_this.getActiveClassName = function () {
|
|
|
return "".concat(_this.getPrefixCls(), "-active");
|
|
|
};
|
|
|
|
|
|
_this.getDisabledClassName = function () {
|
|
|
return "".concat(_this.getPrefixCls(), "-disabled");
|
|
|
};
|
|
|
|
|
|
_this.getSelectedClassName = function () {
|
|
|
return "".concat(_this.getPrefixCls(), "-selected");
|
|
|
};
|
|
|
|
|
|
_this.getOpenClassName = function () {
|
|
|
return "".concat(_this.props.rootPrefixCls, "-submenu-open");
|
|
|
};
|
|
|
|
|
|
_this.getVisible = function () {
|
|
|
return _this.state.isOpen;
|
|
|
};
|
|
|
|
|
|
_this.getMode = function () {
|
|
|
return _this.state.mode;
|
|
|
};
|
|
|
|
|
|
_this.saveMenuInstance = function (c) {
|
|
|
// children menu instance
|
|
|
_this.menuInstance = c;
|
|
|
};
|
|
|
|
|
|
_this.addKeyPath = function (info) {
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, info), {}, {
|
|
|
keyPath: (info.keyPath || []).concat(_this.props.eventKey)
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.triggerOpenChange = function (open, type) {
|
|
|
var key = _this.props.eventKey;
|
|
|
|
|
|
var openChange = function openChange() {
|
|
|
_this.onOpenChange({
|
|
|
key: key,
|
|
|
item: Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
trigger: type,
|
|
|
open: open
|
|
|
});
|
|
|
};
|
|
|
|
|
|
if (type === 'mouseenter') {
|
|
|
// make sure mouseenter happen after other menu item's mouseleave
|
|
|
_this.mouseenterTimeout = setTimeout(function () {
|
|
|
openChange();
|
|
|
}, 0);
|
|
|
} else {
|
|
|
openChange();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.isChildrenSelected = function () {
|
|
|
var ret = {
|
|
|
find: false
|
|
|
};
|
|
|
loopMenuItemRecursively(_this.props.children, _this.props.selectedKeys, ret);
|
|
|
return ret.find;
|
|
|
};
|
|
|
|
|
|
_this.isInlineMode = function () {
|
|
|
return _this.getMode() === 'inline';
|
|
|
};
|
|
|
|
|
|
_this.adjustWidth = function () {
|
|
|
/* istanbul ignore if */
|
|
|
if (!_this.subMenuTitle || !_this.menuInstance) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var popupMenu = external_window_ReactDOM_["findDOMNode"](_this.menuInstance);
|
|
|
|
|
|
if (popupMenu.offsetWidth >= _this.subMenuTitle.offsetWidth) {
|
|
|
return;
|
|
|
}
|
|
|
/* istanbul ignore next */
|
|
|
|
|
|
|
|
|
popupMenu.style.minWidth = "".concat(_this.subMenuTitle.offsetWidth, "px");
|
|
|
};
|
|
|
|
|
|
_this.saveSubMenuTitle = function (subMenuTitle) {
|
|
|
_this.subMenuTitle = subMenuTitle;
|
|
|
};
|
|
|
|
|
|
_this.getBaseProps = function () {
|
|
|
var _assertThisInitialize2 = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
props = _assertThisInitialize2.props;
|
|
|
|
|
|
var mergedMode = _this.getMode();
|
|
|
|
|
|
return {
|
|
|
mode: mergedMode === 'horizontal' ? 'vertical' : mergedMode,
|
|
|
visible: _this.getVisible(),
|
|
|
level: props.level + 1,
|
|
|
inlineIndent: props.inlineIndent,
|
|
|
focusable: false,
|
|
|
onClick: _this.onSubMenuClick,
|
|
|
onSelect: _this.onSelect,
|
|
|
onDeselect: _this.onDeselect,
|
|
|
onDestroy: _this.onDestroy,
|
|
|
selectedKeys: props.selectedKeys,
|
|
|
eventKey: "".concat(props.eventKey, "-menu-"),
|
|
|
openKeys: props.openKeys,
|
|
|
motion: props.motion,
|
|
|
onOpenChange: _this.onOpenChange,
|
|
|
subMenuOpenDelay: props.subMenuOpenDelay,
|
|
|
parentMenu: Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
subMenuCloseDelay: props.subMenuCloseDelay,
|
|
|
forceSubMenuRender: props.forceSubMenuRender,
|
|
|
triggerSubMenuAction: props.triggerSubMenuAction,
|
|
|
builtinPlacements: props.builtinPlacements,
|
|
|
defaultActiveFirst: props.store.getState().defaultActiveFirst[getMenuIdFromSubMenuEventKey(props.eventKey)],
|
|
|
multiple: props.multiple,
|
|
|
prefixCls: props.rootPrefixCls,
|
|
|
id: _this.internalMenuId,
|
|
|
manualRef: _this.saveMenuInstance,
|
|
|
itemIcon: props.itemIcon,
|
|
|
expandIcon: props.expandIcon,
|
|
|
direction: props.direction
|
|
|
};
|
|
|
};
|
|
|
|
|
|
_this.getMotion = function (mode, visible) {
|
|
|
var _assertThisInitialize3 = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
haveRendered = _assertThisInitialize3.haveRendered;
|
|
|
|
|
|
var _this$props5 = _this.props,
|
|
|
motion = _this$props5.motion,
|
|
|
rootPrefixCls = _this$props5.rootPrefixCls; // don't show transition on first rendering (no animation for opened menu)
|
|
|
// show appear transition if it's not visible (not sure why)
|
|
|
// show appear transition if it's not inline mode
|
|
|
|
|
|
var mergedMotion = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, motion), {}, {
|
|
|
leavedClassName: "".concat(rootPrefixCls, "-hidden"),
|
|
|
removeOnLeave: false,
|
|
|
motionAppear: haveRendered || !visible || mode !== 'inline'
|
|
|
});
|
|
|
|
|
|
return mergedMotion;
|
|
|
};
|
|
|
|
|
|
var store = props.store,
|
|
|
eventKey = props.eventKey;
|
|
|
|
|
|
var _store$getState = store.getState(),
|
|
|
defaultActiveFirst = _store$getState.defaultActiveFirst;
|
|
|
|
|
|
_this.isRootMenu = false;
|
|
|
var value = false;
|
|
|
|
|
|
if (defaultActiveFirst) {
|
|
|
value = defaultActiveFirst[eventKey];
|
|
|
}
|
|
|
|
|
|
SubMenu_updateDefaultActiveFirst(store, eventKey, value);
|
|
|
_this.state = {
|
|
|
mode: props.mode,
|
|
|
isOpen: props.isOpen
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(SubMenu, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
this.componentDidUpdate();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate() {
|
|
|
var _this2 = this;
|
|
|
|
|
|
var _this$props6 = this.props,
|
|
|
mode = _this$props6.mode,
|
|
|
parentMenu = _this$props6.parentMenu,
|
|
|
manualRef = _this$props6.manualRef,
|
|
|
isOpen = _this$props6.isOpen;
|
|
|
|
|
|
var updateState = function updateState() {
|
|
|
_this2.setState({
|
|
|
mode: mode,
|
|
|
isOpen: isOpen
|
|
|
});
|
|
|
}; // Delay sync when mode changed in case openKeys change not sync
|
|
|
|
|
|
|
|
|
var isOpenChanged = isOpen !== this.state.isOpen;
|
|
|
var isModeChanged = mode !== this.state.mode;
|
|
|
|
|
|
if (isModeChanged || isOpenChanged) {
|
|
|
es_raf["a" /* default */].cancel(this.updateStateRaf);
|
|
|
|
|
|
if (isModeChanged) {
|
|
|
this.updateStateRaf = Object(es_raf["a" /* default */])(updateState);
|
|
|
} else {
|
|
|
updateState();
|
|
|
}
|
|
|
} // invoke customized ref to expose component to mixin
|
|
|
|
|
|
|
|
|
if (manualRef) {
|
|
|
manualRef(this);
|
|
|
}
|
|
|
|
|
|
if (mode !== 'horizontal' || !(parentMenu === null || parentMenu === void 0 ? void 0 : parentMenu.isRootMenu) || !isOpen) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.minWidthTimeout = setTimeout(function () {
|
|
|
return _this2.adjustWidth();
|
|
|
}, 0);
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
var _this$props7 = this.props,
|
|
|
onDestroy = _this$props7.onDestroy,
|
|
|
eventKey = _this$props7.eventKey;
|
|
|
|
|
|
if (onDestroy) {
|
|
|
onDestroy(eventKey);
|
|
|
}
|
|
|
/* istanbul ignore if */
|
|
|
|
|
|
|
|
|
if (this.minWidthTimeout) {
|
|
|
clearTimeout(this.minWidthTimeout);
|
|
|
}
|
|
|
/* istanbul ignore if */
|
|
|
|
|
|
|
|
|
if (this.mouseenterTimeout) {
|
|
|
clearTimeout(this.mouseenterTimeout);
|
|
|
}
|
|
|
|
|
|
es_raf["a" /* default */].cancel(this.updateStateRaf);
|
|
|
}
|
|
|
}, {
|
|
|
key: "renderPopupMenu",
|
|
|
value: function renderPopupMenu(className, style) {
|
|
|
var baseProps = this.getBaseProps();
|
|
|
/**
|
|
|
* zombiej: Why SubPopupMenu here?
|
|
|
* Seems whatever popup or inline mode both will render SubPopupMenu.
|
|
|
* It's controlled by Trigger for popup or not.
|
|
|
*/
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_SubPopupMenu, Object(esm_extends["a" /* default */])({}, baseProps, {
|
|
|
id: this.internalMenuId,
|
|
|
className: className,
|
|
|
style: style
|
|
|
}), this.props.children);
|
|
|
}
|
|
|
}, {
|
|
|
key: "renderChildren",
|
|
|
value: function renderChildren() {
|
|
|
var _this3 = this;
|
|
|
|
|
|
var baseProps = this.getBaseProps();
|
|
|
var mode = baseProps.mode,
|
|
|
visible = baseProps.visible,
|
|
|
forceSubMenuRender = baseProps.forceSubMenuRender,
|
|
|
direction = baseProps.direction; // [Legacy] getMotion must be called before `haveRendered`
|
|
|
|
|
|
var mergedMotion = this.getMotion(mode, visible);
|
|
|
this.haveRendered = true;
|
|
|
this.haveOpened = this.haveOpened || visible || forceSubMenuRender; // never rendered not planning to, don't render
|
|
|
|
|
|
if (!this.haveOpened) {
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("div", null);
|
|
|
}
|
|
|
|
|
|
var sharedClassName = classnames_default()("".concat(baseProps.prefixCls, "-sub"), Object(defineProperty["a" /* default */])({}, "".concat(baseProps.prefixCls, "-rtl"), direction === 'rtl'));
|
|
|
|
|
|
if (!this.isInlineMode()) {
|
|
|
return this.renderPopupMenu(sharedClassName);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({
|
|
|
visible: baseProps.visible,
|
|
|
forceRender: forceSubMenuRender
|
|
|
}, mergedMotion), function (_ref) {
|
|
|
var className = _ref.className,
|
|
|
style = _ref.style;
|
|
|
var mergedClassName = classnames_default()(sharedClassName, className);
|
|
|
return _this3.renderPopupMenu(mergedClassName, style);
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _classNames2, _props$parentMenu, _classNames3;
|
|
|
|
|
|
var props = Object(objectSpread2["a" /* default */])({}, this.props);
|
|
|
|
|
|
var visible = this.getVisible();
|
|
|
var prefixCls = this.getPrefixCls();
|
|
|
var inline = this.isInlineMode();
|
|
|
var mergedMode = this.getMode();
|
|
|
var className = classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedMode), (_classNames2 = {}, Object(defineProperty["a" /* default */])(_classNames2, props.className, !!props.className), Object(defineProperty["a" /* default */])(_classNames2, this.getOpenClassName(), visible), Object(defineProperty["a" /* default */])(_classNames2, this.getActiveClassName(), props.active || visible && !inline), Object(defineProperty["a" /* default */])(_classNames2, this.getDisabledClassName(), props.disabled), Object(defineProperty["a" /* default */])(_classNames2, this.getSelectedClassName(), this.isChildrenSelected()), _classNames2));
|
|
|
|
|
|
if (!this.internalMenuId) {
|
|
|
if (props.eventKey) {
|
|
|
this.internalMenuId = "".concat(props.eventKey, "$Menu");
|
|
|
} else {
|
|
|
guid += 1;
|
|
|
this.internalMenuId = "$__$".concat(guid, "$Menu");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var mouseEvents = {};
|
|
|
var titleClickEvents = {};
|
|
|
var titleMouseEvents = {};
|
|
|
|
|
|
if (!props.disabled) {
|
|
|
mouseEvents = {
|
|
|
onMouseLeave: this.onMouseLeave,
|
|
|
onMouseEnter: this.onMouseEnter
|
|
|
}; // only works in title, not outer li
|
|
|
|
|
|
titleClickEvents = {
|
|
|
onClick: this.onTitleClick
|
|
|
};
|
|
|
titleMouseEvents = {
|
|
|
onMouseEnter: this.onTitleMouseEnter,
|
|
|
onMouseLeave: this.onTitleMouseLeave
|
|
|
};
|
|
|
}
|
|
|
|
|
|
var style = {};
|
|
|
var direction = props.direction;
|
|
|
var isRTL = direction === 'rtl';
|
|
|
|
|
|
if (inline) {
|
|
|
if (isRTL) {
|
|
|
style.paddingRight = props.inlineIndent * props.level;
|
|
|
} else {
|
|
|
style.paddingLeft = props.inlineIndent * props.level;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var ariaOwns = {}; // only set aria-owns when menu is open
|
|
|
// otherwise it would be an invalid aria-owns value
|
|
|
// since corresponding node cannot be found
|
|
|
|
|
|
if (this.getVisible()) {
|
|
|
ariaOwns = {
|
|
|
'aria-owns': this.internalMenuId
|
|
|
};
|
|
|
} // expand custom icon should NOT be displayed in menu with horizontal mode.
|
|
|
|
|
|
|
|
|
var icon = null;
|
|
|
|
|
|
if (mergedMode !== 'horizontal') {
|
|
|
icon = this.props.expandIcon; // ReactNode
|
|
|
|
|
|
if (typeof this.props.expandIcon === 'function') {
|
|
|
icon = /*#__PURE__*/external_window_React_["createElement"](this.props.expandIcon, Object(objectSpread2["a" /* default */])({}, this.props));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var title = /*#__PURE__*/external_window_React_["createElement"]("div", Object(esm_extends["a" /* default */])({
|
|
|
ref: this.saveSubMenuTitle,
|
|
|
style: style,
|
|
|
className: "".concat(prefixCls, "-title"),
|
|
|
role: "button"
|
|
|
}, titleMouseEvents, titleClickEvents, {
|
|
|
"aria-expanded": visible
|
|
|
}, ariaOwns, {
|
|
|
"aria-haspopup": "true",
|
|
|
title: typeof props.title === 'string' ? props.title : undefined
|
|
|
}), props.title, icon || /*#__PURE__*/external_window_React_["createElement"]("i", {
|
|
|
className: "".concat(prefixCls, "-arrow")
|
|
|
}));
|
|
|
var children = this.renderChildren();
|
|
|
var getPopupContainer = ((_props$parentMenu = props.parentMenu) === null || _props$parentMenu === void 0 ? void 0 : _props$parentMenu.isRootMenu) ? props.parentMenu.props.getPopupContainer : function (triggerNode) {
|
|
|
return triggerNode.parentNode;
|
|
|
};
|
|
|
var popupPlacement = popupPlacementMap[mergedMode];
|
|
|
var popupAlign = props.popupOffset ? {
|
|
|
offset: props.popupOffset
|
|
|
} : {};
|
|
|
var popupClassName = classnames_default()((_classNames3 = {}, Object(defineProperty["a" /* default */])(_classNames3, props.popupClassName, props.popupClassName && !inline), Object(defineProperty["a" /* default */])(_classNames3, "".concat(prefixCls, "-rtl"), isRTL), _classNames3));
|
|
|
var disabled = props.disabled,
|
|
|
triggerSubMenuAction = props.triggerSubMenuAction,
|
|
|
subMenuOpenDelay = props.subMenuOpenDelay,
|
|
|
forceSubMenuRender = props.forceSubMenuRender,
|
|
|
subMenuCloseDelay = props.subMenuCloseDelay,
|
|
|
builtinPlacements = props.builtinPlacements;
|
|
|
menuAllProps.forEach(function (key) {
|
|
|
return delete props[key];
|
|
|
}); // Set onClick to null, to ignore propagated onClick event
|
|
|
|
|
|
delete props.onClick;
|
|
|
var placement = isRTL ? Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, placementsRtl), builtinPlacements) : Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, placements), builtinPlacements);
|
|
|
delete props.direction; // [Legacy] It's a fast fix,
|
|
|
// but we should check if we can refactor this to make code more easy to understand
|
|
|
|
|
|
var baseProps = this.getBaseProps();
|
|
|
var mergedMotion = inline ? null : this.getMotion(baseProps.mode, baseProps.visible);
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("li", Object(esm_extends["a" /* default */])({}, props, mouseEvents, {
|
|
|
className: className,
|
|
|
role: "menuitem"
|
|
|
}), /*#__PURE__*/external_window_React_["createElement"](rc_trigger_es, {
|
|
|
prefixCls: prefixCls,
|
|
|
popupClassName: classnames_default()("".concat(prefixCls, "-popup"), popupClassName),
|
|
|
getPopupContainer: getPopupContainer,
|
|
|
builtinPlacements: placement,
|
|
|
popupPlacement: popupPlacement,
|
|
|
popupVisible: inline ? false : visible,
|
|
|
popupAlign: popupAlign,
|
|
|
popup: inline ? null : children,
|
|
|
action: disabled || inline ? [] : [triggerSubMenuAction],
|
|
|
mouseEnterDelay: subMenuOpenDelay,
|
|
|
mouseLeaveDelay: subMenuCloseDelay,
|
|
|
onPopupVisibleChange: this.onPopupVisibleChange,
|
|
|
forceRender: forceSubMenuRender,
|
|
|
popupMotion: mergedMotion
|
|
|
}, title), inline ? children : null);
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return SubMenu;
|
|
|
}(external_window_React_["Component"]);
|
|
|
SubMenu_SubMenu.defaultProps = {
|
|
|
onMouseEnter: noop,
|
|
|
onMouseLeave: noop,
|
|
|
onTitleMouseEnter: noop,
|
|
|
onTitleMouseLeave: noop,
|
|
|
onTitleClick: noop,
|
|
|
manualRef: noop,
|
|
|
mode: 'vertical',
|
|
|
title: ''
|
|
|
};
|
|
|
var connected = Object(esm["b" /* connect */])(function (_ref2, _ref3) {
|
|
|
var openKeys = _ref2.openKeys,
|
|
|
activeKey = _ref2.activeKey,
|
|
|
selectedKeys = _ref2.selectedKeys;
|
|
|
var eventKey = _ref3.eventKey,
|
|
|
subMenuKey = _ref3.subMenuKey;
|
|
|
return {
|
|
|
isOpen: openKeys.indexOf(eventKey) > -1,
|
|
|
active: activeKey[subMenuKey] === eventKey,
|
|
|
selectedKeys: selectedKeys
|
|
|
};
|
|
|
})(SubMenu_SubMenu);
|
|
|
connected.isSubMenu = true;
|
|
|
/* harmony default export */ var es_SubMenu = (connected);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/DOMWrap.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MENUITEM_OVERFLOWED_CLASSNAME = 'menuitem-overflowed';
|
|
|
var FLOAT_PRECISION_ADJUST = 0.5;
|
|
|
|
|
|
var DOMWrap_DOMWrap = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(DOMWrap, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(DOMWrap);
|
|
|
|
|
|
function DOMWrap() {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, DOMWrap);
|
|
|
|
|
|
_this = _super.apply(this, arguments);
|
|
|
_this.resizeObserver = null;
|
|
|
_this.mutationObserver = null; // original scroll size of the list
|
|
|
|
|
|
_this.originalTotalWidth = 0; // copy of overflowed items
|
|
|
|
|
|
_this.overflowedItems = []; // cache item of the original items (so we can track the size and order)
|
|
|
|
|
|
_this.menuItemSizes = [];
|
|
|
_this.cancelFrameId = null;
|
|
|
_this.state = {
|
|
|
lastVisibleIndex: undefined
|
|
|
};
|
|
|
_this.childRef = /*#__PURE__*/external_window_React_["createRef"](); // get all valid menuItem nodes
|
|
|
|
|
|
_this.getMenuItemNodes = function () {
|
|
|
var prefixCls = _this.props.prefixCls;
|
|
|
var ul = _this.childRef.current;
|
|
|
|
|
|
if (!ul) {
|
|
|
return [];
|
|
|
} // filter out all overflowed indicator placeholder
|
|
|
|
|
|
|
|
|
return [].slice.call(ul.children).filter(function (node) {
|
|
|
return node.className.split(' ').indexOf("".concat(prefixCls, "-overflowed-submenu")) < 0;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.getOverflowedSubMenuItem = function (keyPrefix, overflowedItems, renderPlaceholder) {
|
|
|
var _this$props = _this.props,
|
|
|
overflowedIndicator = _this$props.overflowedIndicator,
|
|
|
level = _this$props.level,
|
|
|
mode = _this$props.mode,
|
|
|
prefixCls = _this$props.prefixCls,
|
|
|
theme = _this$props.theme;
|
|
|
|
|
|
if (level !== 1 || mode !== 'horizontal') {
|
|
|
return null;
|
|
|
} // put all the overflowed item inside a submenu
|
|
|
// with a title of overflow indicator ('...')
|
|
|
|
|
|
|
|
|
var copy = _this.props.children[0];
|
|
|
|
|
|
var _copy$props = copy.props,
|
|
|
throwAway = _copy$props.children,
|
|
|
title = _copy$props.title,
|
|
|
propStyle = _copy$props.style,
|
|
|
rest = Object(objectWithoutProperties["a" /* default */])(_copy$props, ["children", "title", "style"]);
|
|
|
|
|
|
var style = Object(objectSpread2["a" /* default */])({}, propStyle);
|
|
|
|
|
|
var key = "".concat(keyPrefix, "-overflowed-indicator");
|
|
|
var eventKey = "".concat(keyPrefix, "-overflowed-indicator");
|
|
|
|
|
|
if (overflowedItems.length === 0 && renderPlaceholder !== true) {
|
|
|
style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, style), {}, {
|
|
|
display: 'none'
|
|
|
});
|
|
|
} else if (renderPlaceholder) {
|
|
|
style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, style), {}, {
|
|
|
visibility: 'hidden',
|
|
|
// prevent from taking normal dom space
|
|
|
position: 'absolute'
|
|
|
});
|
|
|
key = "".concat(key, "-placeholder");
|
|
|
eventKey = "".concat(eventKey, "-placeholder");
|
|
|
}
|
|
|
|
|
|
var popupClassName = theme ? "".concat(prefixCls, "-").concat(theme) : '';
|
|
|
var props = {};
|
|
|
menuAllProps.forEach(function (k) {
|
|
|
if (rest[k] !== undefined) {
|
|
|
props[k] = rest[k];
|
|
|
}
|
|
|
});
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_SubMenu, Object(esm_extends["a" /* default */])({
|
|
|
title: overflowedIndicator,
|
|
|
className: "".concat(prefixCls, "-overflowed-submenu"),
|
|
|
popupClassName: popupClassName
|
|
|
}, props, {
|
|
|
key: key,
|
|
|
eventKey: eventKey,
|
|
|
disabled: false,
|
|
|
style: style
|
|
|
}), overflowedItems);
|
|
|
}; // memorize rendered menuSize
|
|
|
|
|
|
|
|
|
_this.setChildrenWidthAndResize = function () {
|
|
|
if (_this.props.mode !== 'horizontal') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var ul = _this.childRef.current;
|
|
|
|
|
|
if (!ul) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var ulChildrenNodes = ul.children;
|
|
|
|
|
|
if (!ulChildrenNodes || ulChildrenNodes.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var lastOverflowedIndicatorPlaceholder = ul.children[ulChildrenNodes.length - 1]; // need last overflowed indicator for calculating length;
|
|
|
|
|
|
util_setStyle(lastOverflowedIndicatorPlaceholder, 'display', 'inline-block');
|
|
|
|
|
|
var menuItemNodes = _this.getMenuItemNodes(); // reset display attribute for all hidden elements caused by overflow to calculate updated width
|
|
|
// and then reset to original state after width calculation
|
|
|
|
|
|
|
|
|
var overflowedItems = menuItemNodes.filter(function (c) {
|
|
|
return c.className.split(' ').indexOf(MENUITEM_OVERFLOWED_CLASSNAME) >= 0;
|
|
|
});
|
|
|
overflowedItems.forEach(function (c) {
|
|
|
util_setStyle(c, 'display', 'inline-block');
|
|
|
});
|
|
|
_this.menuItemSizes = menuItemNodes.map(function (c) {
|
|
|
return getWidth(c, true);
|
|
|
});
|
|
|
overflowedItems.forEach(function (c) {
|
|
|
util_setStyle(c, 'display', 'none');
|
|
|
});
|
|
|
_this.overflowedIndicatorWidth = getWidth(ul.children[ul.children.length - 1], true);
|
|
|
_this.originalTotalWidth = _this.menuItemSizes.reduce(function (acc, cur) {
|
|
|
return acc + cur;
|
|
|
}, 0);
|
|
|
|
|
|
_this.handleResize(); // prevent the overflowed indicator from taking space;
|
|
|
|
|
|
|
|
|
util_setStyle(lastOverflowedIndicatorPlaceholder, 'display', 'none');
|
|
|
};
|
|
|
|
|
|
_this.handleResize = function () {
|
|
|
if (_this.props.mode !== 'horizontal') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var ul = _this.childRef.current;
|
|
|
|
|
|
if (!ul) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var width = getWidth(ul);
|
|
|
_this.overflowedItems = [];
|
|
|
var currentSumWidth = 0; // index for last visible child in horizontal mode
|
|
|
|
|
|
var lastVisibleIndex; // float number comparison could be problematic
|
|
|
// e.g. 0.1 + 0.2 > 0.3 =====> true
|
|
|
// thus using FLOAT_PRECISION_ADJUST as buffer to help the situation
|
|
|
|
|
|
if (_this.originalTotalWidth > width + FLOAT_PRECISION_ADJUST) {
|
|
|
lastVisibleIndex = -1;
|
|
|
|
|
|
_this.menuItemSizes.forEach(function (liWidth) {
|
|
|
currentSumWidth += liWidth;
|
|
|
|
|
|
if (currentSumWidth + _this.overflowedIndicatorWidth <= width) {
|
|
|
lastVisibleIndex += 1;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
_this.setState({
|
|
|
lastVisibleIndex: lastVisibleIndex
|
|
|
});
|
|
|
};
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(DOMWrap, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
var _this2 = this;
|
|
|
|
|
|
this.setChildrenWidthAndResize();
|
|
|
|
|
|
if (this.props.level === 1 && this.props.mode === 'horizontal') {
|
|
|
var menuUl = this.childRef.current;
|
|
|
|
|
|
if (!menuUl) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.resizeObserver = new ResizeObserver_es["default"](function (entries) {
|
|
|
entries.forEach(function () {
|
|
|
var cancelFrameId = _this2.cancelFrameId;
|
|
|
cancelAnimationFrame(cancelFrameId);
|
|
|
_this2.cancelFrameId = requestAnimationFrame(_this2.setChildrenWidthAndResize);
|
|
|
});
|
|
|
});
|
|
|
[].slice.call(menuUl.children).concat(menuUl).forEach(function (el) {
|
|
|
_this2.resizeObserver.observe(el);
|
|
|
});
|
|
|
|
|
|
if (typeof MutationObserver !== 'undefined') {
|
|
|
this.mutationObserver = new MutationObserver(function () {
|
|
|
_this2.resizeObserver.disconnect();
|
|
|
|
|
|
[].slice.call(menuUl.children).concat(menuUl).forEach(function (el) {
|
|
|
_this2.resizeObserver.observe(el);
|
|
|
});
|
|
|
|
|
|
_this2.setChildrenWidthAndResize();
|
|
|
});
|
|
|
this.mutationObserver.observe(menuUl, {
|
|
|
attributes: false,
|
|
|
childList: true,
|
|
|
subTree: false
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
if (this.resizeObserver) {
|
|
|
this.resizeObserver.disconnect();
|
|
|
}
|
|
|
|
|
|
if (this.mutationObserver) {
|
|
|
this.mutationObserver.disconnect();
|
|
|
}
|
|
|
|
|
|
cancelAnimationFrame(this.cancelFrameId);
|
|
|
}
|
|
|
}, {
|
|
|
key: "renderChildren",
|
|
|
value: function renderChildren(children) {
|
|
|
var _this3 = this;
|
|
|
|
|
|
// need to take care of overflowed items in horizontal mode
|
|
|
var lastVisibleIndex = this.state.lastVisibleIndex;
|
|
|
return (children || []).reduce(function (acc, childNode, index) {
|
|
|
var item = childNode;
|
|
|
|
|
|
if (_this3.props.mode === 'horizontal') {
|
|
|
var overflowed = _this3.getOverflowedSubMenuItem(childNode.props.eventKey, []);
|
|
|
|
|
|
if (lastVisibleIndex !== undefined && _this3.props.className.indexOf("".concat(_this3.props.prefixCls, "-root")) !== -1) {
|
|
|
if (index > lastVisibleIndex) {
|
|
|
item = /*#__PURE__*/external_window_React_["cloneElement"](childNode, // 这里修改 eventKey 是为了防止隐藏状态下还会触发 openkeys 事件
|
|
|
{
|
|
|
style: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
eventKey: "".concat(childNode.props.eventKey, "-hidden"),
|
|
|
|
|
|
/**
|
|
|
* Legacy code. Here `className` never used:
|
|
|
* https://github.com/react-component/menu/commit/4cd6b49fce9d116726f4ea00dda85325d6f26500#diff-e2fa48f75c2dd2318295cde428556a76R240
|
|
|
*/
|
|
|
className: "".concat(MENUITEM_OVERFLOWED_CLASSNAME)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (index === lastVisibleIndex + 1) {
|
|
|
_this3.overflowedItems = children.slice(lastVisibleIndex + 1).map(function (c) {
|
|
|
return /*#__PURE__*/external_window_React_["cloneElement"](c, // children[index].key will become '.$key' in clone by default,
|
|
|
// we have to overwrite with the correct key explicitly
|
|
|
{
|
|
|
key: c.props.eventKey,
|
|
|
mode: 'vertical-left'
|
|
|
});
|
|
|
});
|
|
|
overflowed = _this3.getOverflowedSubMenuItem(childNode.props.eventKey, _this3.overflowedItems);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var ret = [].concat(Object(toConsumableArray["a" /* default */])(acc), [overflowed, item]);
|
|
|
|
|
|
if (index === children.length - 1) {
|
|
|
// need a placeholder for calculating overflowed indicator width
|
|
|
ret.push(_this3.getOverflowedSubMenuItem(childNode.props.eventKey, [], true));
|
|
|
}
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
return [].concat(Object(toConsumableArray["a" /* default */])(acc), [item]);
|
|
|
}, []);
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _this$props2 = this.props,
|
|
|
visible = _this$props2.visible,
|
|
|
prefixCls = _this$props2.prefixCls,
|
|
|
overflowedIndicator = _this$props2.overflowedIndicator,
|
|
|
mode = _this$props2.mode,
|
|
|
level = _this$props2.level,
|
|
|
tag = _this$props2.tag,
|
|
|
children = _this$props2.children,
|
|
|
theme = _this$props2.theme,
|
|
|
rest = Object(objectWithoutProperties["a" /* default */])(_this$props2, ["visible", "prefixCls", "overflowedIndicator", "mode", "level", "tag", "children", "theme"]);
|
|
|
|
|
|
var Tag = tag;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](Tag, Object(esm_extends["a" /* default */])({
|
|
|
ref: this.childRef
|
|
|
}, rest), this.renderChildren(children));
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return DOMWrap;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
DOMWrap_DOMWrap.defaultProps = {
|
|
|
tag: 'div',
|
|
|
className: ''
|
|
|
};
|
|
|
/* harmony default export */ var es_DOMWrap = (DOMWrap_DOMWrap);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/SubPopupMenu.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function allDisabled(arr) {
|
|
|
if (!arr.length) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return arr.every(function (c) {
|
|
|
return !!c.props.disabled;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function updateActiveKey(store, menuId, activeKey) {
|
|
|
var state = store.getState();
|
|
|
store.setState({
|
|
|
activeKey: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, state.activeKey), {}, Object(defineProperty["a" /* default */])({}, menuId, activeKey))
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function getEventKey(props) {
|
|
|
// when eventKey not available ,it's menu and return menu id '0-menu-'
|
|
|
return props.eventKey || '0-menu-';
|
|
|
}
|
|
|
|
|
|
function getActiveKey(props, originalActiveKey) {
|
|
|
var activeKey = originalActiveKey;
|
|
|
var children = props.children,
|
|
|
eventKey = props.eventKey;
|
|
|
|
|
|
if (activeKey) {
|
|
|
var found;
|
|
|
loopMenuItem(children, function (c, i) {
|
|
|
if (c && c.props && !c.props.disabled && activeKey === getKeyFromChildrenIndex(c, eventKey, i)) {
|
|
|
found = true;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (found) {
|
|
|
return activeKey;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
activeKey = null;
|
|
|
|
|
|
if (props.defaultActiveFirst) {
|
|
|
loopMenuItem(children, function (c, i) {
|
|
|
if (!activeKey && c && !c.props.disabled) {
|
|
|
activeKey = getKeyFromChildrenIndex(c, eventKey, i);
|
|
|
}
|
|
|
});
|
|
|
return activeKey;
|
|
|
}
|
|
|
|
|
|
return activeKey;
|
|
|
}
|
|
|
function saveRef(c) {
|
|
|
if (!c) {
|
|
|
return;
|
|
|
}
|
|
|
/* eslint-disable @typescript-eslint/no-invalid-this */
|
|
|
|
|
|
|
|
|
var index = this.instanceArray.indexOf(c);
|
|
|
|
|
|
if (index !== -1) {
|
|
|
// update component if it's already inside instanceArray
|
|
|
this.instanceArray[index] = c;
|
|
|
} else {
|
|
|
// add component if it's not in instanceArray yet;
|
|
|
this.instanceArray.push(c);
|
|
|
}
|
|
|
/* eslint-enable @typescript-eslint/no-invalid-this */
|
|
|
|
|
|
}
|
|
|
var SubPopupMenu_SubPopupMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(SubPopupMenu, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(SubPopupMenu);
|
|
|
|
|
|
function SubPopupMenu(props) {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, SubPopupMenu);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
/**
|
|
|
* all keyboard events callbacks run from here at first
|
|
|
*
|
|
|
* note:
|
|
|
* This legacy code that `onKeyDown` is called by parent instead of dom self.
|
|
|
* which need return code to check if this event is handled
|
|
|
*/
|
|
|
|
|
|
_this.onKeyDown = function (e, callback) {
|
|
|
var keyCode = e.keyCode;
|
|
|
var handled;
|
|
|
|
|
|
_this.getFlatInstanceArray().forEach(function (obj) {
|
|
|
if (obj && obj.props.active && obj.onKeyDown) {
|
|
|
handled = obj.onKeyDown(e);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (handled) {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
var activeItem = null;
|
|
|
|
|
|
if (keyCode === KeyCode["a" /* default */].UP || keyCode === KeyCode["a" /* default */].DOWN) {
|
|
|
activeItem = _this.step(keyCode === KeyCode["a" /* default */].UP ? -1 : 1);
|
|
|
}
|
|
|
|
|
|
if (activeItem) {
|
|
|
e.preventDefault();
|
|
|
updateActiveKey(_this.props.store, getEventKey(_this.props), activeItem.props.eventKey);
|
|
|
|
|
|
if (typeof callback === 'function') {
|
|
|
callback(activeItem);
|
|
|
}
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
return undefined;
|
|
|
};
|
|
|
|
|
|
_this.onItemHover = function (e) {
|
|
|
var key = e.key,
|
|
|
hover = e.hover;
|
|
|
updateActiveKey(_this.props.store, getEventKey(_this.props), hover ? key : null);
|
|
|
};
|
|
|
|
|
|
_this.onDeselect = function (selectInfo) {
|
|
|
_this.props.onDeselect(selectInfo);
|
|
|
};
|
|
|
|
|
|
_this.onSelect = function (selectInfo) {
|
|
|
_this.props.onSelect(selectInfo);
|
|
|
};
|
|
|
|
|
|
_this.onClick = function (e) {
|
|
|
_this.props.onClick(e);
|
|
|
};
|
|
|
|
|
|
_this.onOpenChange = function (e) {
|
|
|
_this.props.onOpenChange(e);
|
|
|
};
|
|
|
|
|
|
_this.onDestroy = function (key) {
|
|
|
/* istanbul ignore next */
|
|
|
_this.props.onDestroy(key);
|
|
|
};
|
|
|
|
|
|
_this.getFlatInstanceArray = function () {
|
|
|
return _this.instanceArray;
|
|
|
};
|
|
|
|
|
|
_this.step = function (direction) {
|
|
|
var children = _this.getFlatInstanceArray();
|
|
|
|
|
|
var activeKey = _this.props.store.getState().activeKey[getEventKey(_this.props)];
|
|
|
|
|
|
var len = children.length;
|
|
|
|
|
|
if (!len) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
if (direction < 0) {
|
|
|
children = children.concat().reverse();
|
|
|
} // find current activeIndex
|
|
|
|
|
|
|
|
|
var activeIndex = -1;
|
|
|
children.every(function (c, ci) {
|
|
|
if (c && c.props.eventKey === activeKey) {
|
|
|
activeIndex = ci;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
});
|
|
|
|
|
|
if (!_this.props.defaultActiveFirst && activeIndex !== -1 && allDisabled(children.slice(activeIndex, len - 1))) {
|
|
|
return undefined;
|
|
|
}
|
|
|
|
|
|
var start = (activeIndex + 1) % len;
|
|
|
var i = start;
|
|
|
|
|
|
do {
|
|
|
var child = children[i];
|
|
|
|
|
|
if (!child || child.props.disabled) {
|
|
|
i = (i + 1) % len;
|
|
|
} else {
|
|
|
return child;
|
|
|
}
|
|
|
} while (i !== start);
|
|
|
|
|
|
return null;
|
|
|
};
|
|
|
|
|
|
_this.renderCommonMenuItem = function (child, i, extraProps) {
|
|
|
var state = _this.props.store.getState();
|
|
|
|
|
|
var _assertThisInitialize = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
props = _assertThisInitialize.props;
|
|
|
|
|
|
var key = getKeyFromChildrenIndex(child, props.eventKey, i);
|
|
|
var childProps = child.props; // https://github.com/ant-design/ant-design/issues/11517#issuecomment-477403055
|
|
|
|
|
|
if (!childProps || typeof child.type === 'string') {
|
|
|
return child;
|
|
|
}
|
|
|
|
|
|
var isActive = key === state.activeKey;
|
|
|
|
|
|
var newChildProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
|
|
|
mode: childProps.mode || props.mode,
|
|
|
level: props.level,
|
|
|
inlineIndent: props.inlineIndent,
|
|
|
renderMenuItem: _this.renderMenuItem,
|
|
|
rootPrefixCls: props.prefixCls,
|
|
|
index: i,
|
|
|
parentMenu: props.parentMenu,
|
|
|
// customized ref function, need to be invoked manually in child's componentDidMount
|
|
|
manualRef: childProps.disabled ? undefined : Object(createChainedFunction["a" /* default */])(child.ref, saveRef.bind(Object(assertThisInitialized["a" /* default */])(_this))),
|
|
|
eventKey: key,
|
|
|
active: !childProps.disabled && isActive,
|
|
|
multiple: props.multiple,
|
|
|
onClick: function onClick(e) {
|
|
|
(childProps.onClick || noop)(e);
|
|
|
|
|
|
_this.onClick(e);
|
|
|
},
|
|
|
onItemHover: _this.onItemHover,
|
|
|
motion: props.motion,
|
|
|
subMenuOpenDelay: props.subMenuOpenDelay,
|
|
|
subMenuCloseDelay: props.subMenuCloseDelay,
|
|
|
forceSubMenuRender: props.forceSubMenuRender,
|
|
|
onOpenChange: _this.onOpenChange,
|
|
|
onDeselect: _this.onDeselect,
|
|
|
onSelect: _this.onSelect,
|
|
|
builtinPlacements: props.builtinPlacements,
|
|
|
itemIcon: childProps.itemIcon || _this.props.itemIcon,
|
|
|
expandIcon: childProps.expandIcon || _this.props.expandIcon
|
|
|
}, extraProps), {}, {
|
|
|
direction: props.direction
|
|
|
}); // ref: https://github.com/ant-design/ant-design/issues/13943
|
|
|
|
|
|
|
|
|
if (props.mode === 'inline' || util_isMobileDevice()) {
|
|
|
newChildProps.triggerSubMenuAction = 'click';
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["cloneElement"](child, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, newChildProps), {}, {
|
|
|
key: key || i
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
_this.renderMenuItem = function (c, i, subMenuKey) {
|
|
|
/* istanbul ignore if */
|
|
|
if (!c) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
var state = _this.props.store.getState();
|
|
|
|
|
|
var extraProps = {
|
|
|
openKeys: state.openKeys,
|
|
|
selectedKeys: state.selectedKeys,
|
|
|
triggerSubMenuAction: _this.props.triggerSubMenuAction,
|
|
|
subMenuKey: subMenuKey
|
|
|
};
|
|
|
return _this.renderCommonMenuItem(c, i, extraProps);
|
|
|
};
|
|
|
|
|
|
props.store.setState({
|
|
|
activeKey: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props.store.getState().activeKey), {}, Object(defineProperty["a" /* default */])({}, props.eventKey, getActiveKey(props, props.activeKey)))
|
|
|
});
|
|
|
_this.instanceArray = [];
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(SubPopupMenu, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
// invoke customized ref to expose component to mixin
|
|
|
if (this.props.manualRef) {
|
|
|
this.props.manualRef(this);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "shouldComponentUpdate",
|
|
|
value: function shouldComponentUpdate(nextProps) {
|
|
|
return this.props.visible || nextProps.visible || this.props.className !== nextProps.className || !shallowequal_default()(this.props.style, nextProps.style);
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate(prevProps) {
|
|
|
var props = this.props;
|
|
|
var originalActiveKey = 'activeKey' in props ? props.activeKey : props.store.getState().activeKey[getEventKey(props)];
|
|
|
var activeKey = getActiveKey(props, originalActiveKey);
|
|
|
|
|
|
if (activeKey !== originalActiveKey) {
|
|
|
updateActiveKey(props.store, getEventKey(props), activeKey);
|
|
|
} else if ('activeKey' in prevProps) {
|
|
|
// If prev activeKey is not same as current activeKey,
|
|
|
// we should set it.
|
|
|
var prevActiveKey = getActiveKey(prevProps, prevProps.activeKey);
|
|
|
|
|
|
if (activeKey !== prevActiveKey) {
|
|
|
updateActiveKey(props.store, getEventKey(props), activeKey);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _this2 = this;
|
|
|
|
|
|
var props = Object(esm_extends["a" /* default */])({}, this.props);
|
|
|
|
|
|
this.instanceArray = [];
|
|
|
var className = classnames_default()(props.prefixCls, props.className, "".concat(props.prefixCls, "-").concat(props.mode));
|
|
|
var domProps = {
|
|
|
className: className,
|
|
|
// role could be 'select' and by default set to menu
|
|
|
role: props.role || 'menu'
|
|
|
};
|
|
|
|
|
|
if (props.id) {
|
|
|
domProps.id = props.id;
|
|
|
}
|
|
|
|
|
|
if (props.focusable) {
|
|
|
domProps.tabIndex = 0;
|
|
|
domProps.onKeyDown = this.onKeyDown;
|
|
|
}
|
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
eventKey = props.eventKey,
|
|
|
visible = props.visible,
|
|
|
level = props.level,
|
|
|
mode = props.mode,
|
|
|
overflowedIndicator = props.overflowedIndicator,
|
|
|
theme = props.theme;
|
|
|
menuAllProps.forEach(function (key) {
|
|
|
return delete props[key];
|
|
|
}); // Otherwise, the propagated click event will trigger another onClick
|
|
|
|
|
|
delete props.onClick;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_DOMWrap, Object(esm_extends["a" /* default */])({}, props, {
|
|
|
prefixCls: prefixCls,
|
|
|
mode: mode,
|
|
|
tag: "ul",
|
|
|
level: level,
|
|
|
theme: theme,
|
|
|
visible: visible,
|
|
|
overflowedIndicator: overflowedIndicator
|
|
|
}, domProps), Object(toArray["a" /* default */])(props.children).map(function (c, i) {
|
|
|
return _this2.renderMenuItem(c, i, eventKey || '0-menu-');
|
|
|
}));
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return SubPopupMenu;
|
|
|
}(external_window_React_["Component"]);
|
|
|
SubPopupMenu_SubPopupMenu.defaultProps = {
|
|
|
prefixCls: 'rc-menu',
|
|
|
className: '',
|
|
|
mode: 'vertical',
|
|
|
level: 1,
|
|
|
inlineIndent: 24,
|
|
|
visible: true,
|
|
|
focusable: true,
|
|
|
style: {},
|
|
|
manualRef: noop
|
|
|
};
|
|
|
var SubPopupMenu_connected = Object(esm["b" /* connect */])()(SubPopupMenu_SubPopupMenu);
|
|
|
/* harmony default export */ var es_SubPopupMenu = (SubPopupMenu_connected);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
|
var warning = __webpack_require__("Kwbf");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/utils/legacyUtil.js
|
|
|
|
|
|
|
|
|
function legacyUtil_getMotion(_ref, _ref2, menuMode) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
motion = _ref.motion,
|
|
|
_ref$defaultMotions = _ref.defaultMotions,
|
|
|
defaultMotions = _ref$defaultMotions === void 0 ? {} : _ref$defaultMotions,
|
|
|
openAnimation = _ref.openAnimation,
|
|
|
openTransitionName = _ref.openTransitionName;
|
|
|
var switchingModeFromInline = _ref2.switchingModeFromInline;
|
|
|
|
|
|
if (motion) {
|
|
|
return motion;
|
|
|
}
|
|
|
|
|
|
if (Object(esm_typeof["a" /* default */])(openAnimation) === 'object' && openAnimation) {
|
|
|
Object(warning["a" /* default */])(false, 'Object type of `openAnimation` is removed. Please use `motion` instead.');
|
|
|
} else if (typeof openAnimation === 'string') {
|
|
|
return {
|
|
|
motionName: "".concat(prefixCls, "-open-").concat(openAnimation)
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (openTransitionName) {
|
|
|
return {
|
|
|
motionName: openTransitionName
|
|
|
};
|
|
|
} // Default logic
|
|
|
|
|
|
|
|
|
var defaultMotion = defaultMotions[menuMode];
|
|
|
|
|
|
if (defaultMotion) {
|
|
|
return defaultMotion;
|
|
|
} // When mode switch from inline
|
|
|
// submenu should hide without animation
|
|
|
|
|
|
|
|
|
return switchingModeFromInline ? null : defaultMotions.other;
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/Menu.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Menu_Menu = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(Menu, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(Menu);
|
|
|
|
|
|
function Menu(props) {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, Menu);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
|
|
|
_this.onSelect = function (selectInfo) {
|
|
|
var _assertThisInitialize = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
props = _assertThisInitialize.props;
|
|
|
|
|
|
if (props.selectable) {
|
|
|
// root menu
|
|
|
var _this$store$getState = _this.store.getState(),
|
|
|
_selectedKeys = _this$store$getState.selectedKeys;
|
|
|
|
|
|
var selectedKey = selectInfo.key;
|
|
|
|
|
|
if (props.multiple) {
|
|
|
_selectedKeys = _selectedKeys.concat([selectedKey]);
|
|
|
} else {
|
|
|
_selectedKeys = [selectedKey];
|
|
|
}
|
|
|
|
|
|
if (!('selectedKeys' in props)) {
|
|
|
_this.store.setState({
|
|
|
selectedKeys: _selectedKeys
|
|
|
});
|
|
|
}
|
|
|
|
|
|
props.onSelect(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, selectInfo), {}, {
|
|
|
selectedKeys: _selectedKeys
|
|
|
}));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onClick = function (e) {
|
|
|
var mode = _this.getRealMenuMode();
|
|
|
|
|
|
var _assertThisInitialize2 = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
store = _assertThisInitialize2.store,
|
|
|
onOpenChange = _assertThisInitialize2.props.onOpenChange;
|
|
|
|
|
|
if (mode !== 'inline' && !('openKeys' in _this.props)) {
|
|
|
// closing vertical popup submenu after click it
|
|
|
store.setState({
|
|
|
openKeys: []
|
|
|
});
|
|
|
onOpenChange([]);
|
|
|
}
|
|
|
|
|
|
_this.props.onClick(e);
|
|
|
}; // onKeyDown needs to be exposed as a instance method
|
|
|
// e.g., in rc-select, we need to navigate menu item while
|
|
|
// current active item is rc-select input box rather than the menu itself
|
|
|
|
|
|
|
|
|
_this.onKeyDown = function (e, callback) {
|
|
|
_this.innerMenu.getWrappedInstance().onKeyDown(e, callback);
|
|
|
};
|
|
|
|
|
|
_this.onOpenChange = function (event) {
|
|
|
var _assertThisInitialize3 = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
props = _assertThisInitialize3.props;
|
|
|
|
|
|
var openKeys = _this.store.getState().openKeys.concat();
|
|
|
|
|
|
var changed = false;
|
|
|
|
|
|
var processSingle = function processSingle(e) {
|
|
|
var oneChanged = false;
|
|
|
|
|
|
if (e.open) {
|
|
|
oneChanged = openKeys.indexOf(e.key) === -1;
|
|
|
|
|
|
if (oneChanged) {
|
|
|
openKeys.push(e.key);
|
|
|
}
|
|
|
} else {
|
|
|
var index = openKeys.indexOf(e.key);
|
|
|
oneChanged = index !== -1;
|
|
|
|
|
|
if (oneChanged) {
|
|
|
openKeys.splice(index, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
changed = changed || oneChanged;
|
|
|
};
|
|
|
|
|
|
if (Array.isArray(event)) {
|
|
|
// batch change call
|
|
|
event.forEach(processSingle);
|
|
|
} else {
|
|
|
processSingle(event);
|
|
|
}
|
|
|
|
|
|
if (changed) {
|
|
|
if (!('openKeys' in _this.props)) {
|
|
|
_this.store.setState({
|
|
|
openKeys: openKeys
|
|
|
});
|
|
|
}
|
|
|
|
|
|
props.onOpenChange(openKeys);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onDeselect = function (selectInfo) {
|
|
|
var _assertThisInitialize4 = Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
props = _assertThisInitialize4.props;
|
|
|
|
|
|
if (props.selectable) {
|
|
|
var _selectedKeys2 = _this.store.getState().selectedKeys.concat();
|
|
|
|
|
|
var selectedKey = selectInfo.key;
|
|
|
|
|
|
var index = _selectedKeys2.indexOf(selectedKey);
|
|
|
|
|
|
if (index !== -1) {
|
|
|
_selectedKeys2.splice(index, 1);
|
|
|
}
|
|
|
|
|
|
if (!('selectedKeys' in props)) {
|
|
|
_this.store.setState({
|
|
|
selectedKeys: _selectedKeys2
|
|
|
});
|
|
|
}
|
|
|
|
|
|
props.onDeselect(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, selectInfo), {}, {
|
|
|
selectedKeys: _selectedKeys2
|
|
|
}));
|
|
|
}
|
|
|
}; // Restore vertical mode when menu is collapsed responsively when mounted
|
|
|
// https://github.com/ant-design/ant-design/issues/13104
|
|
|
// TODO: not a perfect solution,
|
|
|
// looking a new way to avoid setting switchingModeFromInline in this situation
|
|
|
|
|
|
|
|
|
_this.onMouseEnter = function (e) {
|
|
|
_this.restoreModeVerticalFromInline();
|
|
|
|
|
|
var onMouseEnter = _this.props.onMouseEnter;
|
|
|
|
|
|
if (onMouseEnter) {
|
|
|
onMouseEnter(e);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.onTransitionEnd = function (e) {
|
|
|
// when inlineCollapsed menu width animation finished
|
|
|
// https://github.com/ant-design/ant-design/issues/12864
|
|
|
var widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; // Fix SVGElement e.target.className.indexOf is not a function
|
|
|
// https://github.com/ant-design/ant-design/issues/15699
|
|
|
|
|
|
var className = e.target.className; // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal,
|
|
|
// unless during an animation.
|
|
|
|
|
|
var classNameValue = Object.prototype.toString.call(className) === '[object SVGAnimatedString]' ? className.animVal : className; // Fix for <Menu style={{ width: '100%' }} />,
|
|
|
// the width transition won't trigger when menu is collapsed
|
|
|
// https://github.com/ant-design/ant-design-pro/issues/2783
|
|
|
|
|
|
var iconScaled = e.propertyName === 'font-size' && classNameValue.indexOf('anticon') >= 0;
|
|
|
|
|
|
if (widthCollapsed || iconScaled) {
|
|
|
_this.restoreModeVerticalFromInline();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.setInnerMenu = function (node) {
|
|
|
_this.innerMenu = node;
|
|
|
};
|
|
|
|
|
|
_this.isRootMenu = true;
|
|
|
var selectedKeys = props.defaultSelectedKeys;
|
|
|
var openKeys = props.defaultOpenKeys;
|
|
|
|
|
|
if ('selectedKeys' in props) {
|
|
|
selectedKeys = props.selectedKeys || [];
|
|
|
}
|
|
|
|
|
|
if ('openKeys' in props) {
|
|
|
openKeys = props.openKeys || [];
|
|
|
}
|
|
|
|
|
|
_this.store = Object(esm["c" /* create */])({
|
|
|
selectedKeys: selectedKeys,
|
|
|
openKeys: openKeys,
|
|
|
activeKey: {
|
|
|
'0-menu-': getActiveKey(props, props.activeKey)
|
|
|
}
|
|
|
});
|
|
|
_this.state = {
|
|
|
switchingModeFromInline: false,
|
|
|
prevProps: props,
|
|
|
inlineOpenKeys: [],
|
|
|
store: _this.store
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(Menu, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
this.updateMiniStore();
|
|
|
this.updateMenuDisplay();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate(prevProps) {
|
|
|
var _this$props = this.props,
|
|
|
siderCollapsed = _this$props.siderCollapsed,
|
|
|
inlineCollapsed = _this$props.inlineCollapsed,
|
|
|
onOpenChange = _this$props.onOpenChange;
|
|
|
|
|
|
if (!prevProps.inlineCollapsed && inlineCollapsed || !prevProps.siderCollapsed && siderCollapsed) {
|
|
|
onOpenChange([]);
|
|
|
}
|
|
|
|
|
|
this.updateMiniStore();
|
|
|
this.updateMenuDisplay();
|
|
|
}
|
|
|
}, {
|
|
|
key: "updateMenuDisplay",
|
|
|
value: function updateMenuDisplay() {
|
|
|
var collapsedWidth = this.props.collapsedWidth,
|
|
|
store = this.store,
|
|
|
prevOpenKeys = this.prevOpenKeys; // https://github.com/ant-design/ant-design/issues/8587
|
|
|
|
|
|
var hideMenu = this.getInlineCollapsed() && (collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px');
|
|
|
|
|
|
if (hideMenu) {
|
|
|
this.prevOpenKeys = store.getState().openKeys.concat();
|
|
|
this.store.setState({
|
|
|
openKeys: []
|
|
|
});
|
|
|
} else if (prevOpenKeys) {
|
|
|
this.store.setState({
|
|
|
openKeys: prevOpenKeys
|
|
|
});
|
|
|
this.prevOpenKeys = null;
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "getRealMenuMode",
|
|
|
value: function getRealMenuMode() {
|
|
|
var mode = this.props.mode;
|
|
|
var switchingModeFromInline = this.state.switchingModeFromInline;
|
|
|
var inlineCollapsed = this.getInlineCollapsed();
|
|
|
|
|
|
if (switchingModeFromInline && inlineCollapsed) {
|
|
|
return 'inline';
|
|
|
}
|
|
|
|
|
|
return inlineCollapsed ? 'vertical' : mode;
|
|
|
}
|
|
|
}, {
|
|
|
key: "getInlineCollapsed",
|
|
|
value: function getInlineCollapsed() {
|
|
|
var _this$props2 = this.props,
|
|
|
inlineCollapsed = _this$props2.inlineCollapsed,
|
|
|
siderCollapsed = _this$props2.siderCollapsed;
|
|
|
|
|
|
if (siderCollapsed !== undefined) {
|
|
|
return siderCollapsed;
|
|
|
}
|
|
|
|
|
|
return inlineCollapsed;
|
|
|
}
|
|
|
}, {
|
|
|
key: "restoreModeVerticalFromInline",
|
|
|
value: function restoreModeVerticalFromInline() {
|
|
|
var switchingModeFromInline = this.state.switchingModeFromInline;
|
|
|
|
|
|
if (switchingModeFromInline) {
|
|
|
this.setState({
|
|
|
switchingModeFromInline: false
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "updateMiniStore",
|
|
|
value: function updateMiniStore() {
|
|
|
if ('selectedKeys' in this.props) {
|
|
|
this.store.setState({
|
|
|
selectedKeys: this.props.selectedKeys || []
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if ('openKeys' in this.props) {
|
|
|
this.store.setState({
|
|
|
openKeys: this.props.openKeys || []
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var props = Object(objectSpread2["a" /* default */])({}, Object(omit["a" /* default */])(this.props, ['collapsedWidth', 'siderCollapsed', 'defaultMotions']));
|
|
|
|
|
|
var mode = this.getRealMenuMode();
|
|
|
props.className += " ".concat(props.prefixCls, "-root");
|
|
|
|
|
|
if (props.direction === 'rtl') {
|
|
|
props.className += " ".concat(props.prefixCls, "-rtl");
|
|
|
}
|
|
|
|
|
|
props = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props), {}, {
|
|
|
mode: mode,
|
|
|
onClick: this.onClick,
|
|
|
onOpenChange: this.onOpenChange,
|
|
|
onDeselect: this.onDeselect,
|
|
|
onSelect: this.onSelect,
|
|
|
onMouseEnter: this.onMouseEnter,
|
|
|
onTransitionEnd: this.onTransitionEnd,
|
|
|
parentMenu: this,
|
|
|
motion: legacyUtil_getMotion(this.props, this.state, mode)
|
|
|
});
|
|
|
delete props.openAnimation;
|
|
|
delete props.openTransitionName;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](esm["a" /* Provider */], {
|
|
|
store: this.store
|
|
|
}, /*#__PURE__*/external_window_React_["createElement"](es_SubPopupMenu, Object(esm_extends["a" /* default */])({}, props, {
|
|
|
ref: this.setInnerMenu
|
|
|
}), this.props.children));
|
|
|
}
|
|
|
}], [{
|
|
|
key: "getDerivedStateFromProps",
|
|
|
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
|
var prevProps = prevState.prevProps,
|
|
|
store = prevState.store;
|
|
|
var prevStoreState = store.getState();
|
|
|
var newStoreState = {};
|
|
|
var newState = {
|
|
|
prevProps: nextProps
|
|
|
};
|
|
|
|
|
|
if (prevProps.mode === 'inline' && nextProps.mode !== 'inline') {
|
|
|
newState.switchingModeFromInline = true;
|
|
|
}
|
|
|
|
|
|
if ('openKeys' in nextProps) {
|
|
|
newStoreState.openKeys = nextProps.openKeys || [];
|
|
|
} else {
|
|
|
// [Legacy] Old code will return after `openKeys` changed.
|
|
|
// Not sure the reason, we should keep this logic still.
|
|
|
if (nextProps.inlineCollapsed && !prevProps.inlineCollapsed || nextProps.siderCollapsed && !prevProps.siderCollapsed) {
|
|
|
newState.switchingModeFromInline = true;
|
|
|
newState.inlineOpenKeys = prevStoreState.openKeys;
|
|
|
newStoreState.openKeys = [];
|
|
|
}
|
|
|
|
|
|
if (!nextProps.inlineCollapsed && prevProps.inlineCollapsed || !nextProps.siderCollapsed && prevProps.siderCollapsed) {
|
|
|
newStoreState.openKeys = prevState.inlineOpenKeys;
|
|
|
newState.inlineOpenKeys = [];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (Object.keys(newStoreState).length) {
|
|
|
store.setState(newStoreState);
|
|
|
}
|
|
|
|
|
|
return newState;
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return Menu;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
Menu_Menu.defaultProps = {
|
|
|
selectable: true,
|
|
|
onClick: noop,
|
|
|
onSelect: noop,
|
|
|
onOpenChange: noop,
|
|
|
onDeselect: noop,
|
|
|
defaultSelectedKeys: [],
|
|
|
defaultOpenKeys: [],
|
|
|
subMenuOpenDelay: 0.1,
|
|
|
subMenuCloseDelay: 0.1,
|
|
|
triggerSubMenuAction: 'hover',
|
|
|
prefixCls: 'rc-menu',
|
|
|
className: '',
|
|
|
mode: 'vertical',
|
|
|
style: {},
|
|
|
builtinPlacements: {},
|
|
|
overflowedIndicator: /*#__PURE__*/external_window_React_["createElement"]("span", null, "\xB7\xB7\xB7")
|
|
|
};
|
|
|
/* harmony default export */ var es_Menu = (Menu_Menu);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/MenuItem.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MenuItem_MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(MenuItem, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(MenuItem);
|
|
|
|
|
|
function MenuItem() {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, MenuItem);
|
|
|
|
|
|
_this = _super.apply(this, arguments);
|
|
|
|
|
|
_this.onKeyDown = function (e) {
|
|
|
var keyCode = e.keyCode;
|
|
|
|
|
|
if (keyCode === KeyCode["a" /* default */].ENTER) {
|
|
|
_this.onClick(e);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return undefined;
|
|
|
};
|
|
|
|
|
|
_this.onMouseLeave = function (e) {
|
|
|
var _this$props = _this.props,
|
|
|
eventKey = _this$props.eventKey,
|
|
|
onItemHover = _this$props.onItemHover,
|
|
|
onMouseLeave = _this$props.onMouseLeave;
|
|
|
onItemHover({
|
|
|
key: eventKey,
|
|
|
hover: false
|
|
|
});
|
|
|
onMouseLeave({
|
|
|
key: eventKey,
|
|
|
domEvent: e
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.onMouseEnter = function (e) {
|
|
|
var _this$props2 = _this.props,
|
|
|
eventKey = _this$props2.eventKey,
|
|
|
onItemHover = _this$props2.onItemHover,
|
|
|
onMouseEnter = _this$props2.onMouseEnter;
|
|
|
onItemHover({
|
|
|
key: eventKey,
|
|
|
hover: true
|
|
|
});
|
|
|
onMouseEnter({
|
|
|
key: eventKey,
|
|
|
domEvent: e
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_this.onClick = function (e) {
|
|
|
var _this$props3 = _this.props,
|
|
|
eventKey = _this$props3.eventKey,
|
|
|
multiple = _this$props3.multiple,
|
|
|
onClick = _this$props3.onClick,
|
|
|
onSelect = _this$props3.onSelect,
|
|
|
onDeselect = _this$props3.onDeselect,
|
|
|
isSelected = _this$props3.isSelected;
|
|
|
var info = {
|
|
|
key: eventKey,
|
|
|
keyPath: [eventKey],
|
|
|
item: Object(assertThisInitialized["a" /* default */])(_this),
|
|
|
domEvent: e
|
|
|
};
|
|
|
onClick(info);
|
|
|
|
|
|
if (multiple) {
|
|
|
if (isSelected) {
|
|
|
onDeselect(info);
|
|
|
} else {
|
|
|
onSelect(info);
|
|
|
}
|
|
|
} else if (!isSelected) {
|
|
|
onSelect(info);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.saveNode = function (node) {
|
|
|
_this.node = node;
|
|
|
};
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(MenuItem, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
// invoke customized ref to expose component to mixin
|
|
|
this.callRef();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate() {
|
|
|
this.callRef();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
var props = this.props;
|
|
|
|
|
|
if (props.onDestroy) {
|
|
|
props.onDestroy(props.eventKey);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "getPrefixCls",
|
|
|
value: function getPrefixCls() {
|
|
|
return "".concat(this.props.rootPrefixCls, "-item");
|
|
|
}
|
|
|
}, {
|
|
|
key: "getActiveClassName",
|
|
|
value: function getActiveClassName() {
|
|
|
return "".concat(this.getPrefixCls(), "-active");
|
|
|
}
|
|
|
}, {
|
|
|
key: "getSelectedClassName",
|
|
|
value: function getSelectedClassName() {
|
|
|
return "".concat(this.getPrefixCls(), "-selected");
|
|
|
}
|
|
|
}, {
|
|
|
key: "getDisabledClassName",
|
|
|
value: function getDisabledClassName() {
|
|
|
return "".concat(this.getPrefixCls(), "-disabled");
|
|
|
}
|
|
|
}, {
|
|
|
key: "callRef",
|
|
|
value: function callRef() {
|
|
|
if (this.props.manualRef) {
|
|
|
this.props.manualRef(this);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _classNames;
|
|
|
|
|
|
var props = Object(objectSpread2["a" /* default */])({}, this.props);
|
|
|
|
|
|
var className = classnames_default()(this.getPrefixCls(), props.className, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, this.getActiveClassName(), !props.disabled && props.active), Object(defineProperty["a" /* default */])(_classNames, this.getSelectedClassName(), props.isSelected), Object(defineProperty["a" /* default */])(_classNames, this.getDisabledClassName(), props.disabled), _classNames));
|
|
|
|
|
|
var attrs = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props.attribute), {}, {
|
|
|
title: typeof props.title === 'string' ? props.title : undefined,
|
|
|
className: className,
|
|
|
// set to menuitem by default
|
|
|
role: props.role || 'menuitem',
|
|
|
'aria-disabled': props.disabled
|
|
|
});
|
|
|
|
|
|
if (props.role === 'option') {
|
|
|
// overwrite to option
|
|
|
attrs = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, attrs), {}, {
|
|
|
role: 'option',
|
|
|
'aria-selected': props.isSelected
|
|
|
});
|
|
|
} else if (props.role === null || props.role === 'none') {
|
|
|
// sometimes we want to specify role inside <li/> element
|
|
|
// <li><a role='menuitem'>Link</a></li> would be a good example
|
|
|
// in this case the role on <li/> should be "none" to
|
|
|
// remove the implied listitem role.
|
|
|
// https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html
|
|
|
attrs.role = 'none';
|
|
|
} // In case that onClick/onMouseLeave/onMouseEnter is passed down from owner
|
|
|
|
|
|
|
|
|
var mouseEvent = {
|
|
|
onClick: props.disabled ? null : this.onClick,
|
|
|
onMouseLeave: props.disabled ? null : this.onMouseLeave,
|
|
|
onMouseEnter: props.disabled ? null : this.onMouseEnter
|
|
|
};
|
|
|
|
|
|
var style = Object(objectSpread2["a" /* default */])({}, props.style);
|
|
|
|
|
|
if (props.mode === 'inline') {
|
|
|
if (props.direction === 'rtl') {
|
|
|
style.paddingRight = props.inlineIndent * props.level;
|
|
|
} else {
|
|
|
style.paddingLeft = props.inlineIndent * props.level;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
menuAllProps.forEach(function (key) {
|
|
|
return delete props[key];
|
|
|
});
|
|
|
delete props.direction;
|
|
|
var icon = this.props.itemIcon;
|
|
|
|
|
|
if (typeof this.props.itemIcon === 'function') {
|
|
|
// TODO: This is a bug which should fixed after TS refactor
|
|
|
icon = /*#__PURE__*/external_window_React_["createElement"](this.props.itemIcon, this.props);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("li", Object(esm_extends["a" /* default */])({}, Object(omit["a" /* default */])(props, ['onClick', 'onMouseEnter', 'onMouseLeave', 'onSelect']), attrs, mouseEvent, {
|
|
|
style: style,
|
|
|
ref: this.saveNode
|
|
|
}), props.children, icon);
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return MenuItem;
|
|
|
}(external_window_React_["Component"]);
|
|
|
MenuItem_MenuItem.isMenuItem = true;
|
|
|
MenuItem_MenuItem.defaultProps = {
|
|
|
onSelect: noop,
|
|
|
onMouseEnter: noop,
|
|
|
onMouseLeave: noop,
|
|
|
manualRef: noop
|
|
|
};
|
|
|
var MenuItem_connected = Object(esm["b" /* connect */])(function (_ref, _ref2) {
|
|
|
var activeKey = _ref.activeKey,
|
|
|
selectedKeys = _ref.selectedKeys;
|
|
|
var eventKey = _ref2.eventKey,
|
|
|
subMenuKey = _ref2.subMenuKey;
|
|
|
return {
|
|
|
active: activeKey[subMenuKey] === eventKey,
|
|
|
// selectedKeys should be array in any circumstance
|
|
|
// when it is not, we have fallback logic for https://github.com/ant-design/ant-design/issues/29430
|
|
|
isSelected: Array.isArray(selectedKeys) ? selectedKeys.indexOf(eventKey) !== -1 : selectedKeys === eventKey
|
|
|
};
|
|
|
})(MenuItem_MenuItem);
|
|
|
/* harmony default export */ var es_MenuItem = (MenuItem_connected);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/MenuItemGroup.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MenuItemGroup_MenuItemGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(inherits["a" /* default */])(MenuItemGroup, _React$Component);
|
|
|
|
|
|
var _super = Object(createSuper["a" /* default */])(MenuItemGroup);
|
|
|
|
|
|
function MenuItemGroup() {
|
|
|
var _this;
|
|
|
|
|
|
Object(classCallCheck["a" /* default */])(this, MenuItemGroup);
|
|
|
|
|
|
_this = _super.apply(this, arguments);
|
|
|
|
|
|
_this.renderInnerMenuItem = function (item) {
|
|
|
var _this$props = _this.props,
|
|
|
renderMenuItem = _this$props.renderMenuItem,
|
|
|
index = _this$props.index;
|
|
|
return renderMenuItem(item, index, _this.props.subMenuKey);
|
|
|
};
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(createClass["a" /* default */])(MenuItemGroup, [{
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var props = Object(esm_extends["a" /* default */])({}, this.props);
|
|
|
|
|
|
var _props$className = props.className,
|
|
|
className = _props$className === void 0 ? '' : _props$className,
|
|
|
rootPrefixCls = props.rootPrefixCls;
|
|
|
var titleClassName = "".concat(rootPrefixCls, "-item-group-title");
|
|
|
var listClassName = "".concat(rootPrefixCls, "-item-group-list");
|
|
|
var title = props.title,
|
|
|
children = props.children;
|
|
|
menuAllProps.forEach(function (key) {
|
|
|
return delete props[key];
|
|
|
});
|
|
|
delete props.direction;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("li", Object(esm_extends["a" /* default */])({}, props, {
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
},
|
|
|
className: "".concat(className, " ").concat(rootPrefixCls, "-item-group")
|
|
|
}), /*#__PURE__*/external_window_React_["createElement"]("div", {
|
|
|
className: titleClassName,
|
|
|
title: typeof title === 'string' ? title : undefined
|
|
|
}, title), /*#__PURE__*/external_window_React_["createElement"]("ul", {
|
|
|
className: listClassName
|
|
|
}, external_window_React_["Children"].map(children, this.renderInnerMenuItem)));
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return MenuItemGroup;
|
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
MenuItemGroup_MenuItemGroup.isMenuItemGroup = true;
|
|
|
MenuItemGroup_MenuItemGroup.defaultProps = {
|
|
|
disabled: true
|
|
|
};
|
|
|
/* harmony default export */ var es_MenuItemGroup = (MenuItemGroup_MenuItemGroup);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/Divider.js
|
|
|
|
|
|
|
|
|
var Divider_Divider = function Divider(_ref) {
|
|
|
var className = _ref.className,
|
|
|
rootPrefixCls = _ref.rootPrefixCls,
|
|
|
style = _ref.style;
|
|
|
return /*#__PURE__*/external_window_React_["createElement"]("li", {
|
|
|
className: "".concat(className, " ").concat(rootPrefixCls, "-item-divider"),
|
|
|
style: style
|
|
|
});
|
|
|
};
|
|
|
|
|
|
Divider_Divider.defaultProps = {
|
|
|
// To fix keyboard UX.
|
|
|
disabled: true,
|
|
|
className: '',
|
|
|
style: {}
|
|
|
};
|
|
|
/* harmony default export */ var es_Divider = (Divider_Divider);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_menu_es = (es_Menu);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-dropdown/es/index.js + 2 modules
|
|
|
var rc_dropdown_es = __webpack_require__("eDIo");
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/AddButton.js
|
|
|
|
|
|
|
|
|
function AddButton(_ref, ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
editable = _ref.editable,
|
|
|
locale = _ref.locale,
|
|
|
style = _ref.style;
|
|
|
|
|
|
if (!editable || editable.showAdd === false) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
return external_window_React_["createElement"]("button", {
|
|
|
ref: ref,
|
|
|
type: "button",
|
|
|
className: "".concat(prefixCls, "-nav-add"),
|
|
|
style: style,
|
|
|
"aria-label": (locale === null || locale === void 0 ? void 0 : locale.addAriaLabel) || 'Add tab',
|
|
|
onClick: function onClick(event) {
|
|
|
editable.onEdit('add', {
|
|
|
event: event
|
|
|
});
|
|
|
}
|
|
|
}, editable.addIcon || '+');
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var TabNavList_AddButton = (external_window_React_["forwardRef"](AddButton));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/OperationNode.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function OperationNode(_ref, ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
id = _ref.id,
|
|
|
tabs = _ref.tabs,
|
|
|
locale = _ref.locale,
|
|
|
mobile = _ref.mobile,
|
|
|
_ref$moreIcon = _ref.moreIcon,
|
|
|
moreIcon = _ref$moreIcon === void 0 ? 'More' : _ref$moreIcon,
|
|
|
moreTransitionName = _ref.moreTransitionName,
|
|
|
style = _ref.style,
|
|
|
className = _ref.className,
|
|
|
editable = _ref.editable,
|
|
|
tabBarGutter = _ref.tabBarGutter,
|
|
|
rtl = _ref.rtl,
|
|
|
onTabClick = _ref.onTabClick;
|
|
|
|
|
|
// ======================== Dropdown ========================
|
|
|
var _useState = Object(external_window_React_["useState"])(false),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
open = _useState2[0],
|
|
|
setOpen = _useState2[1];
|
|
|
|
|
|
var _useState3 = Object(external_window_React_["useState"])(null),
|
|
|
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
|
|
selectedKey = _useState4[0],
|
|
|
setSelectedKey = _useState4[1];
|
|
|
|
|
|
var popupId = "".concat(id, "-more-popup");
|
|
|
var dropdownPrefix = "".concat(prefixCls, "-dropdown");
|
|
|
var selectedItemId = selectedKey !== null ? "".concat(popupId, "-").concat(selectedKey) : null;
|
|
|
var dropdownAriaLabel = locale === null || locale === void 0 ? void 0 : locale.dropdownAriaLabel;
|
|
|
var menu = external_window_React_["createElement"](rc_menu_es, {
|
|
|
onClick: function onClick(_ref2) {
|
|
|
var key = _ref2.key,
|
|
|
domEvent = _ref2.domEvent;
|
|
|
onTabClick(key, domEvent);
|
|
|
setOpen(false);
|
|
|
},
|
|
|
id: popupId,
|
|
|
tabIndex: -1,
|
|
|
role: "listbox",
|
|
|
"aria-activedescendant": selectedItemId,
|
|
|
selectedKeys: [selectedKey],
|
|
|
"aria-label": dropdownAriaLabel !== undefined ? dropdownAriaLabel : 'expanded dropdown'
|
|
|
}, tabs.map(function (tab) {
|
|
|
return external_window_React_["createElement"](es_MenuItem, {
|
|
|
key: tab.key,
|
|
|
id: "".concat(popupId, "-").concat(tab.key),
|
|
|
role: "option",
|
|
|
"aria-controls": id && "".concat(id, "-panel-").concat(tab.key),
|
|
|
disabled: tab.disabled
|
|
|
}, tab.tab);
|
|
|
}));
|
|
|
|
|
|
function selectOffset(offset) {
|
|
|
var enabledTabs = tabs.filter(function (tab) {
|
|
|
return !tab.disabled;
|
|
|
});
|
|
|
var selectedIndex = enabledTabs.findIndex(function (tab) {
|
|
|
return tab.key === selectedKey;
|
|
|
}) || 0;
|
|
|
var len = enabledTabs.length;
|
|
|
|
|
|
for (var i = 0; i < len; i += 1) {
|
|
|
selectedIndex = (selectedIndex + offset + len) % len;
|
|
|
var tab = enabledTabs[selectedIndex];
|
|
|
|
|
|
if (!tab.disabled) {
|
|
|
setSelectedKey(tab.key);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function onKeyDown(e) {
|
|
|
var which = e.which;
|
|
|
|
|
|
if (!open) {
|
|
|
if ([KeyCode["a" /* default */].DOWN, KeyCode["a" /* default */].SPACE, KeyCode["a" /* default */].ENTER].includes(which)) {
|
|
|
setOpen(true);
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
switch (which) {
|
|
|
case KeyCode["a" /* default */].UP:
|
|
|
selectOffset(-1);
|
|
|
e.preventDefault();
|
|
|
break;
|
|
|
|
|
|
case KeyCode["a" /* default */].DOWN:
|
|
|
selectOffset(1);
|
|
|
e.preventDefault();
|
|
|
break;
|
|
|
|
|
|
case KeyCode["a" /* default */].ESC:
|
|
|
setOpen(false);
|
|
|
break;
|
|
|
|
|
|
case KeyCode["a" /* default */].SPACE:
|
|
|
case KeyCode["a" /* default */].ENTER:
|
|
|
if (selectedKey !== null) onTabClick(selectedKey, e);
|
|
|
break;
|
|
|
}
|
|
|
} // ========================= Effect =========================
|
|
|
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
// We use query element here to avoid React strict warning
|
|
|
var ele = document.getElementById(selectedItemId);
|
|
|
|
|
|
if (ele && ele.scrollIntoView) {
|
|
|
ele.scrollIntoView(false);
|
|
|
}
|
|
|
}, [selectedKey]);
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
if (!open) {
|
|
|
setSelectedKey(null);
|
|
|
}
|
|
|
}, [open]); // ========================= Render =========================
|
|
|
|
|
|
var moreStyle = Object(defineProperty["a" /* default */])({}, rtl ? 'marginLeft' : 'marginRight', tabBarGutter);
|
|
|
|
|
|
if (!tabs.length) {
|
|
|
moreStyle.visibility = 'hidden';
|
|
|
moreStyle.order = 1;
|
|
|
}
|
|
|
|
|
|
var overlayClassName = classnames_default()(Object(defineProperty["a" /* default */])({}, "".concat(dropdownPrefix, "-rtl"), rtl));
|
|
|
var moreNode = mobile ? null : external_window_React_["createElement"](rc_dropdown_es["a" /* default */], {
|
|
|
prefixCls: dropdownPrefix,
|
|
|
overlay: menu,
|
|
|
trigger: ['hover'],
|
|
|
visible: open,
|
|
|
transitionName: moreTransitionName,
|
|
|
onVisibleChange: setOpen,
|
|
|
overlayClassName: overlayClassName,
|
|
|
mouseEnterDelay: 0.1,
|
|
|
mouseLeaveDelay: 0.1
|
|
|
}, external_window_React_["createElement"]("button", {
|
|
|
type: "button",
|
|
|
className: "".concat(prefixCls, "-nav-more"),
|
|
|
style: moreStyle,
|
|
|
tabIndex: -1,
|
|
|
"aria-hidden": "true",
|
|
|
"aria-haspopup": "listbox",
|
|
|
"aria-controls": popupId,
|
|
|
id: "".concat(id, "-more"),
|
|
|
"aria-expanded": open,
|
|
|
onKeyDown: onKeyDown
|
|
|
}, moreIcon));
|
|
|
return external_window_React_["createElement"]("div", {
|
|
|
className: classnames_default()("".concat(prefixCls, "-nav-operations"), className),
|
|
|
style: style,
|
|
|
ref: ref
|
|
|
}, moreNode, external_window_React_["createElement"](TabNavList_AddButton, {
|
|
|
prefixCls: prefixCls,
|
|
|
locale: locale,
|
|
|
editable: editable
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var TabNavList_OperationNode = (external_window_React_["forwardRef"](OperationNode));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabContext.js
|
|
|
|
|
|
/* harmony default export */ var TabContext = (Object(external_window_React_["createContext"])(null));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useTouchMove.js
|
|
|
|
|
|
|
|
|
|
|
|
var MIN_SWIPE_DISTANCE = 0.1;
|
|
|
var STOP_SWIPE_DISTANCE = 0.01;
|
|
|
var REFRESH_INTERVAL = 20;
|
|
|
var SPEED_OFF_MULTIPLE = Math.pow(0.995, REFRESH_INTERVAL); // ========================= Check if is a mobile =========================
|
|
|
|
|
|
function useTouchMove_isMobile() {
|
|
|
var agent = navigator.userAgent || navigator.vendor || window.opera;
|
|
|
|
|
|
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent.substr(0, 4))) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
} // ================================= Hook =================================
|
|
|
|
|
|
function useTouchMove(ref, onOffset) {
|
|
|
var _useState = Object(external_window_React_["useState"])(),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
touchPosition = _useState2[0],
|
|
|
setTouchPosition = _useState2[1];
|
|
|
|
|
|
var _useState3 = Object(external_window_React_["useState"])(0),
|
|
|
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
|
|
lastTimestamp = _useState4[0],
|
|
|
setLastTimestamp = _useState4[1];
|
|
|
|
|
|
var _useState5 = Object(external_window_React_["useState"])(0),
|
|
|
_useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2),
|
|
|
lastTimeDiff = _useState6[0],
|
|
|
setLastTimeDiff = _useState6[1];
|
|
|
|
|
|
var _useState7 = Object(external_window_React_["useState"])(),
|
|
|
_useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2),
|
|
|
lastOffset = _useState8[0],
|
|
|
setLastOffset = _useState8[1];
|
|
|
|
|
|
var motionRef = Object(external_window_React_["useRef"])(); // ========================= Events =========================
|
|
|
// >>> Touch events
|
|
|
|
|
|
function onTouchStart(e) {
|
|
|
var _e$touches$ = e.touches[0],
|
|
|
screenX = _e$touches$.screenX,
|
|
|
screenY = _e$touches$.screenY;
|
|
|
setTouchPosition({
|
|
|
x: screenX,
|
|
|
y: screenY
|
|
|
});
|
|
|
window.clearInterval(motionRef.current);
|
|
|
}
|
|
|
|
|
|
function onTouchMove(e) {
|
|
|
if (!touchPosition) return;
|
|
|
e.preventDefault();
|
|
|
var _e$touches$2 = e.touches[0],
|
|
|
screenX = _e$touches$2.screenX,
|
|
|
screenY = _e$touches$2.screenY;
|
|
|
setTouchPosition({
|
|
|
x: screenX,
|
|
|
y: screenY
|
|
|
});
|
|
|
var offsetX = screenX - touchPosition.x;
|
|
|
var offsetY = screenY - touchPosition.y;
|
|
|
onOffset(offsetX, offsetY);
|
|
|
var now = Date.now();
|
|
|
setLastTimestamp(now);
|
|
|
setLastTimeDiff(now - lastTimestamp);
|
|
|
setLastOffset({
|
|
|
x: offsetX,
|
|
|
y: offsetY
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function onTouchEnd() {
|
|
|
if (!touchPosition) return;
|
|
|
setTouchPosition(null);
|
|
|
setLastOffset(null); // Swipe if needed
|
|
|
|
|
|
if (lastOffset) {
|
|
|
var distanceX = lastOffset.x / lastTimeDiff;
|
|
|
var distanceY = lastOffset.y / lastTimeDiff;
|
|
|
var absX = Math.abs(distanceX);
|
|
|
var absY = Math.abs(distanceY); // Skip swipe if low distance
|
|
|
|
|
|
if (Math.max(absX, absY) < MIN_SWIPE_DISTANCE) return;
|
|
|
var currentX = distanceX;
|
|
|
var currentY = distanceY;
|
|
|
motionRef.current = window.setInterval(function () {
|
|
|
if (Math.abs(currentX) < STOP_SWIPE_DISTANCE && Math.abs(currentY) < STOP_SWIPE_DISTANCE) {
|
|
|
window.clearInterval(motionRef.current);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
currentX *= SPEED_OFF_MULTIPLE;
|
|
|
currentY *= SPEED_OFF_MULTIPLE;
|
|
|
onOffset(currentX * REFRESH_INTERVAL, currentY * REFRESH_INTERVAL);
|
|
|
}, REFRESH_INTERVAL);
|
|
|
}
|
|
|
} // >>> Wheel event
|
|
|
|
|
|
|
|
|
var lastWheelTimestampRef = Object(external_window_React_["useRef"])(0);
|
|
|
var lastWheelPreventRef = Object(external_window_React_["useRef"])(false);
|
|
|
var lastWheelDirectionRef = Object(external_window_React_["useRef"])();
|
|
|
|
|
|
function onWheel(e) {
|
|
|
var deltaX = e.deltaX,
|
|
|
deltaY = e.deltaY; // Convert both to x & y since wheel only happened on PC
|
|
|
|
|
|
var mixed = 0;
|
|
|
var absX = Math.abs(deltaX);
|
|
|
var absY = Math.abs(deltaY);
|
|
|
|
|
|
if (absX === absY) {
|
|
|
mixed = lastWheelDirectionRef.current === 'x' ? deltaX : deltaY;
|
|
|
} else if (absX > absY) {
|
|
|
mixed = deltaX;
|
|
|
lastWheelDirectionRef.current = 'x';
|
|
|
} else {
|
|
|
mixed = deltaY;
|
|
|
lastWheelDirectionRef.current = 'y';
|
|
|
} // Optimize mac touch scroll
|
|
|
|
|
|
|
|
|
var now = Date.now();
|
|
|
|
|
|
if (now - lastWheelTimestampRef.current > 100) {
|
|
|
lastWheelPreventRef.current = false;
|
|
|
}
|
|
|
|
|
|
if (onOffset(-mixed, -mixed) || lastWheelPreventRef.current) {
|
|
|
e.preventDefault();
|
|
|
lastWheelPreventRef.current = true;
|
|
|
}
|
|
|
|
|
|
lastWheelTimestampRef.current = now;
|
|
|
} // ========================= Effect =========================
|
|
|
|
|
|
|
|
|
var touchEventsRef = Object(external_window_React_["useRef"])(null);
|
|
|
touchEventsRef.current = {
|
|
|
onTouchStart: onTouchStart,
|
|
|
onTouchMove: onTouchMove,
|
|
|
onTouchEnd: onTouchEnd,
|
|
|
onWheel: onWheel
|
|
|
};
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
function onProxyTouchStart(e) {
|
|
|
touchEventsRef.current.onTouchStart(e);
|
|
|
}
|
|
|
|
|
|
function onProxyTouchMove(e) {
|
|
|
touchEventsRef.current.onTouchMove(e);
|
|
|
}
|
|
|
|
|
|
function onProxyTouchEnd(e) {
|
|
|
touchEventsRef.current.onTouchEnd(e);
|
|
|
}
|
|
|
|
|
|
function onProxyWheel(e) {
|
|
|
touchEventsRef.current.onWheel(e);
|
|
|
}
|
|
|
|
|
|
document.addEventListener('touchmove', onProxyTouchMove, {
|
|
|
passive: false
|
|
|
});
|
|
|
document.addEventListener('touchend', onProxyTouchEnd, {
|
|
|
passive: false
|
|
|
}); // No need to clean up since element removed
|
|
|
|
|
|
ref.current.addEventListener('touchstart', onProxyTouchStart, {
|
|
|
passive: false
|
|
|
});
|
|
|
ref.current.addEventListener('wheel', onProxyWheel);
|
|
|
return function () {
|
|
|
document.removeEventListener('touchmove', onProxyTouchMove);
|
|
|
document.removeEventListener('touchend', onProxyTouchEnd);
|
|
|
};
|
|
|
}, []);
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useRefs.js
|
|
|
|
|
|
|
|
|
function useRefs() {
|
|
|
var cacheRefs = Object(external_window_React_["useRef"])(new Map());
|
|
|
|
|
|
function getRef(key) {
|
|
|
if (!cacheRefs.current.has(key)) {
|
|
|
cacheRefs.current.set(key, external_window_React_["createRef"]());
|
|
|
}
|
|
|
|
|
|
return cacheRefs.current.get(key);
|
|
|
}
|
|
|
|
|
|
function removeRef(key) {
|
|
|
cacheRefs.current.delete(key);
|
|
|
}
|
|
|
|
|
|
return [getRef, removeRef];
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useSyncState.js
|
|
|
|
|
|
|
|
|
function useSyncState(defaultState, onChange) {
|
|
|
var stateRef = external_window_React_["useRef"](defaultState);
|
|
|
|
|
|
var _React$useState = external_window_React_["useState"]({}),
|
|
|
_React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2),
|
|
|
forceUpdate = _React$useState2[1];
|
|
|
|
|
|
function setState(updater) {
|
|
|
var newValue = typeof updater === 'function' ? updater(stateRef.current) : updater;
|
|
|
|
|
|
if (newValue !== stateRef.current) {
|
|
|
onChange(newValue, stateRef.current);
|
|
|
}
|
|
|
|
|
|
stateRef.current = newValue;
|
|
|
forceUpdate({});
|
|
|
}
|
|
|
|
|
|
return [stateRef.current, setState];
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabNavList_ExtraContent = function ExtraContent(_ref) {
|
|
|
var position = _ref.position,
|
|
|
prefixCls = _ref.prefixCls,
|
|
|
extra = _ref.extra;
|
|
|
if (!extra) return null;
|
|
|
var content;
|
|
|
var assertExtra = extra;
|
|
|
|
|
|
if (position === 'right') {
|
|
|
content = assertExtra.right || !assertExtra.left && assertExtra || null;
|
|
|
}
|
|
|
|
|
|
if (position === 'left') {
|
|
|
content = assertExtra.left || null;
|
|
|
}
|
|
|
|
|
|
return content ? external_window_React_["createElement"]("div", {
|
|
|
className: "".concat(prefixCls, "-extra-content")
|
|
|
}, content) : null;
|
|
|
};
|
|
|
|
|
|
function TabNavList(props, ref) {
|
|
|
var _classNames;
|
|
|
|
|
|
var _React$useContext = external_window_React_["useContext"](TabContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
tabs = _React$useContext.tabs;
|
|
|
|
|
|
var className = props.className,
|
|
|
style = props.style,
|
|
|
id = props.id,
|
|
|
animated = props.animated,
|
|
|
activeKey = props.activeKey,
|
|
|
rtl = props.rtl,
|
|
|
extra = props.extra,
|
|
|
editable = props.editable,
|
|
|
locale = props.locale,
|
|
|
tabPosition = props.tabPosition,
|
|
|
tabBarGutter = props.tabBarGutter,
|
|
|
children = props.children,
|
|
|
onTabClick = props.onTabClick,
|
|
|
onTabScroll = props.onTabScroll;
|
|
|
var tabsWrapperRef = Object(external_window_React_["useRef"])();
|
|
|
var tabListRef = Object(external_window_React_["useRef"])();
|
|
|
var operationsRef = Object(external_window_React_["useRef"])();
|
|
|
var innerAddButtonRef = Object(external_window_React_["useRef"])();
|
|
|
|
|
|
var _useRefs = useRefs(),
|
|
|
_useRefs2 = Object(slicedToArray["a" /* default */])(_useRefs, 2),
|
|
|
getBtnRef = _useRefs2[0],
|
|
|
removeBtnRef = _useRefs2[1];
|
|
|
|
|
|
var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';
|
|
|
|
|
|
var _useSyncState = useSyncState(0, function (next, prev) {
|
|
|
if (tabPositionTopOrBottom && onTabScroll) {
|
|
|
onTabScroll({
|
|
|
direction: next > prev ? 'left' : 'right'
|
|
|
});
|
|
|
}
|
|
|
}),
|
|
|
_useSyncState2 = Object(slicedToArray["a" /* default */])(_useSyncState, 2),
|
|
|
transformLeft = _useSyncState2[0],
|
|
|
setTransformLeft = _useSyncState2[1];
|
|
|
|
|
|
var _useSyncState3 = useSyncState(0, function (next, prev) {
|
|
|
if (!tabPositionTopOrBottom && onTabScroll) {
|
|
|
onTabScroll({
|
|
|
direction: next > prev ? 'top' : 'bottom'
|
|
|
});
|
|
|
}
|
|
|
}),
|
|
|
_useSyncState4 = Object(slicedToArray["a" /* default */])(_useSyncState3, 2),
|
|
|
transformTop = _useSyncState4[0],
|
|
|
setTransformTop = _useSyncState4[1];
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])(0),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
wrapperScrollWidth = _useState2[0],
|
|
|
setWrapperScrollWidth = _useState2[1];
|
|
|
|
|
|
var _useState3 = Object(external_window_React_["useState"])(0),
|
|
|
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
|
|
wrapperScrollHeight = _useState4[0],
|
|
|
setWrapperScrollHeight = _useState4[1];
|
|
|
|
|
|
var _useState5 = Object(external_window_React_["useState"])(0),
|
|
|
_useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2),
|
|
|
wrapperContentWidth = _useState6[0],
|
|
|
setWrapperContentWidth = _useState6[1];
|
|
|
|
|
|
var _useState7 = Object(external_window_React_["useState"])(0),
|
|
|
_useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2),
|
|
|
wrapperContentHeight = _useState8[0],
|
|
|
setWrapperContentHeight = _useState8[1];
|
|
|
|
|
|
var _useState9 = Object(external_window_React_["useState"])(null),
|
|
|
_useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2),
|
|
|
wrapperWidth = _useState10[0],
|
|
|
setWrapperWidth = _useState10[1];
|
|
|
|
|
|
var _useState11 = Object(external_window_React_["useState"])(null),
|
|
|
_useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2),
|
|
|
wrapperHeight = _useState12[0],
|
|
|
setWrapperHeight = _useState12[1];
|
|
|
|
|
|
var _useState13 = Object(external_window_React_["useState"])(0),
|
|
|
_useState14 = Object(slicedToArray["a" /* default */])(_useState13, 2),
|
|
|
addWidth = _useState14[0],
|
|
|
setAddWidth = _useState14[1];
|
|
|
|
|
|
var _useState15 = Object(external_window_React_["useState"])(0),
|
|
|
_useState16 = Object(slicedToArray["a" /* default */])(_useState15, 2),
|
|
|
addHeight = _useState16[0],
|
|
|
setAddHeight = _useState16[1];
|
|
|
|
|
|
var _useRafState = useRafState(new Map()),
|
|
|
_useRafState2 = Object(slicedToArray["a" /* default */])(_useRafState, 2),
|
|
|
tabSizes = _useRafState2[0],
|
|
|
setTabSizes = _useRafState2[1];
|
|
|
|
|
|
var tabOffsets = useOffsets(tabs, tabSizes, wrapperScrollWidth); // ========================== Util =========================
|
|
|
|
|
|
var operationsHiddenClassName = "".concat(prefixCls, "-nav-operations-hidden");
|
|
|
var transformMin = 0;
|
|
|
var transformMax = 0;
|
|
|
|
|
|
if (!tabPositionTopOrBottom) {
|
|
|
transformMin = Math.min(0, wrapperHeight - wrapperScrollHeight);
|
|
|
transformMax = 0;
|
|
|
} else if (rtl) {
|
|
|
transformMin = 0;
|
|
|
transformMax = Math.max(0, wrapperScrollWidth - wrapperWidth);
|
|
|
} else {
|
|
|
transformMin = Math.min(0, wrapperWidth - wrapperScrollWidth);
|
|
|
transformMax = 0;
|
|
|
}
|
|
|
|
|
|
function alignInRange(value) {
|
|
|
if (value < transformMin) {
|
|
|
return [transformMin, false];
|
|
|
}
|
|
|
|
|
|
if (value > transformMax) {
|
|
|
return [transformMax, false];
|
|
|
}
|
|
|
|
|
|
return [value, true];
|
|
|
} // ========================= Mobile ========================
|
|
|
|
|
|
|
|
|
var touchMovingRef = Object(external_window_React_["useRef"])();
|
|
|
|
|
|
var _useState17 = Object(external_window_React_["useState"])(),
|
|
|
_useState18 = Object(slicedToArray["a" /* default */])(_useState17, 2),
|
|
|
lockAnimation = _useState18[0],
|
|
|
setLockAnimation = _useState18[1];
|
|
|
|
|
|
function doLockAnimation() {
|
|
|
setLockAnimation(Date.now());
|
|
|
}
|
|
|
|
|
|
function clearTouchMoving() {
|
|
|
window.clearTimeout(touchMovingRef.current);
|
|
|
}
|
|
|
|
|
|
useTouchMove(tabsWrapperRef, function (offsetX, offsetY) {
|
|
|
var preventDefault = false;
|
|
|
|
|
|
function doMove(setState, offset) {
|
|
|
setState(function (value) {
|
|
|
var _alignInRange = alignInRange(value + offset),
|
|
|
_alignInRange2 = Object(slicedToArray["a" /* default */])(_alignInRange, 2),
|
|
|
newValue = _alignInRange2[0],
|
|
|
needPrevent = _alignInRange2[1];
|
|
|
|
|
|
preventDefault = needPrevent;
|
|
|
return newValue;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (tabPositionTopOrBottom) {
|
|
|
// Skip scroll if place is enough
|
|
|
if (wrapperWidth >= wrapperScrollWidth) {
|
|
|
return preventDefault;
|
|
|
}
|
|
|
|
|
|
doMove(setTransformLeft, offsetX);
|
|
|
} else {
|
|
|
if (wrapperHeight >= wrapperScrollHeight) {
|
|
|
return preventDefault;
|
|
|
}
|
|
|
|
|
|
doMove(setTransformTop, offsetY);
|
|
|
}
|
|
|
|
|
|
clearTouchMoving();
|
|
|
doLockAnimation();
|
|
|
return preventDefault;
|
|
|
});
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
clearTouchMoving();
|
|
|
|
|
|
if (lockAnimation) {
|
|
|
touchMovingRef.current = window.setTimeout(function () {
|
|
|
setLockAnimation(0);
|
|
|
}, 100);
|
|
|
}
|
|
|
|
|
|
return clearTouchMoving;
|
|
|
}, [lockAnimation]); // ========================= Scroll ========================
|
|
|
|
|
|
function scrollToTab() {
|
|
|
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey;
|
|
|
var tabOffset = tabOffsets.get(key);
|
|
|
if (!tabOffset) return;
|
|
|
|
|
|
if (tabPositionTopOrBottom) {
|
|
|
// ============ Align with top & bottom ============
|
|
|
var newTransform = transformLeft; // RTL
|
|
|
|
|
|
if (rtl) {
|
|
|
if (tabOffset.right < transformLeft) {
|
|
|
newTransform = tabOffset.right;
|
|
|
} else if (tabOffset.right + tabOffset.width > transformLeft + wrapperWidth) {
|
|
|
newTransform = tabOffset.right + tabOffset.width - wrapperWidth;
|
|
|
}
|
|
|
} // LTR
|
|
|
else if (tabOffset.left < -transformLeft) {
|
|
|
newTransform = -tabOffset.left;
|
|
|
} else if (tabOffset.left + tabOffset.width > -transformLeft + wrapperWidth) {
|
|
|
newTransform = -(tabOffset.left + tabOffset.width - wrapperWidth);
|
|
|
}
|
|
|
|
|
|
setTransformTop(0);
|
|
|
setTransformLeft(alignInRange(newTransform)[0]);
|
|
|
} else {
|
|
|
// ============ Align with left & right ============
|
|
|
var _newTransform = transformTop;
|
|
|
|
|
|
if (tabOffset.top < -transformTop) {
|
|
|
_newTransform = -tabOffset.top;
|
|
|
} else if (tabOffset.top + tabOffset.height > -transformTop + wrapperHeight) {
|
|
|
_newTransform = -(tabOffset.top + tabOffset.height - wrapperHeight);
|
|
|
}
|
|
|
|
|
|
setTransformLeft(0);
|
|
|
setTransformTop(alignInRange(_newTransform)[0]);
|
|
|
}
|
|
|
} // ========================== Tab ==========================
|
|
|
// Render tab node & collect tab offset
|
|
|
|
|
|
|
|
|
var _useVisibleRange = useVisibleRange(tabOffsets, {
|
|
|
width: wrapperWidth,
|
|
|
height: wrapperHeight,
|
|
|
left: transformLeft,
|
|
|
top: transformTop
|
|
|
}, {
|
|
|
width: wrapperContentWidth,
|
|
|
height: wrapperContentHeight
|
|
|
}, {
|
|
|
width: addWidth,
|
|
|
height: addHeight
|
|
|
}, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props), {}, {
|
|
|
tabs: tabs
|
|
|
})),
|
|
|
_useVisibleRange2 = Object(slicedToArray["a" /* default */])(_useVisibleRange, 2),
|
|
|
visibleStart = _useVisibleRange2[0],
|
|
|
visibleEnd = _useVisibleRange2[1];
|
|
|
|
|
|
var tabNodes = tabs.map(function (tab) {
|
|
|
var key = tab.key;
|
|
|
return external_window_React_["createElement"](TabNavList_TabNode, {
|
|
|
id: id,
|
|
|
prefixCls: prefixCls,
|
|
|
key: key,
|
|
|
rtl: rtl,
|
|
|
tab: tab,
|
|
|
closable: tab.closable,
|
|
|
editable: editable,
|
|
|
active: key === activeKey,
|
|
|
tabPosition: tabPosition,
|
|
|
tabBarGutter: tabBarGutter,
|
|
|
renderWrapper: children,
|
|
|
removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,
|
|
|
ref: getBtnRef(key),
|
|
|
onClick: function onClick(e) {
|
|
|
onTabClick(key, e);
|
|
|
},
|
|
|
onRemove: function onRemove() {
|
|
|
removeBtnRef(key);
|
|
|
},
|
|
|
onFocus: function onFocus() {
|
|
|
scrollToTab(key);
|
|
|
doLockAnimation(); // Focus element will make scrollLeft change which we should reset back
|
|
|
|
|
|
if (!rtl) {
|
|
|
tabsWrapperRef.current.scrollLeft = 0;
|
|
|
}
|
|
|
|
|
|
tabsWrapperRef.current.scrollTop = 0;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
var onListHolderResize = useRaf(function () {
|
|
|
var _tabsWrapperRef$curre, _tabsWrapperRef$curre2, _innerAddButtonRef$cu, _innerAddButtonRef$cu2, _operationsRef$curren, _operationsRef$curren2, _tabListRef$current, _tabListRef$current2, _operationsRef$curren3;
|
|
|
|
|
|
// Update wrapper records
|
|
|
var offsetWidth = ((_tabsWrapperRef$curre = tabsWrapperRef.current) === null || _tabsWrapperRef$curre === void 0 ? void 0 : _tabsWrapperRef$curre.offsetWidth) || 0;
|
|
|
var offsetHeight = ((_tabsWrapperRef$curre2 = tabsWrapperRef.current) === null || _tabsWrapperRef$curre2 === void 0 ? void 0 : _tabsWrapperRef$curre2.offsetHeight) || 0;
|
|
|
var newAddWidth = ((_innerAddButtonRef$cu = innerAddButtonRef.current) === null || _innerAddButtonRef$cu === void 0 ? void 0 : _innerAddButtonRef$cu.offsetWidth) || 0;
|
|
|
var newAddHeight = ((_innerAddButtonRef$cu2 = innerAddButtonRef.current) === null || _innerAddButtonRef$cu2 === void 0 ? void 0 : _innerAddButtonRef$cu2.offsetHeight) || 0;
|
|
|
var newOperationWidth = ((_operationsRef$curren = operationsRef.current) === null || _operationsRef$curren === void 0 ? void 0 : _operationsRef$curren.offsetWidth) || 0;
|
|
|
var newOperationHeight = ((_operationsRef$curren2 = operationsRef.current) === null || _operationsRef$curren2 === void 0 ? void 0 : _operationsRef$curren2.offsetHeight) || 0;
|
|
|
setWrapperWidth(offsetWidth);
|
|
|
setWrapperHeight(offsetHeight);
|
|
|
setAddWidth(newAddWidth);
|
|
|
setAddHeight(newAddHeight);
|
|
|
var newWrapperScrollWidth = (((_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.offsetWidth) || 0) - newAddWidth;
|
|
|
var newWrapperScrollHeight = (((_tabListRef$current2 = tabListRef.current) === null || _tabListRef$current2 === void 0 ? void 0 : _tabListRef$current2.offsetHeight) || 0) - newAddHeight;
|
|
|
setWrapperScrollWidth(newWrapperScrollWidth);
|
|
|
setWrapperScrollHeight(newWrapperScrollHeight);
|
|
|
var isOperationHidden = (_operationsRef$curren3 = operationsRef.current) === null || _operationsRef$curren3 === void 0 ? void 0 : _operationsRef$curren3.className.includes(operationsHiddenClassName);
|
|
|
setWrapperContentWidth(newWrapperScrollWidth - (isOperationHidden ? 0 : newOperationWidth));
|
|
|
setWrapperContentHeight(newWrapperScrollHeight - (isOperationHidden ? 0 : newOperationHeight)); // Update buttons records
|
|
|
|
|
|
setTabSizes(function () {
|
|
|
var newSizes = new Map();
|
|
|
tabs.forEach(function (_ref2) {
|
|
|
var key = _ref2.key;
|
|
|
var btnNode = getBtnRef(key).current;
|
|
|
|
|
|
if (btnNode) {
|
|
|
newSizes.set(key, {
|
|
|
width: btnNode.offsetWidth,
|
|
|
height: btnNode.offsetHeight,
|
|
|
left: btnNode.offsetLeft,
|
|
|
top: btnNode.offsetTop
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
return newSizes;
|
|
|
});
|
|
|
}); // ======================== Dropdown =======================
|
|
|
|
|
|
var startHiddenTabs = tabs.slice(0, visibleStart);
|
|
|
var endHiddenTabs = tabs.slice(visibleEnd + 1);
|
|
|
var hiddenTabs = [].concat(Object(toConsumableArray["a" /* default */])(startHiddenTabs), Object(toConsumableArray["a" /* default */])(endHiddenTabs)); // =================== Link & Operations ===================
|
|
|
|
|
|
var _useState19 = Object(external_window_React_["useState"])(),
|
|
|
_useState20 = Object(slicedToArray["a" /* default */])(_useState19, 2),
|
|
|
inkStyle = _useState20[0],
|
|
|
setInkStyle = _useState20[1];
|
|
|
|
|
|
var activeTabOffset = tabOffsets.get(activeKey); // Delay set ink style to avoid remove tab blink
|
|
|
|
|
|
var inkBarRafRef = Object(external_window_React_["useRef"])();
|
|
|
|
|
|
function cleanInkBarRaf() {
|
|
|
raf_default.a.cancel(inkBarRafRef.current);
|
|
|
}
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
var newInkStyle = {};
|
|
|
|
|
|
if (activeTabOffset) {
|
|
|
if (tabPositionTopOrBottom) {
|
|
|
if (rtl) {
|
|
|
newInkStyle.right = activeTabOffset.right;
|
|
|
} else {
|
|
|
newInkStyle.left = activeTabOffset.left;
|
|
|
}
|
|
|
|
|
|
newInkStyle.width = activeTabOffset.width;
|
|
|
} else {
|
|
|
newInkStyle.top = activeTabOffset.top;
|
|
|
newInkStyle.height = activeTabOffset.height;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
cleanInkBarRaf();
|
|
|
inkBarRafRef.current = raf_default()(function () {
|
|
|
setInkStyle(newInkStyle);
|
|
|
});
|
|
|
return cleanInkBarRaf;
|
|
|
}, [activeTabOffset, tabPositionTopOrBottom, rtl]); // ========================= Effect ========================
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
scrollToTab();
|
|
|
}, [activeKey, activeTabOffset, tabOffsets, tabPositionTopOrBottom]); // Should recalculate when rtl changed
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
onListHolderResize();
|
|
|
}, [rtl, tabBarGutter, activeKey, tabs.map(function (tab) {
|
|
|
return tab.key;
|
|
|
}).join('_')]); // ========================= Render ========================
|
|
|
|
|
|
var hasDropdown = !!hiddenTabs.length;
|
|
|
var wrapPrefix = "".concat(prefixCls, "-nav-wrap");
|
|
|
var pingLeft;
|
|
|
var pingRight;
|
|
|
var pingTop;
|
|
|
var pingBottom;
|
|
|
|
|
|
if (tabPositionTopOrBottom) {
|
|
|
if (rtl) {
|
|
|
pingRight = transformLeft > 0;
|
|
|
pingLeft = transformLeft + wrapperWidth < wrapperScrollWidth;
|
|
|
} else {
|
|
|
pingLeft = transformLeft < 0;
|
|
|
pingRight = -transformLeft + wrapperWidth < wrapperScrollWidth;
|
|
|
}
|
|
|
} else {
|
|
|
pingTop = transformTop < 0;
|
|
|
pingBottom = -transformTop + wrapperHeight < wrapperScrollHeight;
|
|
|
}
|
|
|
/* eslint-disable jsx-a11y/interactive-supports-focus */
|
|
|
|
|
|
|
|
|
return external_window_React_["createElement"]("div", {
|
|
|
ref: ref,
|
|
|
role: "tablist",
|
|
|
className: classnames_default()("".concat(prefixCls, "-nav"), className),
|
|
|
style: style,
|
|
|
onKeyDown: function onKeyDown() {
|
|
|
// No need animation when use keyboard
|
|
|
doLockAnimation();
|
|
|
}
|
|
|
}, external_window_React_["createElement"](TabNavList_ExtraContent, {
|
|
|
position: "left",
|
|
|
extra: extra,
|
|
|
prefixCls: prefixCls
|
|
|
}), external_window_React_["createElement"](es["a" /* default */], {
|
|
|
onResize: onListHolderResize
|
|
|
}, external_window_React_["createElement"]("div", {
|
|
|
className: classnames_default()(wrapPrefix, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-left"), pingLeft), Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-right"), pingRight), Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-top"), pingTop), Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-bottom"), pingBottom), _classNames)),
|
|
|
ref: tabsWrapperRef
|
|
|
}, external_window_React_["createElement"](es["a" /* default */], {
|
|
|
onResize: onListHolderResize
|
|
|
}, external_window_React_["createElement"]("div", {
|
|
|
ref: tabListRef,
|
|
|
className: "".concat(prefixCls, "-nav-list"),
|
|
|
style: {
|
|
|
transform: "translate(".concat(transformLeft, "px, ").concat(transformTop, "px)"),
|
|
|
transition: lockAnimation ? 'none' : undefined
|
|
|
}
|
|
|
}, tabNodes, external_window_React_["createElement"](TabNavList_AddButton, {
|
|
|
ref: innerAddButtonRef,
|
|
|
prefixCls: prefixCls,
|
|
|
locale: locale,
|
|
|
editable: editable,
|
|
|
style: {
|
|
|
visibility: hasDropdown ? 'hidden' : null
|
|
|
}
|
|
|
}), external_window_React_["createElement"]("div", {
|
|
|
className: classnames_default()("".concat(prefixCls, "-ink-bar"), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-ink-bar-animated"), animated.inkBar)),
|
|
|
style: inkStyle
|
|
|
}))))), external_window_React_["createElement"](TabNavList_OperationNode, Object.assign({}, props, {
|
|
|
ref: operationsRef,
|
|
|
prefixCls: prefixCls,
|
|
|
tabs: hiddenTabs,
|
|
|
className: !hasDropdown && operationsHiddenClassName
|
|
|
})), external_window_React_["createElement"](TabNavList_ExtraContent, {
|
|
|
position: "right",
|
|
|
extra: extra,
|
|
|
prefixCls: prefixCls
|
|
|
}));
|
|
|
/* eslint-enable */
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var es_TabNavList = (external_window_React_["forwardRef"](TabNavList));
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabPanelList/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function TabPanelList(_ref) {
|
|
|
var id = _ref.id,
|
|
|
activeKey = _ref.activeKey,
|
|
|
animated = _ref.animated,
|
|
|
tabPosition = _ref.tabPosition,
|
|
|
rtl = _ref.rtl,
|
|
|
destroyInactiveTabPane = _ref.destroyInactiveTabPane;
|
|
|
|
|
|
var _React$useContext = external_window_React_["useContext"](TabContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
tabs = _React$useContext.tabs;
|
|
|
|
|
|
var tabPaneAnimated = animated.tabPane;
|
|
|
var activeIndex = tabs.findIndex(function (tab) {
|
|
|
return tab.key === activeKey;
|
|
|
});
|
|
|
return external_window_React_["createElement"]("div", {
|
|
|
className: classnames_default()("".concat(prefixCls, "-content-holder"))
|
|
|
}, external_window_React_["createElement"]("div", {
|
|
|
className: classnames_default()("".concat(prefixCls, "-content"), "".concat(prefixCls, "-content-").concat(tabPosition), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-content-animated"), tabPaneAnimated)),
|
|
|
style: activeIndex && tabPaneAnimated ? Object(defineProperty["a" /* default */])({}, rtl ? 'marginRight' : 'marginLeft', "-".concat(activeIndex, "00%")) : null
|
|
|
}, tabs.map(function (tab) {
|
|
|
return external_window_React_["cloneElement"](tab.node, {
|
|
|
key: tab.key,
|
|
|
prefixCls: prefixCls,
|
|
|
tabKey: tab.key,
|
|
|
id: id,
|
|
|
animated: tabPaneAnimated,
|
|
|
active: tab.key === activeKey,
|
|
|
destroyInactiveTabPane: destroyInactiveTabPane
|
|
|
});
|
|
|
})));
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabPanelList/TabPane.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function TabPane(_ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
forceRender = _ref.forceRender,
|
|
|
className = _ref.className,
|
|
|
style = _ref.style,
|
|
|
id = _ref.id,
|
|
|
active = _ref.active,
|
|
|
animated = _ref.animated,
|
|
|
destroyInactiveTabPane = _ref.destroyInactiveTabPane,
|
|
|
tabKey = _ref.tabKey,
|
|
|
children = _ref.children;
|
|
|
|
|
|
var _React$useState = external_window_React_["useState"](forceRender),
|
|
|
_React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2),
|
|
|
visited = _React$useState2[0],
|
|
|
setVisited = _React$useState2[1];
|
|
|
|
|
|
external_window_React_["useEffect"](function () {
|
|
|
if (active) {
|
|
|
setVisited(true);
|
|
|
} else if (destroyInactiveTabPane) {
|
|
|
setVisited(false);
|
|
|
}
|
|
|
}, [active, destroyInactiveTabPane]);
|
|
|
var mergedStyle = {};
|
|
|
|
|
|
if (!active) {
|
|
|
if (animated) {
|
|
|
mergedStyle.visibility = 'hidden';
|
|
|
mergedStyle.height = 0;
|
|
|
mergedStyle.overflowY = 'hidden';
|
|
|
} else {
|
|
|
mergedStyle.display = 'none';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return external_window_React_["createElement"]("div", {
|
|
|
id: id && "".concat(id, "-panel-").concat(tabKey),
|
|
|
role: "tabpanel",
|
|
|
tabIndex: active ? 0 : -1,
|
|
|
"aria-labelledby": id && "".concat(id, "-tab-").concat(tabKey),
|
|
|
"aria-hidden": !active,
|
|
|
style: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedStyle), style),
|
|
|
className: classnames_default()("".concat(prefixCls, "-tabpane"), active && "".concat(prefixCls, "-tabpane-active"), className)
|
|
|
}, (active || visited || forceRender) && children);
|
|
|
}
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/Tabs.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Should added antd:
|
|
|
* - type
|
|
|
*
|
|
|
* Removed:
|
|
|
* - onNextClick
|
|
|
* - onPrevClick
|
|
|
* - keyboard
|
|
|
*/
|
|
|
// Used for accessibility
|
|
|
|
|
|
var uuid = 0;
|
|
|
|
|
|
function parseTabList(children) {
|
|
|
return Object(toArray["a" /* default */])(children).map(function (node) {
|
|
|
if (external_window_React_["isValidElement"](node)) {
|
|
|
var key = node.key !== undefined ? String(node.key) : undefined;
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
|
|
|
key: key
|
|
|
}, node.props), {}, {
|
|
|
node: node
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
}).filter(function (tab) {
|
|
|
return tab;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function Tabs(_ref, ref) {
|
|
|
var _classNames;
|
|
|
|
|
|
var id = _ref.id,
|
|
|
_ref$prefixCls = _ref.prefixCls,
|
|
|
prefixCls = _ref$prefixCls === void 0 ? 'rc-tabs' : _ref$prefixCls,
|
|
|
className = _ref.className,
|
|
|
children = _ref.children,
|
|
|
direction = _ref.direction,
|
|
|
activeKey = _ref.activeKey,
|
|
|
defaultActiveKey = _ref.defaultActiveKey,
|
|
|
editable = _ref.editable,
|
|
|
animated = _ref.animated,
|
|
|
_ref$tabPosition = _ref.tabPosition,
|
|
|
tabPosition = _ref$tabPosition === void 0 ? 'top' : _ref$tabPosition,
|
|
|
tabBarGutter = _ref.tabBarGutter,
|
|
|
tabBarStyle = _ref.tabBarStyle,
|
|
|
tabBarExtraContent = _ref.tabBarExtraContent,
|
|
|
locale = _ref.locale,
|
|
|
moreIcon = _ref.moreIcon,
|
|
|
moreTransitionName = _ref.moreTransitionName,
|
|
|
destroyInactiveTabPane = _ref.destroyInactiveTabPane,
|
|
|
renderTabBar = _ref.renderTabBar,
|
|
|
onChange = _ref.onChange,
|
|
|
onTabClick = _ref.onTabClick,
|
|
|
onTabScroll = _ref.onTabScroll,
|
|
|
restProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["id", "prefixCls", "className", "children", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "moreIcon", "moreTransitionName", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll"]);
|
|
|
|
|
|
var tabs = parseTabList(children);
|
|
|
var rtl = direction === 'rtl';
|
|
|
var mergedAnimated;
|
|
|
|
|
|
if (animated === false) {
|
|
|
mergedAnimated = {
|
|
|
inkBar: false,
|
|
|
tabPane: false
|
|
|
};
|
|
|
} else {
|
|
|
mergedAnimated = Object(objectSpread2["a" /* default */])({
|
|
|
inkBar: true,
|
|
|
tabPane: false
|
|
|
}, animated !== true ? animated : null);
|
|
|
} // ======================== Mobile ========================
|
|
|
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])(false),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
mobile = _useState2[0],
|
|
|
setMobile = _useState2[1];
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
// Only update on the client side
|
|
|
setMobile(useTouchMove_isMobile());
|
|
|
}, []); // ====================== Active Key ======================
|
|
|
|
|
|
var _useMergedState = Object(useMergedState["a" /* default */])(function () {
|
|
|
var _tabs$;
|
|
|
|
|
|
return (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key;
|
|
|
}, {
|
|
|
value: activeKey,
|
|
|
defaultValue: defaultActiveKey
|
|
|
}),
|
|
|
_useMergedState2 = Object(slicedToArray["a" /* default */])(_useMergedState, 2),
|
|
|
mergedActiveKey = _useMergedState2[0],
|
|
|
setMergedActiveKey = _useMergedState2[1];
|
|
|
|
|
|
var _useState3 = Object(external_window_React_["useState"])(function () {
|
|
|
return tabs.findIndex(function (tab) {
|
|
|
return tab.key === mergedActiveKey;
|
|
|
});
|
|
|
}),
|
|
|
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
|
|
activeIndex = _useState4[0],
|
|
|
setActiveIndex = _useState4[1]; // Reset active key if not exist anymore
|
|
|
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
var newActiveIndex = tabs.findIndex(function (tab) {
|
|
|
return tab.key === mergedActiveKey;
|
|
|
});
|
|
|
|
|
|
if (newActiveIndex === -1) {
|
|
|
var _tabs$newActiveIndex;
|
|
|
|
|
|
newActiveIndex = Math.max(0, Math.min(activeIndex, tabs.length - 1));
|
|
|
setMergedActiveKey((_tabs$newActiveIndex = tabs[newActiveIndex]) === null || _tabs$newActiveIndex === void 0 ? void 0 : _tabs$newActiveIndex.key);
|
|
|
}
|
|
|
|
|
|
setActiveIndex(newActiveIndex);
|
|
|
}, [tabs.map(function (tab) {
|
|
|
return tab.key;
|
|
|
}).join('_'), mergedActiveKey, activeIndex]); // ===================== Accessibility ====================
|
|
|
|
|
|
var _useMergedState3 = Object(useMergedState["a" /* default */])(null, {
|
|
|
value: id
|
|
|
}),
|
|
|
_useMergedState4 = Object(slicedToArray["a" /* default */])(_useMergedState3, 2),
|
|
|
mergedId = _useMergedState4[0],
|
|
|
setMergedId = _useMergedState4[1];
|
|
|
|
|
|
var mergedTabPosition = tabPosition;
|
|
|
|
|
|
if (mobile && !['left', 'right'].includes(tabPosition)) {
|
|
|
mergedTabPosition = 'top';
|
|
|
} // Async generate id to avoid ssr mapping failed
|
|
|
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
if (!id) {
|
|
|
setMergedId("rc-tabs-".concat( false ? undefined : uuid));
|
|
|
uuid += 1;
|
|
|
}
|
|
|
}, []); // ======================== Events ========================
|
|
|
|
|
|
function onInternalTabClick(key, e) {
|
|
|
onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(key, e);
|
|
|
setMergedActiveKey(key);
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(key);
|
|
|
} // ======================== Render ========================
|
|
|
|
|
|
|
|
|
var sharedProps = {
|
|
|
id: mergedId,
|
|
|
activeKey: mergedActiveKey,
|
|
|
animated: mergedAnimated,
|
|
|
tabPosition: mergedTabPosition,
|
|
|
rtl: rtl,
|
|
|
mobile: mobile
|
|
|
};
|
|
|
var tabNavBar;
|
|
|
|
|
|
var tabNavBarProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, sharedProps), {}, {
|
|
|
editable: editable,
|
|
|
locale: locale,
|
|
|
moreIcon: moreIcon,
|
|
|
moreTransitionName: moreTransitionName,
|
|
|
tabBarGutter: tabBarGutter,
|
|
|
onTabClick: onInternalTabClick,
|
|
|
onTabScroll: onTabScroll,
|
|
|
extra: tabBarExtraContent,
|
|
|
style: tabBarStyle,
|
|
|
panes: children
|
|
|
});
|
|
|
|
|
|
if (renderTabBar) {
|
|
|
tabNavBar = renderTabBar(tabNavBarProps, es_TabNavList);
|
|
|
} else {
|
|
|
tabNavBar = external_window_React_["createElement"](es_TabNavList, Object.assign({}, tabNavBarProps));
|
|
|
}
|
|
|
|
|
|
return external_window_React_["createElement"](TabContext.Provider, {
|
|
|
value: {
|
|
|
tabs: tabs,
|
|
|
prefixCls: prefixCls
|
|
|
}
|
|
|
}, external_window_React_["createElement"]("div", Object.assign({
|
|
|
ref: ref,
|
|
|
id: id,
|
|
|
className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedTabPosition), (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-mobile"), mobile), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-editable"), editable), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-rtl"), rtl), _classNames), className)
|
|
|
}, restProps), tabNavBar, external_window_React_["createElement"](TabPanelList, Object.assign({
|
|
|
destroyInactiveTabPane: destroyInactiveTabPane
|
|
|
}, sharedProps, {
|
|
|
animated: mergedAnimated
|
|
|
}))));
|
|
|
}
|
|
|
|
|
|
var ForwardTabs = external_window_React_["forwardRef"](Tabs);
|
|
|
ForwardTabs.TabPane = TabPane;
|
|
|
/* harmony default export */ var es_Tabs = (ForwardTabs);
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-tabs/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_tabs_es = __webpack_exports__["b"] = (es_Tabs);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "t23M":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/rc-resize-observer/es/index.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "VTBJ");
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "1OyB");
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "vuIU");
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "Ji7U");
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createSuper */ "LK+K");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "cDcd");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
/* harmony import */ var rc_util_es_Dom_findDOMNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/Dom/findDOMNode */ "m+aA");
|
|
|
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rc-util/es/Children/toArray */ "Zm9Q");
|
|
|
/* harmony import */ var rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rc-util/es/warning */ "Kwbf");
|
|
|
/* harmony import */ var rc_util_es_ref__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rc-util/es/ref */ "c+Xe");
|
|
|
/* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! resize-observer-polyfill */ "bdgK");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var INTERNAL_PREFIX_KEY = 'rc-observer-key'; // Still need to be compatible with React 15, we use class component here
|
|
|
|
|
|
var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(ReactResizeObserver, _React$Component);
|
|
|
|
|
|
var _super = Object(_babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(ReactResizeObserver);
|
|
|
|
|
|
function ReactResizeObserver() {
|
|
|
var _this;
|
|
|
|
|
|
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this, ReactResizeObserver);
|
|
|
|
|
|
_this = _super.apply(this, arguments);
|
|
|
_this.resizeObserver = null;
|
|
|
_this.childNode = null;
|
|
|
_this.currentElement = null;
|
|
|
_this.state = {
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
offsetHeight: 0,
|
|
|
offsetWidth: 0
|
|
|
};
|
|
|
|
|
|
_this.onResize = function (entries) {
|
|
|
var onResize = _this.props.onResize;
|
|
|
var target = entries[0].target;
|
|
|
|
|
|
var _target$getBoundingCl = target.getBoundingClientRect(),
|
|
|
width = _target$getBoundingCl.width,
|
|
|
height = _target$getBoundingCl.height;
|
|
|
|
|
|
var offsetWidth = target.offsetWidth,
|
|
|
offsetHeight = target.offsetHeight;
|
|
|
/**
|
|
|
* Resize observer trigger when content size changed.
|
|
|
* In most case we just care about element size,
|
|
|
* let's use `boundary` instead of `contentRect` here to avoid shaking.
|
|
|
*/
|
|
|
|
|
|
var fixedWidth = Math.floor(width);
|
|
|
var fixedHeight = Math.floor(height);
|
|
|
|
|
|
if (_this.state.width !== fixedWidth || _this.state.height !== fixedHeight || _this.state.offsetWidth !== offsetWidth || _this.state.offsetHeight !== offsetHeight) {
|
|
|
var size = {
|
|
|
width: fixedWidth,
|
|
|
height: fixedHeight,
|
|
|
offsetWidth: offsetWidth,
|
|
|
offsetHeight: offsetHeight
|
|
|
};
|
|
|
|
|
|
_this.setState(size);
|
|
|
|
|
|
if (onResize) {
|
|
|
// defer the callback but not defer to next frame
|
|
|
Promise.resolve().then(function () {
|
|
|
onResize(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, size), {}, {
|
|
|
offsetWidth: offsetWidth,
|
|
|
offsetHeight: offsetHeight
|
|
|
}));
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.setChildNode = function (node) {
|
|
|
_this.childNode = node;
|
|
|
};
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(ReactResizeObserver, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
this.onComponentUpdated();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate() {
|
|
|
this.onComponentUpdated();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
this.destroyObserver();
|
|
|
}
|
|
|
}, {
|
|
|
key: "onComponentUpdated",
|
|
|
value: function onComponentUpdated() {
|
|
|
var disabled = this.props.disabled; // Unregister if disabled
|
|
|
|
|
|
if (disabled) {
|
|
|
this.destroyObserver();
|
|
|
return;
|
|
|
} // Unregister if element changed
|
|
|
|
|
|
|
|
|
var element = Object(rc_util_es_Dom_findDOMNode__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(this.childNode || this);
|
|
|
var elementChanged = element !== this.currentElement;
|
|
|
|
|
|
if (elementChanged) {
|
|
|
this.destroyObserver();
|
|
|
this.currentElement = element;
|
|
|
}
|
|
|
|
|
|
if (!this.resizeObserver && element) {
|
|
|
this.resizeObserver = new resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_10__["default"](this.onResize);
|
|
|
this.resizeObserver.observe(element);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "destroyObserver",
|
|
|
value: function destroyObserver() {
|
|
|
if (this.resizeObserver) {
|
|
|
this.resizeObserver.disconnect();
|
|
|
this.resizeObserver = null;
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var children = this.props.children;
|
|
|
var childNodes = Object(rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(children);
|
|
|
|
|
|
if (childNodes.length > 1) {
|
|
|
Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(false, 'Find more than one child node with `children` in ResizeObserver. Will only observe first one.');
|
|
|
} else if (childNodes.length === 0) {
|
|
|
Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(false, '`children` of ResizeObserver is empty. Nothing is in observe.');
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
var childNode = childNodes[0];
|
|
|
|
|
|
if (react__WEBPACK_IMPORTED_MODULE_5__["isValidElement"](childNode) && Object(rc_util_es_ref__WEBPACK_IMPORTED_MODULE_9__[/* supportRef */ "c"])(childNode)) {
|
|
|
var ref = childNode.ref;
|
|
|
childNodes[0] = react__WEBPACK_IMPORTED_MODULE_5__["cloneElement"](childNode, {
|
|
|
ref: Object(rc_util_es_ref__WEBPACK_IMPORTED_MODULE_9__[/* composeRef */ "a"])(ref, this.setChildNode)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return childNodes.length === 1 ? childNodes[0] : childNodes.map(function (node, index) {
|
|
|
if (!react__WEBPACK_IMPORTED_MODULE_5__["isValidElement"](node) || 'key' in node && node.key !== null) {
|
|
|
return node;
|
|
|
}
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_5__["cloneElement"](node, {
|
|
|
key: "".concat(INTERNAL_PREFIX_KEY, "-").concat(index)
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return ReactResizeObserver;
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
|
|
|
|
|
ReactResizeObserver.displayName = 'ResizeObserver';
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (ReactResizeObserver);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "vYR1":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/pages/Innovation/PublicProject/index.tsx ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var antd_es_pagination_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/pagination/style */ "DjyN");
|
|
|
/* harmony import */ var antd_es_pagination__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/pagination */ "NUBc");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw");
|
|
|
/* harmony import */ var antd_es_divider_style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/es/divider/style */ "/zsF");
|
|
|
/* harmony import */ var antd_es_divider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/es/divider */ "PArb");
|
|
|
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/button/style */ "+L6B");
|
|
|
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd/es/button */ "2/Rp");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT");
|
|
|
/* harmony import */ var antd_es_tabs_style__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd/es/tabs/style */ "Znn+");
|
|
|
/* harmony import */ var antd_es_tabs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd/es/tabs */ "ZTPi");
|
|
|
/* harmony import */ var antd_es_typography_style__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd/es/typography/style */ "tU7J");
|
|
|
/* harmony import */ var antd_es_typography__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd/es/typography */ "wFql");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS");
|
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_13__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react */ "cDcd");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_14__);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ant-design/icons */ "xvlK");
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ant-design/icons */ "0TN8");
|
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! umi */ "9kvl");
|
|
|
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/utils/authority */ "xKgJ");
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/utils/fetch */ "ErOA");
|
|
|
/* harmony import */ var _components_NoData__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/components/NoData */ "BdwD");
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! moment */ "wd/R");
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_21__);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./index.less?modules */ "Bikx");
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_22__);
|
|
|
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/utils/env */ "m3rI");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Paragraph = antd_es_typography__WEBPACK_IMPORTED_MODULE_12__[/* default */ "a"].Paragraph;
|
|
|
var TabPane = antd_es_tabs__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"].TabPane;
|
|
|
|
|
|
var ProjectDetailPage = function ProjectDetailPage(_ref) {
|
|
|
var _datas$sci_projects;
|
|
|
|
|
|
var dispatch = _ref.dispatch;
|
|
|
|
|
|
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_14__["useState"])({
|
|
|
limit: 10,
|
|
|
page: 1,
|
|
|
tab: 'public'
|
|
|
}),
|
|
|
_useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(_useState, 2),
|
|
|
params = _useState2[0],
|
|
|
setparasm = _useState2[1];
|
|
|
|
|
|
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_14__["useState"])([]),
|
|
|
_useState4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(_useState3, 2),
|
|
|
datas = _useState4[0],
|
|
|
setdatas = _useState4[1];
|
|
|
|
|
|
Object(react__WEBPACK_IMPORTED_MODULE_14__["useEffect"])(function () {
|
|
|
getdata();
|
|
|
}, []);
|
|
|
|
|
|
function getdata() {
|
|
|
return _getdata.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
function _getdata() {
|
|
|
_getdata = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_13___default.a.mark(function _callee() {
|
|
|
var res;
|
|
|
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_13___default.a.wrap(function _callee$(_context) {
|
|
|
while (1) {
|
|
|
switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_19__[/* default */ "a"])("/api/sci/projects.json", {
|
|
|
method: 'get',
|
|
|
params: params
|
|
|
});
|
|
|
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
setdatas(res);
|
|
|
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _getdata.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
var handleCreateProject = function handleCreateProject() {
|
|
|
if ((datas === null || datas === void 0 ? void 0 : datas.my_sci_projects_num) >= 10 && !Object(_utils_authority__WEBPACK_IMPORTED_MODULE_18__[/* isSuperAdmins */ "v"])()) {
|
|
|
dispatch({
|
|
|
type: 'innovation/openSimpleModal',
|
|
|
payload: {
|
|
|
title: '项目数量达到上限',
|
|
|
children: '每位用户最多只能创建10个项目,你的项目数量已经达到上限。',
|
|
|
footer: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
|
|
|
onClick: function onClick() {
|
|
|
return dispatch({
|
|
|
type: 'innovation/closeSimpleModal'
|
|
|
});
|
|
|
},
|
|
|
type: "primary"
|
|
|
}, "\u6211\u77E5\u9053\u4E86")
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
umi__WEBPACK_IMPORTED_MODULE_17__[/* history */ "d"].push('/innovation/project/create');
|
|
|
};
|
|
|
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_22___default.a.header
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("span", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_22___default.a.title
|
|
|
}, "\u516C\u5F00\u9879\u76EE"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
|
|
|
type: "primary",
|
|
|
onClick: handleCreateProject,
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_22___default.a.createProjectBtn,
|
|
|
icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(_ant_design_icons__WEBPACK_IMPORTED_MODULE_15__[/* default */ "a"], null)
|
|
|
}, "\u521B\u5EFA\u9879\u76EE")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(antd_es_divider__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], null), (datas === null || datas === void 0 ? void 0 : datas.count) <= 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(_components_NoData__WEBPACK_IMPORTED_MODULE_20__[/* default */ "a"], null), datas === null || datas === void 0 ? void 0 : (_datas$sci_projects = datas.sci_projects) === null || _datas$sci_projects === void 0 ? void 0 : _datas$sci_projects.map(function (item, index) {
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", {
|
|
|
key: index,
|
|
|
style: {
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
umi__WEBPACK_IMPORTED_MODULE_17__[/* history */ "d"].push("/innovation/project/detail/".concat(item === null || item === void 0 ? void 0 : item.id, "?my_sci_projects_num=").concat(datas === null || datas === void 0 ? void 0 : datas.my_sci_projects_num));
|
|
|
}
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between'
|
|
|
}
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("img", {
|
|
|
style: {
|
|
|
width: 30,
|
|
|
height: 30,
|
|
|
borderRadius: '50%',
|
|
|
marginRight: 10
|
|
|
},
|
|
|
src: _utils_env__WEBPACK_IMPORTED_MODULE_23__[/* default */ "a"].IMG_SERVER + '/images/' + item.avatar_url
|
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("span", {
|
|
|
style: {
|
|
|
fontSize: '14px',
|
|
|
color: '#6B758B',
|
|
|
marginRight: 10
|
|
|
}
|
|
|
}, item === null || item === void 0 ? void 0 : item.username), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("span", {
|
|
|
style: {
|
|
|
color: '#464F66',
|
|
|
fontSize: '14px'
|
|
|
}
|
|
|
}, item === null || item === void 0 ? void 0 : item.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("span", {
|
|
|
style: {
|
|
|
marginRight: 20,
|
|
|
color: '#464F66'
|
|
|
}
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("i", {
|
|
|
className: "iconfont icon-chakan1 current ml5",
|
|
|
style: {
|
|
|
marginRight: 8,
|
|
|
color: '#B1BACD',
|
|
|
fontSize: 12
|
|
|
}
|
|
|
}), item === null || item === void 0 ? void 0 : item.visits), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("span", {
|
|
|
style: {
|
|
|
marginRight: 20,
|
|
|
color: '#464F66'
|
|
|
}
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(_ant_design_icons__WEBPACK_IMPORTED_MODULE_16__[/* default */ "a"], {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
}
|
|
|
}), item === null || item === void 0 ? void 0 : item.forked_count))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_22___default.a.count,
|
|
|
style: {
|
|
|
marginTop: 5,
|
|
|
color: '#464F66',
|
|
|
fontSize: 14,
|
|
|
marginLeft: 40
|
|
|
}
|
|
|
}, item === null || item === void 0 ? void 0 : item.description), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement("div", {
|
|
|
style: {
|
|
|
marginTop: 15,
|
|
|
color: '#B1BACD',
|
|
|
fontSize: 14,
|
|
|
marginLeft: 40
|
|
|
}
|
|
|
}, "\u521B\u5EFA\u65F6\u95F4\uFF1A", moment__WEBPACK_IMPORTED_MODULE_21___default()(item === null || item === void 0 ? void 0 : item.created_at).format('YYYY-MM-DD HH:mm')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(antd_es_divider__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], null));
|
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(antd_es_pagination__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], {
|
|
|
style: {
|
|
|
textAlign: 'center',
|
|
|
marginTop: 20
|
|
|
},
|
|
|
current: params.page,
|
|
|
pageSize: 10,
|
|
|
showSizeChanger: false,
|
|
|
total: datas === null || datas === void 0 ? void 0 : datas.count,
|
|
|
hideOnSinglePage: true,
|
|
|
onChange: function onChange(e) {
|
|
|
params.page = e, setparasm(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({}, params));
|
|
|
getdata();
|
|
|
}
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(umi__WEBPACK_IMPORTED_MODULE_17__[/* connect */ "a"])(function (_ref2) {
|
|
|
var innovation = _ref2.innovation;
|
|
|
return {
|
|
|
innovation: innovation
|
|
|
};
|
|
|
})(ProjectDetailPage));
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |