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.
2752 lines
103 KiB
2752 lines
103 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[83051,67390],{
|
|
|
|
/***/ 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));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 64082:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/InboxOutlined.js + 1 modules ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_InboxOutlined; }
|
|
});
|
|
|
|
// 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/InboxOutlined.js
|
|
// This icon file is generated automatically.
|
|
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };
|
|
/* harmony default export */ var asn_InboxOutlined = (InboxOutlined);
|
|
|
|
// 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/InboxOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var InboxOutlined_InboxOutlined = function InboxOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_InboxOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_InboxOutlined = (/*#__PURE__*/react.forwardRef(InboxOutlined_InboxOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 88484:
|
|
/*!*******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/UploadOutlined.js + 1 modules ***!
|
|
\*******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_UploadOutlined; }
|
|
});
|
|
|
|
// 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/UploadOutlined.js
|
|
// This icon file is generated automatically.
|
|
var UploadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, "name": "upload", "theme": "outlined" };
|
|
/* harmony default export */ var asn_UploadOutlined = (UploadOutlined);
|
|
|
|
// 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/UploadOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var UploadOutlined_UploadOutlined = function UploadOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_UploadOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_UploadOutlined = (/*#__PURE__*/react.forwardRef(UploadOutlined_UploadOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 49288:
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/antd/es/auto-complete/index.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 94184);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/Children/toArray */ 37419);
|
|
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/omit */ 10366);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_util/PurePanel */ 8745);
|
|
/* harmony import */ var _util_reactNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../_util/reactNode */ 96159);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config-provider */ 53124);
|
|
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../select */ 79035);
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
Option
|
|
} = _select__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z;
|
|
function isSelectOptionOrSelectOptGroup(child) {
|
|
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
|
}
|
|
const AutoComplete = (props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
popupClassName,
|
|
dropdownClassName,
|
|
children,
|
|
dataSource
|
|
} = props;
|
|
const childNodes = (0,rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(children);
|
|
// ============================= Input =============================
|
|
let customizeInput;
|
|
if (childNodes.length === 1 && (0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
|
[customizeInput] = childNodes;
|
|
}
|
|
const getInputElement = customizeInput ? () => customizeInput : undefined;
|
|
// ============================ Options ============================
|
|
let optionChildren;
|
|
// [Legacy] convert `children` or `dataSource` into option children
|
|
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
|
optionChildren = children;
|
|
} else {
|
|
optionChildren = dataSource ? dataSource.map(item => {
|
|
if ((0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(item)) {
|
|
return item;
|
|
}
|
|
switch (typeof item) {
|
|
case 'string':
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
|
|
key: item,
|
|
value: item
|
|
}, item);
|
|
case 'object':
|
|
{
|
|
const {
|
|
value: optionValue
|
|
} = item;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
|
|
key: optionValue,
|
|
value: optionValue
|
|
}, item.text);
|
|
}
|
|
default:
|
|
false ? 0 : void 0;
|
|
return undefined;
|
|
}
|
|
}) : [];
|
|
}
|
|
if (false) {}
|
|
const {
|
|
getPrefixCls
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_5__/* .ConfigContext */ .E_);
|
|
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_select__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, Object.assign({
|
|
ref: ref,
|
|
showArrow: false
|
|
}, (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props, ['dataSource', 'dropdownClassName']), {
|
|
prefixCls: prefixCls,
|
|
popupClassName: popupClassName || dropdownClassName,
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(`${prefixCls}-auto-complete`, className),
|
|
mode: _select__WEBPACK_IMPORTED_MODULE_3__/* ["default"].SECRET_COMBOBOX_MODE_DO_NOT_USE */ .Z.SECRET_COMBOBOX_MODE_DO_NOT_USE,
|
|
// Internal api
|
|
getInputElement
|
|
}), optionChildren);
|
|
};
|
|
const RefAutoComplete = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(AutoComplete);
|
|
// We don't care debug panel
|
|
/* istanbul ignore next */
|
|
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(RefAutoComplete);
|
|
RefAutoComplete.Option = Option;
|
|
RefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
|
if (false) {}
|
|
/* harmony default export */ __webpack_exports__["Z"] = (RefAutoComplete);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 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);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4393:
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/antd/es/card/index.js + 4 modules ***!
|
|
\********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ card; }
|
|
});
|
|
|
|
// 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/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/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);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(21687);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tabs/index.js + 28 modules
|
|
var es_tabs = __webpack_require__(34755);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/card/Grid.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 Grid = _a => {
|
|
var {
|
|
prefixCls,
|
|
className,
|
|
hoverable = true
|
|
} = _a,
|
|
props = __rest(_a, ["prefixCls", "className", "hoverable"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefix = getPrefixCls('card', prefixCls);
|
|
const classString = classnames_default()(`${prefix}-grid`, className, {
|
|
[`${prefix}-grid-hoverable`]: hoverable
|
|
});
|
|
return /*#__PURE__*/react.createElement("div", Object.assign({}, props, {
|
|
className: classString
|
|
}));
|
|
};
|
|
/* harmony default export */ var card_Grid = (Grid);
|
|
// 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/card/style/index.js
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
// ============================== Head ==============================
|
|
const genCardHeadStyle = token => {
|
|
const {
|
|
antCls,
|
|
componentCls,
|
|
headerHeight,
|
|
cardPaddingBase,
|
|
tabsMarginBottom
|
|
} = token;
|
|
return Object.assign(Object.assign({
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
flexDirection: 'column',
|
|
minHeight: headerHeight,
|
|
marginBottom: -1,
|
|
padding: `0 ${cardPaddingBase}px`,
|
|
color: token.colorTextHeading,
|
|
fontWeight: token.fontWeightStrong,
|
|
fontSize: token.headerFontSize,
|
|
background: token.headerBg,
|
|
borderBottom: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`,
|
|
borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
'&-wrapper': {
|
|
width: '100%',
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
},
|
|
'&-title': Object.assign(Object.assign({
|
|
display: 'inline-block',
|
|
flex: 1
|
|
}, style/* textEllipsis */.vS), {
|
|
[`
|
|
> ${componentCls}-typography,
|
|
> ${componentCls}-typography-edit-content
|
|
`]: {
|
|
insetInlineStart: 0,
|
|
marginTop: 0,
|
|
marginBottom: 0
|
|
}
|
|
}),
|
|
[`${antCls}-tabs-top`]: {
|
|
clear: 'both',
|
|
marginBottom: tabsMarginBottom,
|
|
color: token.colorText,
|
|
fontWeight: 'normal',
|
|
fontSize: token.fontSize,
|
|
'&-bar': {
|
|
borderBottom: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`
|
|
}
|
|
}
|
|
});
|
|
};
|
|
// ============================== Grid ==============================
|
|
const genCardGridStyle = token => {
|
|
const {
|
|
cardPaddingBase,
|
|
colorBorderSecondary,
|
|
cardShadow,
|
|
lineWidth
|
|
} = token;
|
|
return {
|
|
width: '33.33%',
|
|
padding: cardPaddingBase,
|
|
border: 0,
|
|
borderRadius: 0,
|
|
boxShadow: `
|
|
${lineWidth}px 0 0 0 ${colorBorderSecondary},
|
|
0 ${lineWidth}px 0 0 ${colorBorderSecondary},
|
|
${lineWidth}px ${lineWidth}px 0 0 ${colorBorderSecondary},
|
|
${lineWidth}px 0 0 0 ${colorBorderSecondary} inset,
|
|
0 ${lineWidth}px 0 0 ${colorBorderSecondary} inset;
|
|
`,
|
|
transition: `all ${token.motionDurationMid}`,
|
|
'&-hoverable:hover': {
|
|
position: 'relative',
|
|
zIndex: 1,
|
|
boxShadow: cardShadow
|
|
}
|
|
};
|
|
};
|
|
// ============================== Actions ==============================
|
|
const genCardActionsStyle = token => {
|
|
const {
|
|
componentCls,
|
|
iconCls,
|
|
actionsLiMargin,
|
|
cardActionsIconSize,
|
|
colorBorderSecondary,
|
|
actionsBg
|
|
} = token;
|
|
return Object.assign(Object.assign({
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none',
|
|
background: actionsBg,
|
|
borderTop: `${token.lineWidth}px ${token.lineType} ${colorBorderSecondary}`,
|
|
display: 'flex',
|
|
borderRadius: `0 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px `
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
'& > li': {
|
|
margin: actionsLiMargin,
|
|
color: token.colorTextDescription,
|
|
textAlign: 'center',
|
|
'> span': {
|
|
position: 'relative',
|
|
display: 'block',
|
|
minWidth: token.cardActionsIconSize * 2,
|
|
fontSize: token.fontSize,
|
|
lineHeight: token.lineHeight,
|
|
cursor: 'pointer',
|
|
'&:hover': {
|
|
color: token.colorPrimary,
|
|
transition: `color ${token.motionDurationMid}`
|
|
},
|
|
[`a:not(${componentCls}-btn), > ${iconCls}`]: {
|
|
display: 'inline-block',
|
|
width: '100%',
|
|
color: token.colorTextDescription,
|
|
lineHeight: `${token.fontSize * token.lineHeight}px`,
|
|
transition: `color ${token.motionDurationMid}`,
|
|
'&:hover': {
|
|
color: token.colorPrimary
|
|
}
|
|
},
|
|
[`> ${iconCls}`]: {
|
|
fontSize: cardActionsIconSize,
|
|
lineHeight: `${cardActionsIconSize * token.lineHeight}px`
|
|
}
|
|
},
|
|
'&:not(:last-child)': {
|
|
borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${colorBorderSecondary}`
|
|
}
|
|
}
|
|
});
|
|
};
|
|
// ============================== Meta ==============================
|
|
const genCardMetaStyle = token => Object.assign(Object.assign({
|
|
margin: `-${token.marginXXS}px 0`,
|
|
display: 'flex'
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
'&-avatar': {
|
|
paddingInlineEnd: token.padding
|
|
},
|
|
'&-detail': {
|
|
overflow: 'hidden',
|
|
flex: 1,
|
|
'> div:not(:last-child)': {
|
|
marginBottom: token.marginXS
|
|
}
|
|
},
|
|
'&-title': Object.assign({
|
|
color: token.colorTextHeading,
|
|
fontWeight: token.fontWeightStrong,
|
|
fontSize: token.fontSizeLG
|
|
}, style/* textEllipsis */.vS),
|
|
'&-description': {
|
|
color: token.colorTextDescription
|
|
}
|
|
});
|
|
// ============================== Inner ==============================
|
|
const genCardTypeInnerStyle = token => {
|
|
const {
|
|
componentCls,
|
|
cardPaddingBase,
|
|
colorFillAlter
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-head`]: {
|
|
padding: `0 ${cardPaddingBase}px`,
|
|
background: colorFillAlter,
|
|
'&-title': {
|
|
fontSize: token.fontSize
|
|
}
|
|
},
|
|
[`${componentCls}-body`]: {
|
|
padding: `${token.padding}px ${cardPaddingBase}px`
|
|
}
|
|
};
|
|
};
|
|
// ============================== Loading ==============================
|
|
const genCardLoadingStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
overflow: 'hidden',
|
|
[`${componentCls}-body`]: {
|
|
userSelect: 'none'
|
|
}
|
|
};
|
|
};
|
|
// ============================== Basic ==============================
|
|
const genCardStyle = token => {
|
|
const {
|
|
antCls,
|
|
componentCls,
|
|
cardShadow,
|
|
cardHeadPadding,
|
|
colorBorderSecondary,
|
|
boxShadowTertiary,
|
|
cardPaddingBase,
|
|
extraColor
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
background: token.colorBgContainer,
|
|
borderRadius: token.borderRadiusLG,
|
|
[`&:not(${componentCls}-bordered)`]: {
|
|
boxShadow: boxShadowTertiary
|
|
},
|
|
[`${componentCls}-head`]: genCardHeadStyle(token),
|
|
[`${componentCls}-extra`]: {
|
|
// https://stackoverflow.com/a/22429853/3040605
|
|
marginInlineStart: 'auto',
|
|
color: extraColor,
|
|
fontWeight: 'normal',
|
|
fontSize: token.fontSize
|
|
},
|
|
[`${componentCls}-body`]: Object.assign({
|
|
padding: cardPaddingBase,
|
|
borderRadius: ` 0 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px`
|
|
}, (0,style/* clearFix */.dF)()),
|
|
[`${componentCls}-grid`]: genCardGridStyle(token),
|
|
[`${componentCls}-cover`]: {
|
|
'> *': {
|
|
display: 'block',
|
|
width: '100%'
|
|
},
|
|
[`img, img + ${antCls}-image-mask`]: {
|
|
borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`
|
|
}
|
|
},
|
|
[`${componentCls}-actions`]: genCardActionsStyle(token),
|
|
[`${componentCls}-meta`]: genCardMetaStyle(token)
|
|
}),
|
|
[`${componentCls}-bordered`]: {
|
|
border: `${token.lineWidth}px ${token.lineType} ${colorBorderSecondary}`,
|
|
[`${componentCls}-cover`]: {
|
|
marginTop: -1,
|
|
marginInlineStart: -1,
|
|
marginInlineEnd: -1
|
|
}
|
|
},
|
|
[`${componentCls}-hoverable`]: {
|
|
cursor: 'pointer',
|
|
transition: `box-shadow ${token.motionDurationMid}, border-color ${token.motionDurationMid}`,
|
|
'&:hover': {
|
|
borderColor: 'transparent',
|
|
boxShadow: cardShadow
|
|
}
|
|
},
|
|
[`${componentCls}-contain-grid`]: {
|
|
[`${componentCls}-body`]: {
|
|
display: 'flex',
|
|
flexWrap: 'wrap'
|
|
},
|
|
[`&:not(${componentCls}-loading) ${componentCls}-body`]: {
|
|
marginBlockStart: -token.lineWidth,
|
|
marginInlineStart: -token.lineWidth,
|
|
padding: 0
|
|
}
|
|
},
|
|
[`${componentCls}-contain-tabs`]: {
|
|
[`> ${componentCls}-head`]: {
|
|
[`${componentCls}-head-title, ${componentCls}-extra`]: {
|
|
paddingTop: cardHeadPadding
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-type-inner`]: genCardTypeInnerStyle(token),
|
|
[`${componentCls}-loading`]: genCardLoadingStyle(token),
|
|
[`${componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
};
|
|
};
|
|
// ============================== Size ==============================
|
|
const genCardSizeStyle = token => {
|
|
const {
|
|
componentCls,
|
|
cardPaddingSM,
|
|
headerHeightSM,
|
|
headerFontSizeSM
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-small`]: {
|
|
[`> ${componentCls}-head`]: {
|
|
minHeight: headerHeightSM,
|
|
padding: `0 ${cardPaddingSM}px`,
|
|
fontSize: headerFontSizeSM,
|
|
[`> ${componentCls}-head-wrapper`]: {
|
|
[`> ${componentCls}-extra`]: {
|
|
fontSize: token.fontSize
|
|
}
|
|
}
|
|
},
|
|
[`> ${componentCls}-body`]: {
|
|
padding: cardPaddingSM
|
|
}
|
|
},
|
|
[`${componentCls}-small${componentCls}-contain-tabs`]: {
|
|
[`> ${componentCls}-head`]: {
|
|
[`${componentCls}-head-title, ${componentCls}-extra`]: {
|
|
minHeight: headerHeightSM,
|
|
paddingTop: 0,
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var card_style = ((0,genComponentStyleHook/* default */.Z)('Card', token => {
|
|
const cardToken = (0,statistic/* merge */.TS)(token, {
|
|
cardShadow: token.boxShadowCard,
|
|
cardHeadPadding: token.padding,
|
|
cardPaddingBase: token.paddingLG,
|
|
cardActionsIconSize: token.fontSize,
|
|
cardPaddingSM: 12 // Fixed padding.
|
|
});
|
|
|
|
return [
|
|
// Style
|
|
genCardStyle(cardToken),
|
|
// Size
|
|
genCardSizeStyle(cardToken)];
|
|
}, token => ({
|
|
headerBg: 'transparent',
|
|
headerFontSize: token.fontSizeLG,
|
|
headerFontSizeSM: token.fontSize,
|
|
headerHeight: token.fontSizeLG * token.lineHeightLG + token.padding * 2,
|
|
headerHeightSM: token.fontSize * token.lineHeight + token.paddingXS * 2,
|
|
actionsBg: token.colorBgContainer,
|
|
actionsLiMargin: `${token.paddingSM}px 0`,
|
|
tabsMarginBottom: -token.padding - token.lineWidth,
|
|
extraColor: token.colorText
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/card/Card.js
|
|
var Card_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 getAction(actions) {
|
|
return actions.map((action, index) =>
|
|
/*#__PURE__*/
|
|
// eslint-disable-next-line react/no-array-index-key
|
|
react.createElement("li", {
|
|
style: {
|
|
width: `${100 / actions.length}%`
|
|
},
|
|
key: `action-${index}`
|
|
}, /*#__PURE__*/react.createElement("span", null, action)));
|
|
}
|
|
const Card = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
extra,
|
|
headStyle = {},
|
|
bodyStyle = {},
|
|
title,
|
|
loading,
|
|
bordered = true,
|
|
size: customizeSize,
|
|
type,
|
|
cover,
|
|
actions,
|
|
tabList,
|
|
children,
|
|
activeTabKey,
|
|
defaultActiveTabKey,
|
|
tabBarExtraContent,
|
|
hoverable,
|
|
tabProps = {}
|
|
} = props,
|
|
others = Card_rest(props, ["prefixCls", "className", "rootClassName", "style", "extra", "headStyle", "bodyStyle", "title", "loading", "bordered", "size", "type", "cover", "actions", "tabList", "children", "activeTabKey", "defaultActiveTabKey", "tabBarExtraContent", "hoverable", "tabProps"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
card
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const onTabChange = key => {
|
|
var _a;
|
|
(_a = props.onTabChange) === null || _a === void 0 ? void 0 : _a.call(props, key);
|
|
};
|
|
const isContainGrid = react.useMemo(() => {
|
|
let containGrid = false;
|
|
react.Children.forEach(children, element => {
|
|
if (element && element.type && element.type === card_Grid) {
|
|
containGrid = true;
|
|
}
|
|
});
|
|
return containGrid;
|
|
}, [children]);
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
const [wrapSSR, hashId] = card_style(prefixCls);
|
|
const loadingBlock = /*#__PURE__*/react.createElement(skeleton/* default */.Z, {
|
|
loading: true,
|
|
active: true,
|
|
paragraph: {
|
|
rows: 4
|
|
},
|
|
title: false
|
|
}, children);
|
|
const hasActiveTabKey = activeTabKey !== undefined;
|
|
const extraProps = Object.assign(Object.assign({}, tabProps), {
|
|
[hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey ? activeTabKey : defaultActiveTabKey,
|
|
tabBarExtraContent
|
|
});
|
|
let head;
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
const tabSize = !mergedSize || mergedSize === 'default' ? 'large' : mergedSize;
|
|
const tabs = tabList ? /*#__PURE__*/react.createElement(es_tabs/* default */.Z, Object.assign({
|
|
size: tabSize
|
|
}, extraProps, {
|
|
className: `${prefixCls}-head-tabs`,
|
|
onChange: onTabChange,
|
|
items: tabList.map(_a => {
|
|
var {
|
|
tab
|
|
} = _a,
|
|
item = Card_rest(_a, ["tab"]);
|
|
return Object.assign({
|
|
label: tab
|
|
}, item);
|
|
})
|
|
})) : null;
|
|
if (title || extra || tabs) {
|
|
head = /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-head`,
|
|
style: headStyle
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-head-wrapper`
|
|
}, title && /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-head-title`
|
|
}, title), extra && /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-extra`
|
|
}, extra)), tabs);
|
|
}
|
|
const coverDom = cover ? /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-cover`
|
|
}, cover) : null;
|
|
const body = /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-body`,
|
|
style: bodyStyle
|
|
}, loading ? loadingBlock : children);
|
|
const actionDom = actions && actions.length ? /*#__PURE__*/react.createElement("ul", {
|
|
className: `${prefixCls}-actions`
|
|
}, getAction(actions)) : null;
|
|
const divProps = (0,omit/* default */.Z)(others, ['onTabChange']);
|
|
const classString = classnames_default()(prefixCls, card === null || card === void 0 ? void 0 : card.className, {
|
|
[`${prefixCls}-loading`]: loading,
|
|
[`${prefixCls}-bordered`]: bordered,
|
|
[`${prefixCls}-hoverable`]: hoverable,
|
|
[`${prefixCls}-contain-grid`]: isContainGrid,
|
|
[`${prefixCls}-contain-tabs`]: tabList && tabList.length,
|
|
[`${prefixCls}-${mergedSize}`]: mergedSize,
|
|
[`${prefixCls}-type-${type}`]: !!type,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, card === null || card === void 0 ? void 0 : card.style), style);
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", Object.assign({
|
|
ref: ref
|
|
}, divProps, {
|
|
className: classString,
|
|
style: mergedStyle
|
|
}), head, coverDom, body, actionDom));
|
|
});
|
|
/* harmony default export */ var card_Card = (Card);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/card/Meta.js
|
|
var Meta_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 Meta = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
avatar,
|
|
title,
|
|
description
|
|
} = props,
|
|
others = Meta_rest(props, ["prefixCls", "className", "avatar", "title", "description"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
const classString = classnames_default()(`${prefixCls}-meta`, className);
|
|
const avatarDom = avatar ? /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-meta-avatar`
|
|
}, avatar) : null;
|
|
const titleDom = title ? /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-meta-title`
|
|
}, title) : null;
|
|
const descriptionDom = description ? /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-meta-description`
|
|
}, description) : null;
|
|
const MetaDetail = titleDom || descriptionDom ? /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-meta-detail`
|
|
}, titleDom, descriptionDom) : null;
|
|
return /*#__PURE__*/react.createElement("div", Object.assign({}, others, {
|
|
className: classString
|
|
}), avatarDom, MetaDetail);
|
|
};
|
|
/* harmony default export */ var card_Meta = (Meta);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/card/index.js
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
const es_card_Card = card_Card;
|
|
es_card_Card.Grid = card_Grid;
|
|
es_card_Card.Meta = card_Meta;
|
|
if (false) {}
|
|
/* harmony default export */ var card = (es_card_Card);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 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;
|
|
}
|
|
|
|
/***/ })
|
|
|
|
}]); |