You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5013 lines
170 KiB
5013 lines
170 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[98668,67390,47897,47221],{
|
|
|
|
/***/ 11475:
|
|
/*!******************************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
|
|
\******************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_ExclamationCircleOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_ExclamationCircleOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3089:
|
|
/*!************************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules ***!
|
|
\************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_MinusCircleOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/MinusCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var MinusCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "minus-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_MinusCircleOutlined = (MinusCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/MinusCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var MinusCircleOutlined_MinusCircleOutlined = function MinusCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_MinusCircleOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_MinusCircleOutlined = (/*#__PURE__*/react.forwardRef(MinusCircleOutlined_MinusCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 64789:
|
|
/*!***********************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules ***!
|
|
\***********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_PlusCircleOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/PlusCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var PlusCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "plus-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_PlusCircleOutlined = (PlusCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/PlusCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var PlusCircleOutlined_PlusCircleOutlined = function PlusCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_PlusCircleOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_PlusCircleOutlined = (/*#__PURE__*/react.forwardRef(PlusCircleOutlined_PlusCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 48783:
|
|
/*!****************************************************************!*\
|
|
!*** ./node_modules/antd/es/_util/throttleByAnimationFrame.js ***!
|
|
\****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ 74902);
|
|
/* harmony import */ var rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/raf */ 96523);
|
|
|
|
|
|
function throttleByAnimationFrame(fn) {
|
|
let requestId;
|
|
const later = args => () => {
|
|
requestId = null;
|
|
fn.apply(void 0, (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(args));
|
|
};
|
|
const throttled = function () {
|
|
if (requestId == null) {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
requestId = (0,rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(later(args));
|
|
}
|
|
};
|
|
throttled.cancel = () => {
|
|
rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cancel */ .Z.cancel(requestId);
|
|
requestId = null;
|
|
};
|
|
return throttled;
|
|
}
|
|
/* harmony default export */ __webpack_exports__["Z"] = (throttleByAnimationFrame);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 30291:
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/antd/es/affix/index.js + 2 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ affix; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
var classCallCheck = __webpack_require__(15671);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
var createClass = __webpack_require__(43144);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
var inherits = __webpack_require__(60136);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
var createSuper = __webpack_require__(51630);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js + 4 modules
|
|
var es = __webpack_require__(48555);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/throttleByAnimationFrame.js
|
|
var throttleByAnimationFrame = __webpack_require__(48783);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(45503);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/affix/style/index.js
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedAffixStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: {
|
|
position: 'fixed',
|
|
zIndex: token.zIndexPopup
|
|
}
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var style = ((0,genComponentStyleHook/* default */.Z)('Affix', token => {
|
|
const affixToken = (0,statistic/* merge */.TS)(token, {
|
|
zIndexPopup: token.zIndexBase + 10
|
|
});
|
|
return [genSharedAffixStyle(affixToken)];
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/affix/utils.js
|
|
function getTargetRect(target) {
|
|
return target !== window ? target.getBoundingClientRect() : {
|
|
top: 0,
|
|
bottom: window.innerHeight
|
|
};
|
|
}
|
|
function getFixedTop(placeholderRect, targetRect, offsetTop) {
|
|
if (offsetTop !== undefined && targetRect.top > placeholderRect.top - offsetTop) {
|
|
return offsetTop + targetRect.top;
|
|
}
|
|
return undefined;
|
|
}
|
|
function getFixedBottom(placeholderRect, targetRect, offsetBottom) {
|
|
if (offsetBottom !== undefined && targetRect.bottom < placeholderRect.bottom + offsetBottom) {
|
|
const targetBottomOffset = window.innerHeight - targetRect.bottom;
|
|
return offsetBottom + targetBottomOffset;
|
|
}
|
|
return undefined;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/affix/index.js
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TRIGGER_EVENTS = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'];
|
|
function getDefaultTarget() {
|
|
return typeof window !== 'undefined' ? window : null;
|
|
}
|
|
var AffixStatus;
|
|
(function (AffixStatus) {
|
|
AffixStatus[AffixStatus["None"] = 0] = "None";
|
|
AffixStatus[AffixStatus["Prepare"] = 1] = "Prepare";
|
|
})(AffixStatus || (AffixStatus = {}));
|
|
let InternalAffix = /*#__PURE__*/function (_React$Component) {
|
|
(0,inherits/* default */.Z)(InternalAffix, _React$Component);
|
|
var _super = (0,createSuper/* default */.Z)(InternalAffix);
|
|
function InternalAffix() {
|
|
var _this;
|
|
(0,classCallCheck/* default */.Z)(this, InternalAffix);
|
|
_this = _super.apply(this, arguments);
|
|
_this.state = {
|
|
status: AffixStatus.None,
|
|
lastAffix: false,
|
|
prevTarget: null
|
|
};
|
|
_this.placeholderNodeRef = /*#__PURE__*/(0,react.createRef)();
|
|
_this.fixedNodeRef = /*#__PURE__*/(0,react.createRef)();
|
|
_this.addListeners = () => {
|
|
const targetFunc = _this.getTargetFunc();
|
|
const target = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
|
|
const {
|
|
prevTarget
|
|
} = _this.state;
|
|
if (prevTarget !== target) {
|
|
TRIGGER_EVENTS.forEach(eventName => {
|
|
prevTarget === null || prevTarget === void 0 ? void 0 : prevTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
target === null || target === void 0 ? void 0 : target.addEventListener(eventName, _this.lazyUpdatePosition);
|
|
});
|
|
_this.updatePosition();
|
|
_this.setState({
|
|
prevTarget: target
|
|
});
|
|
}
|
|
};
|
|
_this.removeListeners = () => {
|
|
if (_this.timer) {
|
|
clearTimeout(_this.timer);
|
|
_this.timer = null;
|
|
}
|
|
const {
|
|
prevTarget
|
|
} = _this.state;
|
|
const targetFunc = _this.getTargetFunc();
|
|
const newTarget = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
|
|
TRIGGER_EVENTS.forEach(eventName => {
|
|
newTarget === null || newTarget === void 0 ? void 0 : newTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
prevTarget === null || prevTarget === void 0 ? void 0 : prevTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
});
|
|
_this.updatePosition.cancel();
|
|
// https://github.com/ant-design/ant-design/issues/22683
|
|
_this.lazyUpdatePosition.cancel();
|
|
};
|
|
_this.getOffsetTop = () => {
|
|
const {
|
|
offsetBottom,
|
|
offsetTop
|
|
} = _this.props;
|
|
return offsetBottom === undefined && offsetTop === undefined ? 0 : offsetTop;
|
|
};
|
|
_this.getOffsetBottom = () => _this.props.offsetBottom;
|
|
// =================== Measure ===================
|
|
_this.measure = () => {
|
|
const {
|
|
status,
|
|
lastAffix
|
|
} = _this.state;
|
|
const {
|
|
onChange
|
|
} = _this.props;
|
|
const targetFunc = _this.getTargetFunc();
|
|
if (status !== AffixStatus.Prepare || !_this.fixedNodeRef.current || !_this.placeholderNodeRef.current || !targetFunc) {
|
|
return;
|
|
}
|
|
const offsetTop = _this.getOffsetTop();
|
|
const offsetBottom = _this.getOffsetBottom();
|
|
const targetNode = targetFunc();
|
|
if (targetNode) {
|
|
const newState = {
|
|
status: AffixStatus.None
|
|
};
|
|
const placeholderRect = getTargetRect(_this.placeholderNodeRef.current);
|
|
if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) {
|
|
return;
|
|
}
|
|
const targetRect = getTargetRect(targetNode);
|
|
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop);
|
|
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
|
|
if (fixedTop !== undefined) {
|
|
newState.affixStyle = {
|
|
position: 'fixed',
|
|
top: fixedTop,
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
newState.placeholderStyle = {
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
} else if (fixedBottom !== undefined) {
|
|
newState.affixStyle = {
|
|
position: 'fixed',
|
|
bottom: fixedBottom,
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
newState.placeholderStyle = {
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
}
|
|
newState.lastAffix = !!newState.affixStyle;
|
|
if (onChange && lastAffix !== newState.lastAffix) {
|
|
onChange(newState.lastAffix);
|
|
}
|
|
_this.setState(newState);
|
|
}
|
|
};
|
|
_this.prepareMeasure = () => {
|
|
// event param is used before. Keep compatible ts define here.
|
|
_this.setState({
|
|
status: AffixStatus.Prepare,
|
|
affixStyle: undefined,
|
|
placeholderStyle: undefined
|
|
});
|
|
// Test if `updatePosition` called
|
|
if (false) {}
|
|
};
|
|
_this.updatePosition = (0,throttleByAnimationFrame/* default */.Z)(() => {
|
|
_this.prepareMeasure();
|
|
});
|
|
_this.lazyUpdatePosition = (0,throttleByAnimationFrame/* default */.Z)(() => {
|
|
const targetFunc = _this.getTargetFunc();
|
|
const {
|
|
affixStyle
|
|
} = _this.state;
|
|
// Check position change before measure to make Safari smooth
|
|
if (targetFunc && affixStyle) {
|
|
const offsetTop = _this.getOffsetTop();
|
|
const offsetBottom = _this.getOffsetBottom();
|
|
const targetNode = targetFunc();
|
|
if (targetNode && _this.placeholderNodeRef.current) {
|
|
const targetRect = getTargetRect(targetNode);
|
|
const placeholderRect = getTargetRect(_this.placeholderNodeRef.current);
|
|
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop);
|
|
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
|
|
if (fixedTop !== undefined && affixStyle.top === fixedTop || fixedBottom !== undefined && affixStyle.bottom === fixedBottom) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
// Directly call prepare measure since it's already throttled.
|
|
_this.prepareMeasure();
|
|
});
|
|
return _this;
|
|
}
|
|
(0,createClass/* default */.Z)(InternalAffix, [{
|
|
key: "getTargetFunc",
|
|
value: function getTargetFunc() {
|
|
const {
|
|
getTargetContainer
|
|
} = this.context;
|
|
const {
|
|
target
|
|
} = this.props;
|
|
if (target !== undefined) {
|
|
return target;
|
|
}
|
|
return getTargetContainer !== null && getTargetContainer !== void 0 ? getTargetContainer : getDefaultTarget;
|
|
}
|
|
// Event handler
|
|
}, {
|
|
key: "componentDidMount",
|
|
value: function componentDidMount() {
|
|
// [Legacy] Wait for parent component ref has its value.
|
|
// We should use target as directly element instead of function which makes element check hard.
|
|
this.timer = setTimeout(this.addListeners);
|
|
}
|
|
}, {
|
|
key: "componentDidUpdate",
|
|
value: function componentDidUpdate(prevProps) {
|
|
this.addListeners();
|
|
if (prevProps.offsetTop !== this.props.offsetTop || prevProps.offsetBottom !== this.props.offsetBottom) {
|
|
this.updatePosition();
|
|
}
|
|
this.measure();
|
|
}
|
|
}, {
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
this.removeListeners();
|
|
}
|
|
// =================== Render ===================
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
const {
|
|
affixStyle,
|
|
placeholderStyle
|
|
} = this.state;
|
|
const {
|
|
affixPrefixCls,
|
|
rootClassName,
|
|
children
|
|
} = this.props;
|
|
const className = classnames_default()(affixStyle && rootClassName, {
|
|
[affixPrefixCls]: !!affixStyle
|
|
});
|
|
let props = (0,omit/* default */.Z)(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange', 'affixPrefixCls', 'rootClassName']);
|
|
// Omit this since `onTestUpdatePosition` only works on test.
|
|
if (false) {}
|
|
return /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: this.updatePosition
|
|
}, /*#__PURE__*/react.createElement("div", Object.assign({}, props, {
|
|
ref: this.placeholderNodeRef
|
|
}), affixStyle && /*#__PURE__*/react.createElement("div", {
|
|
style: placeholderStyle,
|
|
"aria-hidden": "true"
|
|
}), /*#__PURE__*/react.createElement("div", {
|
|
className: className,
|
|
ref: this.fixedNodeRef,
|
|
style: affixStyle
|
|
}, /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: this.updatePosition
|
|
}, children))));
|
|
}
|
|
}]);
|
|
return InternalAffix;
|
|
}(react.Component);
|
|
InternalAffix.contextType = context/* ConfigContext */.E_;
|
|
const Affix = /*#__PURE__*/(0,react.forwardRef)((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
rootClassName
|
|
} = props;
|
|
const {
|
|
getPrefixCls
|
|
} = (0,react.useContext)(context/* ConfigContext */.E_);
|
|
const affixPrefixCls = getPrefixCls('affix', customizePrefixCls);
|
|
const [wrapSSR, hashId] = style(affixPrefixCls);
|
|
const AffixProps = Object.assign(Object.assign({}, props), {
|
|
affixPrefixCls,
|
|
rootClassName: classnames_default()(rootClassName, hashId)
|
|
});
|
|
return wrapSSR( /*#__PURE__*/react.createElement(InternalAffix, Object.assign({}, AffixProps, {
|
|
ref: ref
|
|
})));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var affix = (Affix);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 85673:
|
|
/*!**************************************************************!*\
|
|
!*** ./node_modules/antd/es/breadcrumb/index.js + 6 modules ***!
|
|
\**************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ breadcrumb; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(37419);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/pickAttrs.js
|
|
var pickAttrs = __webpack_require__(1337);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(96159);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(80882);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/dropdown.js + 9 modules
|
|
var dropdown = __webpack_require__(35874);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbSeparator.js
|
|
|
|
|
|
const BreadcrumbSeparator = _ref => {
|
|
let {
|
|
children
|
|
} = _ref;
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('breadcrumb');
|
|
return /*#__PURE__*/react.createElement("li", {
|
|
className: `${prefixCls}-separator`,
|
|
"aria-hidden": "true"
|
|
}, children === '' ? children : children || '/');
|
|
};
|
|
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
|
|
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/useItemRender.js
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
function getBreadcrumbName(route, params) {
|
|
if (route.title === undefined || route.title === null) {
|
|
return null;
|
|
}
|
|
const paramsKeys = Object.keys(params).join('|');
|
|
return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
|
|
}
|
|
function renderItem(prefixCls, item, children, href) {
|
|
if (children === null || children === undefined) {
|
|
return null;
|
|
}
|
|
const {
|
|
className,
|
|
onClick
|
|
} = item,
|
|
restItem = __rest(item, ["className", "onClick"]);
|
|
const passedProps = Object.assign(Object.assign({}, (0,pickAttrs/* default */.Z)(restItem, {
|
|
data: true,
|
|
aria: true
|
|
})), {
|
|
onClick
|
|
});
|
|
if (href !== undefined) {
|
|
return /*#__PURE__*/react.createElement("a", Object.assign({}, passedProps, {
|
|
className: classnames_default()(`${prefixCls}-link`, className),
|
|
href: href
|
|
}), children);
|
|
}
|
|
return /*#__PURE__*/react.createElement("span", Object.assign({}, passedProps, {
|
|
className: classnames_default()(`${prefixCls}-link`, className)
|
|
}), children);
|
|
}
|
|
function useItemRender(prefixCls, itemRender) {
|
|
const mergedItemRender = (item, params, routes, path, href) => {
|
|
if (itemRender) {
|
|
return itemRender(item, params, routes, path);
|
|
}
|
|
const name = getBreadcrumbName(item, params);
|
|
return renderItem(prefixCls, item, name, href);
|
|
};
|
|
return mergedItemRender;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbItem.js
|
|
var BreadcrumbItem_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalBreadcrumbItem = props => {
|
|
const {
|
|
prefixCls,
|
|
separator = '/',
|
|
children,
|
|
menu,
|
|
overlay,
|
|
dropdownProps,
|
|
href
|
|
} = props;
|
|
// Warning for deprecated usage
|
|
if (false) {}
|
|
/** If overlay is have Wrap a Dropdown */
|
|
const renderBreadcrumbNode = breadcrumbItem => {
|
|
if (menu || overlay) {
|
|
const mergeDropDownProps = Object.assign({}, dropdownProps);
|
|
if (menu) {
|
|
const _a = menu || {},
|
|
{
|
|
items
|
|
} = _a,
|
|
menuProps = BreadcrumbItem_rest(_a, ["items"]);
|
|
mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
|
|
items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
|
|
var {
|
|
key,
|
|
title,
|
|
label,
|
|
path
|
|
} = _a,
|
|
itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
|
|
let mergedLabel = label !== null && label !== void 0 ? label : title;
|
|
if (path) {
|
|
mergedLabel = /*#__PURE__*/react.createElement("a", {
|
|
href: `${href}${path}`
|
|
}, mergedLabel);
|
|
}
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
key: key !== null && key !== void 0 ? key : index,
|
|
label: mergedLabel
|
|
});
|
|
})
|
|
});
|
|
} else if (overlay) {
|
|
mergeDropDownProps.overlay = overlay;
|
|
}
|
|
return /*#__PURE__*/react.createElement(dropdown/* default */.Z, Object.assign({
|
|
placement: "bottom"
|
|
}, mergeDropDownProps), /*#__PURE__*/react.createElement("span", {
|
|
className: `${prefixCls}-overlay-link`
|
|
}, breadcrumbItem, /*#__PURE__*/react.createElement(DownOutlined/* default */.Z, null)));
|
|
}
|
|
return breadcrumbItem;
|
|
};
|
|
// wrap to dropDown
|
|
const link = renderBreadcrumbNode(children);
|
|
if (link !== undefined && link !== null) {
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("li", null, link), separator && /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
|
|
}
|
|
return null;
|
|
};
|
|
const BreadcrumbItem = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
children,
|
|
href
|
|
} = props,
|
|
restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
return /*#__PURE__*/react.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls
|
|
}), renderItem(prefixCls, restProps, children, href));
|
|
};
|
|
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
|
|
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(45503);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/style/index.js
|
|
|
|
|
|
const genBreadcrumbStyle = token => {
|
|
const {
|
|
componentCls,
|
|
iconCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
color: token.itemColor,
|
|
fontSize: token.fontSize,
|
|
[iconCls]: {
|
|
fontSize: token.iconFontSize
|
|
},
|
|
ol: {
|
|
display: 'flex',
|
|
flexWrap: 'wrap',
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none'
|
|
},
|
|
a: Object.assign({
|
|
color: token.linkColor,
|
|
transition: `color ${token.motionDurationMid}`,
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
borderRadius: token.borderRadiusSM,
|
|
height: token.lineHeight * token.fontSize,
|
|
display: 'inline-block',
|
|
marginInline: -token.marginXXS,
|
|
'&:hover': {
|
|
color: token.linkHoverColor,
|
|
backgroundColor: token.colorBgTextHover
|
|
}
|
|
}, (0,style/* genFocusStyle */.Qy)(token)),
|
|
[`li:last-child`]: {
|
|
color: token.lastItemColor
|
|
},
|
|
[`${componentCls}-separator`]: {
|
|
marginInline: token.separatorMargin,
|
|
color: token.separatorColor
|
|
},
|
|
[`${componentCls}-link`]: {
|
|
[`
|
|
> ${iconCls} + span,
|
|
> ${iconCls} + a
|
|
`]: {
|
|
marginInlineStart: token.marginXXS
|
|
}
|
|
},
|
|
[`${componentCls}-overlay-link`]: {
|
|
borderRadius: token.borderRadiusSM,
|
|
height: token.lineHeight * token.fontSize,
|
|
display: 'inline-block',
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
marginInline: -token.marginXXS,
|
|
[`> ${iconCls}`]: {
|
|
marginInlineStart: token.marginXXS,
|
|
fontSize: token.fontSizeIcon
|
|
},
|
|
'&:hover': {
|
|
color: token.linkHoverColor,
|
|
backgroundColor: token.colorBgTextHover,
|
|
a: {
|
|
color: token.linkHoverColor
|
|
}
|
|
},
|
|
a: {
|
|
'&:hover': {
|
|
backgroundColor: 'transparent'
|
|
}
|
|
}
|
|
},
|
|
// rtl style
|
|
[`&${token.componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var breadcrumb_style = ((0,genComponentStyleHook/* default */.Z)('Breadcrumb', token => {
|
|
const BreadcrumbToken = (0,statistic/* merge */.TS)(token, {});
|
|
return [genBreadcrumbStyle(BreadcrumbToken)];
|
|
}, token => ({
|
|
itemColor: token.colorTextDescription,
|
|
lastItemColor: token.colorText,
|
|
iconFontSize: token.fontSize,
|
|
linkColor: token.colorTextDescription,
|
|
linkHoverColor: token.colorText,
|
|
separatorColor: token.colorTextDescription,
|
|
separatorMargin: token.marginXS
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/useItems.js
|
|
var useItems_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
function route2item(route) {
|
|
const {
|
|
breadcrumbName,
|
|
children
|
|
} = route,
|
|
rest = useItems_rest(route, ["breadcrumbName", "children"]);
|
|
const clone = Object.assign({
|
|
title: breadcrumbName
|
|
}, rest);
|
|
if (children) {
|
|
clone.menu = {
|
|
items: children.map(_a => {
|
|
var {
|
|
breadcrumbName: itemBreadcrumbName
|
|
} = _a,
|
|
itemProps = useItems_rest(_a, ["breadcrumbName"]);
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
title: itemBreadcrumbName
|
|
});
|
|
})
|
|
};
|
|
}
|
|
return clone;
|
|
}
|
|
function useItems(items, routes) {
|
|
return (0,react.useMemo)(() => {
|
|
if (items) {
|
|
return items;
|
|
}
|
|
if (routes) {
|
|
return routes.map(route2item);
|
|
}
|
|
return null;
|
|
}, [items, routes]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/Breadcrumb.js
|
|
var Breadcrumb_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getPath = (params, path) => {
|
|
if (path === undefined) {
|
|
return path;
|
|
}
|
|
let mergedPath = (path || '').replace(/^\//, '');
|
|
Object.keys(params).forEach(key => {
|
|
mergedPath = mergedPath.replace(`:${key}`, params[key]);
|
|
});
|
|
return mergedPath;
|
|
};
|
|
const Breadcrumb = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
separator = '/',
|
|
style,
|
|
className,
|
|
rootClassName,
|
|
routes: legacyRoutes,
|
|
items,
|
|
children,
|
|
itemRender,
|
|
params = {}
|
|
} = props,
|
|
restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
breadcrumb
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
let crumbs;
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
const [wrapSSR, hashId] = breadcrumb_style(prefixCls);
|
|
const mergedItems = useItems(items, legacyRoutes);
|
|
if (false) {}
|
|
const mergedItemRender = useItemRender(prefixCls, itemRender);
|
|
if (mergedItems && mergedItems.length > 0) {
|
|
// generated by route
|
|
const paths = [];
|
|
const itemRenderRoutes = items || legacyRoutes;
|
|
crumbs = mergedItems.map((item, index) => {
|
|
const {
|
|
path,
|
|
key,
|
|
type,
|
|
menu,
|
|
overlay,
|
|
onClick,
|
|
className: itemClassName,
|
|
separator: itemSeparator,
|
|
dropdownProps
|
|
} = item;
|
|
const mergedPath = getPath(params, path);
|
|
if (mergedPath !== undefined) {
|
|
paths.push(mergedPath);
|
|
}
|
|
const mergedKey = key !== null && key !== void 0 ? key : index;
|
|
if (type === 'separator') {
|
|
return /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbSeparator, {
|
|
key: mergedKey
|
|
}, itemSeparator);
|
|
}
|
|
const itemProps = {};
|
|
const isLastItem = index === mergedItems.length - 1;
|
|
if (menu) {
|
|
itemProps.menu = menu;
|
|
} else if (overlay) {
|
|
itemProps.overlay = overlay;
|
|
}
|
|
let {
|
|
href
|
|
} = item;
|
|
if (paths.length && mergedPath !== undefined) {
|
|
href = `#/${paths.join('/')}`;
|
|
}
|
|
return /*#__PURE__*/react.createElement(InternalBreadcrumbItem, Object.assign({
|
|
key: mergedKey
|
|
}, itemProps, (0,pickAttrs/* default */.Z)(item, {
|
|
data: true,
|
|
aria: true
|
|
}), {
|
|
className: itemClassName,
|
|
dropdownProps: dropdownProps,
|
|
href: href,
|
|
separator: isLastItem ? '' : separator,
|
|
onClick: onClick,
|
|
prefixCls: prefixCls
|
|
}), mergedItemRender(item, params, itemRenderRoutes, paths, href));
|
|
});
|
|
} else if (children) {
|
|
const childrenLength = (0,toArray/* default */.Z)(children).length;
|
|
crumbs = (0,toArray/* default */.Z)(children).map((element, index) => {
|
|
if (!element) {
|
|
return element;
|
|
}
|
|
// =================== Warning =====================
|
|
if (false) {}
|
|
false ? 0 : void 0;
|
|
const isLastItem = index === childrenLength - 1;
|
|
return (0,reactNode/* cloneElement */.Tm)(element, {
|
|
separator: isLastItem ? '' : separator,
|
|
key: index
|
|
});
|
|
});
|
|
}
|
|
const breadcrumbClassName = classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
|
|
return wrapSSR( /*#__PURE__*/react.createElement("nav", Object.assign({
|
|
className: breadcrumbClassName,
|
|
style: mergedStyle
|
|
}, restProps), /*#__PURE__*/react.createElement("ol", null, crumbs)));
|
|
};
|
|
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
|
|
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
|
|
if (false) {}
|
|
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/index.js
|
|
'use client';
|
|
|
|
|
|
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 47221:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/antd/es/collapse/index.js + 8 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_collapse; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/RightOutlined.js + 1 modules
|
|
var RightOutlined = __webpack_require__(18073);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(97685);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__(71002);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMergedState.js
|
|
var useMergedState = __webpack_require__(21770);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
var warning = __webpack_require__(80334);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(50344);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// EXTERNAL MODULE: ./node_modules/rc-motion/es/index.js + 11 modules
|
|
var es = __webpack_require__(62874);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js
|
|
var KeyCode = __webpack_require__(15105);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-collapse/es/PanelContent.js
|
|
|
|
|
|
|
|
|
|
var PanelContent = /*#__PURE__*/ react.forwardRef(function (props, ref) {
|
|
var _classnames;
|
|
var prefixCls = props.prefixCls,
|
|
forceRender = props.forceRender,
|
|
className = props.className,
|
|
style = props.style,
|
|
children = props.children,
|
|
isActive = props.isActive,
|
|
role = props.role;
|
|
var _React$useState = react.useState(isActive || forceRender),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
rendered = _React$useState2[0],
|
|
setRendered = _React$useState2[1];
|
|
react.useEffect(
|
|
function () {
|
|
if (forceRender || isActive) {
|
|
setRendered(true);
|
|
}
|
|
},
|
|
[forceRender, isActive],
|
|
);
|
|
if (!rendered) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/ react.createElement(
|
|
'div',
|
|
{
|
|
ref: ref,
|
|
className: classnames_default()(
|
|
''.concat(prefixCls, '-content'),
|
|
((_classnames = {}),
|
|
(0,defineProperty/* default */.Z)(_classnames, ''.concat(prefixCls, '-content-active'), isActive),
|
|
(0,defineProperty/* default */.Z)(_classnames, ''.concat(prefixCls, '-content-inactive'), !isActive),
|
|
_classnames),
|
|
className,
|
|
),
|
|
style: style,
|
|
role: role,
|
|
},
|
|
/*#__PURE__*/ react.createElement(
|
|
'div',
|
|
{
|
|
className: ''.concat(prefixCls, '-content-box'),
|
|
},
|
|
children,
|
|
),
|
|
);
|
|
});
|
|
PanelContent.displayName = 'PanelContent';
|
|
/* harmony default export */ var es_PanelContent = (PanelContent);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-collapse/es/Panel.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = [
|
|
'showArrow',
|
|
'headerClass',
|
|
'isActive',
|
|
'onItemClick',
|
|
'forceRender',
|
|
'className',
|
|
'prefixCls',
|
|
'collapsible',
|
|
'accordion',
|
|
'panelKey',
|
|
'extra',
|
|
'header',
|
|
'expandIcon',
|
|
'openMotion',
|
|
'destroyInactivePanel',
|
|
'children',
|
|
];
|
|
var CollapsePanel = /*#__PURE__*/ react.forwardRef(function (props, ref) {
|
|
var _classNames, _classNames2;
|
|
var _props$showArrow = props.showArrow,
|
|
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
headerClass = props.headerClass,
|
|
isActive = props.isActive,
|
|
onItemClick = props.onItemClick,
|
|
forceRender = props.forceRender,
|
|
className = props.className,
|
|
prefixCls = props.prefixCls,
|
|
collapsible = props.collapsible,
|
|
accordion = props.accordion,
|
|
panelKey = props.panelKey,
|
|
extra = props.extra,
|
|
header = props.header,
|
|
expandIcon = props.expandIcon,
|
|
openMotion = props.openMotion,
|
|
destroyInactivePanel = props.destroyInactivePanel,
|
|
children = props.children,
|
|
resetProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
var disabled = collapsible === 'disabled';
|
|
var collapsibleHeader = collapsible === 'header';
|
|
var collapsibleIcon = collapsible === 'icon';
|
|
var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean';
|
|
var handleItemClick = function handleItemClick() {
|
|
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(panelKey);
|
|
};
|
|
var handleKeyDown = function handleKeyDown(e) {
|
|
if (e.key === 'Enter' || e.keyCode === KeyCode/* default.ENTER */.Z.ENTER || e.which === KeyCode/* default.ENTER */.Z.ENTER) {
|
|
handleItemClick();
|
|
}
|
|
};
|
|
|
|
// ======================== Icon ========================
|
|
var iconNode =
|
|
typeof expandIcon === 'function'
|
|
? expandIcon(props)
|
|
: /*#__PURE__*/ react.createElement('i', {
|
|
className: 'arrow',
|
|
});
|
|
if (iconNode) {
|
|
iconNode = /*#__PURE__*/ react.createElement(
|
|
'div',
|
|
{
|
|
className: ''.concat(prefixCls, '-expand-icon'),
|
|
onClick: ['header', 'icon'].includes(collapsible) ? handleItemClick : undefined,
|
|
},
|
|
iconNode,
|
|
);
|
|
}
|
|
var collapsePanelClassNames = classnames_default()(
|
|
((_classNames = {}),
|
|
(0,defineProperty/* default */.Z)(_classNames, ''.concat(prefixCls, '-item'), true),
|
|
(0,defineProperty/* default */.Z)(_classNames, ''.concat(prefixCls, '-item-active'), isActive),
|
|
(0,defineProperty/* default */.Z)(_classNames, ''.concat(prefixCls, '-item-disabled'), disabled),
|
|
_classNames),
|
|
className,
|
|
);
|
|
var headerClassName = classnames_default()(
|
|
((_classNames2 = {}),
|
|
(0,defineProperty/* default */.Z)(_classNames2, ''.concat(prefixCls, '-header'), true),
|
|
(0,defineProperty/* default */.Z)(_classNames2, 'headerClass', headerClass),
|
|
(0,defineProperty/* default */.Z)(
|
|
_classNames2,
|
|
''.concat(prefixCls, '-header-collapsible-only'),
|
|
collapsibleHeader,
|
|
),
|
|
(0,defineProperty/* default */.Z)(_classNames2, ''.concat(prefixCls, '-icon-collapsible-only'), collapsibleIcon),
|
|
_classNames2),
|
|
);
|
|
|
|
// ======================== HeaderProps ========================
|
|
var headerProps = {
|
|
className: headerClassName,
|
|
'aria-expanded': isActive,
|
|
'aria-disabled': disabled,
|
|
onKeyDown: handleKeyDown,
|
|
};
|
|
if (!collapsibleHeader && !collapsibleIcon) {
|
|
headerProps.onClick = handleItemClick;
|
|
headerProps.role = accordion ? 'tab' : 'button';
|
|
headerProps.tabIndex = disabled ? -1 : 0;
|
|
}
|
|
|
|
// ======================== Render ========================
|
|
return /*#__PURE__*/ react.createElement(
|
|
'div',
|
|
(0,esm_extends/* default */.Z)({}, resetProps, {
|
|
ref: ref,
|
|
className: collapsePanelClassNames,
|
|
}),
|
|
/*#__PURE__*/ react.createElement(
|
|
'div',
|
|
headerProps,
|
|
showArrow && iconNode,
|
|
/*#__PURE__*/ react.createElement(
|
|
'span',
|
|
{
|
|
className: ''.concat(prefixCls, '-header-text'),
|
|
onClick: collapsible === 'header' ? handleItemClick : undefined,
|
|
},
|
|
header,
|
|
),
|
|
ifExtraExist &&
|
|
/*#__PURE__*/ react.createElement(
|
|
'div',
|
|
{
|
|
className: ''.concat(prefixCls, '-extra'),
|
|
},
|
|
extra,
|
|
),
|
|
),
|
|
/*#__PURE__*/ react.createElement(
|
|
es/* default */.Z,
|
|
(0,esm_extends/* default */.Z)(
|
|
{
|
|
visible: isActive,
|
|
leavedClassName: ''.concat(prefixCls, '-content-hidden'),
|
|
},
|
|
openMotion,
|
|
{
|
|
forceRender: forceRender,
|
|
removeOnLeave: destroyInactivePanel,
|
|
},
|
|
),
|
|
function (_ref, motionRef) {
|
|
var motionClassName = _ref.className,
|
|
motionStyle = _ref.style;
|
|
return /*#__PURE__*/ react.createElement(
|
|
es_PanelContent,
|
|
{
|
|
ref: motionRef,
|
|
prefixCls: prefixCls,
|
|
className: motionClassName,
|
|
style: motionStyle,
|
|
isActive: isActive,
|
|
forceRender: forceRender,
|
|
role: accordion ? 'tabpanel' : void 0,
|
|
},
|
|
children,
|
|
);
|
|
},
|
|
),
|
|
);
|
|
});
|
|
/* harmony default export */ var Panel = (CollapsePanel);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-collapse/es/hooks/useItems.js
|
|
|
|
|
|
|
|
|
|
|
|
var useItems_excluded = ['children', 'label', 'key', 'collapsible', 'onItemClick', 'destroyInactivePanel'];
|
|
var convertItemsToNodes = function convertItemsToNodes(items, props) {
|
|
var prefixCls = props.prefixCls,
|
|
accordion = props.accordion,
|
|
collapsible = props.collapsible,
|
|
destroyInactivePanel = props.destroyInactivePanel,
|
|
onItemClick = props.onItemClick,
|
|
activeKey = props.activeKey,
|
|
openMotion = props.openMotion,
|
|
expandIcon = props.expandIcon;
|
|
return items.map(function (item, index) {
|
|
var children = item.children,
|
|
label = item.label,
|
|
rawKey = item.key,
|
|
rawCollapsible = item.collapsible,
|
|
rawOnItemClick = item.onItemClick,
|
|
rawDestroyInactivePanel = item.destroyInactivePanel,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(item, useItems_excluded);
|
|
|
|
// You may be puzzled why you want to convert them all into strings, me too.
|
|
// Maybe: https://github.com/react-component/collapse/blob/aac303a8b6ff30e35060b4f8fecde6f4556fcbe2/src/Collapse.tsx#L15
|
|
var key = String(rawKey !== null && rawKey !== void 0 ? rawKey : index);
|
|
var mergeCollapsible =
|
|
rawCollapsible !== null && rawCollapsible !== void 0 ? rawCollapsible : collapsible;
|
|
var mergeDestroyInactivePanel =
|
|
rawDestroyInactivePanel !== null && rawDestroyInactivePanel !== void 0
|
|
? rawDestroyInactivePanel
|
|
: destroyInactivePanel;
|
|
var handleItemClick = function handleItemClick(value) {
|
|
if (mergeCollapsible === 'disabled') return;
|
|
onItemClick(value);
|
|
rawOnItemClick === null || rawOnItemClick === void 0 ? void 0 : rawOnItemClick(value);
|
|
};
|
|
var isActive = false;
|
|
if (accordion) {
|
|
isActive = activeKey[0] === key;
|
|
} else {
|
|
isActive = activeKey.indexOf(key) > -1;
|
|
}
|
|
return /*#__PURE__*/ react.createElement(
|
|
Panel,
|
|
(0,esm_extends/* default */.Z)({}, restProps, {
|
|
prefixCls: prefixCls,
|
|
key: key,
|
|
panelKey: key,
|
|
isActive: isActive,
|
|
accordion: accordion,
|
|
openMotion: openMotion,
|
|
expandIcon: expandIcon,
|
|
header: label,
|
|
collapsible: mergeCollapsible,
|
|
onItemClick: handleItemClick,
|
|
destroyInactivePanel: mergeDestroyInactivePanel,
|
|
}),
|
|
children,
|
|
);
|
|
});
|
|
};
|
|
|
|
/**
|
|
* @deprecated The next major version will be removed
|
|
*/
|
|
var getNewChild = function getNewChild(child, index, props) {
|
|
if (!child) return null;
|
|
var prefixCls = props.prefixCls,
|
|
accordion = props.accordion,
|
|
collapsible = props.collapsible,
|
|
destroyInactivePanel = props.destroyInactivePanel,
|
|
onItemClick = props.onItemClick,
|
|
activeKey = props.activeKey,
|
|
openMotion = props.openMotion,
|
|
expandIcon = props.expandIcon;
|
|
var key = child.key || String(index);
|
|
var _child$props = child.props,
|
|
header = _child$props.header,
|
|
headerClass = _child$props.headerClass,
|
|
childDestroyInactivePanel = _child$props.destroyInactivePanel,
|
|
childCollapsible = _child$props.collapsible,
|
|
childOnItemClick = _child$props.onItemClick;
|
|
var isActive = false;
|
|
if (accordion) {
|
|
isActive = activeKey[0] === key;
|
|
} else {
|
|
isActive = activeKey.indexOf(key) > -1;
|
|
}
|
|
var mergeCollapsible =
|
|
childCollapsible !== null && childCollapsible !== void 0 ? childCollapsible : collapsible;
|
|
var handleItemClick = function handleItemClick(value) {
|
|
if (mergeCollapsible === 'disabled') return;
|
|
onItemClick(value);
|
|
childOnItemClick === null || childOnItemClick === void 0 ? void 0 : childOnItemClick(value);
|
|
};
|
|
var childProps = {
|
|
key: key,
|
|
panelKey: key,
|
|
header: header,
|
|
headerClass: headerClass,
|
|
isActive: isActive,
|
|
prefixCls: prefixCls,
|
|
destroyInactivePanel:
|
|
childDestroyInactivePanel !== null && childDestroyInactivePanel !== void 0
|
|
? childDestroyInactivePanel
|
|
: destroyInactivePanel,
|
|
openMotion: openMotion,
|
|
accordion: accordion,
|
|
children: child.props.children,
|
|
onItemClick: handleItemClick,
|
|
expandIcon: expandIcon,
|
|
collapsible: mergeCollapsible,
|
|
};
|
|
|
|
// https://github.com/ant-design/ant-design/issues/20479
|
|
if (typeof child.type === 'string') {
|
|
return child;
|
|
}
|
|
Object.keys(childProps).forEach(function (propName) {
|
|
if (typeof childProps[propName] === 'undefined') {
|
|
delete childProps[propName];
|
|
}
|
|
});
|
|
return /*#__PURE__*/ react.cloneElement(child, childProps);
|
|
};
|
|
function useItems(items, rawChildren, props) {
|
|
if (Array.isArray(items)) {
|
|
return convertItemsToNodes(items, props);
|
|
}
|
|
return (0,toArray/* default */.Z)(rawChildren).map(function (child, index) {
|
|
return getNewChild(child, index, props);
|
|
});
|
|
}
|
|
/* harmony default export */ var hooks_useItems = (useItems);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-collapse/es/Collapse.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getActiveKeysArray(activeKey) {
|
|
var currentActiveKey = activeKey;
|
|
if (!Array.isArray(currentActiveKey)) {
|
|
var activeKeyType = (0,esm_typeof/* default */.Z)(currentActiveKey);
|
|
currentActiveKey =
|
|
activeKeyType === 'number' || activeKeyType === 'string' ? [currentActiveKey] : [];
|
|
}
|
|
return currentActiveKey.map(function (key) {
|
|
return String(key);
|
|
});
|
|
}
|
|
var Collapse = /*#__PURE__*/ react.forwardRef(function (props, ref) {
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-collapse' : _props$prefixCls,
|
|
_props$destroyInactiv = props.destroyInactivePanel,
|
|
destroyInactivePanel = _props$destroyInactiv === void 0 ? false : _props$destroyInactiv,
|
|
style = props.style,
|
|
accordion = props.accordion,
|
|
className = props.className,
|
|
children = props.children,
|
|
collapsible = props.collapsible,
|
|
openMotion = props.openMotion,
|
|
expandIcon = props.expandIcon,
|
|
rawActiveKey = props.activeKey,
|
|
defaultActiveKey = props.defaultActiveKey,
|
|
_onChange = props.onChange,
|
|
items = props.items;
|
|
var collapseClassName = classnames_default()(prefixCls, className);
|
|
var _useMergedState = (0,useMergedState/* default */.Z)([], {
|
|
value: rawActiveKey,
|
|
onChange: function onChange(v) {
|
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(v);
|
|
},
|
|
defaultValue: defaultActiveKey,
|
|
postState: getActiveKeysArray,
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
activeKey = _useMergedState2[0],
|
|
setActiveKey = _useMergedState2[1];
|
|
var onItemClick = function onItemClick(key) {
|
|
return setActiveKey(function () {
|
|
if (accordion) {
|
|
return activeKey[0] === key ? [] : [key];
|
|
}
|
|
var index = activeKey.indexOf(key);
|
|
var isActive = index > -1;
|
|
if (isActive) {
|
|
return activeKey.filter(function (item) {
|
|
return item !== key;
|
|
});
|
|
}
|
|
return [].concat((0,toConsumableArray/* default */.Z)(activeKey), [key]);
|
|
});
|
|
};
|
|
|
|
// ======================== Children ========================
|
|
(0,warning/* default */.ZP)(
|
|
!children,
|
|
'`children` will be removed in next major version. Please use `items` instead.',
|
|
);
|
|
var mergedChildren = hooks_useItems(items, children, {
|
|
prefixCls: prefixCls,
|
|
accordion: accordion,
|
|
openMotion: openMotion,
|
|
expandIcon: expandIcon,
|
|
collapsible: collapsible,
|
|
destroyInactivePanel: destroyInactivePanel,
|
|
onItemClick: onItemClick,
|
|
activeKey: activeKey,
|
|
});
|
|
|
|
// ======================== Render ========================
|
|
return /*#__PURE__*/ react.createElement(
|
|
'div',
|
|
{
|
|
ref: ref,
|
|
className: collapseClassName,
|
|
style: style,
|
|
role: accordion ? 'tablist' : undefined,
|
|
},
|
|
mergedChildren,
|
|
);
|
|
});
|
|
/* harmony default export */ var es_Collapse = (Object.assign(Collapse, {
|
|
/**
|
|
* @deprecated use `items` instead, will be removed in `v4.0.0`
|
|
*/
|
|
Panel: Panel,
|
|
}));
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-collapse/es/index.js
|
|
|
|
/* harmony default export */ var rc_collapse_es = (es_Collapse);
|
|
|
|
/**
|
|
* @deprecated use `items` instead, will be removed in `v4.0.0`
|
|
*/
|
|
var es_Panel = es_Collapse.Panel;
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/Children/toArray.js
|
|
var Children_toArray = __webpack_require__(37419);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/motion.js
|
|
var motion = __webpack_require__(33603);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(96159);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(98675);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/collapse/CollapsePanel.js
|
|
|
|
|
|
|
|
|
|
|
|
const CollapsePanel_CollapsePanel = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
false ? 0 : void 0;
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
showArrow = true
|
|
} = props;
|
|
const prefixCls = getPrefixCls('collapse', customizePrefixCls);
|
|
const collapsePanelClassName = classnames_default()({
|
|
[`${prefixCls}-no-arrow`]: !showArrow
|
|
}, className);
|
|
return /*#__PURE__*/react.createElement(rc_collapse_es.Panel, Object.assign({
|
|
ref: ref
|
|
}, props, {
|
|
prefixCls: prefixCls,
|
|
className: collapsePanelClassName
|
|
}));
|
|
});
|
|
/* harmony default export */ var collapse_CollapsePanel = (CollapsePanel_CollapsePanel);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/motion/collapse.js
|
|
var collapse = __webpack_require__(33507);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(45503);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/collapse/style/index.js
|
|
|
|
|
|
|
|
const genBaseStyle = token => {
|
|
const {
|
|
componentCls,
|
|
collapseContentBg,
|
|
padding,
|
|
collapseContentPaddingHorizontal,
|
|
collapseHeaderBg,
|
|
collapseHeaderPadding,
|
|
collapseHeaderPaddingSM,
|
|
collapseHeaderPaddingLG,
|
|
collapsePanelBorderRadius,
|
|
lineWidth,
|
|
lineType,
|
|
colorBorder,
|
|
colorText,
|
|
colorTextHeading,
|
|
colorTextDisabled,
|
|
fontSize,
|
|
fontSizeLG,
|
|
lineHeight,
|
|
marginSM,
|
|
paddingSM,
|
|
paddingLG,
|
|
paddingXS,
|
|
motionDurationSlow,
|
|
fontSizeIcon
|
|
} = token;
|
|
const borderBase = `${lineWidth}px ${lineType} ${colorBorder}`;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
backgroundColor: collapseHeaderBg,
|
|
border: borderBase,
|
|
borderBottom: 0,
|
|
borderRadius: `${collapsePanelBorderRadius}px`,
|
|
[`&-rtl`]: {
|
|
direction: 'rtl'
|
|
},
|
|
[`& > ${componentCls}-item`]: {
|
|
borderBottom: borderBase,
|
|
[`&:last-child`]: {
|
|
[`
|
|
&,
|
|
& > ${componentCls}-header`]: {
|
|
borderRadius: `0 0 ${collapsePanelBorderRadius}px ${collapsePanelBorderRadius}px`
|
|
}
|
|
},
|
|
[`> ${componentCls}-header`]: {
|
|
position: 'relative',
|
|
display: 'flex',
|
|
flexWrap: 'nowrap',
|
|
alignItems: 'flex-start',
|
|
padding: collapseHeaderPadding,
|
|
paddingInlineStart: paddingSM,
|
|
color: colorTextHeading,
|
|
lineHeight,
|
|
cursor: 'pointer',
|
|
transition: `all ${motionDurationSlow}, visibility 0s`,
|
|
[`> ${componentCls}-header-text`]: {
|
|
flex: 'auto'
|
|
},
|
|
'&:focus': {
|
|
outline: 'none'
|
|
},
|
|
// >>>>> Arrow
|
|
[`${componentCls}-expand-icon`]: {
|
|
height: fontSize * lineHeight,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
paddingInlineEnd: marginSM,
|
|
// Arrow offset
|
|
marginInlineStart: padding - paddingSM
|
|
},
|
|
[`${componentCls}-arrow`]: Object.assign(Object.assign({}, (0,style/* resetIcon */.Ro)()), {
|
|
fontSize: fontSizeIcon,
|
|
svg: {
|
|
transition: `transform ${motionDurationSlow}`
|
|
}
|
|
}),
|
|
// >>>>> Text
|
|
[`${componentCls}-header-text`]: {
|
|
marginInlineEnd: 'auto'
|
|
}
|
|
},
|
|
[`${componentCls}-header-collapsible-only`]: {
|
|
cursor: 'default',
|
|
[`${componentCls}-header-text`]: {
|
|
flex: 'none',
|
|
cursor: 'pointer'
|
|
}
|
|
},
|
|
[`${componentCls}-icon-collapsible-only`]: {
|
|
cursor: 'default',
|
|
[`${componentCls}-expand-icon`]: {
|
|
cursor: 'pointer'
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-content`]: {
|
|
color: colorText,
|
|
backgroundColor: collapseContentBg,
|
|
borderTop: borderBase,
|
|
[`& > ${componentCls}-content-box`]: {
|
|
padding: `${padding}px ${collapseContentPaddingHorizontal}px`
|
|
},
|
|
[`&-hidden`]: {
|
|
display: 'none'
|
|
}
|
|
},
|
|
[`&-small`]: {
|
|
[`> ${componentCls}-item`]: {
|
|
[`> ${componentCls}-header`]: {
|
|
padding: collapseHeaderPaddingSM,
|
|
paddingInlineStart: paddingXS,
|
|
[`> ${componentCls}-expand-icon`]: {
|
|
// Arrow offset
|
|
marginInlineStart: paddingSM - paddingXS
|
|
}
|
|
},
|
|
[`> ${componentCls}-content > ${componentCls}-content-box`]: {
|
|
padding: paddingSM
|
|
}
|
|
}
|
|
},
|
|
[`&-large`]: {
|
|
[`> ${componentCls}-item`]: {
|
|
fontSize: fontSizeLG,
|
|
[`> ${componentCls}-header`]: {
|
|
padding: collapseHeaderPaddingLG,
|
|
paddingInlineStart: padding,
|
|
[`> ${componentCls}-expand-icon`]: {
|
|
height: fontSizeLG * lineHeight,
|
|
// Arrow offset
|
|
marginInlineStart: paddingLG - padding
|
|
}
|
|
},
|
|
[`> ${componentCls}-content > ${componentCls}-content-box`]: {
|
|
padding: paddingLG
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-item:last-child`]: {
|
|
[`> ${componentCls}-content`]: {
|
|
borderRadius: `0 0 ${collapsePanelBorderRadius}px ${collapsePanelBorderRadius}px`
|
|
}
|
|
},
|
|
[`& ${componentCls}-item-disabled > ${componentCls}-header`]: {
|
|
[`
|
|
&,
|
|
& > .arrow
|
|
`]: {
|
|
color: colorTextDisabled,
|
|
cursor: 'not-allowed'
|
|
}
|
|
},
|
|
// ========================== Icon Position ==========================
|
|
[`&${componentCls}-icon-position-end`]: {
|
|
[`& > ${componentCls}-item`]: {
|
|
[`> ${componentCls}-header`]: {
|
|
[`${componentCls}-expand-icon`]: {
|
|
order: 1,
|
|
paddingInlineEnd: 0,
|
|
paddingInlineStart: marginSM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
};
|
|
};
|
|
const genArrowStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
const fixedSelector = `> ${componentCls}-item > ${componentCls}-header ${componentCls}-arrow svg`;
|
|
return {
|
|
[`${componentCls}-rtl`]: {
|
|
[fixedSelector]: {
|
|
transform: `rotate(180deg)`
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genBorderlessStyle = token => {
|
|
const {
|
|
componentCls,
|
|
collapseHeaderBg,
|
|
paddingXXS,
|
|
colorBorder
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-borderless`]: {
|
|
backgroundColor: collapseHeaderBg,
|
|
border: 0,
|
|
[`> ${componentCls}-item`]: {
|
|
borderBottom: `1px solid ${colorBorder}`
|
|
},
|
|
[`
|
|
> ${componentCls}-item:last-child,
|
|
> ${componentCls}-item:last-child ${componentCls}-header
|
|
`]: {
|
|
borderRadius: 0
|
|
},
|
|
[`> ${componentCls}-item:last-child`]: {
|
|
borderBottom: 0
|
|
},
|
|
[`> ${componentCls}-item > ${componentCls}-content`]: {
|
|
backgroundColor: 'transparent',
|
|
borderTop: 0
|
|
},
|
|
[`> ${componentCls}-item > ${componentCls}-content > ${componentCls}-content-box`]: {
|
|
paddingTop: paddingXXS
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genGhostStyle = token => {
|
|
const {
|
|
componentCls,
|
|
paddingSM
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-ghost`]: {
|
|
backgroundColor: 'transparent',
|
|
border: 0,
|
|
[`> ${componentCls}-item`]: {
|
|
borderBottom: 0,
|
|
[`> ${componentCls}-content`]: {
|
|
backgroundColor: 'transparent',
|
|
border: 0,
|
|
[`> ${componentCls}-content-box`]: {
|
|
paddingBlock: paddingSM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/* harmony default export */ var collapse_style = ((0,genComponentStyleHook/* default */.Z)('Collapse', token => {
|
|
const collapseToken = (0,statistic/* merge */.TS)(token, {
|
|
collapseContentBg: token.colorBgContainer,
|
|
collapseHeaderBg: token.colorFillAlter,
|
|
collapseHeaderPadding: `${token.paddingSM}px ${token.padding}px`,
|
|
collapseHeaderPaddingSM: `${token.paddingXS}px ${token.paddingSM}px`,
|
|
collapseHeaderPaddingLG: `${token.padding}px ${token.paddingLG}px`,
|
|
collapsePanelBorderRadius: token.borderRadiusLG,
|
|
collapseContentPaddingHorizontal: 16 // Fixed value
|
|
});
|
|
|
|
return [genBaseStyle(collapseToken), genBorderlessStyle(collapseToken), genGhostStyle(collapseToken), genArrowStyle(collapseToken), (0,collapse/* default */.Z)(collapseToken)];
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/collapse/Collapse.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Collapse_Collapse = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
collapse
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
bordered = true,
|
|
ghost,
|
|
size: customizeSize,
|
|
expandIconPosition = 'start',
|
|
children,
|
|
expandIcon
|
|
} = props;
|
|
const mergedSize = (0,useSize/* default */.Z)(ctx => {
|
|
var _a;
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : ctx) !== null && _a !== void 0 ? _a : 'middle';
|
|
});
|
|
const prefixCls = getPrefixCls('collapse', customizePrefixCls);
|
|
const rootPrefixCls = getPrefixCls();
|
|
const [wrapSSR, hashId] = collapse_style(prefixCls);
|
|
// Warning if use legacy type `expandIconPosition`
|
|
false ? 0 : void 0;
|
|
// Align with logic position
|
|
const mergedExpandIconPosition = react.useMemo(() => {
|
|
if (expandIconPosition === 'left') {
|
|
return 'start';
|
|
}
|
|
return expandIconPosition === 'right' ? 'end' : expandIconPosition;
|
|
}, [expandIconPosition]);
|
|
const renderExpandIcon = function () {
|
|
let panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
const icon = expandIcon ? expandIcon(panelProps) : /*#__PURE__*/react.createElement(RightOutlined/* default */.Z, {
|
|
rotate: panelProps.isActive ? 90 : undefined
|
|
});
|
|
return (0,reactNode/* cloneElement */.Tm)(icon, () => ({
|
|
className: classnames_default()(icon.props.className, `${prefixCls}-arrow`)
|
|
}));
|
|
};
|
|
const collapseClassName = classnames_default()(`${prefixCls}-icon-position-${mergedExpandIconPosition}`, {
|
|
[`${prefixCls}-borderless`]: !bordered,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-ghost`]: !!ghost,
|
|
[`${prefixCls}-${mergedSize}`]: mergedSize !== 'middle'
|
|
}, collapse === null || collapse === void 0 ? void 0 : collapse.className, className, rootClassName, hashId);
|
|
const openMotion = Object.assign(Object.assign({}, (0,motion/* default */.ZP)(rootPrefixCls)), {
|
|
motionAppear: false,
|
|
leavedClassName: `${prefixCls}-content-hidden`
|
|
});
|
|
const items = react.useMemo(() => children ? (0,Children_toArray/* default */.Z)(children).map((child, index) => {
|
|
var _a, _b;
|
|
if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
const key = (_b = child.key) !== null && _b !== void 0 ? _b : String(index);
|
|
const {
|
|
disabled,
|
|
collapsible
|
|
} = child.props;
|
|
const childProps = Object.assign(Object.assign({}, (0,omit/* default */.Z)(child.props, ['disabled'])), {
|
|
key,
|
|
collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined
|
|
});
|
|
return (0,reactNode/* cloneElement */.Tm)(child, childProps);
|
|
}
|
|
return child;
|
|
}) : null, [children]);
|
|
return wrapSSR( /*#__PURE__*/react.createElement(rc_collapse_es, Object.assign({
|
|
ref: ref,
|
|
openMotion: openMotion
|
|
}, (0,omit/* default */.Z)(props, ['rootClassName']), {
|
|
expandIcon: renderExpandIcon,
|
|
prefixCls: prefixCls,
|
|
className: collapseClassName,
|
|
style: Object.assign(Object.assign({}, collapse === null || collapse === void 0 ? void 0 : collapse.style), style)
|
|
}), items));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var collapse_Collapse = (Object.assign(Collapse_Collapse, {
|
|
Panel: collapse_CollapsePanel
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/collapse/index.js
|
|
'use client';
|
|
|
|
|
|
/* harmony default export */ var es_collapse = (collapse_Collapse);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 47897:
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/antd/es/switch/index.js + 27 modules ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_switch; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
var LoadingOutlined = __webpack_require__(50888);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
function _extends() {
|
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
var source = arguments[i];
|
|
for (var key in source) {
|
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
};
|
|
return _extends.apply(this, arguments);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
|
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
return typeof obj;
|
|
} : function (obj) {
|
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
}, _typeof(obj);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
|
|
function _toPrimitive(input, hint) {
|
|
if (_typeof(input) !== "object" || input === null) return input;
|
|
var prim = input[Symbol.toPrimitive];
|
|
if (prim !== undefined) {
|
|
var res = prim.call(input, hint || "default");
|
|
if (_typeof(res) !== "object") return res;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return (hint === "string" ? String : Number)(input);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
|
|
|
|
function _toPropertyKey(arg) {
|
|
var key = _toPrimitive(arg, "string");
|
|
return _typeof(key) === "symbol" ? key : String(key);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
|
function _defineProperty(obj, key, value) {
|
|
key = _toPropertyKey(key);
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, {
|
|
value: value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
|
function _arrayWithHoles(arr) {
|
|
if (Array.isArray(arr)) return arr;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
|
function _iterableToArrayLimit(arr, i) {
|
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (null != _i) {
|
|
var _s,
|
|
_e,
|
|
_x,
|
|
_r,
|
|
_arr = [],
|
|
_n = !0,
|
|
_d = !1;
|
|
try {
|
|
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
if (Object(_i) !== _i) return;
|
|
_n = !1;
|
|
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
} catch (err) {
|
|
_d = !0, _e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
} finally {
|
|
if (_d) throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length) len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
return arr2;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
|
|
function _unsupportedIterableToArray(o, minLen) {
|
|
if (!o) return;
|
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
|
function _nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
|
|
|
|
|
|
|
|
|
function _slicedToArray(arr, i) {
|
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i;
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
key = sourceKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
|
function _objectWithoutProperties(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
var key, i;
|
|
if (Object.getOwnPropertySymbols) {
|
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
key = sourceSymbolKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
|
function arrayWithHoles_arrayWithHoles(arr) {
|
|
if (Array.isArray(arr)) return arr;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
|
function iterableToArrayLimit_iterableToArrayLimit(arr, i) {
|
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (null != _i) {
|
|
var _s,
|
|
_e,
|
|
_x,
|
|
_r,
|
|
_arr = [],
|
|
_n = !0,
|
|
_d = !1;
|
|
try {
|
|
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
if (Object(_i) !== _i) return;
|
|
_n = !1;
|
|
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
} catch (err) {
|
|
_d = !0, _e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
} finally {
|
|
if (_d) throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
function arrayLikeToArray_arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length) len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
return arr2;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
|
|
function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
|
|
if (!o) return;
|
|
if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
|
function nonIterableRest_nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
|
|
|
|
|
|
|
|
|
function slicedToArray_slicedToArray(arr, i) {
|
|
return arrayWithHoles_arrayWithHoles(arr) || iterableToArrayLimit_iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || nonIterableRest_nonIterableRest();
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function useEvent(callback) {
|
|
var fnRef = react.useRef();
|
|
fnRef.current = callback;
|
|
var memoFn = react.useCallback(function () {
|
|
var _fnRef$current;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
}, []);
|
|
return memoFn;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useInternalLayoutEffect = true && canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
var useLayoutEffect = function useLayoutEffect(callback, deps) {
|
|
var firstMountRef = react.useRef(true);
|
|
useInternalLayoutEffect(function () {
|
|
return callback(firstMountRef.current);
|
|
}, deps);
|
|
|
|
// We tell react that first mount has passed
|
|
useInternalLayoutEffect(function () {
|
|
firstMountRef.current = false;
|
|
return function () {
|
|
firstMountRef.current = true;
|
|
};
|
|
}, []);
|
|
};
|
|
var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
useLayoutEffect(function (firstMount) {
|
|
if (!firstMount) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
};
|
|
/* harmony default export */ var hooks_useLayoutEffect = ((/* unused pure expression or super */ null && (useLayoutEffect)));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/hooks/useState.js
|
|
|
|
|
|
/**
|
|
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
|
|
* We do not make this auto is to avoid real memory leak.
|
|
* Developer should confirm it's safe to ignore themselves.
|
|
*/
|
|
function useSafeState(defaultValue) {
|
|
var destroyRef = react.useRef(false);
|
|
var _React$useState = react.useState(defaultValue),
|
|
_React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
|
|
value = _React$useState2[0],
|
|
setValue = _React$useState2[1];
|
|
react.useEffect(function () {
|
|
destroyRef.current = false;
|
|
return function () {
|
|
destroyRef.current = true;
|
|
};
|
|
}, []);
|
|
function safeSetState(updater, ignoreDestroy) {
|
|
if (ignoreDestroy && destroyRef.current) {
|
|
return;
|
|
}
|
|
setValue(updater);
|
|
}
|
|
return [value, safeSetState];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
|
|
|
|
|
|
|
/** We only think `undefined` is empty */
|
|
function hasValue(value) {
|
|
return value !== undefined;
|
|
}
|
|
|
|
/**
|
|
* Similar to `useState` but will use props value if provided.
|
|
* Note that internal use rc-util `useState` hook.
|
|
*/
|
|
function useMergedState(defaultStateValue, option) {
|
|
var _ref = option || {},
|
|
defaultValue = _ref.defaultValue,
|
|
value = _ref.value,
|
|
onChange = _ref.onChange,
|
|
postState = _ref.postState;
|
|
|
|
// ======================= Init =======================
|
|
var _useState = useSafeState(function () {
|
|
if (hasValue(value)) {
|
|
return value;
|
|
} else if (hasValue(defaultValue)) {
|
|
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
|
|
} else {
|
|
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
|
|
}
|
|
}),
|
|
_useState2 = slicedToArray_slicedToArray(_useState, 2),
|
|
innerValue = _useState2[0],
|
|
setInnerValue = _useState2[1];
|
|
var mergedValue = value !== undefined ? value : innerValue;
|
|
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
|
|
// ====================== Change ======================
|
|
var onChangeFn = useEvent(onChange);
|
|
var _useState3 = useSafeState([mergedValue]),
|
|
_useState4 = slicedToArray_slicedToArray(_useState3, 2),
|
|
prevValue = _useState4[0],
|
|
setPrevValue = _useState4[1];
|
|
useLayoutUpdateEffect(function () {
|
|
var prev = prevValue[0];
|
|
if (innerValue !== prev) {
|
|
onChangeFn(innerValue, prev);
|
|
}
|
|
}, [prevValue]);
|
|
|
|
// Sync value back to `undefined` when it from control to un-control
|
|
useLayoutUpdateEffect(function () {
|
|
if (!hasValue(value)) {
|
|
setInnerValue(value);
|
|
}
|
|
}, [value]);
|
|
|
|
// ====================== Update ======================
|
|
var triggerChange = useEvent(function (updater, ignoreDestroy) {
|
|
setInnerValue(updater, ignoreDestroy);
|
|
setPrevValue([mergedValue], ignoreDestroy);
|
|
});
|
|
return [postMergedValue, triggerChange];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/KeyCode.js
|
|
/**
|
|
* @ignore
|
|
* some key-codes definition and utils from closure-library
|
|
* @author yiminghe@gmail.com
|
|
*/
|
|
|
|
var KeyCode = {
|
|
/**
|
|
* MAC_ENTER
|
|
*/
|
|
MAC_ENTER: 3,
|
|
/**
|
|
* BACKSPACE
|
|
*/
|
|
BACKSPACE: 8,
|
|
/**
|
|
* TAB
|
|
*/
|
|
TAB: 9,
|
|
/**
|
|
* NUMLOCK on FF/Safari Mac
|
|
*/
|
|
NUM_CENTER: 12,
|
|
// NUMLOCK on FF/Safari Mac
|
|
/**
|
|
* ENTER
|
|
*/
|
|
ENTER: 13,
|
|
/**
|
|
* SHIFT
|
|
*/
|
|
SHIFT: 16,
|
|
/**
|
|
* CTRL
|
|
*/
|
|
CTRL: 17,
|
|
/**
|
|
* ALT
|
|
*/
|
|
ALT: 18,
|
|
/**
|
|
* PAUSE
|
|
*/
|
|
PAUSE: 19,
|
|
/**
|
|
* CAPS_LOCK
|
|
*/
|
|
CAPS_LOCK: 20,
|
|
/**
|
|
* ESC
|
|
*/
|
|
ESC: 27,
|
|
/**
|
|
* SPACE
|
|
*/
|
|
SPACE: 32,
|
|
/**
|
|
* PAGE_UP
|
|
*/
|
|
PAGE_UP: 33,
|
|
// also NUM_NORTH_EAST
|
|
/**
|
|
* PAGE_DOWN
|
|
*/
|
|
PAGE_DOWN: 34,
|
|
// also NUM_SOUTH_EAST
|
|
/**
|
|
* END
|
|
*/
|
|
END: 35,
|
|
// also NUM_SOUTH_WEST
|
|
/**
|
|
* HOME
|
|
*/
|
|
HOME: 36,
|
|
// also NUM_NORTH_WEST
|
|
/**
|
|
* LEFT
|
|
*/
|
|
LEFT: 37,
|
|
// also NUM_WEST
|
|
/**
|
|
* UP
|
|
*/
|
|
UP: 38,
|
|
// also NUM_NORTH
|
|
/**
|
|
* RIGHT
|
|
*/
|
|
RIGHT: 39,
|
|
// also NUM_EAST
|
|
/**
|
|
* DOWN
|
|
*/
|
|
DOWN: 40,
|
|
// also NUM_SOUTH
|
|
/**
|
|
* PRINT_SCREEN
|
|
*/
|
|
PRINT_SCREEN: 44,
|
|
/**
|
|
* INSERT
|
|
*/
|
|
INSERT: 45,
|
|
// also NUM_INSERT
|
|
/**
|
|
* DELETE
|
|
*/
|
|
DELETE: 46,
|
|
// also NUM_DELETE
|
|
/**
|
|
* ZERO
|
|
*/
|
|
ZERO: 48,
|
|
/**
|
|
* ONE
|
|
*/
|
|
ONE: 49,
|
|
/**
|
|
* TWO
|
|
*/
|
|
TWO: 50,
|
|
/**
|
|
* THREE
|
|
*/
|
|
THREE: 51,
|
|
/**
|
|
* FOUR
|
|
*/
|
|
FOUR: 52,
|
|
/**
|
|
* FIVE
|
|
*/
|
|
FIVE: 53,
|
|
/**
|
|
* SIX
|
|
*/
|
|
SIX: 54,
|
|
/**
|
|
* SEVEN
|
|
*/
|
|
SEVEN: 55,
|
|
/**
|
|
* EIGHT
|
|
*/
|
|
EIGHT: 56,
|
|
/**
|
|
* NINE
|
|
*/
|
|
NINE: 57,
|
|
/**
|
|
* QUESTION_MARK
|
|
*/
|
|
QUESTION_MARK: 63,
|
|
// needs localization
|
|
/**
|
|
* A
|
|
*/
|
|
A: 65,
|
|
/**
|
|
* B
|
|
*/
|
|
B: 66,
|
|
/**
|
|
* C
|
|
*/
|
|
C: 67,
|
|
/**
|
|
* D
|
|
*/
|
|
D: 68,
|
|
/**
|
|
* E
|
|
*/
|
|
E: 69,
|
|
/**
|
|
* F
|
|
*/
|
|
F: 70,
|
|
/**
|
|
* G
|
|
*/
|
|
G: 71,
|
|
/**
|
|
* H
|
|
*/
|
|
H: 72,
|
|
/**
|
|
* I
|
|
*/
|
|
I: 73,
|
|
/**
|
|
* J
|
|
*/
|
|
J: 74,
|
|
/**
|
|
* K
|
|
*/
|
|
K: 75,
|
|
/**
|
|
* L
|
|
*/
|
|
L: 76,
|
|
/**
|
|
* M
|
|
*/
|
|
M: 77,
|
|
/**
|
|
* N
|
|
*/
|
|
N: 78,
|
|
/**
|
|
* O
|
|
*/
|
|
O: 79,
|
|
/**
|
|
* P
|
|
*/
|
|
P: 80,
|
|
/**
|
|
* Q
|
|
*/
|
|
Q: 81,
|
|
/**
|
|
* R
|
|
*/
|
|
R: 82,
|
|
/**
|
|
* S
|
|
*/
|
|
S: 83,
|
|
/**
|
|
* T
|
|
*/
|
|
T: 84,
|
|
/**
|
|
* U
|
|
*/
|
|
U: 85,
|
|
/**
|
|
* V
|
|
*/
|
|
V: 86,
|
|
/**
|
|
* W
|
|
*/
|
|
W: 87,
|
|
/**
|
|
* X
|
|
*/
|
|
X: 88,
|
|
/**
|
|
* Y
|
|
*/
|
|
Y: 89,
|
|
/**
|
|
* Z
|
|
*/
|
|
Z: 90,
|
|
/**
|
|
* META
|
|
*/
|
|
META: 91,
|
|
// WIN_KEY_LEFT
|
|
/**
|
|
* WIN_KEY_RIGHT
|
|
*/
|
|
WIN_KEY_RIGHT: 92,
|
|
/**
|
|
* CONTEXT_MENU
|
|
*/
|
|
CONTEXT_MENU: 93,
|
|
/**
|
|
* NUM_ZERO
|
|
*/
|
|
NUM_ZERO: 96,
|
|
/**
|
|
* NUM_ONE
|
|
*/
|
|
NUM_ONE: 97,
|
|
/**
|
|
* NUM_TWO
|
|
*/
|
|
NUM_TWO: 98,
|
|
/**
|
|
* NUM_THREE
|
|
*/
|
|
NUM_THREE: 99,
|
|
/**
|
|
* NUM_FOUR
|
|
*/
|
|
NUM_FOUR: 100,
|
|
/**
|
|
* NUM_FIVE
|
|
*/
|
|
NUM_FIVE: 101,
|
|
/**
|
|
* NUM_SIX
|
|
*/
|
|
NUM_SIX: 102,
|
|
/**
|
|
* NUM_SEVEN
|
|
*/
|
|
NUM_SEVEN: 103,
|
|
/**
|
|
* NUM_EIGHT
|
|
*/
|
|
NUM_EIGHT: 104,
|
|
/**
|
|
* NUM_NINE
|
|
*/
|
|
NUM_NINE: 105,
|
|
/**
|
|
* NUM_MULTIPLY
|
|
*/
|
|
NUM_MULTIPLY: 106,
|
|
/**
|
|
* NUM_PLUS
|
|
*/
|
|
NUM_PLUS: 107,
|
|
/**
|
|
* NUM_MINUS
|
|
*/
|
|
NUM_MINUS: 109,
|
|
/**
|
|
* NUM_PERIOD
|
|
*/
|
|
NUM_PERIOD: 110,
|
|
/**
|
|
* NUM_DIVISION
|
|
*/
|
|
NUM_DIVISION: 111,
|
|
/**
|
|
* F1
|
|
*/
|
|
F1: 112,
|
|
/**
|
|
* F2
|
|
*/
|
|
F2: 113,
|
|
/**
|
|
* F3
|
|
*/
|
|
F3: 114,
|
|
/**
|
|
* F4
|
|
*/
|
|
F4: 115,
|
|
/**
|
|
* F5
|
|
*/
|
|
F5: 116,
|
|
/**
|
|
* F6
|
|
*/
|
|
F6: 117,
|
|
/**
|
|
* F7
|
|
*/
|
|
F7: 118,
|
|
/**
|
|
* F8
|
|
*/
|
|
F8: 119,
|
|
/**
|
|
* F9
|
|
*/
|
|
F9: 120,
|
|
/**
|
|
* F10
|
|
*/
|
|
F10: 121,
|
|
/**
|
|
* F11
|
|
*/
|
|
F11: 122,
|
|
/**
|
|
* F12
|
|
*/
|
|
F12: 123,
|
|
/**
|
|
* NUMLOCK
|
|
*/
|
|
NUMLOCK: 144,
|
|
/**
|
|
* SEMICOLON
|
|
*/
|
|
SEMICOLON: 186,
|
|
// needs localization
|
|
/**
|
|
* DASH
|
|
*/
|
|
DASH: 189,
|
|
// needs localization
|
|
/**
|
|
* EQUALS
|
|
*/
|
|
EQUALS: 187,
|
|
// needs localization
|
|
/**
|
|
* COMMA
|
|
*/
|
|
COMMA: 188,
|
|
// needs localization
|
|
/**
|
|
* PERIOD
|
|
*/
|
|
PERIOD: 190,
|
|
// needs localization
|
|
/**
|
|
* SLASH
|
|
*/
|
|
SLASH: 191,
|
|
// needs localization
|
|
/**
|
|
* APOSTROPHE
|
|
*/
|
|
APOSTROPHE: 192,
|
|
// needs localization
|
|
/**
|
|
* SINGLE_QUOTE
|
|
*/
|
|
SINGLE_QUOTE: 222,
|
|
// needs localization
|
|
/**
|
|
* OPEN_SQUARE_BRACKET
|
|
*/
|
|
OPEN_SQUARE_BRACKET: 219,
|
|
// needs localization
|
|
/**
|
|
* BACKSLASH
|
|
*/
|
|
BACKSLASH: 220,
|
|
// needs localization
|
|
/**
|
|
* CLOSE_SQUARE_BRACKET
|
|
*/
|
|
CLOSE_SQUARE_BRACKET: 221,
|
|
// needs localization
|
|
/**
|
|
* WIN_KEY
|
|
*/
|
|
WIN_KEY: 224,
|
|
/**
|
|
* MAC_FF_META
|
|
*/
|
|
MAC_FF_META: 224,
|
|
// Firefox (Gecko) fires this for the meta key instead of 91
|
|
/**
|
|
* WIN_IME
|
|
*/
|
|
WIN_IME: 229,
|
|
// ======================== Function ========================
|
|
/**
|
|
* whether text and modified key is entered at the same time.
|
|
*/
|
|
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
|
|
var keyCode = e.keyCode;
|
|
if (e.altKey && !e.ctrlKey || e.metaKey ||
|
|
// Function keys don't generate text
|
|
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
|
|
return false;
|
|
}
|
|
|
|
// The following keys are quite harmless, even in combination with
|
|
// CTRL, ALT or SHIFT.
|
|
switch (keyCode) {
|
|
case KeyCode.ALT:
|
|
case KeyCode.CAPS_LOCK:
|
|
case KeyCode.CONTEXT_MENU:
|
|
case KeyCode.CTRL:
|
|
case KeyCode.DOWN:
|
|
case KeyCode.END:
|
|
case KeyCode.ESC:
|
|
case KeyCode.HOME:
|
|
case KeyCode.INSERT:
|
|
case KeyCode.LEFT:
|
|
case KeyCode.MAC_FF_META:
|
|
case KeyCode.META:
|
|
case KeyCode.NUMLOCK:
|
|
case KeyCode.NUM_CENTER:
|
|
case KeyCode.PAGE_DOWN:
|
|
case KeyCode.PAGE_UP:
|
|
case KeyCode.PAUSE:
|
|
case KeyCode.PRINT_SCREEN:
|
|
case KeyCode.RIGHT:
|
|
case KeyCode.SHIFT:
|
|
case KeyCode.UP:
|
|
case KeyCode.WIN_KEY:
|
|
case KeyCode.WIN_KEY_RIGHT:
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
},
|
|
/**
|
|
* whether character is entered.
|
|
*/
|
|
isCharacterKey: function isCharacterKey(keyCode) {
|
|
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
|
|
return true;
|
|
}
|
|
|
|
// Safari sends zero key code for non-latin characters.
|
|
if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
|
|
return true;
|
|
}
|
|
switch (keyCode) {
|
|
case KeyCode.SPACE:
|
|
case KeyCode.QUESTION_MARK:
|
|
case KeyCode.NUM_PLUS:
|
|
case KeyCode.NUM_MINUS:
|
|
case KeyCode.NUM_PERIOD:
|
|
case KeyCode.NUM_DIVISION:
|
|
case KeyCode.SEMICOLON:
|
|
case KeyCode.DASH:
|
|
case KeyCode.EQUALS:
|
|
case KeyCode.COMMA:
|
|
case KeyCode.PERIOD:
|
|
case KeyCode.SLASH:
|
|
case KeyCode.APOSTROPHE:
|
|
case KeyCode.SINGLE_QUOTE:
|
|
case KeyCode.OPEN_SQUARE_BRACKET:
|
|
case KeyCode.BACKSLASH:
|
|
case KeyCode.CLOSE_SQUARE_BRACKET:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
/* harmony default export */ var es_KeyCode = (KeyCode);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/es/index.js
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"];
|
|
|
|
|
|
|
|
|
|
var Switch = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
var _classNames;
|
|
var _ref$prefixCls = _ref.prefixCls,
|
|
prefixCls = _ref$prefixCls === void 0 ? 'rc-switch' : _ref$prefixCls,
|
|
className = _ref.className,
|
|
checked = _ref.checked,
|
|
defaultChecked = _ref.defaultChecked,
|
|
disabled = _ref.disabled,
|
|
loadingIcon = _ref.loadingIcon,
|
|
checkedChildren = _ref.checkedChildren,
|
|
unCheckedChildren = _ref.unCheckedChildren,
|
|
onClick = _ref.onClick,
|
|
onChange = _ref.onChange,
|
|
onKeyDown = _ref.onKeyDown,
|
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
var _useMergedState = useMergedState(false, {
|
|
value: checked,
|
|
defaultValue: defaultChecked
|
|
}),
|
|
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
innerChecked = _useMergedState2[0],
|
|
setInnerChecked = _useMergedState2[1];
|
|
function triggerChange(newChecked, event) {
|
|
var mergedChecked = innerChecked;
|
|
if (!disabled) {
|
|
mergedChecked = newChecked;
|
|
setInnerChecked(mergedChecked);
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(mergedChecked, event);
|
|
}
|
|
return mergedChecked;
|
|
}
|
|
function onInternalKeyDown(e) {
|
|
if (e.which === es_KeyCode.LEFT) {
|
|
triggerChange(false, e);
|
|
} else if (e.which === es_KeyCode.RIGHT) {
|
|
triggerChange(true, e);
|
|
}
|
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
}
|
|
function onInternalClick(e) {
|
|
var ret = triggerChange(!innerChecked, e);
|
|
// [Legacy] trigger onClick with value
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);
|
|
}
|
|
var switchClassName = classnames_default()(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-checked"), innerChecked), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
return /*#__PURE__*/react.createElement("button", _extends({}, restProps, {
|
|
type: "button",
|
|
role: "switch",
|
|
"aria-checked": innerChecked,
|
|
disabled: disabled,
|
|
className: switchClassName,
|
|
ref: ref,
|
|
onKeyDown: onInternalKeyDown,
|
|
onClick: onInternalClick
|
|
}), loadingIcon, /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner")
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner-checked")
|
|
}, checkedChildren), /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner-unchecked")
|
|
}, unCheckedChildren)));
|
|
});
|
|
Switch.displayName = 'Switch';
|
|
/* harmony default export */ var es = (Switch);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/wave/index.js + 4 modules
|
|
var wave = __webpack_require__(45353);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(98866);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(98675);
|
|
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
var dist_module = __webpack_require__(10274);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(45503);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/switch/style/index.js
|
|
|
|
|
|
|
|
const genSwitchSmallStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
const switchInnerCls = `${componentCls}-inner`;
|
|
return {
|
|
[componentCls]: {
|
|
[`&${componentCls}-small`]: {
|
|
minWidth: token.switchMinWidthSM,
|
|
height: token.switchHeightSM,
|
|
lineHeight: `${token.switchHeightSM}px`,
|
|
[`${componentCls}-inner`]: {
|
|
paddingInlineStart: token.switchInnerMarginMaxSM,
|
|
paddingInlineEnd: token.switchInnerMarginMinSM,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: `calc(-100% + ${token.switchPinSizeSM + token.switchPadding * 2}px - ${token.switchInnerMarginMaxSM * 2}px)`,
|
|
marginInlineEnd: `calc(100% - ${token.switchPinSizeSM + token.switchPadding * 2}px + ${token.switchInnerMarginMaxSM * 2}px)`
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginTop: -token.switchHeightSM,
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
width: token.switchPinSizeSM,
|
|
height: token.switchPinSizeSM
|
|
},
|
|
[`${componentCls}-loading-icon`]: {
|
|
top: (token.switchPinSizeSM - token.switchLoadingIconSize) / 2,
|
|
fontSize: token.switchLoadingIconSize
|
|
},
|
|
[`&${componentCls}-checked`]: {
|
|
[`${componentCls}-inner`]: {
|
|
paddingInlineStart: token.switchInnerMarginMinSM,
|
|
paddingInlineEnd: token.switchInnerMarginMaxSM,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: `calc(100% - ${token.switchPinSizeSM + token.switchPadding * 2}px + ${token.switchInnerMarginMaxSM * 2}px)`,
|
|
marginInlineEnd: `calc(-100% + ${token.switchPinSizeSM + token.switchPadding * 2}px - ${token.switchInnerMarginMaxSM * 2}px)`
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
insetInlineStart: `calc(100% - ${token.switchPinSizeSM + token.switchPadding}px)`
|
|
}
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: {
|
|
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: token.marginXXS / 2,
|
|
marginInlineEnd: -token.marginXXS / 2
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: -token.marginXXS / 2,
|
|
marginInlineEnd: token.marginXXS / 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchLoadingStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: {
|
|
[`${componentCls}-loading-icon${token.iconCls}`]: {
|
|
position: 'relative',
|
|
top: (token.switchPinSize - token.fontSize) / 2,
|
|
color: token.switchLoadingIconColor,
|
|
verticalAlign: 'top'
|
|
},
|
|
[`&${componentCls}-checked ${componentCls}-loading-icon`]: {
|
|
color: token.switchColor
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchHandleStyle = token => {
|
|
const {
|
|
componentCls,
|
|
motion
|
|
} = token;
|
|
const switchHandleCls = `${componentCls}-handle`;
|
|
return {
|
|
[componentCls]: {
|
|
[switchHandleCls]: {
|
|
position: 'absolute',
|
|
top: token.switchPadding,
|
|
insetInlineStart: token.switchPadding,
|
|
width: token.switchPinSize,
|
|
height: token.switchPinSize,
|
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
'&::before': {
|
|
position: 'absolute',
|
|
top: 0,
|
|
insetInlineEnd: 0,
|
|
bottom: 0,
|
|
insetInlineStart: 0,
|
|
backgroundColor: token.colorWhite,
|
|
borderRadius: token.switchPinSize / 2,
|
|
boxShadow: token.switchHandleShadow,
|
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
content: '""'
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchHandleCls}`]: {
|
|
insetInlineStart: `calc(100% - ${token.switchPinSize + token.switchPadding}px)`
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: motion ? {
|
|
[`${switchHandleCls}::before`]: {
|
|
insetInlineEnd: token.switchHandleActiveInset,
|
|
insetInlineStart: 0
|
|
},
|
|
[`&${componentCls}-checked ${switchHandleCls}::before`]: {
|
|
insetInlineEnd: 0,
|
|
insetInlineStart: token.switchHandleActiveInset
|
|
}
|
|
} : /* istanbul ignore next */
|
|
{}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchInnerStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
const switchInnerCls = `${componentCls}-inner`;
|
|
return {
|
|
[componentCls]: {
|
|
[switchInnerCls]: {
|
|
display: 'block',
|
|
overflow: 'hidden',
|
|
borderRadius: 100,
|
|
height: '100%',
|
|
paddingInlineStart: token.switchInnerMarginMax,
|
|
paddingInlineEnd: token.switchInnerMarginMin,
|
|
transition: `padding-inline-start ${token.switchDuration} ease-in-out, padding-inline-end ${token.switchDuration} ease-in-out`,
|
|
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
|
|
display: 'block',
|
|
color: token.colorTextLightSolid,
|
|
fontSize: token.fontSizeSM,
|
|
transition: `margin-inline-start ${token.switchDuration} ease-in-out, margin-inline-end ${token.switchDuration} ease-in-out`,
|
|
pointerEvents: 'none'
|
|
},
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: `calc(-100% + ${token.switchPinSize + token.switchPadding * 2}px - ${token.switchInnerMarginMax * 2}px)`,
|
|
marginInlineEnd: `calc(100% - ${token.switchPinSize + token.switchPadding * 2}px + ${token.switchInnerMarginMax * 2}px)`
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginTop: -token.switchHeight,
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
paddingInlineStart: token.switchInnerMarginMin,
|
|
paddingInlineEnd: token.switchInnerMarginMax,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: `calc(100% - ${token.switchPinSize + token.switchPadding * 2}px + ${token.switchInnerMarginMax * 2}px)`,
|
|
marginInlineEnd: `calc(-100% + ${token.switchPinSize + token.switchPadding * 2}px - ${token.switchInnerMarginMax * 2}px)`
|
|
}
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: {
|
|
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: token.switchPadding * 2,
|
|
marginInlineEnd: -token.switchPadding * 2
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: -token.switchPadding * 2,
|
|
marginInlineEnd: token.switchPadding * 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
boxSizing: 'border-box',
|
|
minWidth: token.switchMinWidth,
|
|
height: token.switchHeight,
|
|
lineHeight: `${token.switchHeight}px`,
|
|
verticalAlign: 'middle',
|
|
background: token.colorTextQuaternary,
|
|
border: '0',
|
|
borderRadius: 100,
|
|
cursor: 'pointer',
|
|
transition: `all ${token.motionDurationMid}`,
|
|
userSelect: 'none',
|
|
[`&:hover:not(${componentCls}-disabled)`]: {
|
|
background: token.colorTextTertiary
|
|
}
|
|
}), (0,style/* genFocusStyle */.Qy)(token)), {
|
|
[`&${componentCls}-checked`]: {
|
|
background: token.switchColor,
|
|
[`&:hover:not(${componentCls}-disabled)`]: {
|
|
background: token.colorPrimaryHover
|
|
}
|
|
},
|
|
[`&${componentCls}-loading, &${componentCls}-disabled`]: {
|
|
cursor: 'not-allowed',
|
|
opacity: token.switchDisabledOpacity,
|
|
'*': {
|
|
boxShadow: 'none',
|
|
cursor: 'not-allowed'
|
|
}
|
|
},
|
|
// rtl style
|
|
[`&${componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var switch_style = ((0,genComponentStyleHook/* default */.Z)('Switch', token => {
|
|
const switchHeight = token.fontSize * token.lineHeight;
|
|
const switchHeightSM = token.controlHeight / 2;
|
|
const switchPadding = 2; // This is magic
|
|
const switchPinSize = switchHeight - switchPadding * 2;
|
|
const switchPinSizeSM = switchHeightSM - switchPadding * 2;
|
|
const switchToken = (0,statistic/* merge */.TS)(token, {
|
|
switchMinWidth: switchPinSize * 2 + switchPadding * 4,
|
|
switchHeight,
|
|
switchDuration: token.motionDurationMid,
|
|
switchColor: token.colorPrimary,
|
|
switchDisabledOpacity: token.opacityLoading,
|
|
switchInnerMarginMin: switchPinSize / 2,
|
|
switchInnerMarginMax: switchPinSize + switchPadding + switchPadding * 2,
|
|
switchPadding,
|
|
switchPinSize,
|
|
switchBg: token.colorBgContainer,
|
|
switchMinWidthSM: switchPinSizeSM * 2 + switchPadding * 2,
|
|
switchHeightSM,
|
|
switchInnerMarginMinSM: switchPinSizeSM / 2,
|
|
switchInnerMarginMaxSM: switchPinSizeSM + switchPadding + switchPadding * 2,
|
|
switchPinSizeSM,
|
|
switchHandleShadow: `0 2px 4px 0 ${new dist_module/* TinyColor */.C('#00230b').setAlpha(0.2).toRgbString()}`,
|
|
switchLoadingIconSize: token.fontSizeIcon * 0.75,
|
|
switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
|
|
switchHandleActiveInset: '-30%'
|
|
});
|
|
return [genSwitchStyle(switchToken),
|
|
// inner style
|
|
genSwitchInnerStyle(switchToken),
|
|
// handle style
|
|
genSwitchHandleStyle(switchToken),
|
|
// loading style
|
|
genSwitchLoadingStyle(switchToken),
|
|
// small style
|
|
genSwitchSmallStyle(switchToken)];
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/switch/index.js
|
|
'use client';
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const switch_Switch = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
size: customizeSize,
|
|
disabled: customDisabled,
|
|
loading,
|
|
className,
|
|
rootClassName,
|
|
style
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style"]);
|
|
false ? 0 : void 0;
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
switch: SWITCH
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
// ===================== Disabled =====================
|
|
const disabled = react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
|
|
const prefixCls = getPrefixCls('switch', customizePrefixCls);
|
|
const loadingIcon = /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-handle`
|
|
}, loading && /*#__PURE__*/react.createElement(LoadingOutlined/* default */.Z, {
|
|
className: `${prefixCls}-loading-icon`
|
|
}));
|
|
// Style
|
|
const [wrapSSR, hashId] = switch_style(prefixCls);
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
const classes = classnames_default()(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
|
|
[`${prefixCls}-small`]: mergedSize === 'small',
|
|
[`${prefixCls}-loading`]: loading,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.style), style);
|
|
return wrapSSR( /*#__PURE__*/react.createElement(wave/* default */.Z, null, /*#__PURE__*/react.createElement(es, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls,
|
|
className: classes,
|
|
style: mergedStyle,
|
|
disabled: mergedDisabled,
|
|
ref: ref,
|
|
loadingIcon: loadingIcon
|
|
}))));
|
|
});
|
|
switch_Switch.__ANT_SWITCH = true;
|
|
if (false) {}
|
|
/* harmony default export */ var es_switch = (switch_Switch);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 51904:
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/antd/es/tag/index.js + 3 modules ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ tag; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
var CloseOutlined = __webpack_require__(97937);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/colors.js
|
|
var colors = __webpack_require__(98787);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/hooks/useClosable.js
|
|
var useClosable = __webpack_require__(69760);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/wave/index.js + 4 modules
|
|
var wave = __webpack_require__(45353);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/_util/capitalize.js
|
|
function capitalize(str) {
|
|
if (typeof str !== 'string') {
|
|
return str;
|
|
}
|
|
const ret = str.charAt(0).toUpperCase() + str.slice(1);
|
|
return ret;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genPresetColor.js
|
|
var genPresetColor = __webpack_require__(98719);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(45503);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tag/style/index.js
|
|
|
|
|
|
|
|
const genTagStatusStyle = (token, status, cssVariableType) => {
|
|
const capitalizedCssVariableType = capitalize(cssVariableType);
|
|
return {
|
|
[`${token.componentCls}-${status}`]: {
|
|
color: token[`color${cssVariableType}`],
|
|
background: token[`color${capitalizedCssVariableType}Bg`],
|
|
borderColor: token[`color${capitalizedCssVariableType}Border`],
|
|
[`&${token.componentCls}-borderless`]: {
|
|
borderColor: 'transparent'
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genPresetStyle = token => (0,genPresetColor/* default */.Z)(token, (colorKey, _ref) => {
|
|
let {
|
|
textColor,
|
|
lightBorderColor,
|
|
lightColor,
|
|
darkColor
|
|
} = _ref;
|
|
return {
|
|
[`${token.componentCls}-${colorKey}`]: {
|
|
color: textColor,
|
|
background: lightColor,
|
|
borderColor: lightBorderColor,
|
|
// Inverse color
|
|
'&-inverse': {
|
|
color: token.colorTextLightSolid,
|
|
background: darkColor,
|
|
borderColor: darkColor
|
|
},
|
|
[`&${token.componentCls}-borderless`]: {
|
|
borderColor: 'transparent'
|
|
}
|
|
}
|
|
};
|
|
});
|
|
const genBaseStyle = token => {
|
|
const {
|
|
paddingXXS,
|
|
lineWidth,
|
|
tagPaddingHorizontal,
|
|
componentCls
|
|
} = token;
|
|
const paddingInline = tagPaddingHorizontal - lineWidth;
|
|
const iconMarginInline = paddingXXS - lineWidth;
|
|
return {
|
|
// Result
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
display: 'inline-block',
|
|
height: 'auto',
|
|
marginInlineEnd: token.marginXS,
|
|
paddingInline,
|
|
fontSize: token.tagFontSize,
|
|
lineHeight: token.tagLineHeight,
|
|
whiteSpace: 'nowrap',
|
|
background: token.defaultBg,
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
borderRadius: token.borderRadiusSM,
|
|
opacity: 1,
|
|
transition: `all ${token.motionDurationMid}`,
|
|
textAlign: 'start',
|
|
position: 'relative',
|
|
// RTL
|
|
[`&${componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
},
|
|
'&, a, a:hover': {
|
|
color: token.defaultColor
|
|
},
|
|
[`${componentCls}-close-icon`]: {
|
|
marginInlineStart: iconMarginInline,
|
|
color: token.colorTextDescription,
|
|
fontSize: token.tagIconSize,
|
|
cursor: 'pointer',
|
|
transition: `all ${token.motionDurationMid}`,
|
|
'&:hover': {
|
|
color: token.colorTextHeading
|
|
}
|
|
},
|
|
[`&${componentCls}-has-color`]: {
|
|
borderColor: 'transparent',
|
|
[`&, a, a:hover, ${token.iconCls}-close, ${token.iconCls}-close:hover`]: {
|
|
color: token.colorTextLightSolid
|
|
}
|
|
},
|
|
[`&-checkable`]: {
|
|
backgroundColor: 'transparent',
|
|
borderColor: 'transparent',
|
|
cursor: 'pointer',
|
|
[`&:not(${componentCls}-checkable-checked):hover`]: {
|
|
color: token.colorPrimary,
|
|
backgroundColor: token.colorFillSecondary
|
|
},
|
|
'&:active, &-checked': {
|
|
color: token.colorTextLightSolid
|
|
},
|
|
'&-checked': {
|
|
backgroundColor: token.colorPrimary,
|
|
'&:hover': {
|
|
backgroundColor: token.colorPrimaryHover
|
|
}
|
|
},
|
|
'&:active': {
|
|
backgroundColor: token.colorPrimaryActive
|
|
}
|
|
},
|
|
[`&-hidden`]: {
|
|
display: 'none'
|
|
},
|
|
// To ensure that a space will be placed between character and `Icon`.
|
|
[`> ${token.iconCls} + span, > span + ${token.iconCls}`]: {
|
|
marginInlineStart: paddingInline
|
|
}
|
|
}),
|
|
[`${componentCls}-borderless`]: {
|
|
borderColor: 'transparent',
|
|
background: token.tagBorderlessBg
|
|
}
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var tag_style = ((0,genComponentStyleHook/* default */.Z)('Tag', token => {
|
|
const {
|
|
lineWidth,
|
|
fontSizeIcon
|
|
} = token;
|
|
const tagFontSize = token.fontSizeSM;
|
|
const tagLineHeight = `${token.lineHeightSM * tagFontSize}px`;
|
|
const tagToken = (0,statistic/* merge */.TS)(token, {
|
|
tagFontSize,
|
|
tagLineHeight,
|
|
tagIconSize: fontSizeIcon - 2 * lineWidth,
|
|
tagPaddingHorizontal: 8,
|
|
tagBorderlessBg: token.colorFillTertiary
|
|
});
|
|
return [genBaseStyle(tagToken), genPresetStyle(tagToken), genTagStatusStyle(tagToken, 'success', 'Success'), genTagStatusStyle(tagToken, 'processing', 'Info'), genTagStatusStyle(tagToken, 'error', 'Error'), genTagStatusStyle(tagToken, 'warning', 'Warning')];
|
|
}, token => ({
|
|
defaultBg: token.colorFillQuaternary,
|
|
defaultColor: token.colorText
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tag/CheckableTag.js
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
const CheckableTag = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
checked,
|
|
onChange,
|
|
onClick
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "className", "checked", "onChange", "onClick"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const handleClick = e => {
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
};
|
|
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
// Style
|
|
const [wrapSSR, hashId] = tag_style(prefixCls);
|
|
const cls = classnames_default()(prefixCls, `${prefixCls}-checkable`, {
|
|
[`${prefixCls}-checkable-checked`]: checked
|
|
}, className, hashId);
|
|
return wrapSSR( /*#__PURE__*/react.createElement("span", Object.assign({}, restProps, {
|
|
className: cls,
|
|
onClick: handleClick
|
|
})));
|
|
};
|
|
/* harmony default export */ var tag_CheckableTag = (CheckableTag);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tag/index.js
|
|
'use client';
|
|
|
|
var tag_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalTag = (tagProps, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
children,
|
|
icon,
|
|
color,
|
|
onClose,
|
|
closeIcon,
|
|
closable,
|
|
bordered = true
|
|
} = tagProps,
|
|
props = tag_rest(tagProps, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "closeIcon", "closable", "bordered"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
tag
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const [visible, setVisible] = react.useState(true);
|
|
// Warning for deprecated usage
|
|
if (false) {}
|
|
react.useEffect(() => {
|
|
if ('visible' in props) {
|
|
setVisible(props.visible);
|
|
}
|
|
}, [props.visible]);
|
|
const isInternalColor = (0,colors/* isPresetColor */.o2)(color) || (0,colors/* isPresetStatusColor */.yT)(color);
|
|
const tagStyle = Object.assign(Object.assign({
|
|
backgroundColor: color && !isInternalColor ? color : undefined
|
|
}, tag === null || tag === void 0 ? void 0 : tag.style), style);
|
|
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
// Style
|
|
const [wrapSSR, hashId] = tag_style(prefixCls);
|
|
const tagClassName = classnames_default()(prefixCls, tag === null || tag === void 0 ? void 0 : tag.className, {
|
|
[`${prefixCls}-${color}`]: isInternalColor,
|
|
[`${prefixCls}-has-color`]: color && !isInternalColor,
|
|
[`${prefixCls}-hidden`]: !visible,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-borderless`]: !bordered
|
|
}, className, rootClassName, hashId);
|
|
const handleCloseClick = e => {
|
|
e.stopPropagation();
|
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
if (e.defaultPrevented) {
|
|
return;
|
|
}
|
|
setVisible(false);
|
|
};
|
|
const [, mergedCloseIcon] = (0,useClosable/* default */.Z)(closable, closeIcon, iconNode => iconNode === null ? /*#__PURE__*/react.createElement(CloseOutlined/* default */.Z, {
|
|
className: `${prefixCls}-close-icon`,
|
|
onClick: handleCloseClick
|
|
}) : /*#__PURE__*/react.createElement("span", {
|
|
className: `${prefixCls}-close-icon`,
|
|
onClick: handleCloseClick
|
|
}, iconNode), null, false);
|
|
const isNeedWave = typeof props.onClick === 'function' || children && children.type === 'a';
|
|
const iconNode = icon || null;
|
|
const kids = iconNode ? /*#__PURE__*/react.createElement(react.Fragment, null, iconNode, children && /*#__PURE__*/react.createElement("span", null, children)) : children;
|
|
const tagNode = /*#__PURE__*/react.createElement("span", Object.assign({}, props, {
|
|
ref: ref,
|
|
className: tagClassName,
|
|
style: tagStyle
|
|
}), kids, mergedCloseIcon);
|
|
return wrapSSR(isNeedWave ? /*#__PURE__*/react.createElement(wave/* default */.Z, null, tagNode) : tagNode);
|
|
};
|
|
const Tag = /*#__PURE__*/react.forwardRef(InternalTag);
|
|
if (false) {}
|
|
Tag.CheckableTag = tag_CheckableTag;
|
|
/* harmony default export */ var tag = (Tag);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 86128:
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/rc-tree/es/TreeNode.js + 1 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ TreeNode; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: InternalTreeNode
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
var classCallCheck = __webpack_require__(15671);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
var createClass = __webpack_require__(43144);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
var assertThisInitialized = __webpack_require__(97326);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
var inherits = __webpack_require__(60136);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
var createSuper = __webpack_require__(51630);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/pickAttrs.js
|
|
var pickAttrs = __webpack_require__(64217);
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/contextTypes.js
|
|
var contextTypes = __webpack_require__(27822);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-tree/es/Indent.js
|
|
|
|
|
|
|
|
var Indent = function Indent(_ref) {
|
|
var prefixCls = _ref.prefixCls,
|
|
level = _ref.level,
|
|
isStart = _ref.isStart,
|
|
isEnd = _ref.isEnd;
|
|
var baseClassName = "".concat(prefixCls, "-indent-unit");
|
|
var list = [];
|
|
for (var i = 0; i < level; i += 1) {
|
|
var _classNames;
|
|
list.push( /*#__PURE__*/react.createElement("span", {
|
|
key: i,
|
|
className: classnames_default()(baseClassName, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(baseClassName, "-start"), isStart[i]), (0,defineProperty/* default */.Z)(_classNames, "".concat(baseClassName, "-end"), isEnd[i]), _classNames))
|
|
}));
|
|
}
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
"aria-hidden": "true",
|
|
className: "".concat(prefixCls, "-indent")
|
|
}, list);
|
|
};
|
|
/* harmony default export */ var es_Indent = (/*#__PURE__*/react.memo(Indent));
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/utils/treeUtil.js
|
|
var treeUtil = __webpack_require__(1089);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-tree/es/TreeNode.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove", "selectable"];
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
var ICON_OPEN = 'open';
|
|
var ICON_CLOSE = 'close';
|
|
var defaultTitle = '---';
|
|
var InternalTreeNode = /*#__PURE__*/function (_React$Component) {
|
|
(0,inherits/* default */.Z)(InternalTreeNode, _React$Component);
|
|
var _super = (0,createSuper/* default */.Z)(InternalTreeNode);
|
|
function InternalTreeNode() {
|
|
var _this;
|
|
(0,classCallCheck/* default */.Z)(this, InternalTreeNode);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_this.state = {
|
|
dragNodeHighlight: false
|
|
};
|
|
_this.selectHandle = void 0;
|
|
_this.onSelectorClick = function (e) {
|
|
// Click trigger before select/check operation
|
|
var onNodeClick = _this.props.context.onNodeClick;
|
|
onNodeClick(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
if (_this.isSelectable()) {
|
|
_this.onSelect(e);
|
|
} else {
|
|
_this.onCheck(e);
|
|
}
|
|
};
|
|
_this.onSelectorDoubleClick = function (e) {
|
|
var onNodeDoubleClick = _this.props.context.onNodeDoubleClick;
|
|
onNodeDoubleClick(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
};
|
|
_this.onSelect = function (e) {
|
|
if (_this.isDisabled()) return;
|
|
var onNodeSelect = _this.props.context.onNodeSelect;
|
|
e.preventDefault();
|
|
onNodeSelect(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
};
|
|
_this.onCheck = function (e) {
|
|
if (_this.isDisabled()) return;
|
|
var _this$props = _this.props,
|
|
disableCheckbox = _this$props.disableCheckbox,
|
|
checked = _this$props.checked;
|
|
var onNodeCheck = _this.props.context.onNodeCheck;
|
|
if (!_this.isCheckable() || disableCheckbox) return;
|
|
e.preventDefault();
|
|
var targetChecked = !checked;
|
|
onNodeCheck(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props), targetChecked);
|
|
};
|
|
_this.onMouseEnter = function (e) {
|
|
var onNodeMouseEnter = _this.props.context.onNodeMouseEnter;
|
|
onNodeMouseEnter(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
};
|
|
_this.onMouseLeave = function (e) {
|
|
var onNodeMouseLeave = _this.props.context.onNodeMouseLeave;
|
|
onNodeMouseLeave(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
};
|
|
_this.onContextMenu = function (e) {
|
|
var onNodeContextMenu = _this.props.context.onNodeContextMenu;
|
|
onNodeContextMenu(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
};
|
|
_this.onDragStart = function (e) {
|
|
var onNodeDragStart = _this.props.context.onNodeDragStart;
|
|
e.stopPropagation();
|
|
_this.setState({
|
|
dragNodeHighlight: true
|
|
});
|
|
onNodeDragStart(e, (0,assertThisInitialized/* default */.Z)(_this));
|
|
try {
|
|
// ie throw error
|
|
// firefox-need-it
|
|
e.dataTransfer.setData('text/plain', '');
|
|
} catch (error) {
|
|
// empty
|
|
}
|
|
};
|
|
_this.onDragEnter = function (e) {
|
|
var onNodeDragEnter = _this.props.context.onNodeDragEnter;
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
onNodeDragEnter(e, (0,assertThisInitialized/* default */.Z)(_this));
|
|
};
|
|
_this.onDragOver = function (e) {
|
|
var onNodeDragOver = _this.props.context.onNodeDragOver;
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
onNodeDragOver(e, (0,assertThisInitialized/* default */.Z)(_this));
|
|
};
|
|
_this.onDragLeave = function (e) {
|
|
var onNodeDragLeave = _this.props.context.onNodeDragLeave;
|
|
e.stopPropagation();
|
|
onNodeDragLeave(e, (0,assertThisInitialized/* default */.Z)(_this));
|
|
};
|
|
_this.onDragEnd = function (e) {
|
|
var onNodeDragEnd = _this.props.context.onNodeDragEnd;
|
|
e.stopPropagation();
|
|
_this.setState({
|
|
dragNodeHighlight: false
|
|
});
|
|
onNodeDragEnd(e, (0,assertThisInitialized/* default */.Z)(_this));
|
|
};
|
|
_this.onDrop = function (e) {
|
|
var onNodeDrop = _this.props.context.onNodeDrop;
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
_this.setState({
|
|
dragNodeHighlight: false
|
|
});
|
|
onNodeDrop(e, (0,assertThisInitialized/* default */.Z)(_this));
|
|
};
|
|
// Disabled item still can be switch
|
|
_this.onExpand = function (e) {
|
|
var _this$props2 = _this.props,
|
|
loading = _this$props2.loading,
|
|
onNodeExpand = _this$props2.context.onNodeExpand;
|
|
if (loading) return;
|
|
onNodeExpand(e, (0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
};
|
|
// Drag usage
|
|
_this.setSelectHandle = function (node) {
|
|
_this.selectHandle = node;
|
|
};
|
|
_this.getNodeState = function () {
|
|
var expanded = _this.props.expanded;
|
|
if (_this.isLeaf()) {
|
|
return null;
|
|
}
|
|
return expanded ? ICON_OPEN : ICON_CLOSE;
|
|
};
|
|
_this.hasChildren = function () {
|
|
var eventKey = _this.props.eventKey;
|
|
var keyEntities = _this.props.context.keyEntities;
|
|
var _ref = keyEntities[eventKey] || {},
|
|
children = _ref.children;
|
|
return !!(children || []).length;
|
|
};
|
|
_this.isLeaf = function () {
|
|
var _this$props3 = _this.props,
|
|
isLeaf = _this$props3.isLeaf,
|
|
loaded = _this$props3.loaded;
|
|
var loadData = _this.props.context.loadData;
|
|
var hasChildren = _this.hasChildren();
|
|
if (isLeaf === false) {
|
|
return false;
|
|
}
|
|
return isLeaf || !loadData && !hasChildren || loadData && loaded && !hasChildren;
|
|
};
|
|
_this.isDisabled = function () {
|
|
var disabled = _this.props.disabled;
|
|
var treeDisabled = _this.props.context.disabled;
|
|
return !!(treeDisabled || disabled);
|
|
};
|
|
_this.isCheckable = function () {
|
|
var checkable = _this.props.checkable;
|
|
var treeCheckable = _this.props.context.checkable;
|
|
// Return false if tree or treeNode is not checkable
|
|
if (!treeCheckable || checkable === false) return false;
|
|
return treeCheckable;
|
|
};
|
|
// Load data to avoid default expanded tree without data
|
|
_this.syncLoadData = function (props) {
|
|
var expanded = props.expanded,
|
|
loading = props.loading,
|
|
loaded = props.loaded;
|
|
var _this$props$context = _this.props.context,
|
|
loadData = _this$props$context.loadData,
|
|
onNodeLoad = _this$props$context.onNodeLoad;
|
|
if (loading) {
|
|
return;
|
|
}
|
|
// read from state to avoid loadData at same time
|
|
if (loadData && expanded && !_this.isLeaf()) {
|
|
// We needn't reload data when has children in sync logic
|
|
// It's only needed in node expanded
|
|
if (!_this.hasChildren() && !loaded) {
|
|
onNodeLoad((0,treeUtil/* convertNodePropsToEventData */.F)(_this.props));
|
|
}
|
|
}
|
|
};
|
|
_this.isDraggable = function () {
|
|
var _this$props4 = _this.props,
|
|
data = _this$props4.data,
|
|
draggable = _this$props4.context.draggable;
|
|
return !!(draggable && (!draggable.nodeDraggable || draggable.nodeDraggable(data)));
|
|
};
|
|
// ==================== Render: Drag Handler ====================
|
|
_this.renderDragHandler = function () {
|
|
var _this$props$context2 = _this.props.context,
|
|
draggable = _this$props$context2.draggable,
|
|
prefixCls = _this$props$context2.prefixCls;
|
|
return (draggable === null || draggable === void 0 ? void 0 : draggable.icon) ? /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-draggable-icon")
|
|
}, draggable.icon) : null;
|
|
};
|
|
// ====================== Render: Switcher ======================
|
|
_this.renderSwitcherIconDom = function (isLeaf) {
|
|
var switcherIconFromProps = _this.props.switcherIcon;
|
|
var switcherIconFromCtx = _this.props.context.switcherIcon;
|
|
var switcherIcon = switcherIconFromProps || switcherIconFromCtx;
|
|
// if switcherIconDom is null, no render switcher span
|
|
if (typeof switcherIcon === 'function') {
|
|
return switcherIcon((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, _this.props), {}, {
|
|
isLeaf: isLeaf
|
|
}));
|
|
}
|
|
return switcherIcon;
|
|
};
|
|
// Switcher
|
|
_this.renderSwitcher = function () {
|
|
var expanded = _this.props.expanded;
|
|
var prefixCls = _this.props.context.prefixCls;
|
|
if (_this.isLeaf()) {
|
|
// if switcherIconDom is null, no render switcher span
|
|
var _switcherIconDom = _this.renderSwitcherIconDom(true);
|
|
return _switcherIconDom !== false ? /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher-noop"))
|
|
}, _switcherIconDom) : null;
|
|
}
|
|
var switcherCls = classnames_default()("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher_").concat(expanded ? ICON_OPEN : ICON_CLOSE));
|
|
var switcherIconDom = _this.renderSwitcherIconDom(false);
|
|
return switcherIconDom !== false ? /*#__PURE__*/react.createElement("span", {
|
|
onClick: _this.onExpand,
|
|
className: switcherCls
|
|
}, switcherIconDom) : null;
|
|
};
|
|
// ====================== Render: Checkbox ======================
|
|
// Checkbox
|
|
_this.renderCheckbox = function () {
|
|
var _this$props5 = _this.props,
|
|
checked = _this$props5.checked,
|
|
halfChecked = _this$props5.halfChecked,
|
|
disableCheckbox = _this$props5.disableCheckbox;
|
|
var prefixCls = _this.props.context.prefixCls;
|
|
var disabled = _this.isDisabled();
|
|
var checkable = _this.isCheckable();
|
|
if (!checkable) return null;
|
|
// [Legacy] Custom element should be separate with `checkable` in future
|
|
var $custom = typeof checkable !== 'boolean' ? checkable : null;
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()("".concat(prefixCls, "-checkbox"), checked && "".concat(prefixCls, "-checkbox-checked"), !checked && halfChecked && "".concat(prefixCls, "-checkbox-indeterminate"), (disabled || disableCheckbox) && "".concat(prefixCls, "-checkbox-disabled")),
|
|
onClick: _this.onCheck
|
|
}, $custom);
|
|
};
|
|
// ==================== Render: Title + Icon ====================
|
|
_this.renderIcon = function () {
|
|
var loading = _this.props.loading;
|
|
var prefixCls = _this.props.context.prefixCls;
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()("".concat(prefixCls, "-iconEle"), "".concat(prefixCls, "-icon__").concat(_this.getNodeState() || 'docu'), loading && "".concat(prefixCls, "-icon_loading"))
|
|
});
|
|
};
|
|
// Icon + Title
|
|
_this.renderSelector = function () {
|
|
var dragNodeHighlight = _this.state.dragNodeHighlight;
|
|
var _this$props6 = _this.props,
|
|
_this$props6$title = _this$props6.title,
|
|
title = _this$props6$title === void 0 ? defaultTitle : _this$props6$title,
|
|
selected = _this$props6.selected,
|
|
icon = _this$props6.icon,
|
|
loading = _this$props6.loading,
|
|
data = _this$props6.data;
|
|
var _this$props$context3 = _this.props.context,
|
|
prefixCls = _this$props$context3.prefixCls,
|
|
showIcon = _this$props$context3.showIcon,
|
|
treeIcon = _this$props$context3.icon,
|
|
loadData = _this$props$context3.loadData,
|
|
titleRender = _this$props$context3.titleRender;
|
|
var disabled = _this.isDisabled();
|
|
var wrapClass = "".concat(prefixCls, "-node-content-wrapper");
|
|
// Icon - Still show loading icon when loading without showIcon
|
|
var $icon;
|
|
if (showIcon) {
|
|
var currentIcon = icon || treeIcon;
|
|
$icon = currentIcon ? /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()("".concat(prefixCls, "-iconEle"), "".concat(prefixCls, "-icon__customize"))
|
|
}, typeof currentIcon === 'function' ? currentIcon(_this.props) : currentIcon) : _this.renderIcon();
|
|
} else if (loadData && loading) {
|
|
$icon = _this.renderIcon();
|
|
}
|
|
// Title
|
|
var titleNode;
|
|
if (typeof title === 'function') {
|
|
titleNode = title(data);
|
|
} else if (titleRender) {
|
|
titleNode = titleRender(data);
|
|
} else {
|
|
titleNode = title;
|
|
}
|
|
var $title = /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-title")
|
|
}, titleNode);
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
ref: _this.setSelectHandle,
|
|
title: typeof title === 'string' ? title : '',
|
|
className: classnames_default()("".concat(wrapClass), "".concat(wrapClass, "-").concat(_this.getNodeState() || 'normal'), !disabled && (selected || dragNodeHighlight) && "".concat(prefixCls, "-node-selected")),
|
|
onMouseEnter: _this.onMouseEnter,
|
|
onMouseLeave: _this.onMouseLeave,
|
|
onContextMenu: _this.onContextMenu,
|
|
onClick: _this.onSelectorClick,
|
|
onDoubleClick: _this.onSelectorDoubleClick
|
|
}, $icon, $title, _this.renderDropIndicator());
|
|
};
|
|
// =================== Render: Drop Indicator ===================
|
|
_this.renderDropIndicator = function () {
|
|
var _this$props7 = _this.props,
|
|
disabled = _this$props7.disabled,
|
|
eventKey = _this$props7.eventKey;
|
|
var _this$props$context4 = _this.props.context,
|
|
draggable = _this$props$context4.draggable,
|
|
dropLevelOffset = _this$props$context4.dropLevelOffset,
|
|
dropPosition = _this$props$context4.dropPosition,
|
|
prefixCls = _this$props$context4.prefixCls,
|
|
indent = _this$props$context4.indent,
|
|
dropIndicatorRender = _this$props$context4.dropIndicatorRender,
|
|
dragOverNodeKey = _this$props$context4.dragOverNodeKey,
|
|
direction = _this$props$context4.direction;
|
|
var rootDraggable = !!draggable;
|
|
// allowDrop is calculated in Tree.tsx, there is no need for calc it here
|
|
var showIndicator = !disabled && rootDraggable && dragOverNodeKey === eventKey;
|
|
return showIndicator ? dropIndicatorRender({
|
|
dropPosition: dropPosition,
|
|
dropLevelOffset: dropLevelOffset,
|
|
indent: indent,
|
|
prefixCls: prefixCls,
|
|
direction: direction
|
|
}) : null;
|
|
};
|
|
return _this;
|
|
}
|
|
(0,createClass/* default */.Z)(InternalTreeNode, [{
|
|
key: "componentDidMount",
|
|
value:
|
|
// Isomorphic needn't load data in server side
|
|
function componentDidMount() {
|
|
this.syncLoadData(this.props);
|
|
}
|
|
}, {
|
|
key: "componentDidUpdate",
|
|
value: function componentDidUpdate() {
|
|
this.syncLoadData(this.props);
|
|
}
|
|
}, {
|
|
key: "isSelectable",
|
|
value: function isSelectable() {
|
|
var selectable = this.props.selectable;
|
|
var treeSelectable = this.props.context.selectable;
|
|
// Ignore when selectable is undefined or null
|
|
if (typeof selectable === 'boolean') {
|
|
return selectable;
|
|
}
|
|
return treeSelectable;
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value:
|
|
// =========================== Render ===========================
|
|
function render() {
|
|
var _classNames;
|
|
var _this$props8 = this.props,
|
|
eventKey = _this$props8.eventKey,
|
|
className = _this$props8.className,
|
|
style = _this$props8.style,
|
|
dragOver = _this$props8.dragOver,
|
|
dragOverGapTop = _this$props8.dragOverGapTop,
|
|
dragOverGapBottom = _this$props8.dragOverGapBottom,
|
|
isLeaf = _this$props8.isLeaf,
|
|
isStart = _this$props8.isStart,
|
|
isEnd = _this$props8.isEnd,
|
|
expanded = _this$props8.expanded,
|
|
selected = _this$props8.selected,
|
|
checked = _this$props8.checked,
|
|
halfChecked = _this$props8.halfChecked,
|
|
loading = _this$props8.loading,
|
|
domRef = _this$props8.domRef,
|
|
active = _this$props8.active,
|
|
data = _this$props8.data,
|
|
onMouseMove = _this$props8.onMouseMove,
|
|
selectable = _this$props8.selectable,
|
|
otherProps = (0,objectWithoutProperties/* default */.Z)(_this$props8, _excluded);
|
|
var _this$props$context5 = this.props.context,
|
|
prefixCls = _this$props$context5.prefixCls,
|
|
filterTreeNode = _this$props$context5.filterTreeNode,
|
|
keyEntities = _this$props$context5.keyEntities,
|
|
dropContainerKey = _this$props$context5.dropContainerKey,
|
|
dropTargetKey = _this$props$context5.dropTargetKey,
|
|
draggingNodeKey = _this$props$context5.draggingNodeKey;
|
|
var disabled = this.isDisabled();
|
|
var dataOrAriaAttributeProps = (0,pickAttrs/* default */.Z)(otherProps, {
|
|
aria: true,
|
|
data: true
|
|
});
|
|
var _ref2 = keyEntities[eventKey] || {},
|
|
level = _ref2.level;
|
|
var isEndNode = isEnd[isEnd.length - 1];
|
|
var mergedDraggable = this.isDraggable();
|
|
var draggableWithoutDisabled = !disabled && mergedDraggable;
|
|
var dragging = draggingNodeKey === eventKey;
|
|
var ariaSelected = selectable !== undefined ? {
|
|
'aria-selected': !!selectable
|
|
} : undefined;
|
|
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
ref: domRef,
|
|
className: classnames_default()(className, "".concat(prefixCls, "-treenode"), (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-disabled"), disabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-switcher-").concat(expanded ? 'open' : 'close'), !isLeaf), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-checkbox-checked"), checked), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-checkbox-indeterminate"), halfChecked), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-selected"), selected), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-loading"), loading), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-active"), active), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-leaf-last"), isEndNode), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-treenode-draggable"), mergedDraggable), (0,defineProperty/* default */.Z)(_classNames, "dragging", dragging), (0,defineProperty/* default */.Z)(_classNames, 'drop-target', dropTargetKey === eventKey), (0,defineProperty/* default */.Z)(_classNames, 'drop-container', dropContainerKey === eventKey), (0,defineProperty/* default */.Z)(_classNames, 'drag-over', !disabled && dragOver), (0,defineProperty/* default */.Z)(_classNames, 'drag-over-gap-top', !disabled && dragOverGapTop), (0,defineProperty/* default */.Z)(_classNames, 'drag-over-gap-bottom', !disabled && dragOverGapBottom), (0,defineProperty/* default */.Z)(_classNames, 'filter-node', filterTreeNode && filterTreeNode((0,treeUtil/* convertNodePropsToEventData */.F)(this.props))), _classNames)),
|
|
style: style
|
|
// Draggable config
|
|
,
|
|
draggable: draggableWithoutDisabled,
|
|
"aria-grabbed": dragging,
|
|
onDragStart: draggableWithoutDisabled ? this.onDragStart : undefined
|
|
// Drop config
|
|
,
|
|
onDragEnter: mergedDraggable ? this.onDragEnter : undefined,
|
|
onDragOver: mergedDraggable ? this.onDragOver : undefined,
|
|
onDragLeave: mergedDraggable ? this.onDragLeave : undefined,
|
|
onDrop: mergedDraggable ? this.onDrop : undefined,
|
|
onDragEnd: mergedDraggable ? this.onDragEnd : undefined,
|
|
onMouseMove: onMouseMove
|
|
}, ariaSelected, dataOrAriaAttributeProps), /*#__PURE__*/react.createElement(es_Indent, {
|
|
prefixCls: prefixCls,
|
|
level: level,
|
|
isStart: isStart,
|
|
isEnd: isEnd
|
|
}), this.renderDragHandler(), this.renderSwitcher(), this.renderCheckbox(), this.renderSelector());
|
|
}
|
|
}]);
|
|
return InternalTreeNode;
|
|
}(react.Component);
|
|
var ContextTreeNode = function ContextTreeNode(props) {
|
|
return /*#__PURE__*/react.createElement(contextTypes/* TreeContext.Consumer */.k.Consumer, null, function (context) {
|
|
return /*#__PURE__*/react.createElement(InternalTreeNode, (0,esm_extends/* default */.Z)({}, props, {
|
|
context: context
|
|
}));
|
|
});
|
|
};
|
|
ContextTreeNode.displayName = 'TreeNode';
|
|
ContextTreeNode.isTreeNode = 1;
|
|
|
|
/* harmony default export */ var TreeNode = (ContextTreeNode);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 27822:
|
|
/*!*************************************************!*\
|
|
!*** ./node_modules/rc-tree/es/contextTypes.js ***!
|
|
\*************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "k": function() { return /* binding */ TreeContext; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/**
|
|
* Webpack has bug for import loop, which is not the same behavior as ES module.
|
|
* When util.js imports the TreeNode for tree generate will cause treeContextTypes be empty.
|
|
*/
|
|
|
|
var TreeContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 10225:
|
|
/*!*****************************************!*\
|
|
!*** ./node_modules/rc-tree/es/util.js ***!
|
|
\*****************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "BT": function() { return /* binding */ calcSelectedKeys; },
|
|
/* harmony export */ "Ds": function() { return /* binding */ isTreeNode; },
|
|
/* harmony export */ "E6": function() { return /* binding */ parseCheckedKeys; },
|
|
/* harmony export */ "L0": function() { return /* binding */ arrAdd; },
|
|
/* harmony export */ "OM": function() { return /* binding */ calcDropPosition; },
|
|
/* harmony export */ "_5": function() { return /* binding */ arrDel; },
|
|
/* harmony export */ "bt": function() { return /* binding */ getPosition; },
|
|
/* harmony export */ "r7": function() { return /* binding */ conductExpandParent; },
|
|
/* harmony export */ "wA": function() { return /* binding */ getDragChildrenKeys; },
|
|
/* harmony export */ "yx": function() { return /* binding */ posToArr; }
|
|
/* harmony export */ });
|
|
/* unused harmony exports isLastChild, isFirstChild, convertDataToTree */
|
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ 74902);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ 71002);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/warning */ 80334);
|
|
/* harmony import */ var _TreeNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TreeNode */ 86128);
|
|
|
|
|
|
|
|
|
|
var _excluded = (/* unused pure expression or super */ null && (["children"]));
|
|
/* eslint-disable no-lonely-if */
|
|
/**
|
|
* Legacy code. Should avoid to use if you are new to import these code.
|
|
*/
|
|
|
|
|
|
|
|
function arrDel(list, value) {
|
|
if (!list) return [];
|
|
var clone = list.slice();
|
|
var index = clone.indexOf(value);
|
|
if (index >= 0) {
|
|
clone.splice(index, 1);
|
|
}
|
|
return clone;
|
|
}
|
|
function arrAdd(list, value) {
|
|
var clone = (list || []).slice();
|
|
if (clone.indexOf(value) === -1) {
|
|
clone.push(value);
|
|
}
|
|
return clone;
|
|
}
|
|
function posToArr(pos) {
|
|
return pos.split('-');
|
|
}
|
|
function getPosition(level, index) {
|
|
return "".concat(level, "-").concat(index);
|
|
}
|
|
function isTreeNode(node) {
|
|
return node && node.type && node.type.isTreeNode;
|
|
}
|
|
function getDragChildrenKeys(dragNodeKey, keyEntities) {
|
|
// not contains self
|
|
// self for left or right drag
|
|
var dragChildrenKeys = [];
|
|
var entity = keyEntities[dragNodeKey];
|
|
function dig() {
|
|
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
list.forEach(function (_ref) {
|
|
var key = _ref.key,
|
|
children = _ref.children;
|
|
dragChildrenKeys.push(key);
|
|
dig(children);
|
|
});
|
|
}
|
|
dig(entity.children);
|
|
return dragChildrenKeys;
|
|
}
|
|
function isLastChild(treeNodeEntity) {
|
|
if (treeNodeEntity.parent) {
|
|
var posArr = posToArr(treeNodeEntity.pos);
|
|
return Number(posArr[posArr.length - 1]) === treeNodeEntity.parent.children.length - 1;
|
|
}
|
|
return false;
|
|
}
|
|
function isFirstChild(treeNodeEntity) {
|
|
var posArr = posToArr(treeNodeEntity.pos);
|
|
return Number(posArr[posArr.length - 1]) === 0;
|
|
}
|
|
// Only used when drag, not affect SSR.
|
|
function calcDropPosition(event, dragNode, targetNode, indent, startMousePosition, allowDrop, flattenedNodes, keyEntities, expandKeys, direction) {
|
|
var _abstractDropNodeEnti;
|
|
var clientX = event.clientX,
|
|
clientY = event.clientY;
|
|
var _event$target$getBoun = event.target.getBoundingClientRect(),
|
|
top = _event$target$getBoun.top,
|
|
height = _event$target$getBoun.height;
|
|
// optional chain for testing
|
|
var horizontalMouseOffset = (direction === 'rtl' ? -1 : 1) * (((startMousePosition === null || startMousePosition === void 0 ? void 0 : startMousePosition.x) || 0) - clientX);
|
|
var rawDropLevelOffset = (horizontalMouseOffset - 12) / indent;
|
|
// find abstract drop node by horizontal offset
|
|
var abstractDropNodeEntity = keyEntities[targetNode.props.eventKey];
|
|
if (clientY < top + height / 2) {
|
|
// first half, set abstract drop node to previous node
|
|
var nodeIndex = flattenedNodes.findIndex(function (flattenedNode) {
|
|
return flattenedNode.key === abstractDropNodeEntity.key;
|
|
});
|
|
var prevNodeIndex = nodeIndex <= 0 ? 0 : nodeIndex - 1;
|
|
var prevNodeKey = flattenedNodes[prevNodeIndex].key;
|
|
abstractDropNodeEntity = keyEntities[prevNodeKey];
|
|
}
|
|
var initialAbstractDropNodeKey = abstractDropNodeEntity.key;
|
|
var abstractDragOverEntity = abstractDropNodeEntity;
|
|
var dragOverNodeKey = abstractDropNodeEntity.key;
|
|
var dropPosition = 0;
|
|
var dropLevelOffset = 0;
|
|
// Only allow cross level drop when dragging on a non-expanded node
|
|
if (!expandKeys.includes(initialAbstractDropNodeKey)) {
|
|
for (var i = 0; i < rawDropLevelOffset; i += 1) {
|
|
if (isLastChild(abstractDropNodeEntity)) {
|
|
abstractDropNodeEntity = abstractDropNodeEntity.parent;
|
|
dropLevelOffset += 1;
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
var abstractDragDataNode = dragNode.props.data;
|
|
var abstractDropDataNode = abstractDropNodeEntity.node;
|
|
var dropAllowed = true;
|
|
if (isFirstChild(abstractDropNodeEntity) && abstractDropNodeEntity.level === 0 && clientY < top + height / 2 && allowDrop({
|
|
dragNode: abstractDragDataNode,
|
|
dropNode: abstractDropDataNode,
|
|
dropPosition: -1
|
|
}) && abstractDropNodeEntity.key === targetNode.props.eventKey) {
|
|
// first half of first node in first level
|
|
dropPosition = -1;
|
|
} else if ((abstractDragOverEntity.children || []).length && expandKeys.includes(dragOverNodeKey)) {
|
|
// drop on expanded node
|
|
// only allow drop inside
|
|
if (allowDrop({
|
|
dragNode: abstractDragDataNode,
|
|
dropNode: abstractDropDataNode,
|
|
dropPosition: 0
|
|
})) {
|
|
dropPosition = 0;
|
|
} else {
|
|
dropAllowed = false;
|
|
}
|
|
} else if (dropLevelOffset === 0) {
|
|
if (rawDropLevelOffset > -1.5) {
|
|
// | Node | <- abstractDropNode
|
|
// | -^-===== | <- mousePosition
|
|
// 1. try drop after
|
|
// 2. do not allow drop
|
|
if (allowDrop({
|
|
dragNode: abstractDragDataNode,
|
|
dropNode: abstractDropDataNode,
|
|
dropPosition: 1
|
|
})) {
|
|
dropPosition = 1;
|
|
} else {
|
|
dropAllowed = false;
|
|
}
|
|
} else {
|
|
// | Node | <- abstractDropNode
|
|
// | ---==^== | <- mousePosition
|
|
// whether it has children or doesn't has children
|
|
// always
|
|
// 1. try drop inside
|
|
// 2. try drop after
|
|
// 3. do not allow drop
|
|
if (allowDrop({
|
|
dragNode: abstractDragDataNode,
|
|
dropNode: abstractDropDataNode,
|
|
dropPosition: 0
|
|
})) {
|
|
dropPosition = 0;
|
|
} else if (allowDrop({
|
|
dragNode: abstractDragDataNode,
|
|
dropNode: abstractDropDataNode,
|
|
dropPosition: 1
|
|
})) {
|
|
dropPosition = 1;
|
|
} else {
|
|
dropAllowed = false;
|
|
}
|
|
}
|
|
} else {
|
|
// | Node1 | <- abstractDropNode
|
|
// | Node2 |
|
|
// --^--|----=====| <- mousePosition
|
|
// 1. try insert after Node1
|
|
// 2. do not allow drop
|
|
if (allowDrop({
|
|
dragNode: abstractDragDataNode,
|
|
dropNode: abstractDropDataNode,
|
|
dropPosition: 1
|
|
})) {
|
|
dropPosition = 1;
|
|
} else {
|
|
dropAllowed = false;
|
|
}
|
|
}
|
|
return {
|
|
dropPosition: dropPosition,
|
|
dropLevelOffset: dropLevelOffset,
|
|
dropTargetKey: abstractDropNodeEntity.key,
|
|
dropTargetPos: abstractDropNodeEntity.pos,
|
|
dragOverNodeKey: dragOverNodeKey,
|
|
dropContainerKey: dropPosition === 0 ? null : ((_abstractDropNodeEnti = abstractDropNodeEntity.parent) === null || _abstractDropNodeEnti === void 0 ? void 0 : _abstractDropNodeEnti.key) || null,
|
|
dropAllowed: dropAllowed
|
|
};
|
|
}
|
|
/**
|
|
* Return selectedKeys according with multiple prop
|
|
* @param selectedKeys
|
|
* @param props
|
|
* @returns [string]
|
|
*/
|
|
function calcSelectedKeys(selectedKeys, props) {
|
|
if (!selectedKeys) return undefined;
|
|
var multiple = props.multiple;
|
|
if (multiple) {
|
|
return selectedKeys.slice();
|
|
}
|
|
if (selectedKeys.length) {
|
|
return [selectedKeys[0]];
|
|
}
|
|
return selectedKeys;
|
|
}
|
|
var internalProcessProps = function internalProcessProps(props) {
|
|
return props;
|
|
};
|
|
function convertDataToTree(treeData, processor) {
|
|
if (!treeData) return [];
|
|
var _ref2 = processor || {},
|
|
_ref2$processProps = _ref2.processProps,
|
|
processProps = _ref2$processProps === void 0 ? internalProcessProps : _ref2$processProps;
|
|
var list = Array.isArray(treeData) ? treeData : [treeData];
|
|
return list.map(function (_ref3) {
|
|
var children = _ref3.children,
|
|
props = _objectWithoutProperties(_ref3, _excluded);
|
|
var childrenNodes = convertDataToTree(children, processor);
|
|
return /*#__PURE__*/React.createElement(TreeNode, _extends({
|
|
key: props.key
|
|
}, processProps(props)), childrenNodes);
|
|
});
|
|
}
|
|
/**
|
|
* Parse `checkedKeys` to { checkedKeys, halfCheckedKeys } style
|
|
*/
|
|
function parseCheckedKeys(keys) {
|
|
if (!keys) {
|
|
return null;
|
|
}
|
|
// Convert keys to object format
|
|
var keyProps;
|
|
if (Array.isArray(keys)) {
|
|
// [Legacy] Follow the api doc
|
|
keyProps = {
|
|
checkedKeys: keys,
|
|
halfCheckedKeys: undefined
|
|
};
|
|
} else if ((0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(keys) === 'object') {
|
|
keyProps = {
|
|
checkedKeys: keys.checked || undefined,
|
|
halfCheckedKeys: keys.halfChecked || undefined
|
|
};
|
|
} else {
|
|
(0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(false, '`checkedKeys` is not an array or an object');
|
|
return null;
|
|
}
|
|
return keyProps;
|
|
}
|
|
/**
|
|
* If user use `autoExpandParent` we should get the list of parent node
|
|
* @param keyList
|
|
* @param keyEntities
|
|
*/
|
|
function conductExpandParent(keyList, keyEntities) {
|
|
var expandedKeys = new Set();
|
|
function conductUp(key) {
|
|
if (expandedKeys.has(key)) return;
|
|
var entity = keyEntities[key];
|
|
if (!entity) return;
|
|
expandedKeys.add(key);
|
|
var parent = entity.parent,
|
|
node = entity.node;
|
|
if (node.disabled) return;
|
|
if (parent) {
|
|
conductUp(parent.key);
|
|
}
|
|
}
|
|
(keyList || []).forEach(function (key) {
|
|
conductUp(key);
|
|
});
|
|
return (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(expandedKeys);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 17341:
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/rc-tree/es/utils/conductUtil.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "S": function() { return /* binding */ conductCheck; }
|
|
/* harmony export */ });
|
|
/* unused harmony export isCheckDisabled */
|
|
/* harmony import */ var rc_util_es_warning__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/warning */ 80334);
|
|
|
|
function removeFromCheckedKeys(halfCheckedKeys, checkedKeys) {
|
|
var filteredKeys = new Set();
|
|
halfCheckedKeys.forEach(function (key) {
|
|
if (!checkedKeys.has(key)) {
|
|
filteredKeys.add(key);
|
|
}
|
|
});
|
|
return filteredKeys;
|
|
}
|
|
function isCheckDisabled(node) {
|
|
var _ref = node || {},
|
|
disabled = _ref.disabled,
|
|
disableCheckbox = _ref.disableCheckbox,
|
|
checkable = _ref.checkable;
|
|
return !!(disabled || disableCheckbox) || checkable === false;
|
|
}
|
|
// Fill miss keys
|
|
function fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
|
|
var checkedKeys = new Set(keys);
|
|
var halfCheckedKeys = new Set();
|
|
// Add checked keys top to bottom
|
|
for (var level = 0; level <= maxLevel; level += 1) {
|
|
var entities = levelEntities.get(level) || new Set();
|
|
entities.forEach(function (entity) {
|
|
var key = entity.key,
|
|
node = entity.node,
|
|
_entity$children = entity.children,
|
|
children = _entity$children === void 0 ? [] : _entity$children;
|
|
if (checkedKeys.has(key) && !syntheticGetCheckDisabled(node)) {
|
|
children.filter(function (childEntity) {
|
|
return !syntheticGetCheckDisabled(childEntity.node);
|
|
}).forEach(function (childEntity) {
|
|
checkedKeys.add(childEntity.key);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
// Add checked keys from bottom to top
|
|
var visitedKeys = new Set();
|
|
for (var _level = maxLevel; _level >= 0; _level -= 1) {
|
|
var _entities = levelEntities.get(_level) || new Set();
|
|
_entities.forEach(function (entity) {
|
|
var parent = entity.parent,
|
|
node = entity.node;
|
|
// Skip if no need to check
|
|
if (syntheticGetCheckDisabled(node) || !entity.parent || visitedKeys.has(entity.parent.key)) {
|
|
return;
|
|
}
|
|
// Skip if parent is disabled
|
|
if (syntheticGetCheckDisabled(entity.parent.node)) {
|
|
visitedKeys.add(parent.key);
|
|
return;
|
|
}
|
|
var allChecked = true;
|
|
var partialChecked = false;
|
|
(parent.children || []).filter(function (childEntity) {
|
|
return !syntheticGetCheckDisabled(childEntity.node);
|
|
}).forEach(function (_ref2) {
|
|
var key = _ref2.key;
|
|
var checked = checkedKeys.has(key);
|
|
if (allChecked && !checked) {
|
|
allChecked = false;
|
|
}
|
|
if (!partialChecked && (checked || halfCheckedKeys.has(key))) {
|
|
partialChecked = true;
|
|
}
|
|
});
|
|
if (allChecked) {
|
|
checkedKeys.add(parent.key);
|
|
}
|
|
if (partialChecked) {
|
|
halfCheckedKeys.add(parent.key);
|
|
}
|
|
visitedKeys.add(parent.key);
|
|
});
|
|
}
|
|
return {
|
|
checkedKeys: Array.from(checkedKeys),
|
|
halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
|
|
};
|
|
}
|
|
// Remove useless key
|
|
function cleanConductCheck(keys, halfKeys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
|
|
var checkedKeys = new Set(keys);
|
|
var halfCheckedKeys = new Set(halfKeys);
|
|
// Remove checked keys from top to bottom
|
|
for (var level = 0; level <= maxLevel; level += 1) {
|
|
var entities = levelEntities.get(level) || new Set();
|
|
entities.forEach(function (entity) {
|
|
var key = entity.key,
|
|
node = entity.node,
|
|
_entity$children2 = entity.children,
|
|
children = _entity$children2 === void 0 ? [] : _entity$children2;
|
|
if (!checkedKeys.has(key) && !halfCheckedKeys.has(key) && !syntheticGetCheckDisabled(node)) {
|
|
children.filter(function (childEntity) {
|
|
return !syntheticGetCheckDisabled(childEntity.node);
|
|
}).forEach(function (childEntity) {
|
|
checkedKeys.delete(childEntity.key);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
// Remove checked keys form bottom to top
|
|
halfCheckedKeys = new Set();
|
|
var visitedKeys = new Set();
|
|
for (var _level2 = maxLevel; _level2 >= 0; _level2 -= 1) {
|
|
var _entities2 = levelEntities.get(_level2) || new Set();
|
|
_entities2.forEach(function (entity) {
|
|
var parent = entity.parent,
|
|
node = entity.node;
|
|
// Skip if no need to check
|
|
if (syntheticGetCheckDisabled(node) || !entity.parent || visitedKeys.has(entity.parent.key)) {
|
|
return;
|
|
}
|
|
// Skip if parent is disabled
|
|
if (syntheticGetCheckDisabled(entity.parent.node)) {
|
|
visitedKeys.add(parent.key);
|
|
return;
|
|
}
|
|
var allChecked = true;
|
|
var partialChecked = false;
|
|
(parent.children || []).filter(function (childEntity) {
|
|
return !syntheticGetCheckDisabled(childEntity.node);
|
|
}).forEach(function (_ref3) {
|
|
var key = _ref3.key;
|
|
var checked = checkedKeys.has(key);
|
|
if (allChecked && !checked) {
|
|
allChecked = false;
|
|
}
|
|
if (!partialChecked && (checked || halfCheckedKeys.has(key))) {
|
|
partialChecked = true;
|
|
}
|
|
});
|
|
if (!allChecked) {
|
|
checkedKeys.delete(parent.key);
|
|
}
|
|
if (partialChecked) {
|
|
halfCheckedKeys.add(parent.key);
|
|
}
|
|
visitedKeys.add(parent.key);
|
|
});
|
|
}
|
|
return {
|
|
checkedKeys: Array.from(checkedKeys),
|
|
halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
|
|
};
|
|
}
|
|
/**
|
|
* Conduct with keys.
|
|
* @param keyList current key list
|
|
* @param keyEntities key - dataEntity map
|
|
* @param mode `fill` to fill missing key, `clean` to remove useless key
|
|
*/
|
|
function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
|
|
var warningMissKeys = [];
|
|
var syntheticGetCheckDisabled;
|
|
if (getCheckDisabled) {
|
|
syntheticGetCheckDisabled = getCheckDisabled;
|
|
} else {
|
|
syntheticGetCheckDisabled = isCheckDisabled;
|
|
}
|
|
// We only handle exist keys
|
|
var keys = new Set(keyList.filter(function (key) {
|
|
var hasEntity = !!keyEntities[key];
|
|
if (!hasEntity) {
|
|
warningMissKeys.push(key);
|
|
}
|
|
return hasEntity;
|
|
}));
|
|
var levelEntities = new Map();
|
|
var maxLevel = 0;
|
|
// Convert entities by level for calculation
|
|
Object.keys(keyEntities).forEach(function (key) {
|
|
var entity = keyEntities[key];
|
|
var level = entity.level;
|
|
var levelSet = levelEntities.get(level);
|
|
if (!levelSet) {
|
|
levelSet = new Set();
|
|
levelEntities.set(level, levelSet);
|
|
}
|
|
levelSet.add(entity);
|
|
maxLevel = Math.max(maxLevel, level);
|
|
});
|
|
(0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(!warningMissKeys.length, "Tree missing follow keys: ".concat(warningMissKeys.slice(0, 100).map(function (key) {
|
|
return "'".concat(key, "'");
|
|
}).join(', ')));
|
|
var result;
|
|
if (checked === true) {
|
|
result = fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled);
|
|
} else {
|
|
result = cleanConductCheck(keys, checked.halfCheckedKeys, levelEntities, maxLevel, syntheticGetCheckDisabled);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1089:
|
|
/*!***************************************************!*\
|
|
!*** ./node_modules/rc-tree/es/utils/treeUtil.js ***!
|
|
\***************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "F": function() { return /* binding */ convertNodePropsToEventData; },
|
|
/* harmony export */ "H8": function() { return /* binding */ getTreeNodeProps; },
|
|
/* harmony export */ "I8": function() { return /* binding */ convertDataToEntities; },
|
|
/* harmony export */ "km": function() { return /* binding */ getKey; },
|
|
/* harmony export */ "oH": function() { return /* binding */ flattenTreeData; },
|
|
/* harmony export */ "w$": function() { return /* binding */ fillFieldNames; },
|
|
/* harmony export */ "zn": function() { return /* binding */ convertTreeToData; }
|
|
/* harmony export */ });
|
|
/* unused harmony exports warningWithoutKey, traverseDataNodes */
|
|
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ 71002);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ 74902);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ 45987);
|
|
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rc-util/es/omit */ 98423);
|
|
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/Children/toArray */ 50344);
|
|
/* harmony import */ var rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/warning */ 80334);
|
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ 10225);
|
|
|
|
|
|
|
|
|
|
var _excluded = ["children"];
|
|
|
|
|
|
|
|
|
|
function getKey(key, pos) {
|
|
if (key !== null && key !== undefined) {
|
|
return key;
|
|
}
|
|
return pos;
|
|
}
|
|
function fillFieldNames(fieldNames) {
|
|
var _ref = fieldNames || {},
|
|
title = _ref.title,
|
|
_title = _ref._title,
|
|
key = _ref.key,
|
|
children = _ref.children;
|
|
var mergedTitle = title || 'title';
|
|
return {
|
|
title: mergedTitle,
|
|
_title: _title || [mergedTitle],
|
|
key: key || 'key',
|
|
children: children || 'children'
|
|
};
|
|
}
|
|
/**
|
|
* Warning if TreeNode do not provides key
|
|
*/
|
|
function warningWithoutKey(treeData, fieldNames) {
|
|
var keys = new Map();
|
|
function dig(list) {
|
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
(list || []).forEach(function (treeNode) {
|
|
var key = treeNode[fieldNames.key];
|
|
var children = treeNode[fieldNames.children];
|
|
warning(key !== null && key !== undefined, "Tree node must have a certain key: [".concat(path).concat(key, "]"));
|
|
var recordKey = String(key);
|
|
warning(!keys.has(recordKey) || key === null || key === undefined, "Same 'key' exist in the Tree: ".concat(recordKey));
|
|
keys.set(recordKey, true);
|
|
dig(children, "".concat(path).concat(recordKey, " > "));
|
|
});
|
|
}
|
|
dig(treeData);
|
|
}
|
|
/**
|
|
* Convert `children` of Tree into `treeData` structure.
|
|
*/
|
|
function convertTreeToData(rootNodes) {
|
|
function dig(node) {
|
|
var treeNodes = (0,rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(node);
|
|
return treeNodes.map(function (treeNode) {
|
|
// Filter invalidate node
|
|
if (!(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .isTreeNode */ .Ds)(treeNode)) {
|
|
(0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(!treeNode, 'Tree/TreeNode can only accept TreeNode as children.');
|
|
return null;
|
|
}
|
|
var key = treeNode.key;
|
|
var _treeNode$props = treeNode.props,
|
|
children = _treeNode$props.children,
|
|
rest = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(_treeNode$props, _excluded);
|
|
var dataNode = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({
|
|
key: key
|
|
}, rest);
|
|
var parsedChildren = dig(children);
|
|
if (parsedChildren.length) {
|
|
dataNode.children = parsedChildren;
|
|
}
|
|
return dataNode;
|
|
}).filter(function (dataNode) {
|
|
return dataNode;
|
|
});
|
|
}
|
|
return dig(rootNodes);
|
|
}
|
|
/**
|
|
* Flat nest tree data into flatten list. This is used for virtual list render.
|
|
* @param treeNodeList Origin data node list
|
|
* @param expandedKeys
|
|
* need expanded keys, provides `true` means all expanded (used in `rc-tree-select`).
|
|
*/
|
|
function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
|
|
var _fillFieldNames = fillFieldNames(fieldNames),
|
|
fieldTitles = _fillFieldNames._title,
|
|
fieldKey = _fillFieldNames.key,
|
|
fieldChildren = _fillFieldNames.children;
|
|
var expandedKeySet = new Set(expandedKeys === true ? [] : expandedKeys);
|
|
var flattenList = [];
|
|
function dig(list) {
|
|
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
return list.map(function (treeNode, index) {
|
|
var pos = (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .getPosition */ .bt)(parent ? parent.pos : '0', index);
|
|
var mergedKey = getKey(treeNode[fieldKey], pos);
|
|
// Pick matched title in field title list
|
|
var mergedTitle;
|
|
for (var i = 0; i < fieldTitles.length; i += 1) {
|
|
var fieldTitle = fieldTitles[i];
|
|
if (treeNode[fieldTitle] !== undefined) {
|
|
mergedTitle = treeNode[fieldTitle];
|
|
break;
|
|
}
|
|
}
|
|
// Add FlattenDataNode into list
|
|
var flattenNode = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({}, (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(treeNode, [].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(fieldTitles), [fieldKey, fieldChildren]))), {}, {
|
|
title: mergedTitle,
|
|
key: mergedKey,
|
|
parent: parent,
|
|
pos: pos,
|
|
children: null,
|
|
data: treeNode,
|
|
isStart: [].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(parent ? parent.isStart : []), [index === 0]),
|
|
isEnd: [].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(parent ? parent.isEnd : []), [index === list.length - 1])
|
|
});
|
|
flattenList.push(flattenNode);
|
|
// Loop treeNode children
|
|
if (expandedKeys === true || expandedKeySet.has(mergedKey)) {
|
|
flattenNode.children = dig(treeNode[fieldChildren] || [], flattenNode);
|
|
} else {
|
|
flattenNode.children = [];
|
|
}
|
|
return flattenNode;
|
|
});
|
|
}
|
|
dig(treeNodeList);
|
|
return flattenList;
|
|
}
|
|
/**
|
|
* Traverse all the data by `treeData`.
|
|
* Please not use it out of the `rc-tree` since we may refactor this code.
|
|
*/
|
|
function traverseDataNodes(dataNodes, callback,
|
|
// To avoid too many params, let use config instead of origin param
|
|
config) {
|
|
var mergedConfig = {};
|
|
if ((0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(config) === 'object') {
|
|
mergedConfig = config;
|
|
} else {
|
|
mergedConfig = {
|
|
externalGetKey: config
|
|
};
|
|
}
|
|
mergedConfig = mergedConfig || {};
|
|
// Init config
|
|
var _mergedConfig = mergedConfig,
|
|
childrenPropName = _mergedConfig.childrenPropName,
|
|
externalGetKey = _mergedConfig.externalGetKey,
|
|
fieldNames = _mergedConfig.fieldNames;
|
|
var _fillFieldNames2 = fillFieldNames(fieldNames),
|
|
fieldKey = _fillFieldNames2.key,
|
|
fieldChildren = _fillFieldNames2.children;
|
|
var mergeChildrenPropName = childrenPropName || fieldChildren;
|
|
// Get keys
|
|
var syntheticGetKey;
|
|
if (externalGetKey) {
|
|
if (typeof externalGetKey === 'string') {
|
|
syntheticGetKey = function syntheticGetKey(node) {
|
|
return node[externalGetKey];
|
|
};
|
|
} else if (typeof externalGetKey === 'function') {
|
|
syntheticGetKey = function syntheticGetKey(node) {
|
|
return externalGetKey(node);
|
|
};
|
|
}
|
|
} else {
|
|
syntheticGetKey = function syntheticGetKey(node, pos) {
|
|
return getKey(node[fieldKey], pos);
|
|
};
|
|
}
|
|
// Process
|
|
function processNode(node, index, parent, pathNodes) {
|
|
var children = node ? node[mergeChildrenPropName] : dataNodes;
|
|
var pos = node ? (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .getPosition */ .bt)(parent.pos, index) : '0';
|
|
var connectNodes = node ? [].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(pathNodes), [node]) : [];
|
|
// Process node if is not root
|
|
if (node) {
|
|
var key = syntheticGetKey(node, pos);
|
|
var data = {
|
|
node: node,
|
|
index: index,
|
|
pos: pos,
|
|
key: key,
|
|
parentPos: parent.node ? parent.pos : null,
|
|
level: parent.level + 1,
|
|
nodes: connectNodes
|
|
};
|
|
callback(data);
|
|
}
|
|
// Process children node
|
|
if (children) {
|
|
children.forEach(function (subNode, subIndex) {
|
|
processNode(subNode, subIndex, {
|
|
node: node,
|
|
pos: pos,
|
|
level: parent ? parent.level + 1 : -1
|
|
}, connectNodes);
|
|
});
|
|
}
|
|
}
|
|
processNode(null);
|
|
}
|
|
/**
|
|
* Convert `treeData` into entity records.
|
|
*/
|
|
function convertDataToEntities(dataNodes) {
|
|
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
initWrapper = _ref2.initWrapper,
|
|
processEntity = _ref2.processEntity,
|
|
onProcessFinished = _ref2.onProcessFinished,
|
|
externalGetKey = _ref2.externalGetKey,
|
|
childrenPropName = _ref2.childrenPropName,
|
|
fieldNames = _ref2.fieldNames;
|
|
var /** @deprecated Use `config.externalGetKey` instead */
|
|
legacyExternalGetKey = arguments.length > 2 ? arguments[2] : undefined;
|
|
// Init config
|
|
var mergedExternalGetKey = externalGetKey || legacyExternalGetKey;
|
|
var posEntities = {};
|
|
var keyEntities = {};
|
|
var wrapper = {
|
|
posEntities: posEntities,
|
|
keyEntities: keyEntities
|
|
};
|
|
if (initWrapper) {
|
|
wrapper = initWrapper(wrapper) || wrapper;
|
|
}
|
|
traverseDataNodes(dataNodes, function (item) {
|
|
var node = item.node,
|
|
index = item.index,
|
|
pos = item.pos,
|
|
key = item.key,
|
|
parentPos = item.parentPos,
|
|
level = item.level,
|
|
nodes = item.nodes;
|
|
var entity = {
|
|
node: node,
|
|
nodes: nodes,
|
|
index: index,
|
|
key: key,
|
|
pos: pos,
|
|
level: level
|
|
};
|
|
var mergedKey = getKey(key, pos);
|
|
posEntities[pos] = entity;
|
|
keyEntities[mergedKey] = entity;
|
|
// Fill children
|
|
entity.parent = posEntities[parentPos];
|
|
if (entity.parent) {
|
|
entity.parent.children = entity.parent.children || [];
|
|
entity.parent.children.push(entity);
|
|
}
|
|
if (processEntity) {
|
|
processEntity(entity, wrapper);
|
|
}
|
|
}, {
|
|
externalGetKey: mergedExternalGetKey,
|
|
childrenPropName: childrenPropName,
|
|
fieldNames: fieldNames
|
|
});
|
|
if (onProcessFinished) {
|
|
onProcessFinished(wrapper);
|
|
}
|
|
return wrapper;
|
|
}
|
|
/**
|
|
* Get TreeNode props with Tree props.
|
|
*/
|
|
function getTreeNodeProps(key, _ref3) {
|
|
var expandedKeys = _ref3.expandedKeys,
|
|
selectedKeys = _ref3.selectedKeys,
|
|
loadedKeys = _ref3.loadedKeys,
|
|
loadingKeys = _ref3.loadingKeys,
|
|
checkedKeys = _ref3.checkedKeys,
|
|
halfCheckedKeys = _ref3.halfCheckedKeys,
|
|
dragOverNodeKey = _ref3.dragOverNodeKey,
|
|
dropPosition = _ref3.dropPosition,
|
|
keyEntities = _ref3.keyEntities;
|
|
var entity = keyEntities[key];
|
|
var treeNodeProps = {
|
|
eventKey: key,
|
|
expanded: expandedKeys.indexOf(key) !== -1,
|
|
selected: selectedKeys.indexOf(key) !== -1,
|
|
loaded: loadedKeys.indexOf(key) !== -1,
|
|
loading: loadingKeys.indexOf(key) !== -1,
|
|
checked: checkedKeys.indexOf(key) !== -1,
|
|
halfChecked: halfCheckedKeys.indexOf(key) !== -1,
|
|
pos: String(entity ? entity.pos : ''),
|
|
// [Legacy] Drag props
|
|
// Since the interaction of drag is changed, the semantic of the props are
|
|
// not accuracy, I think it should be finally removed
|
|
dragOver: dragOverNodeKey === key && dropPosition === 0,
|
|
dragOverGapTop: dragOverNodeKey === key && dropPosition === -1,
|
|
dragOverGapBottom: dragOverNodeKey === key && dropPosition === 1
|
|
};
|
|
return treeNodeProps;
|
|
}
|
|
function convertNodePropsToEventData(props) {
|
|
var data = props.data,
|
|
expanded = props.expanded,
|
|
selected = props.selected,
|
|
checked = props.checked,
|
|
loaded = props.loaded,
|
|
loading = props.loading,
|
|
halfChecked = props.halfChecked,
|
|
dragOver = props.dragOver,
|
|
dragOverGapTop = props.dragOverGapTop,
|
|
dragOverGapBottom = props.dragOverGapBottom,
|
|
pos = props.pos,
|
|
active = props.active,
|
|
eventKey = props.eventKey;
|
|
var eventData = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({}, data), {}, {
|
|
expanded: expanded,
|
|
selected: selected,
|
|
checked: checked,
|
|
loaded: loaded,
|
|
loading: loading,
|
|
halfChecked: halfChecked,
|
|
dragOver: dragOver,
|
|
dragOverGapTop: dragOverGapTop,
|
|
dragOverGapBottom: dragOverGapBottom,
|
|
pos: pos,
|
|
active: active,
|
|
key: eventKey
|
|
});
|
|
if (!('props' in eventData)) {
|
|
Object.defineProperty(eventData, 'props', {
|
|
get: function get() {
|
|
(0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(false, 'Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`.');
|
|
return props;
|
|
}
|
|
});
|
|
}
|
|
return eventData;
|
|
}
|
|
|
|
/***/ })
|
|
|
|
}]); |