|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[75800],{
|
|
|
|
|
|
/***/ 57727:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons-svg/es/asn/CaretDownOutlined.js ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
"use strict";
|
|
|
// This icon file is generated automatically.
|
|
|
var CaretDownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "outlined" };
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (CaretDownOutlined);
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 54200:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons-svg/es/asn/CaretUpOutlined.js ***!
|
|
|
\**********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
"use strict";
|
|
|
// This icon file is generated automatically.
|
|
|
var CaretUpOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" } }] }, "name": "caret-up", "theme": "outlined" };
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (CaretUpOutlined);
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 48898:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons-svg/es/asn/FolderOpenOutlined.js ***!
|
|
|
\*************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
"use strict";
|
|
|
// This icon file is generated automatically.
|
|
|
var FolderOpenOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" } }] }, "name": "folder-open", "theme": "outlined" };
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (FolderOpenOutlined);
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 66367:
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/antd/es/_util/getScroll.js ***!
|
|
|
\*************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "F": function() { return /* binding */ isWindow; },
|
|
|
/* harmony export */ "Z": function() { return /* binding */ getScroll; }
|
|
|
/* harmony export */ });
|
|
|
function isWindow(obj) {
|
|
|
return obj !== null && obj !== undefined && obj === obj.window;
|
|
|
}
|
|
|
function getScroll(target, top) {
|
|
|
var _a, _b;
|
|
|
if (typeof window === 'undefined') {
|
|
|
return 0;
|
|
|
}
|
|
|
var method = top ? 'scrollTop' : 'scrollLeft';
|
|
|
var result = 0;
|
|
|
if (isWindow(target)) {
|
|
|
result = target[top ? 'pageYOffset' : 'pageXOffset'];
|
|
|
} else if (target instanceof Document) {
|
|
|
result = target.documentElement[method];
|
|
|
} else if (target instanceof HTMLElement) {
|
|
|
result = target[method];
|
|
|
} else if (target) {
|
|
|
// According to the type inference, the `target` is `never` type.
|
|
|
// Since we configured the loose mode type checking, and supports mocking the target with such shape below::
|
|
|
// `{ documentElement: { scrollLeft: 200, scrollTop: 400 } }`,
|
|
|
// the program may falls into this branch.
|
|
|
// Check the corresponding tests for details. Don't sure what is the real scenario this happens.
|
|
|
result = target[method];
|
|
|
}
|
|
|
if (target && !isWindow(target) && typeof result !== 'number') {
|
|
|
result = (_b = ((_a = target.ownerDocument) !== null && _a !== void 0 ? _a : target).documentElement) === null || _b === void 0 ? void 0 : _b[method];
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 58375:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/antd/es/_util/scrollTo.js + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ scrollTo; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/raf.js
|
|
|
var raf = __webpack_require__(75164);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/_util/easings.js
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
|
function easeInOutCubic(t, b, c, d) {
|
|
|
var cc = c - b;
|
|
|
t /= d / 2;
|
|
|
if (t < 1) {
|
|
|
return cc / 2 * t * t * t + b;
|
|
|
}
|
|
|
// eslint-disable-next-line no-return-assign
|
|
|
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/getScroll.js
|
|
|
var getScroll = __webpack_require__(66367);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/_util/scrollTo.js
|
|
|
|
|
|
|
|
|
|
|
|
function scrollTo(y) {
|
|
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
|
var _options$getContainer = options.getContainer,
|
|
|
getContainer = _options$getContainer === void 0 ? function () {
|
|
|
return window;
|
|
|
} : _options$getContainer,
|
|
|
callback = options.callback,
|
|
|
_options$duration = options.duration,
|
|
|
duration = _options$duration === void 0 ? 450 : _options$duration;
|
|
|
var container = getContainer();
|
|
|
var scrollTop = (0,getScroll/* default */.Z)(container, true);
|
|
|
var startTime = Date.now();
|
|
|
var frameFunc = function frameFunc() {
|
|
|
var timestamp = Date.now();
|
|
|
var time = timestamp - startTime;
|
|
|
var nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
|
|
if ((0,getScroll/* isWindow */.F)(container)) {
|
|
|
container.scrollTo(window.pageXOffset, nextScrollTop);
|
|
|
} else if (container instanceof Document || container.constructor.name === 'HTMLDocument') {
|
|
|
container.documentElement.scrollTop = nextScrollTop;
|
|
|
} else {
|
|
|
container.scrollTop = nextScrollTop;
|
|
|
}
|
|
|
if (time < duration) {
|
|
|
(0,raf/* default */.Z)(frameFunc);
|
|
|
} else if (typeof callback === 'function') {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
(0,raf/* default */.Z)(frameFunc);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 13013:
|
|
|
/*!************************************************!*\
|
|
|
!*** ./node_modules/antd/es/dropdown/index.js ***!
|
|
|
\************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdown */ 18562);
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (_dropdown__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 75008:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/antd/es/input/index.js + 5 modules ***!
|
|
|
\*********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ input; }
|
|
|
});
|
|
|
|
|
|
// 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/classnames/index.js
|
|
|
var classnames = __webpack_require__(94184);
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
|
var form_context = __webpack_require__(65223);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/Group.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Group = function Group(props) {
|
|
|
var _classNames;
|
|
|
var _useContext = (0,react.useContext)(context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _useContext.getPrefixCls,
|
|
|
direction = _useContext.direction;
|
|
|
var customizePrefixCls = props.prefixCls,
|
|
|
_props$className = props.className,
|
|
|
className = _props$className === void 0 ? '' : _props$className;
|
|
|
var prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
|
var cls = classnames_default()(prefixCls, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-lg"), props.size === 'large'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-sm"), props.size === 'small'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-compact"), props.compact), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames), className);
|
|
|
var formItemContext = (0,react.useContext)(form_context/* FormItemInputContext */.aM);
|
|
|
var groupFormItemContext = (0,react.useMemo)(function () {
|
|
|
return (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, formItemContext), {
|
|
|
isFormItemInput: false
|
|
|
});
|
|
|
}, [formItemContext]);
|
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
|
className: cls,
|
|
|
style: props.style,
|
|
|
onMouseEnter: props.onMouseEnter,
|
|
|
onMouseLeave: props.onMouseLeave,
|
|
|
onFocus: props.onFocus,
|
|
|
onBlur: props.onBlur
|
|
|
}, /*#__PURE__*/react.createElement(form_context/* FormItemInputContext.Provider */.aM.Provider, {
|
|
|
value: groupFormItemContext
|
|
|
}, props.children));
|
|
|
};
|
|
|
/* harmony default export */ var input_Group = (Group);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/Input.js + 1 modules
|
|
|
var Input = __webpack_require__(82586);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__(97685);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__(71002);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeInvisibleOutlined = (EyeInvisibleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(93771);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var EyeInvisibleOutlined_EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeInvisibleOutlined
|
|
|
}));
|
|
|
};
|
|
|
EyeInvisibleOutlined_EyeInvisibleOutlined.displayName = 'EyeInvisibleOutlined';
|
|
|
/* harmony default export */ var icons_EyeInvisibleOutlined = (/*#__PURE__*/react.forwardRef(EyeInvisibleOutlined_EyeInvisibleOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
|
var EyeOutlined = __webpack_require__(7124);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(98423);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(42550);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js
|
|
|
var useRemovePasswordTimeout = __webpack_require__(72922);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/Password.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;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var defaultIconRender = function defaultIconRender(visible) {
|
|
|
return visible ? /*#__PURE__*/react.createElement(EyeOutlined/* default */.Z, null) : /*#__PURE__*/react.createElement(icons_EyeInvisibleOutlined, null);
|
|
|
};
|
|
|
var ActionMap = {
|
|
|
click: 'onClick',
|
|
|
hover: 'onMouseOver'
|
|
|
};
|
|
|
var Password = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
var _props$visibilityTogg = props.visibilityToggle,
|
|
|
visibilityToggle = _props$visibilityTogg === void 0 ? true : _props$visibilityTogg;
|
|
|
var visibilityControlled = (0,esm_typeof/* default */.Z)(visibilityToggle) === 'object' && visibilityToggle.visible !== undefined;
|
|
|
var _useState = (0,react.useState)(function () {
|
|
|
return visibilityControlled ? visibilityToggle.visible : false;
|
|
|
}),
|
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
|
visible = _useState2[0],
|
|
|
setVisible = _useState2[1];
|
|
|
var inputRef = (0,react.useRef)(null);
|
|
|
react.useEffect(function () {
|
|
|
if (visibilityControlled) {
|
|
|
setVisible(visibilityToggle.visible);
|
|
|
}
|
|
|
}, [visibilityControlled, visibilityToggle]);
|
|
|
// Remove Password value
|
|
|
var removePasswordTimeout = (0,useRemovePasswordTimeout/* default */.Z)(inputRef);
|
|
|
var onVisibleChange = function onVisibleChange() {
|
|
|
var disabled = props.disabled;
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (visible) {
|
|
|
removePasswordTimeout();
|
|
|
}
|
|
|
setVisible(function (prevState) {
|
|
|
var _a;
|
|
|
var newState = !prevState;
|
|
|
if ((0,esm_typeof/* default */.Z)(visibilityToggle) === 'object') {
|
|
|
(_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);
|
|
|
}
|
|
|
return newState;
|
|
|
});
|
|
|
};
|
|
|
var getIcon = function getIcon(prefixCls) {
|
|
|
var _iconProps;
|
|
|
var _props$action = props.action,
|
|
|
action = _props$action === void 0 ? 'click' : _props$action,
|
|
|
_props$iconRender = props.iconRender,
|
|
|
iconRender = _props$iconRender === void 0 ? defaultIconRender : _props$iconRender;
|
|
|
var iconTrigger = ActionMap[action] || '';
|
|
|
var icon = iconRender(visible);
|
|
|
var iconProps = (_iconProps = {}, (0,defineProperty/* default */.Z)(_iconProps, iconTrigger, onVisibleChange), (0,defineProperty/* default */.Z)(_iconProps, "className", "".concat(prefixCls, "-icon")), (0,defineProperty/* default */.Z)(_iconProps, "key", 'passwordIcon'), (0,defineProperty/* default */.Z)(_iconProps, "onMouseDown", function onMouseDown(e) {
|
|
|
// Prevent focused state lost
|
|
|
// https://github.com/ant-design/ant-design/issues/15173
|
|
|
e.preventDefault();
|
|
|
}), (0,defineProperty/* default */.Z)(_iconProps, "onMouseUp", function onMouseUp(e) {
|
|
|
// Prevent caret position change
|
|
|
// https://github.com/ant-design/ant-design/issues/23524
|
|
|
e.preventDefault();
|
|
|
}), _iconProps);
|
|
|
return /*#__PURE__*/react.cloneElement( /*#__PURE__*/react.isValidElement(icon) ? icon : /*#__PURE__*/react.createElement("span", null, icon), iconProps);
|
|
|
};
|
|
|
var renderPassword = function renderPassword(_ref) {
|
|
|
var getPrefixCls = _ref.getPrefixCls;
|
|
|
var className = props.className,
|
|
|
customizePrefixCls = props.prefixCls,
|
|
|
customizeInputPrefixCls = props.inputPrefixCls,
|
|
|
size = props.size,
|
|
|
restProps = __rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
|
|
|
var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
var prefixCls = getPrefixCls('input-password', customizePrefixCls);
|
|
|
var suffixIcon = visibilityToggle && getIcon(prefixCls);
|
|
|
var inputClassName = classnames_default()(prefixCls, className, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-").concat(size), !!size));
|
|
|
var omittedProps = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, (0,omit/* default */.Z)(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
|
|
|
type: visible ? 'text' : 'password',
|
|
|
className: inputClassName,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
suffix: suffixIcon
|
|
|
});
|
|
|
if (size) {
|
|
|
omittedProps.size = size;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(Input/* default */.ZP, (0,esm_extends/* default */.Z)({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(ref, inputRef)
|
|
|
}, omittedProps));
|
|
|
};
|
|
|
return /*#__PURE__*/react.createElement(context/* ConfigConsumer */.C, null, renderPassword);
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Password = (Password);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/SearchOutlined.js
|
|
|
var SearchOutlined = __webpack_require__(25783);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/SizeContext.js
|
|
|
var SizeContext = __webpack_require__(97647);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(4173);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(96159);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/Search.js
|
|
|
|
|
|
|
|
|
var Search_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;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Search = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
var _classNames;
|
|
|
var customizePrefixCls = props.prefixCls,
|
|
|
customizeInputPrefixCls = props.inputPrefixCls,
|
|
|
className = props.className,
|
|
|
customizeSize = props.size,
|
|
|
suffix = props.suffix,
|
|
|
_props$enterButton = props.enterButton,
|
|
|
enterButton = _props$enterButton === void 0 ? false : _props$enterButton,
|
|
|
addonAfter = props.addonAfter,
|
|
|
loading = props.loading,
|
|
|
disabled = props.disabled,
|
|
|
customOnSearch = props.onSearch,
|
|
|
customOnChange = props.onChange,
|
|
|
onCompositionStart = props.onCompositionStart,
|
|
|
onCompositionEnd = props.onCompositionEnd,
|
|
|
restProps = Search_rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]);
|
|
|
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
|
direction = _React$useContext.direction;
|
|
|
var contextSize = react.useContext(SizeContext/* default */.Z);
|
|
|
var composedRef = react.useRef(false);
|
|
|
var prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
|
|
var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
var _useCompactItemContex = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction),
|
|
|
compactSize = _useCompactItemContex.compactSize;
|
|
|
var size = compactSize || customizeSize || contextSize;
|
|
|
var inputRef = react.useRef(null);
|
|
|
var onChange = function onChange(e) {
|
|
|
if (e && e.target && e.type === 'click' && customOnSearch) {
|
|
|
customOnSearch(e.target.value, e);
|
|
|
}
|
|
|
if (customOnChange) {
|
|
|
customOnChange(e);
|
|
|
}
|
|
|
};
|
|
|
var onMouseDown = function onMouseDown(e) {
|
|
|
var _a;
|
|
|
if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
var onSearch = function onSearch(e) {
|
|
|
var _a, _b;
|
|
|
if (customOnSearch) {
|
|
|
customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e);
|
|
|
}
|
|
|
};
|
|
|
var onPressEnter = function onPressEnter(e) {
|
|
|
if (composedRef.current || loading) {
|
|
|
return;
|
|
|
}
|
|
|
onSearch(e);
|
|
|
};
|
|
|
var searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/react.createElement(SearchOutlined/* default */.Z, null) : null;
|
|
|
var btnClassName = "".concat(prefixCls, "-button");
|
|
|
var button;
|
|
|
var enterButtonAsElement = enterButton || {};
|
|
|
var isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
|
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
|
|
button = (0,reactNode/* cloneElement */.Tm)(enterButtonAsElement, (0,esm_extends/* default */.Z)({
|
|
|
onMouseDown: onMouseDown,
|
|
|
onClick: function onClick(e) {
|
|
|
var _a, _b;
|
|
|
(_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
|
onSearch(e);
|
|
|
},
|
|
|
key: 'enterButton'
|
|
|
}, isAntdButton ? {
|
|
|
className: btnClassName,
|
|
|
size: size
|
|
|
} : {}));
|
|
|
} else {
|
|
|
button = /*#__PURE__*/react.createElement(es_button/* default */.Z, {
|
|
|
className: btnClassName,
|
|
|
type: enterButton ? 'primary' : undefined,
|
|
|
size: size,
|
|
|
disabled: disabled,
|
|
|
key: "enterButton",
|
|
|
onMouseDown: onMouseDown,
|
|
|
onClick: onSearch,
|
|
|
loading: loading,
|
|
|
icon: searchIcon
|
|
|
}, enterButton);
|
|
|
}
|
|
|
if (addonAfter) {
|
|
|
button = [button, (0,reactNode/* cloneElement */.Tm)(addonAfter, {
|
|
|
key: 'addonAfter'
|
|
|
})];
|
|
|
}
|
|
|
var cls = classnames_default()(prefixCls, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-").concat(size), !!size), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-with-button"), !!enterButton), _classNames), className);
|
|
|
var handleOnCompositionStart = function handleOnCompositionStart(e) {
|
|
|
composedRef.current = true;
|
|
|
onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
|
|
|
};
|
|
|
var handleOnCompositionEnd = function handleOnCompositionEnd(e) {
|
|
|
composedRef.current = false;
|
|
|
onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
|
|
|
};
|
|
|
return /*#__PURE__*/react.createElement(Input/* default */.ZP, (0,esm_extends/* default */.Z)({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(inputRef, ref),
|
|
|
onPressEnter: onPressEnter
|
|
|
}, restProps, {
|
|
|
size: size,
|
|
|
onCompositionStart: handleOnCompositionStart,
|
|
|
onCompositionEnd: handleOnCompositionEnd,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
addonAfter: button,
|
|
|
suffix: suffix,
|
|
|
onChange: onChange,
|
|
|
className: cls,
|
|
|
disabled: disabled
|
|
|
}));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Search = (Search);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/TextArea.js + 1 modules
|
|
|
var TextArea = __webpack_require__(80173);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var input_Input = Input/* default */.ZP;
|
|
|
input_Input.Group = input_Group;
|
|
|
input_Input.Search = input_Search;
|
|
|
input_Input.TextArea = TextArea/* default */.Z;
|
|
|
input_Input.Password = input_Password;
|
|
|
/* harmony default export */ var input = (input_Input);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 40378:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/antd/es/locale/en_US.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default */ 80779);
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (_default__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 67250:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/antd/es/table/index.js + 58 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ table; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__(71002);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(4942);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__(97685);
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__(94184);
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/isVisible.js
|
|
|
var isVisible = __webpack_require__(5110);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/pickAttrs.js
|
|
|
var pickAttrs = __webpack_require__(64217);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/styleChecker.js
|
|
|
var styleChecker = __webpack_require__(79370);
|
|
|
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
|
|
|
var shallowequal = __webpack_require__(96774);
|
|
|
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
|
var es_warning = __webpack_require__(80334);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js + 4 modules
|
|
|
var es = __webpack_require__(48555);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/getScrollBarSize.js
|
|
|
var getScrollBarSize = __webpack_require__(74204);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/sugar/ColumnGroup.js
|
|
|
/* istanbul ignore next */
|
|
|
|
|
|
/**
|
|
|
* This is a syntactic sugar for `columns` prop.
|
|
|
* So HOC will not work on this.
|
|
|
*/
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
function ColumnGroup(_) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var sugar_ColumnGroup = (ColumnGroup);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/sugar/Column.js
|
|
|
/* istanbul ignore next */
|
|
|
|
|
|
/**
|
|
|
* This is a syntactic sugar for `columns` prop.
|
|
|
* So HOC will not work on this.
|
|
|
*/
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
function Column(_) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var sugar_Column = (Column);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(42550);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/valueUtil.js
|
|
|
var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY';
|
|
|
|
|
|
function toArray(arr) {
|
|
|
if (arr === undefined || arr === null) {
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
return Array.isArray(arr) ? arr : [arr];
|
|
|
}
|
|
|
|
|
|
function getPathValue(record, path) {
|
|
|
// Skip if path is empty
|
|
|
if (!path && typeof path !== 'number') {
|
|
|
return record;
|
|
|
}
|
|
|
|
|
|
var pathList = toArray(path);
|
|
|
var current = record;
|
|
|
|
|
|
for (var i = 0; i < pathList.length; i += 1) {
|
|
|
if (!current) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
var prop = pathList[i];
|
|
|
current = current[prop];
|
|
|
}
|
|
|
|
|
|
return current;
|
|
|
}
|
|
|
function getColumnsKey(columns) {
|
|
|
var columnKeys = [];
|
|
|
var keys = {};
|
|
|
columns.forEach(function (column) {
|
|
|
var _ref = column || {},
|
|
|
key = _ref.key,
|
|
|
dataIndex = _ref.dataIndex;
|
|
|
|
|
|
var mergedKey = key || toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX;
|
|
|
|
|
|
while (keys[mergedKey]) {
|
|
|
mergedKey = "".concat(mergedKey, "_next");
|
|
|
}
|
|
|
|
|
|
keys[mergedKey] = true;
|
|
|
columnKeys.push(mergedKey);
|
|
|
});
|
|
|
return columnKeys;
|
|
|
}
|
|
|
function validateValue(val) {
|
|
|
return val !== null && val !== undefined;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/StickyContext.js
|
|
|
// Tell cell that browser support sticky
|
|
|
|
|
|
var StickyContext = /*#__PURE__*/react.createContext(false);
|
|
|
/* harmony default export */ var context_StickyContext = (StickyContext);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
var useLayoutEffect = __webpack_require__(8410);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useEvent.js
|
|
|
var useEvent = __webpack_require__(66680);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/ContextSelector/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createContext() {
|
|
|
var Context = /*#__PURE__*/react.createContext(null);
|
|
|
|
|
|
var Provider = function Provider(_ref) {
|
|
|
var value = _ref.value,
|
|
|
children = _ref.children;
|
|
|
var valueRef = react.useRef(value);
|
|
|
valueRef.current = value;
|
|
|
|
|
|
var _React$useState = react.useState(function () {
|
|
|
return {
|
|
|
getValue: function getValue() {
|
|
|
return valueRef.current;
|
|
|
},
|
|
|
listeners: new Set()
|
|
|
};
|
|
|
}),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 1),
|
|
|
context = _React$useState2[0];
|
|
|
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
|
context.listeners.forEach(function (listener) {
|
|
|
listener(value);
|
|
|
});
|
|
|
}, [value]);
|
|
|
return /*#__PURE__*/react.createElement(Context.Provider, {
|
|
|
value: context
|
|
|
}, children);
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
Context: Context,
|
|
|
Provider: Provider
|
|
|
};
|
|
|
}
|
|
|
function useContextSelector(holder, selector) {
|
|
|
var eventSelector = (0,useEvent/* default */.Z)(selector);
|
|
|
var context = react.useContext(holder === null || holder === void 0 ? void 0 : holder.Context);
|
|
|
|
|
|
var _ref2 = context || {},
|
|
|
listeners = _ref2.listeners,
|
|
|
getValue = _ref2.getValue;
|
|
|
|
|
|
var _React$useState3 = react.useState(function () {
|
|
|
return eventSelector(context ? getValue() : null);
|
|
|
}),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
value = _React$useState4[0],
|
|
|
setValue = _React$useState4[1];
|
|
|
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
|
if (!context) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
function trigger(nextValue) {
|
|
|
setValue(function (prev) {
|
|
|
var selectedValue = eventSelector(nextValue);
|
|
|
return shallowequal_default()(prev, selectedValue) ? prev : selectedValue;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
listeners.add(trigger);
|
|
|
return function () {
|
|
|
listeners.delete(trigger);
|
|
|
};
|
|
|
}, [context]);
|
|
|
return value;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/HoverContext.js
|
|
|
|
|
|
var HoverContext = createContext();
|
|
|
/* harmony default export */ var context_HoverContext = (HoverContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/BodyContext.js
|
|
|
|
|
|
var BodyContext = /*#__PURE__*/react.createContext(null);
|
|
|
/* harmony default export */ var context_BodyContext = (BodyContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/PerfContext.js
|
|
|
|
|
|
var PerfContext = /*#__PURE__*/react.createContext({
|
|
|
renderWithProps: false
|
|
|
});
|
|
|
/* harmony default export */ var context_PerfContext = (PerfContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Cell/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["colSpan", "rowSpan", "style", "className"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Check if cell is in hover range */
|
|
|
|
|
|
function inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {
|
|
|
var cellEndRow = cellStartRow + cellRowSpan - 1;
|
|
|
return cellStartRow <= endRow && cellEndRow >= startRow;
|
|
|
}
|
|
|
|
|
|
function isRenderCell(data) {
|
|
|
return data && (0,esm_typeof/* default */.Z)(data) === 'object' && !Array.isArray(data) && ! /*#__PURE__*/react.isValidElement(data);
|
|
|
}
|
|
|
|
|
|
function isRefComponent(component) {
|
|
|
// String tag component also support ref
|
|
|
if (typeof component === 'string') {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return (0,es_ref/* supportRef */.Yr)(component);
|
|
|
}
|
|
|
|
|
|
var getTitleFromCellRenderChildren = function getTitleFromCellRenderChildren(_ref) {
|
|
|
var ellipsis = _ref.ellipsis,
|
|
|
rowType = _ref.rowType,
|
|
|
children = _ref.children;
|
|
|
var title;
|
|
|
var ellipsisConfig = ellipsis === true ? {
|
|
|
showTitle: true
|
|
|
} : ellipsis;
|
|
|
|
|
|
if (ellipsisConfig && (ellipsisConfig.showTitle || rowType === 'header')) {
|
|
|
if (typeof children === 'string' || typeof children === 'number') {
|
|
|
title = children.toString();
|
|
|
} else if ( /*#__PURE__*/react.isValidElement(children) && typeof children.props.children === 'string') {
|
|
|
title = children.props.children;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return title;
|
|
|
};
|
|
|
|
|
|
function Cell(_ref2, ref) {
|
|
|
var _ref4, _ref5, _classNames;
|
|
|
|
|
|
var prefixCls = _ref2.prefixCls,
|
|
|
className = _ref2.className,
|
|
|
record = _ref2.record,
|
|
|
index = _ref2.index,
|
|
|
renderIndex = _ref2.renderIndex,
|
|
|
dataIndex = _ref2.dataIndex,
|
|
|
render = _ref2.render,
|
|
|
children = _ref2.children,
|
|
|
_ref2$component = _ref2.component,
|
|
|
Component = _ref2$component === void 0 ? 'td' : _ref2$component,
|
|
|
colSpan = _ref2.colSpan,
|
|
|
rowSpan = _ref2.rowSpan,
|
|
|
fixLeft = _ref2.fixLeft,
|
|
|
fixRight = _ref2.fixRight,
|
|
|
firstFixLeft = _ref2.firstFixLeft,
|
|
|
lastFixLeft = _ref2.lastFixLeft,
|
|
|
firstFixRight = _ref2.firstFixRight,
|
|
|
lastFixRight = _ref2.lastFixRight,
|
|
|
appendNode = _ref2.appendNode,
|
|
|
_ref2$additionalProps = _ref2.additionalProps,
|
|
|
additionalProps = _ref2$additionalProps === void 0 ? {} : _ref2$additionalProps,
|
|
|
ellipsis = _ref2.ellipsis,
|
|
|
align = _ref2.align,
|
|
|
rowType = _ref2.rowType,
|
|
|
isSticky = _ref2.isSticky,
|
|
|
hovering = _ref2.hovering,
|
|
|
onHover = _ref2.onHover;
|
|
|
var cellPrefixCls = "".concat(prefixCls, "-cell");
|
|
|
var perfRecord = react.useContext(context_PerfContext);
|
|
|
var supportSticky = react.useContext(context_StickyContext);
|
|
|
|
|
|
var _React$useContext = react.useContext(context_BodyContext),
|
|
|
allColumnsFixedLeft = _React$useContext.allColumnsFixedLeft; // ==================== Child Node ====================
|
|
|
|
|
|
|
|
|
var _React$useMemo = react.useMemo(function () {
|
|
|
if (validateValue(children)) {
|
|
|
return [children];
|
|
|
}
|
|
|
|
|
|
var value = getPathValue(record, dataIndex); // Customize render node
|
|
|
|
|
|
var returnChildNode = value;
|
|
|
var returnCellProps = undefined;
|
|
|
|
|
|
if (render) {
|
|
|
var renderData = render(value, record, renderIndex);
|
|
|
|
|
|
if (isRenderCell(renderData)) {
|
|
|
if (false) {}
|
|
|
|
|
|
returnChildNode = renderData.children;
|
|
|
returnCellProps = renderData.props;
|
|
|
perfRecord.renderWithProps = true;
|
|
|
} else {
|
|
|
returnChildNode = renderData;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return [returnChildNode, returnCellProps];
|
|
|
}, [
|
|
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
|
// Always re-render if `renderWithProps`
|
|
|
perfRecord.renderWithProps ? Math.random() : 0,
|
|
|
/* eslint-enable */
|
|
|
children, dataIndex, perfRecord, record, render, renderIndex]),
|
|
|
_React$useMemo2 = (0,slicedToArray/* default */.Z)(_React$useMemo, 2),
|
|
|
childNode = _React$useMemo2[0],
|
|
|
legacyCellProps = _React$useMemo2[1];
|
|
|
|
|
|
var mergedChildNode = childNode; // Not crash if final `childNode` is not validate ReactNode
|
|
|
|
|
|
if ((0,esm_typeof/* default */.Z)(mergedChildNode) === 'object' && !Array.isArray(mergedChildNode) && ! /*#__PURE__*/react.isValidElement(mergedChildNode)) {
|
|
|
mergedChildNode = null;
|
|
|
}
|
|
|
|
|
|
if (ellipsis && (lastFixLeft || firstFixRight)) {
|
|
|
mergedChildNode = /*#__PURE__*/react.createElement("span", {
|
|
|
className: "".concat(cellPrefixCls, "-content")
|
|
|
}, mergedChildNode);
|
|
|
}
|
|
|
|
|
|
var _ref3 = legacyCellProps || {},
|
|
|
cellColSpan = _ref3.colSpan,
|
|
|
cellRowSpan = _ref3.rowSpan,
|
|
|
cellStyle = _ref3.style,
|
|
|
cellClassName = _ref3.className,
|
|
|
restCellProps = (0,objectWithoutProperties/* default */.Z)(_ref3, _excluded);
|
|
|
|
|
|
var mergedColSpan = (_ref4 = cellColSpan !== undefined ? cellColSpan : colSpan) !== null && _ref4 !== void 0 ? _ref4 : 1;
|
|
|
var mergedRowSpan = (_ref5 = cellRowSpan !== undefined ? cellRowSpan : rowSpan) !== null && _ref5 !== void 0 ? _ref5 : 1;
|
|
|
|
|
|
if (mergedColSpan === 0 || mergedRowSpan === 0) {
|
|
|
return null;
|
|
|
} // ====================== Fixed =======================
|
|
|
|
|
|
|
|
|
var fixedStyle = {};
|
|
|
var isFixLeft = typeof fixLeft === 'number' && supportSticky;
|
|
|
var isFixRight = typeof fixRight === 'number' && supportSticky;
|
|
|
|
|
|
if (isFixLeft) {
|
|
|
fixedStyle.position = 'sticky';
|
|
|
fixedStyle.left = fixLeft;
|
|
|
}
|
|
|
|
|
|
if (isFixRight) {
|
|
|
fixedStyle.position = 'sticky';
|
|
|
fixedStyle.right = fixRight;
|
|
|
} // ====================== Align =======================
|
|
|
|
|
|
|
|
|
var alignStyle = {};
|
|
|
|
|
|
if (align) {
|
|
|
alignStyle.textAlign = align;
|
|
|
} // ====================== Hover =======================
|
|
|
|
|
|
|
|
|
var onMouseEnter = function onMouseEnter(event) {
|
|
|
var _additionalProps$onMo;
|
|
|
|
|
|
if (record) {
|
|
|
onHover(index, index + mergedRowSpan - 1);
|
|
|
}
|
|
|
|
|
|
additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onMo = additionalProps.onMouseEnter) === null || _additionalProps$onMo === void 0 ? void 0 : _additionalProps$onMo.call(additionalProps, event);
|
|
|
};
|
|
|
|
|
|
var onMouseLeave = function onMouseLeave(event) {
|
|
|
var _additionalProps$onMo2;
|
|
|
|
|
|
if (record) {
|
|
|
onHover(-1, -1);
|
|
|
}
|
|
|
|
|
|
additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onMo2 = additionalProps.onMouseLeave) === null || _additionalProps$onMo2 === void 0 ? void 0 : _additionalProps$onMo2.call(additionalProps, event);
|
|
|
}; // ====================== Render ======================
|
|
|
|
|
|
|
|
|
var title = getTitleFromCellRenderChildren({
|
|
|
rowType: rowType,
|
|
|
ellipsis: ellipsis,
|
|
|
children: childNode
|
|
|
});
|
|
|
|
|
|
var componentProps = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
|
title: title
|
|
|
}, restCellProps), additionalProps), {}, {
|
|
|
colSpan: mergedColSpan !== 1 ? mergedColSpan : null,
|
|
|
rowSpan: mergedRowSpan !== 1 ? mergedRowSpan : null,
|
|
|
className: classnames_default()(cellPrefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-ellipsis"), ellipsis), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-with-append"), appendNode), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), (0,defineProperty/* default */.Z)(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering), _classNames), additionalProps.className, cellClassName),
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, additionalProps.style), alignStyle), fixedStyle), cellStyle),
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave,
|
|
|
ref: isRefComponent(Component) ? ref : null
|
|
|
});
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(Component, componentProps, appendNode, mergedChildNode);
|
|
|
}
|
|
|
|
|
|
var RefCell = /*#__PURE__*/react.forwardRef(Cell);
|
|
|
RefCell.displayName = 'Cell';
|
|
|
var comparePropList = ['expanded', 'className', 'hovering'];
|
|
|
var MemoCell = /*#__PURE__*/react.memo(RefCell, function (prev, next) {
|
|
|
if (next.shouldCellUpdate) {
|
|
|
return (// Additional handle of expanded logic
|
|
|
comparePropList.every(function (propName) {
|
|
|
return prev[propName] === next[propName];
|
|
|
}) && // User control update logic
|
|
|
!next.shouldCellUpdate(next.record, prev.record)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
return shallowequal_default()(prev, next);
|
|
|
});
|
|
|
/** Inject hover data here, we still wish MemoCell keep simple `shouldCellUpdate` logic */
|
|
|
|
|
|
var WrappedCell = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
var index = props.index,
|
|
|
_props$additionalProp = props.additionalProps,
|
|
|
additionalProps = _props$additionalProp === void 0 ? {} : _props$additionalProp,
|
|
|
colSpan = props.colSpan,
|
|
|
rowSpan = props.rowSpan;
|
|
|
var cellColSpan = additionalProps.colSpan,
|
|
|
cellRowSpan = additionalProps.rowSpan;
|
|
|
var mergedColSpan = colSpan !== null && colSpan !== void 0 ? colSpan : cellColSpan;
|
|
|
var mergedRowSpan = rowSpan !== null && rowSpan !== void 0 ? rowSpan : cellRowSpan;
|
|
|
|
|
|
var _useContextSelector = useContextSelector(context_HoverContext, function (cxt) {
|
|
|
var isHovering = inHoverRange(index, mergedRowSpan || 1, cxt === null || cxt === void 0 ? void 0 : cxt.startRow, cxt === null || cxt === void 0 ? void 0 : cxt.endRow);
|
|
|
return {
|
|
|
onHover: cxt === null || cxt === void 0 ? void 0 : cxt.onHover,
|
|
|
hovering: isHovering
|
|
|
};
|
|
|
}),
|
|
|
onHover = _useContextSelector.onHover,
|
|
|
hovering = _useContextSelector.hovering;
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(MemoCell, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
colSpan: mergedColSpan,
|
|
|
rowSpan: mergedRowSpan,
|
|
|
hovering: hovering,
|
|
|
ref: ref,
|
|
|
onHover: onHover
|
|
|
}));
|
|
|
});
|
|
|
WrappedCell.displayName = 'WrappedCell';
|
|
|
/* harmony default export */ var es_Cell = (WrappedCell);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/TableContext.js
|
|
|
|
|
|
var TableContext = /*#__PURE__*/react.createContext(null);
|
|
|
/* harmony default export */ var context_TableContext = (TableContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/fixUtil.js
|
|
|
function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction) {
|
|
|
var startColumn = columns[colStart] || {};
|
|
|
var endColumn = columns[colEnd] || {};
|
|
|
var fixLeft;
|
|
|
var fixRight;
|
|
|
|
|
|
if (startColumn.fixed === 'left') {
|
|
|
fixLeft = stickyOffsets.left[colStart];
|
|
|
} else if (endColumn.fixed === 'right') {
|
|
|
fixRight = stickyOffsets.right[colEnd];
|
|
|
}
|
|
|
|
|
|
var lastFixLeft = false;
|
|
|
var firstFixRight = false;
|
|
|
var lastFixRight = false;
|
|
|
var firstFixLeft = false;
|
|
|
var nextColumn = columns[colEnd + 1];
|
|
|
var prevColumn = columns[colStart - 1];
|
|
|
|
|
|
if (direction === 'rtl') {
|
|
|
if (fixLeft !== undefined) {
|
|
|
var prevFixLeft = prevColumn && prevColumn.fixed === 'left';
|
|
|
firstFixLeft = !prevFixLeft;
|
|
|
} else if (fixRight !== undefined) {
|
|
|
var nextFixRight = nextColumn && nextColumn.fixed === 'right';
|
|
|
lastFixRight = !nextFixRight;
|
|
|
}
|
|
|
} else if (fixLeft !== undefined) {
|
|
|
var nextFixLeft = nextColumn && nextColumn.fixed === 'left';
|
|
|
lastFixLeft = !nextFixLeft;
|
|
|
} else if (fixRight !== undefined) {
|
|
|
var prevFixRight = prevColumn && prevColumn.fixed === 'right';
|
|
|
firstFixRight = !prevFixRight;
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
fixLeft: fixLeft,
|
|
|
fixRight: fixRight,
|
|
|
lastFixLeft: lastFixLeft,
|
|
|
firstFixRight: firstFixRight,
|
|
|
lastFixRight: lastFixRight,
|
|
|
firstFixLeft: firstFixLeft,
|
|
|
isSticky: stickyOffsets.isSticky
|
|
|
};
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Header/HeaderRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function HeaderRow(_ref) {
|
|
|
var cells = _ref.cells,
|
|
|
stickyOffsets = _ref.stickyOffsets,
|
|
|
flattenColumns = _ref.flattenColumns,
|
|
|
RowComponent = _ref.rowComponent,
|
|
|
CellComponent = _ref.cellComponent,
|
|
|
onHeaderRow = _ref.onHeaderRow,
|
|
|
index = _ref.index;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
direction = _React$useContext.direction;
|
|
|
|
|
|
var rowProps;
|
|
|
|
|
|
if (onHeaderRow) {
|
|
|
rowProps = onHeaderRow(cells.map(function (cell) {
|
|
|
return cell.column;
|
|
|
}), index);
|
|
|
}
|
|
|
|
|
|
var columnsKey = getColumnsKey(cells.map(function (cell) {
|
|
|
return cell.column;
|
|
|
}));
|
|
|
return /*#__PURE__*/react.createElement(RowComponent, rowProps, cells.map(function (cell, cellIndex) {
|
|
|
var column = cell.column;
|
|
|
var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction);
|
|
|
var additionalProps;
|
|
|
|
|
|
if (column && column.onHeaderCell) {
|
|
|
additionalProps = cell.column.onHeaderCell(column);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(es_Cell, (0,esm_extends/* default */.Z)({}, cell, {
|
|
|
ellipsis: column.ellipsis,
|
|
|
align: column.align,
|
|
|
component: CellComponent,
|
|
|
prefixCls: prefixCls,
|
|
|
key: columnsKey[cellIndex]
|
|
|
}, fixedInfo, {
|
|
|
additionalProps: additionalProps,
|
|
|
rowType: "header"
|
|
|
}));
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
HeaderRow.displayName = 'HeaderRow';
|
|
|
/* harmony default export */ var Header_HeaderRow = (HeaderRow);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Header/Header.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function parseHeaderRows(rootColumns) {
|
|
|
var rows = [];
|
|
|
|
|
|
function fillRowCells(columns, colIndex) {
|
|
|
var rowIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
|
// Init rows
|
|
|
rows[rowIndex] = rows[rowIndex] || [];
|
|
|
var currentColIndex = colIndex;
|
|
|
var colSpans = columns.filter(Boolean).map(function (column) {
|
|
|
var cell = {
|
|
|
key: column.key,
|
|
|
className: column.className || '',
|
|
|
children: column.title,
|
|
|
column: column,
|
|
|
colStart: currentColIndex
|
|
|
};
|
|
|
var colSpan = 1;
|
|
|
var subColumns = column.children;
|
|
|
|
|
|
if (subColumns && subColumns.length > 0) {
|
|
|
colSpan = fillRowCells(subColumns, currentColIndex, rowIndex + 1).reduce(function (total, count) {
|
|
|
return total + count;
|
|
|
}, 0);
|
|
|
cell.hasSubColumns = true;
|
|
|
}
|
|
|
|
|
|
if ('colSpan' in column) {
|
|
|
colSpan = column.colSpan;
|
|
|
}
|
|
|
|
|
|
if ('rowSpan' in column) {
|
|
|
cell.rowSpan = column.rowSpan;
|
|
|
}
|
|
|
|
|
|
cell.colSpan = colSpan;
|
|
|
cell.colEnd = cell.colStart + colSpan - 1;
|
|
|
rows[rowIndex].push(cell);
|
|
|
currentColIndex += colSpan;
|
|
|
return colSpan;
|
|
|
});
|
|
|
return colSpans;
|
|
|
} // Generate `rows` cell data
|
|
|
|
|
|
|
|
|
fillRowCells(rootColumns, 0); // Handle `rowSpan`
|
|
|
|
|
|
var rowCount = rows.length;
|
|
|
|
|
|
var _loop = function _loop(rowIndex) {
|
|
|
rows[rowIndex].forEach(function (cell) {
|
|
|
if (!('rowSpan' in cell) && !cell.hasSubColumns) {
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
cell.rowSpan = rowCount - rowIndex;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
for (var rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
|
|
|
_loop(rowIndex);
|
|
|
}
|
|
|
|
|
|
return rows;
|
|
|
}
|
|
|
|
|
|
function Header(_ref) {
|
|
|
var stickyOffsets = _ref.stickyOffsets,
|
|
|
columns = _ref.columns,
|
|
|
flattenColumns = _ref.flattenColumns,
|
|
|
onHeaderRow = _ref.onHeaderRow;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
getComponent = _React$useContext.getComponent;
|
|
|
|
|
|
var rows = react.useMemo(function () {
|
|
|
return parseHeaderRows(columns);
|
|
|
}, [columns]);
|
|
|
var WrapperComponent = getComponent(['header', 'wrapper'], 'thead');
|
|
|
var trComponent = getComponent(['header', 'row'], 'tr');
|
|
|
var thComponent = getComponent(['header', 'cell'], 'th');
|
|
|
return /*#__PURE__*/react.createElement(WrapperComponent, {
|
|
|
className: "".concat(prefixCls, "-thead")
|
|
|
}, rows.map(function (row, rowIndex) {
|
|
|
var rowNode = /*#__PURE__*/react.createElement(Header_HeaderRow, {
|
|
|
key: rowIndex,
|
|
|
flattenColumns: flattenColumns,
|
|
|
cells: row,
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
rowComponent: trComponent,
|
|
|
cellComponent: thComponent,
|
|
|
onHeaderRow: onHeaderRow,
|
|
|
index: rowIndex
|
|
|
});
|
|
|
return rowNode;
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var Header_Header = (Header);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/ExpandedRowContext.js
|
|
|
|
|
|
var ExpandedRowContext = /*#__PURE__*/react.createContext(null);
|
|
|
/* harmony default export */ var context_ExpandedRowContext = (ExpandedRowContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/ExpandedRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ExpandedRow(_ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
children = _ref.children,
|
|
|
Component = _ref.component,
|
|
|
cellComponent = _ref.cellComponent,
|
|
|
className = _ref.className,
|
|
|
expanded = _ref.expanded,
|
|
|
colSpan = _ref.colSpan,
|
|
|
isEmpty = _ref.isEmpty;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
scrollbarSize = _React$useContext.scrollbarSize;
|
|
|
|
|
|
var _React$useContext2 = react.useContext(context_ExpandedRowContext),
|
|
|
fixHeader = _React$useContext2.fixHeader,
|
|
|
fixColumn = _React$useContext2.fixColumn,
|
|
|
componentWidth = _React$useContext2.componentWidth,
|
|
|
horizonScroll = _React$useContext2.horizonScroll; // Cache render node
|
|
|
|
|
|
|
|
|
return react.useMemo(function () {
|
|
|
var contentNode = children;
|
|
|
|
|
|
if (isEmpty ? horizonScroll : fixColumn) {
|
|
|
contentNode = /*#__PURE__*/react.createElement("div", {
|
|
|
style: {
|
|
|
width: componentWidth - (fixHeader ? scrollbarSize : 0),
|
|
|
position: 'sticky',
|
|
|
left: 0,
|
|
|
overflow: 'hidden'
|
|
|
},
|
|
|
className: "".concat(prefixCls, "-expanded-row-fixed")
|
|
|
}, componentWidth !== 0 && contentNode);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(Component, {
|
|
|
className: className,
|
|
|
style: {
|
|
|
display: expanded ? null : 'none'
|
|
|
}
|
|
|
}, /*#__PURE__*/react.createElement(es_Cell, {
|
|
|
component: cellComponent,
|
|
|
prefixCls: prefixCls,
|
|
|
colSpan: colSpan
|
|
|
}, contentNode));
|
|
|
}, [children, Component, className, expanded, colSpan, isEmpty, scrollbarSize, componentWidth, fixColumn, fixHeader, horizonScroll]);
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var Body_ExpandedRow = (ExpandedRow);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/ResizeContext.js
|
|
|
|
|
|
var ResizeContext = /*#__PURE__*/react.createContext(null);
|
|
|
/* harmony default export */ var context_ResizeContext = (ResizeContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/BodyRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function BodyRow(props) {
|
|
|
var className = props.className,
|
|
|
style = props.style,
|
|
|
record = props.record,
|
|
|
index = props.index,
|
|
|
renderIndex = props.renderIndex,
|
|
|
rowKey = props.rowKey,
|
|
|
rowExpandable = props.rowExpandable,
|
|
|
expandedKeys = props.expandedKeys,
|
|
|
onRow = props.onRow,
|
|
|
_props$indent = props.indent,
|
|
|
indent = _props$indent === void 0 ? 0 : _props$indent,
|
|
|
RowComponent = props.rowComponent,
|
|
|
cellComponent = props.cellComponent,
|
|
|
childrenColumnName = props.childrenColumnName;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
fixedInfoList = _React$useContext.fixedInfoList;
|
|
|
|
|
|
var _React$useContext2 = react.useContext(context_BodyContext),
|
|
|
flattenColumns = _React$useContext2.flattenColumns,
|
|
|
expandableType = _React$useContext2.expandableType,
|
|
|
expandRowByClick = _React$useContext2.expandRowByClick,
|
|
|
onTriggerExpand = _React$useContext2.onTriggerExpand,
|
|
|
rowClassName = _React$useContext2.rowClassName,
|
|
|
expandedRowClassName = _React$useContext2.expandedRowClassName,
|
|
|
indentSize = _React$useContext2.indentSize,
|
|
|
expandIcon = _React$useContext2.expandIcon,
|
|
|
expandedRowRender = _React$useContext2.expandedRowRender,
|
|
|
expandIconColumnIndex = _React$useContext2.expandIconColumnIndex;
|
|
|
|
|
|
var _React$useState = react.useState(false),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
expandRended = _React$useState2[0],
|
|
|
setExpandRended = _React$useState2[1];
|
|
|
|
|
|
var expanded = expandedKeys && expandedKeys.has(props.recordKey);
|
|
|
react.useEffect(function () {
|
|
|
if (expanded) {
|
|
|
setExpandRended(true);
|
|
|
}
|
|
|
}, [expanded]);
|
|
|
var rowSupportExpand = expandableType === 'row' && (!rowExpandable || rowExpandable(record)); // Only when row is not expandable and `children` exist in record
|
|
|
|
|
|
var nestExpandable = expandableType === 'nest';
|
|
|
var hasNestChildren = childrenColumnName && record && record[childrenColumnName];
|
|
|
var mergedExpandable = rowSupportExpand || nestExpandable; // ======================== Expandable =========================
|
|
|
|
|
|
var onExpandRef = react.useRef(onTriggerExpand);
|
|
|
onExpandRef.current = onTriggerExpand;
|
|
|
|
|
|
var onInternalTriggerExpand = function onInternalTriggerExpand() {
|
|
|
onExpandRef.current.apply(onExpandRef, arguments);
|
|
|
}; // =========================== onRow ===========================
|
|
|
|
|
|
|
|
|
var additionalProps = onRow === null || onRow === void 0 ? void 0 : onRow(record, index);
|
|
|
|
|
|
var onClick = function onClick(event) {
|
|
|
var _additionalProps$onCl;
|
|
|
|
|
|
if (expandRowByClick && mergedExpandable) {
|
|
|
onInternalTriggerExpand(record, event);
|
|
|
}
|
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
|
args[_key - 1] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onCl = additionalProps.onClick) === null || _additionalProps$onCl === void 0 ? void 0 : _additionalProps$onCl.call.apply(_additionalProps$onCl, [additionalProps, event].concat(args));
|
|
|
}; // ======================== Base tr row ========================
|
|
|
|
|
|
|
|
|
var computeRowClassName;
|
|
|
|
|
|
if (typeof rowClassName === 'string') {
|
|
|
computeRowClassName = rowClassName;
|
|
|
} else if (typeof rowClassName === 'function') {
|
|
|
computeRowClassName = rowClassName(record, index, indent);
|
|
|
}
|
|
|
|
|
|
var columnsKey = getColumnsKey(flattenColumns);
|
|
|
var baseRowNode = /*#__PURE__*/react.createElement(RowComponent, (0,esm_extends/* default */.Z)({}, additionalProps, {
|
|
|
"data-row-key": rowKey,
|
|
|
className: classnames_default()(className, "".concat(prefixCls, "-row"), "".concat(prefixCls, "-row-level-").concat(indent), computeRowClassName, additionalProps && additionalProps.className),
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, style), additionalProps ? additionalProps.style : null),
|
|
|
onClick: onClick
|
|
|
}), flattenColumns.map(function (column, colIndex) {
|
|
|
var render = column.render,
|
|
|
dataIndex = column.dataIndex,
|
|
|
columnClassName = column.className;
|
|
|
var key = columnsKey[colIndex];
|
|
|
var fixedInfo = fixedInfoList[colIndex]; // ============= Used for nest expandable =============
|
|
|
|
|
|
var appendCellNode;
|
|
|
|
|
|
if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {
|
|
|
appendCellNode = /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("span", {
|
|
|
style: {
|
|
|
paddingLeft: "".concat(indentSize * indent, "px")
|
|
|
},
|
|
|
className: "".concat(prefixCls, "-row-indent indent-level-").concat(indent)
|
|
|
}), expandIcon({
|
|
|
prefixCls: prefixCls,
|
|
|
expanded: expanded,
|
|
|
expandable: hasNestChildren,
|
|
|
record: record,
|
|
|
onExpand: onInternalTriggerExpand
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
var additionalCellProps;
|
|
|
|
|
|
if (column.onCell) {
|
|
|
additionalCellProps = column.onCell(record, index);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(es_Cell, (0,esm_extends/* default */.Z)({
|
|
|
className: columnClassName,
|
|
|
ellipsis: column.ellipsis,
|
|
|
align: column.align,
|
|
|
component: cellComponent,
|
|
|
prefixCls: prefixCls,
|
|
|
key: key,
|
|
|
record: record,
|
|
|
index: index,
|
|
|
renderIndex: renderIndex,
|
|
|
dataIndex: dataIndex,
|
|
|
render: render,
|
|
|
shouldCellUpdate: column.shouldCellUpdate,
|
|
|
expanded: appendCellNode && expanded
|
|
|
}, fixedInfo, {
|
|
|
appendNode: appendCellNode,
|
|
|
additionalProps: additionalCellProps
|
|
|
}));
|
|
|
})); // ======================== Expand Row =========================
|
|
|
|
|
|
var expandRowNode;
|
|
|
|
|
|
if (rowSupportExpand && (expandRended || expanded)) {
|
|
|
var expandContent = expandedRowRender(record, index, indent + 1, expanded);
|
|
|
var computedExpandedRowClassName = expandedRowClassName && expandedRowClassName(record, index, indent);
|
|
|
expandRowNode = /*#__PURE__*/react.createElement(Body_ExpandedRow, {
|
|
|
expanded: expanded,
|
|
|
className: classnames_default()("".concat(prefixCls, "-expanded-row"), "".concat(prefixCls, "-expanded-row-level-").concat(indent + 1), computedExpandedRowClassName),
|
|
|
prefixCls: prefixCls,
|
|
|
component: RowComponent,
|
|
|
cellComponent: cellComponent,
|
|
|
colSpan: flattenColumns.length,
|
|
|
isEmpty: false
|
|
|
}, expandContent);
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, baseRowNode, expandRowNode);
|
|
|
}
|
|
|
|
|
|
BodyRow.displayName = 'BodyRow';
|
|
|
/* harmony default export */ var Body_BodyRow = (BodyRow);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useFlattenRecords.js
|
|
|
|
|
|
// recursion (flat tree structure)
|
|
|
|
|
|
function flatRecord(record, indent, childrenColumnName, expandedKeys, getRowKey, index) {
|
|
|
var arr = [];
|
|
|
arr.push({
|
|
|
record: record,
|
|
|
indent: indent,
|
|
|
index: index
|
|
|
});
|
|
|
var key = getRowKey(record);
|
|
|
var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key);
|
|
|
|
|
|
if (record && Array.isArray(record[childrenColumnName]) && expanded) {
|
|
|
// expanded state, flat record
|
|
|
for (var i = 0; i < record[childrenColumnName].length; i += 1) {
|
|
|
var tempArr = flatRecord(record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);
|
|
|
arr.push.apply(arr, (0,toConsumableArray/* default */.Z)(tempArr));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return arr;
|
|
|
}
|
|
|
/**
|
|
|
* flat tree data on expanded state
|
|
|
*
|
|
|
* @export
|
|
|
* @template T
|
|
|
* @param {*} data : table data
|
|
|
* @param {string} childrenColumnName : 指定树形结构的列名
|
|
|
* @param {Set<Key>} expandedKeys : 展开的行对应的keys
|
|
|
* @param {GetRowKey<T>} getRowKey : 获取当前rowKey的方法
|
|
|
* @returns flattened data
|
|
|
*/
|
|
|
|
|
|
|
|
|
function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
|
|
|
var arr = react.useMemo(function () {
|
|
|
if (expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.size) {
|
|
|
var temp = []; // collect flattened record
|
|
|
|
|
|
for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {
|
|
|
var record = data[i];
|
|
|
temp.push.apply(temp, (0,toConsumableArray/* default */.Z)(flatRecord(record, 0, childrenColumnName, expandedKeys, getRowKey, i)));
|
|
|
}
|
|
|
|
|
|
return temp;
|
|
|
}
|
|
|
|
|
|
return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
|
|
|
return {
|
|
|
record: item,
|
|
|
indent: 0,
|
|
|
index: index
|
|
|
};
|
|
|
});
|
|
|
}, [data, childrenColumnName, expandedKeys, getRowKey]);
|
|
|
return arr;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/MeasureCell.js
|
|
|
|
|
|
|
|
|
function MeasureCell(_ref) {
|
|
|
var columnKey = _ref.columnKey,
|
|
|
onColumnResize = _ref.onColumnResize;
|
|
|
var cellRef = react.useRef();
|
|
|
react.useEffect(function () {
|
|
|
if (cellRef.current) {
|
|
|
onColumnResize(columnKey, cellRef.current.offsetWidth);
|
|
|
}
|
|
|
}, []);
|
|
|
return /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
|
data: columnKey
|
|
|
}, /*#__PURE__*/react.createElement("td", {
|
|
|
ref: cellRef,
|
|
|
style: {
|
|
|
padding: 0,
|
|
|
border: 0,
|
|
|
height: 0
|
|
|
}
|
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
|
style: {
|
|
|
height: 0,
|
|
|
overflow: 'hidden'
|
|
|
}
|
|
|
}, "\xA0")));
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/MeasureRow.js
|
|
|
|
|
|
|
|
|
|
|
|
function MeasureRow(_ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
columnsKey = _ref.columnsKey,
|
|
|
onColumnResize = _ref.onColumnResize;
|
|
|
return /*#__PURE__*/react.createElement("tr", {
|
|
|
"aria-hidden": "true",
|
|
|
className: "".concat(prefixCls, "-measure-row"),
|
|
|
style: {
|
|
|
height: 0,
|
|
|
fontSize: 0
|
|
|
}
|
|
|
}, /*#__PURE__*/react.createElement(es/* default.Collection */.Z.Collection, {
|
|
|
onBatchResize: function onBatchResize(infoList) {
|
|
|
infoList.forEach(function (_ref2) {
|
|
|
var columnKey = _ref2.data,
|
|
|
size = _ref2.size;
|
|
|
onColumnResize(columnKey, size.offsetWidth);
|
|
|
});
|
|
|
}
|
|
|
}, columnsKey.map(function (columnKey) {
|
|
|
return /*#__PURE__*/react.createElement(MeasureCell, {
|
|
|
key: columnKey,
|
|
|
columnKey: columnKey,
|
|
|
onColumnResize: onColumnResize
|
|
|
});
|
|
|
})));
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Body(_ref) {
|
|
|
var data = _ref.data,
|
|
|
getRowKey = _ref.getRowKey,
|
|
|
measureColumnWidth = _ref.measureColumnWidth,
|
|
|
expandedKeys = _ref.expandedKeys,
|
|
|
onRow = _ref.onRow,
|
|
|
rowExpandable = _ref.rowExpandable,
|
|
|
emptyNode = _ref.emptyNode,
|
|
|
childrenColumnName = _ref.childrenColumnName;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_ResizeContext),
|
|
|
onColumnResize = _React$useContext.onColumnResize;
|
|
|
|
|
|
var _React$useContext2 = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext2.prefixCls,
|
|
|
getComponent = _React$useContext2.getComponent;
|
|
|
|
|
|
var _React$useContext3 = react.useContext(context_BodyContext),
|
|
|
flattenColumns = _React$useContext3.flattenColumns;
|
|
|
|
|
|
var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey); // =================== Performance ====================
|
|
|
|
|
|
var perfRef = react.useRef({
|
|
|
renderWithProps: false
|
|
|
}); // ====================== Hover =======================
|
|
|
|
|
|
var _React$useState = react.useState(-1),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
startRow = _React$useState2[0],
|
|
|
setStartRow = _React$useState2[1];
|
|
|
|
|
|
var _React$useState3 = react.useState(-1),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
endRow = _React$useState4[0],
|
|
|
setEndRow = _React$useState4[1];
|
|
|
|
|
|
var onHover = react.useCallback(function (start, end) {
|
|
|
setStartRow(start);
|
|
|
setEndRow(end);
|
|
|
}, []); // ====================== Render ======================
|
|
|
|
|
|
var bodyNode = react.useMemo(function () {
|
|
|
var WrapperComponent = getComponent(['body', 'wrapper'], 'tbody');
|
|
|
var trComponent = getComponent(['body', 'row'], 'tr');
|
|
|
var tdComponent = getComponent(['body', 'cell'], 'td');
|
|
|
var rows;
|
|
|
|
|
|
if (data.length) {
|
|
|
rows = flattenData.map(function (item, idx) {
|
|
|
var record = item.record,
|
|
|
indent = item.indent,
|
|
|
renderIndex = item.index;
|
|
|
var key = getRowKey(record, idx);
|
|
|
return /*#__PURE__*/react.createElement(Body_BodyRow, {
|
|
|
key: key,
|
|
|
rowKey: key,
|
|
|
record: record,
|
|
|
recordKey: key,
|
|
|
index: idx,
|
|
|
renderIndex: renderIndex,
|
|
|
rowComponent: trComponent,
|
|
|
cellComponent: tdComponent,
|
|
|
expandedKeys: expandedKeys,
|
|
|
onRow: onRow,
|
|
|
getRowKey: getRowKey,
|
|
|
rowExpandable: rowExpandable,
|
|
|
childrenColumnName: childrenColumnName,
|
|
|
indent: indent
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
rows = /*#__PURE__*/react.createElement(Body_ExpandedRow, {
|
|
|
expanded: true,
|
|
|
className: "".concat(prefixCls, "-placeholder"),
|
|
|
prefixCls: prefixCls,
|
|
|
component: trComponent,
|
|
|
cellComponent: tdComponent,
|
|
|
colSpan: flattenColumns.length,
|
|
|
isEmpty: true
|
|
|
}, emptyNode);
|
|
|
}
|
|
|
|
|
|
var columnsKey = getColumnsKey(flattenColumns);
|
|
|
return /*#__PURE__*/react.createElement(WrapperComponent, {
|
|
|
className: "".concat(prefixCls, "-tbody")
|
|
|
}, measureColumnWidth && /*#__PURE__*/react.createElement(MeasureRow, {
|
|
|
prefixCls: prefixCls,
|
|
|
columnsKey: columnsKey,
|
|
|
onColumnResize: onColumnResize
|
|
|
}), rows);
|
|
|
}, [data, prefixCls, onRow, measureColumnWidth, expandedKeys, getRowKey, getComponent, emptyNode, flattenColumns, childrenColumnName, onColumnResize, rowExpandable, flattenData]);
|
|
|
return /*#__PURE__*/react.createElement(context_PerfContext.Provider, {
|
|
|
value: perfRef.current
|
|
|
}, /*#__PURE__*/react.createElement(context_HoverContext.Provider, {
|
|
|
value: {
|
|
|
startRow: startRow,
|
|
|
endRow: endRow,
|
|
|
onHover: onHover
|
|
|
}
|
|
|
}, bodyNode));
|
|
|
}
|
|
|
|
|
|
var MemoBody = /*#__PURE__*/react.memo(Body);
|
|
|
MemoBody.displayName = 'Body';
|
|
|
/* harmony default export */ var es_Body = (MemoBody);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
|
|
|
var Children_toArray = __webpack_require__(50344);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/legacyUtil.js
|
|
|
|
|
|
|
|
|
var legacyUtil_excluded = ["expandable"];
|
|
|
|
|
|
var INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE';
|
|
|
function getExpandableProps(props) {
|
|
|
var expandable = props.expandable,
|
|
|
legacyExpandableConfig = (0,objectWithoutProperties/* default */.Z)(props, legacyUtil_excluded);
|
|
|
|
|
|
var config;
|
|
|
|
|
|
if ('expandable' in props) {
|
|
|
config = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, legacyExpandableConfig), expandable);
|
|
|
} else {
|
|
|
if (false) {}
|
|
|
|
|
|
config = legacyExpandableConfig;
|
|
|
}
|
|
|
|
|
|
if (config.showExpandColumn === false) {
|
|
|
config.expandIconColumnIndex = -1;
|
|
|
}
|
|
|
|
|
|
return config;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/constant.js
|
|
|
var EXPAND_COLUMN = {};
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useColumns.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var useColumns_excluded = ["children"],
|
|
|
_excluded2 = ["fixed"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function convertChildrenToColumns(children) {
|
|
|
return (0,Children_toArray/* default */.Z)(children).filter(function (node) {
|
|
|
return /*#__PURE__*/react.isValidElement(node);
|
|
|
}).map(function (_ref) {
|
|
|
var key = _ref.key,
|
|
|
props = _ref.props;
|
|
|
|
|
|
var nodeChildren = props.children,
|
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, useColumns_excluded);
|
|
|
|
|
|
var column = (0,objectSpread2/* default */.Z)({
|
|
|
key: key
|
|
|
}, restProps);
|
|
|
|
|
|
if (nodeChildren) {
|
|
|
column.children = convertChildrenToColumns(nodeChildren);
|
|
|
}
|
|
|
|
|
|
return column;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function flatColumns(columns) {
|
|
|
return columns.reduce(function (list, column) {
|
|
|
var fixed = column.fixed; // Convert `fixed='true'` to `fixed='left'` instead
|
|
|
|
|
|
var parsedFixed = fixed === true ? 'left' : fixed;
|
|
|
var subColumns = column.children;
|
|
|
|
|
|
if (subColumns && subColumns.length > 0) {
|
|
|
return [].concat((0,toConsumableArray/* default */.Z)(list), (0,toConsumableArray/* default */.Z)(flatColumns(subColumns).map(function (subColum) {
|
|
|
return (0,objectSpread2/* default */.Z)({
|
|
|
fixed: parsedFixed
|
|
|
}, subColum);
|
|
|
})));
|
|
|
}
|
|
|
|
|
|
return [].concat((0,toConsumableArray/* default */.Z)(list), [(0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, column), {}, {
|
|
|
fixed: parsedFixed
|
|
|
})]);
|
|
|
}, []);
|
|
|
}
|
|
|
|
|
|
function warningFixed(flattenColumns) {
|
|
|
var allFixLeft = true;
|
|
|
|
|
|
for (var i = 0; i < flattenColumns.length; i += 1) {
|
|
|
var col = flattenColumns[i];
|
|
|
|
|
|
if (allFixLeft && col.fixed !== 'left') {
|
|
|
allFixLeft = false;
|
|
|
} else if (!allFixLeft && col.fixed === 'left') {
|
|
|
warning(false, "Index ".concat(i - 1, " of `columns` missing `fixed='left'` prop."));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var allFixRight = true;
|
|
|
|
|
|
for (var _i = flattenColumns.length - 1; _i >= 0; _i -= 1) {
|
|
|
var _col = flattenColumns[_i];
|
|
|
|
|
|
if (allFixRight && _col.fixed !== 'right') {
|
|
|
allFixRight = false;
|
|
|
} else if (!allFixRight && _col.fixed === 'right') {
|
|
|
warning(false, "Index ".concat(_i + 1, " of `columns` missing `fixed='right'` prop."));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function revertForRtl(columns) {
|
|
|
return columns.map(function (column) {
|
|
|
var fixed = column.fixed,
|
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(column, _excluded2); // Convert `fixed='left'` to `fixed='right'` instead
|
|
|
|
|
|
|
|
|
var parsedFixed = fixed;
|
|
|
|
|
|
if (fixed === 'left') {
|
|
|
parsedFixed = 'right';
|
|
|
} else if (fixed === 'right') {
|
|
|
parsedFixed = 'left';
|
|
|
}
|
|
|
|
|
|
return (0,objectSpread2/* default */.Z)({
|
|
|
fixed: parsedFixed
|
|
|
}, restProps);
|
|
|
});
|
|
|
}
|
|
|
/**
|
|
|
* Parse `columns` & `children` into `columns`.
|
|
|
*/
|
|
|
|
|
|
|
|
|
function useColumns(_ref2, transformColumns) {
|
|
|
var prefixCls = _ref2.prefixCls,
|
|
|
columns = _ref2.columns,
|
|
|
children = _ref2.children,
|
|
|
expandable = _ref2.expandable,
|
|
|
expandedKeys = _ref2.expandedKeys,
|
|
|
columnTitle = _ref2.columnTitle,
|
|
|
getRowKey = _ref2.getRowKey,
|
|
|
onTriggerExpand = _ref2.onTriggerExpand,
|
|
|
expandIcon = _ref2.expandIcon,
|
|
|
rowExpandable = _ref2.rowExpandable,
|
|
|
expandIconColumnIndex = _ref2.expandIconColumnIndex,
|
|
|
direction = _ref2.direction,
|
|
|
expandRowByClick = _ref2.expandRowByClick,
|
|
|
columnWidth = _ref2.columnWidth,
|
|
|
fixed = _ref2.fixed;
|
|
|
var baseColumns = react.useMemo(function () {
|
|
|
return columns || convertChildrenToColumns(children);
|
|
|
}, [columns, children]); // ========================== Expand ==========================
|
|
|
|
|
|
var withExpandColumns = react.useMemo(function () {
|
|
|
if (expandable) {
|
|
|
var _expandColumn;
|
|
|
|
|
|
var cloneColumns = baseColumns.slice(); // >>> Warning if use `expandIconColumnIndex`
|
|
|
|
|
|
if (false) {} // >>> Insert expand column if not exist
|
|
|
|
|
|
|
|
|
if (!cloneColumns.includes(EXPAND_COLUMN)) {
|
|
|
var expandColIndex = expandIconColumnIndex || 0;
|
|
|
|
|
|
if (expandColIndex >= 0) {
|
|
|
cloneColumns.splice(expandColIndex, 0, EXPAND_COLUMN);
|
|
|
}
|
|
|
} // >>> Deduplicate additional expand column
|
|
|
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
var expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);
|
|
|
cloneColumns = cloneColumns.filter(function (column, index) {
|
|
|
return column !== EXPAND_COLUMN || index === expandColumnIndex;
|
|
|
}); // >>> Check if expand column need to fixed
|
|
|
|
|
|
var prevColumn = baseColumns[expandColumnIndex];
|
|
|
var fixedColumn;
|
|
|
|
|
|
if ((fixed === 'left' || fixed) && !expandIconColumnIndex) {
|
|
|
fixedColumn = 'left';
|
|
|
} else if ((fixed === 'right' || fixed) && expandIconColumnIndex === baseColumns.length) {
|
|
|
fixedColumn = 'right';
|
|
|
} else {
|
|
|
fixedColumn = prevColumn ? prevColumn.fixed : null;
|
|
|
} // >>> Create expandable column
|
|
|
|
|
|
|
|
|
var expandColumn = (_expandColumn = {}, (0,defineProperty/* default */.Z)(_expandColumn, INTERNAL_COL_DEFINE, {
|
|
|
className: "".concat(prefixCls, "-expand-icon-col"),
|
|
|
columnType: 'EXPAND_COLUMN'
|
|
|
}), (0,defineProperty/* default */.Z)(_expandColumn, "title", columnTitle), (0,defineProperty/* default */.Z)(_expandColumn, "fixed", fixedColumn), (0,defineProperty/* default */.Z)(_expandColumn, "className", "".concat(prefixCls, "-row-expand-icon-cell")), (0,defineProperty/* default */.Z)(_expandColumn, "width", columnWidth), (0,defineProperty/* default */.Z)(_expandColumn, "render", function render(_, record, index) {
|
|
|
var rowKey = getRowKey(record, index);
|
|
|
var expanded = expandedKeys.has(rowKey);
|
|
|
var recordExpandable = rowExpandable ? rowExpandable(record) : true;
|
|
|
var icon = expandIcon({
|
|
|
prefixCls: prefixCls,
|
|
|
expanded: expanded,
|
|
|
expandable: recordExpandable,
|
|
|
record: record,
|
|
|
onExpand: onTriggerExpand
|
|
|
});
|
|
|
|
|
|
if (expandRowByClick) {
|
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
}
|
|
|
}, icon);
|
|
|
}
|
|
|
|
|
|
return icon;
|
|
|
}), _expandColumn);
|
|
|
return cloneColumns.map(function (col) {
|
|
|
return col === EXPAND_COLUMN ? expandColumn : col;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
return baseColumns.filter(function (col) {
|
|
|
return col !== EXPAND_COLUMN;
|
|
|
});
|
|
|
}, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]); // ========================= Transform ========================
|
|
|
|
|
|
var mergedColumns = react.useMemo(function () {
|
|
|
var finalColumns = withExpandColumns;
|
|
|
|
|
|
if (transformColumns) {
|
|
|
finalColumns = transformColumns(finalColumns);
|
|
|
} // Always provides at least one column for table display
|
|
|
|
|
|
|
|
|
if (!finalColumns.length) {
|
|
|
finalColumns = [{
|
|
|
render: function render() {
|
|
|
return null;
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
return finalColumns;
|
|
|
}, [transformColumns, withExpandColumns, direction]); // ========================== Flatten =========================
|
|
|
|
|
|
var flattenColumns = react.useMemo(function () {
|
|
|
if (direction === 'rtl') {
|
|
|
return revertForRtl(flatColumns(mergedColumns));
|
|
|
}
|
|
|
|
|
|
return flatColumns(mergedColumns);
|
|
|
}, [mergedColumns, direction]); // Only check out of production since it's waste for each render
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
return [mergedColumns, flattenColumns];
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var hooks_useColumns = (useColumns);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useFrame.js
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Execute code before next frame but async
|
|
|
*/
|
|
|
|
|
|
function useLayoutState(defaultState) {
|
|
|
var stateRef = (0,react.useRef)(defaultState);
|
|
|
|
|
|
var _useState = (0,react.useState)({}),
|
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
|
forceUpdate = _useState2[1];
|
|
|
|
|
|
var lastPromiseRef = (0,react.useRef)(null);
|
|
|
var updateBatchRef = (0,react.useRef)([]);
|
|
|
|
|
|
function setFrameState(updater) {
|
|
|
updateBatchRef.current.push(updater);
|
|
|
var promise = Promise.resolve();
|
|
|
lastPromiseRef.current = promise;
|
|
|
promise.then(function () {
|
|
|
if (lastPromiseRef.current === promise) {
|
|
|
var prevBatch = updateBatchRef.current;
|
|
|
var prevState = stateRef.current;
|
|
|
updateBatchRef.current = [];
|
|
|
prevBatch.forEach(function (batchUpdater) {
|
|
|
stateRef.current = batchUpdater(stateRef.current);
|
|
|
});
|
|
|
lastPromiseRef.current = null;
|
|
|
|
|
|
if (prevState !== stateRef.current) {
|
|
|
forceUpdate({});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
(0,react.useEffect)(function () {
|
|
|
return function () {
|
|
|
lastPromiseRef.current = null;
|
|
|
};
|
|
|
}, []);
|
|
|
return [stateRef.current, setFrameState];
|
|
|
}
|
|
|
/** Lock frame, when frame pass reset the lock. */
|
|
|
|
|
|
function useTimeoutLock(defaultState) {
|
|
|
var frameRef = (0,react.useRef)(defaultState || null);
|
|
|
var timeoutRef = (0,react.useRef)();
|
|
|
|
|
|
function cleanUp() {
|
|
|
window.clearTimeout(timeoutRef.current);
|
|
|
}
|
|
|
|
|
|
function setState(newState) {
|
|
|
frameRef.current = newState;
|
|
|
cleanUp();
|
|
|
timeoutRef.current = window.setTimeout(function () {
|
|
|
frameRef.current = null;
|
|
|
timeoutRef.current = undefined;
|
|
|
}, 100);
|
|
|
}
|
|
|
|
|
|
function getState() {
|
|
|
return frameRef.current;
|
|
|
}
|
|
|
|
|
|
(0,react.useEffect)(function () {
|
|
|
return cleanUp;
|
|
|
}, []);
|
|
|
return [setState, getState];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useStickyOffsets.js
|
|
|
|
|
|
/**
|
|
|
* Get sticky column offset width
|
|
|
*/
|
|
|
|
|
|
function useStickyOffsets(colWidths, columnCount, direction) {
|
|
|
var stickyOffsets = (0,react.useMemo)(function () {
|
|
|
var leftOffsets = [];
|
|
|
var rightOffsets = [];
|
|
|
var left = 0;
|
|
|
var right = 0;
|
|
|
|
|
|
for (var start = 0; start < columnCount; start += 1) {
|
|
|
if (direction === 'rtl') {
|
|
|
// Left offset
|
|
|
rightOffsets[start] = right;
|
|
|
right += colWidths[start] || 0; // Right offset
|
|
|
|
|
|
var end = columnCount - start - 1;
|
|
|
leftOffsets[end] = left;
|
|
|
left += colWidths[end] || 0;
|
|
|
} else {
|
|
|
// Left offset
|
|
|
leftOffsets[start] = left;
|
|
|
left += colWidths[start] || 0; // Right offset
|
|
|
|
|
|
var _end = columnCount - start - 1;
|
|
|
|
|
|
rightOffsets[_end] = right;
|
|
|
right += colWidths[_end] || 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
left: leftOffsets,
|
|
|
right: rightOffsets
|
|
|
};
|
|
|
}, [colWidths, columnCount, direction]);
|
|
|
return stickyOffsets;
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var hooks_useStickyOffsets = (useStickyOffsets);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/ColGroup.js
|
|
|
|
|
|
|
|
|
var ColGroup_excluded = ["columnType"];
|
|
|
|
|
|
|
|
|
|
|
|
function ColGroup(_ref) {
|
|
|
var colWidths = _ref.colWidths,
|
|
|
columns = _ref.columns,
|
|
|
columCount = _ref.columCount;
|
|
|
var cols = [];
|
|
|
var len = columCount || columns.length; // Only insert col with width & additional props
|
|
|
// Skip if rest col do not have any useful info
|
|
|
|
|
|
var mustInsert = false;
|
|
|
|
|
|
for (var i = len - 1; i >= 0; i -= 1) {
|
|
|
var width = colWidths[i];
|
|
|
var column = columns && columns[i];
|
|
|
var additionalProps = column && column[INTERNAL_COL_DEFINE];
|
|
|
|
|
|
if (width || additionalProps || mustInsert) {
|
|
|
var _ref2 = additionalProps || {},
|
|
|
columnType = _ref2.columnType,
|
|
|
restAdditionalProps = (0,objectWithoutProperties/* default */.Z)(_ref2, ColGroup_excluded);
|
|
|
|
|
|
cols.unshift( /*#__PURE__*/react.createElement("col", (0,esm_extends/* default */.Z)({
|
|
|
key: i,
|
|
|
style: {
|
|
|
width: width
|
|
|
}
|
|
|
}, restAdditionalProps)));
|
|
|
mustInsert = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/react.createElement("colgroup", null, cols);
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var es_ColGroup = (ColGroup);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Panel/index.js
|
|
|
|
|
|
|
|
|
function Panel(_ref) {
|
|
|
var className = _ref.className,
|
|
|
children = _ref.children;
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: className
|
|
|
}, children);
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var es_Panel = (Panel);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/SummaryContext.js
|
|
|
|
|
|
var SummaryContext = /*#__PURE__*/react.createContext({});
|
|
|
/* harmony default export */ var Footer_SummaryContext = (SummaryContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/Cell.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SummaryCell(_ref) {
|
|
|
var className = _ref.className,
|
|
|
index = _ref.index,
|
|
|
children = _ref.children,
|
|
|
_ref$colSpan = _ref.colSpan,
|
|
|
colSpan = _ref$colSpan === void 0 ? 1 : _ref$colSpan,
|
|
|
rowSpan = _ref.rowSpan,
|
|
|
align = _ref.align;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
direction = _React$useContext.direction;
|
|
|
|
|
|
var _React$useContext2 = react.useContext(Footer_SummaryContext),
|
|
|
scrollColumnIndex = _React$useContext2.scrollColumnIndex,
|
|
|
stickyOffsets = _React$useContext2.stickyOffsets,
|
|
|
flattenColumns = _React$useContext2.flattenColumns;
|
|
|
|
|
|
var lastIndex = index + colSpan - 1;
|
|
|
var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan;
|
|
|
var fixedInfo = getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction);
|
|
|
return /*#__PURE__*/react.createElement(es_Cell, (0,esm_extends/* default */.Z)({
|
|
|
className: className,
|
|
|
index: index,
|
|
|
component: "td",
|
|
|
prefixCls: prefixCls,
|
|
|
record: null,
|
|
|
dataIndex: null,
|
|
|
align: align,
|
|
|
colSpan: mergedColSpan,
|
|
|
rowSpan: rowSpan,
|
|
|
render: function render() {
|
|
|
return children;
|
|
|
}
|
|
|
}, fixedInfo));
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/Row.js
|
|
|
|
|
|
var Row_excluded = ["children"];
|
|
|
|
|
|
function FooterRow(_ref) {
|
|
|
var children = _ref.children,
|
|
|
props = (0,objectWithoutProperties/* default */.Z)(_ref, Row_excluded);
|
|
|
|
|
|
return /*#__PURE__*/react.createElement("tr", props, children);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/Summary.js
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Syntactic sugar. Do not support HOC.
|
|
|
*/
|
|
|
|
|
|
function Summary(_ref) {
|
|
|
var children = _ref.children;
|
|
|
return children;
|
|
|
}
|
|
|
|
|
|
Summary.Row = FooterRow;
|
|
|
Summary.Cell = SummaryCell;
|
|
|
/* harmony default export */ var Footer_Summary = (Summary);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Footer(_ref) {
|
|
|
var children = _ref.children,
|
|
|
stickyOffsets = _ref.stickyOffsets,
|
|
|
flattenColumns = _ref.flattenColumns;
|
|
|
var tableContext = react.useContext(context_TableContext);
|
|
|
var prefixCls = tableContext.prefixCls;
|
|
|
var lastColumnIndex = flattenColumns.length - 1;
|
|
|
var scrollColumn = flattenColumns[lastColumnIndex];
|
|
|
var summaryContext = react.useMemo(function () {
|
|
|
return {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
flattenColumns: flattenColumns,
|
|
|
scrollColumnIndex: (scrollColumn === null || scrollColumn === void 0 ? void 0 : scrollColumn.scrollbar) ? lastColumnIndex : null
|
|
|
};
|
|
|
}, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets]);
|
|
|
return /*#__PURE__*/react.createElement(Footer_SummaryContext.Provider, {
|
|
|
value: summaryContext
|
|
|
}, /*#__PURE__*/react.createElement("tfoot", {
|
|
|
className: "".concat(prefixCls, "-summary")
|
|
|
}, children));
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var es_Footer = (Footer);
|
|
|
var FooterComponents = Footer_Summary;
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/expandUtil.js
|
|
|
|
|
|
|
|
|
|
|
|
function renderExpandIcon(_ref) {
|
|
|
var _classNames;
|
|
|
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
record = _ref.record,
|
|
|
onExpand = _ref.onExpand,
|
|
|
expanded = _ref.expanded,
|
|
|
expandable = _ref.expandable;
|
|
|
var expandClassName = "".concat(prefixCls, "-row-expand-icon");
|
|
|
|
|
|
if (!expandable) {
|
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
|
className: classnames_default()(expandClassName, "".concat(prefixCls, "-row-spaced"))
|
|
|
});
|
|
|
}
|
|
|
|
|
|
var onClick = function onClick(event) {
|
|
|
onExpand(record, event);
|
|
|
event.stopPropagation();
|
|
|
};
|
|
|
|
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
|
className: classnames_default()(expandClassName, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-row-expanded"), expanded), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-row-collapsed"), !expanded), _classNames)),
|
|
|
onClick: onClick
|
|
|
});
|
|
|
}
|
|
|
function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
|
|
|
var keys = [];
|
|
|
|
|
|
function dig(list) {
|
|
|
(list || []).forEach(function (item, index) {
|
|
|
keys.push(getRowKey(item, index));
|
|
|
dig(item[childrenColumnName]);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
dig(data);
|
|
|
return keys;
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/addEventListener.js
|
|
|
var addEventListener = __webpack_require__(64019);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/css.js
|
|
|
var css = __webpack_require__(27678);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/stickyScrollBar.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var StickyScrollBar = function StickyScrollBar(_ref, ref) {
|
|
|
var _scrollBodyRef$curren, _scrollBodyRef$curren2;
|
|
|
|
|
|
var scrollBodyRef = _ref.scrollBodyRef,
|
|
|
onScroll = _ref.onScroll,
|
|
|
offsetScroll = _ref.offsetScroll,
|
|
|
container = _ref.container;
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext.prefixCls;
|
|
|
|
|
|
var bodyScrollWidth = ((_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 ? void 0 : _scrollBodyRef$curren.scrollWidth) || 0;
|
|
|
var bodyWidth = ((_scrollBodyRef$curren2 = scrollBodyRef.current) === null || _scrollBodyRef$curren2 === void 0 ? void 0 : _scrollBodyRef$curren2.clientWidth) || 0;
|
|
|
var scrollBarWidth = bodyScrollWidth && bodyWidth * (bodyWidth / bodyScrollWidth);
|
|
|
var scrollBarRef = react.useRef();
|
|
|
|
|
|
var _useLayoutState = useLayoutState({
|
|
|
scrollLeft: 0,
|
|
|
isHiddenScrollBar: false
|
|
|
}),
|
|
|
_useLayoutState2 = (0,slicedToArray/* default */.Z)(_useLayoutState, 2),
|
|
|
scrollState = _useLayoutState2[0],
|
|
|
setScrollState = _useLayoutState2[1];
|
|
|
|
|
|
var refState = react.useRef({
|
|
|
delta: 0,
|
|
|
x: 0
|
|
|
});
|
|
|
|
|
|
var _React$useState = react.useState(false),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
isActive = _React$useState2[0],
|
|
|
setActive = _React$useState2[1];
|
|
|
|
|
|
var onMouseUp = function onMouseUp() {
|
|
|
setActive(false);
|
|
|
};
|
|
|
|
|
|
var onMouseDown = function onMouseDown(event) {
|
|
|
event.persist();
|
|
|
refState.current.delta = event.pageX - scrollState.scrollLeft;
|
|
|
refState.current.x = 0;
|
|
|
setActive(true);
|
|
|
event.preventDefault();
|
|
|
};
|
|
|
|
|
|
var onMouseMove = function onMouseMove(event) {
|
|
|
var _window;
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
|
|
|
var _ref2 = event || ((_window = window) === null || _window === void 0 ? void 0 : _window.event),
|
|
|
buttons = _ref2.buttons;
|
|
|
|
|
|
if (!isActive || buttons === 0) {
|
|
|
// If out body mouse up, we can set isActive false when mouse move
|
|
|
if (isActive) {
|
|
|
setActive(false);
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta;
|
|
|
|
|
|
if (left <= 0) {
|
|
|
left = 0;
|
|
|
}
|
|
|
|
|
|
if (left + scrollBarWidth >= bodyWidth) {
|
|
|
left = bodyWidth - scrollBarWidth;
|
|
|
}
|
|
|
|
|
|
onScroll({
|
|
|
scrollLeft: left / bodyWidth * (bodyScrollWidth + 2)
|
|
|
});
|
|
|
refState.current.x = event.pageX;
|
|
|
};
|
|
|
|
|
|
var onContainerScroll = function onContainerScroll() {
|
|
|
if (!scrollBodyRef.current) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var tableOffsetTop = (0,css/* getOffset */.os)(scrollBodyRef.current).top;
|
|
|
var tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight;
|
|
|
var currentClientOffset = container === window ? document.documentElement.scrollTop + window.innerHeight : (0,css/* getOffset */.os)(container).top + container.clientHeight;
|
|
|
|
|
|
if (tableBottomOffset - (0,getScrollBarSize/* default */.Z)() <= currentClientOffset || tableOffsetTop >= currentClientOffset - offsetScroll) {
|
|
|
setScrollState(function (state) {
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
|
isHiddenScrollBar: true
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
setScrollState(function (state) {
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
|
isHiddenScrollBar: false
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var setScrollLeft = function setScrollLeft(left) {
|
|
|
setScrollState(function (state) {
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
|
scrollLeft: left / bodyScrollWidth * bodyWidth || 0
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
react.useImperativeHandle(ref, function () {
|
|
|
return {
|
|
|
setScrollLeft: setScrollLeft
|
|
|
};
|
|
|
});
|
|
|
react.useEffect(function () {
|
|
|
var onMouseUpListener = (0,addEventListener/* default */.Z)(document.body, 'mouseup', onMouseUp, false);
|
|
|
var onMouseMoveListener = (0,addEventListener/* default */.Z)(document.body, 'mousemove', onMouseMove, false);
|
|
|
onContainerScroll();
|
|
|
return function () {
|
|
|
onMouseUpListener.remove();
|
|
|
onMouseMoveListener.remove();
|
|
|
};
|
|
|
}, [scrollBarWidth, isActive]);
|
|
|
react.useEffect(function () {
|
|
|
var onScrollListener = (0,addEventListener/* default */.Z)(container, 'scroll', onContainerScroll, false);
|
|
|
var onResizeListener = (0,addEventListener/* default */.Z)(window, 'resize', onContainerScroll, false);
|
|
|
return function () {
|
|
|
onScrollListener.remove();
|
|
|
onResizeListener.remove();
|
|
|
};
|
|
|
}, [container]);
|
|
|
react.useEffect(function () {
|
|
|
if (!scrollState.isHiddenScrollBar) {
|
|
|
setScrollState(function (state) {
|
|
|
var bodyNode = scrollBodyRef.current;
|
|
|
|
|
|
if (!bodyNode) {
|
|
|
return state;
|
|
|
}
|
|
|
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
|
scrollLeft: bodyNode.scrollLeft / bodyNode.scrollWidth * bodyNode.clientWidth
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}, [scrollState.isHiddenScrollBar]);
|
|
|
|
|
|
if (bodyScrollWidth <= bodyWidth || !scrollBarWidth || scrollState.isHiddenScrollBar) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
style: {
|
|
|
height: (0,getScrollBarSize/* default */.Z)(),
|
|
|
width: bodyWidth,
|
|
|
bottom: offsetScroll
|
|
|
},
|
|
|
className: "".concat(prefixCls, "-sticky-scroll")
|
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
|
onMouseDown: onMouseDown,
|
|
|
ref: scrollBarRef,
|
|
|
className: classnames_default()("".concat(prefixCls, "-sticky-scroll-bar"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-sticky-scroll-bar-active"), isActive)),
|
|
|
style: {
|
|
|
width: "".concat(scrollBarWidth, "px"),
|
|
|
transform: "translate3d(".concat(scrollState.scrollLeft, "px, 0, 0)")
|
|
|
}
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var stickyScrollBar = (/*#__PURE__*/react.forwardRef(StickyScrollBar));
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js
|
|
|
var canUseDom = __webpack_require__(98924);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useSticky.js
|
|
|
|
|
|
|
|
|
// fix ssr render
|
|
|
|
|
|
var defaultContainer = (0,canUseDom/* default */.Z)() ? window : null;
|
|
|
/** Sticky header hooks */
|
|
|
|
|
|
function useSticky(sticky, prefixCls) {
|
|
|
var _ref = (0,esm_typeof/* default */.Z)(sticky) === 'object' ? sticky : {},
|
|
|
_ref$offsetHeader = _ref.offsetHeader,
|
|
|
offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader,
|
|
|
_ref$offsetSummary = _ref.offsetSummary,
|
|
|
offsetSummary = _ref$offsetSummary === void 0 ? 0 : _ref$offsetSummary,
|
|
|
_ref$offsetScroll = _ref.offsetScroll,
|
|
|
offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll,
|
|
|
_ref$getContainer = _ref.getContainer,
|
|
|
getContainer = _ref$getContainer === void 0 ? function () {
|
|
|
return defaultContainer;
|
|
|
} : _ref$getContainer;
|
|
|
|
|
|
var container = getContainer() || defaultContainer;
|
|
|
return react.useMemo(function () {
|
|
|
var isSticky = !!sticky;
|
|
|
return {
|
|
|
isSticky: isSticky,
|
|
|
stickyClassName: isSticky ? "".concat(prefixCls, "-sticky-holder") : '',
|
|
|
offsetHeader: offsetHeader,
|
|
|
offsetSummary: offsetSummary,
|
|
|
offsetScroll: offsetScroll,
|
|
|
container: container
|
|
|
};
|
|
|
}, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/FixedHolder/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FixedHolder_excluded = ["className", "noData", "columns", "flattenColumns", "colWidths", "columCount", "stickyOffsets", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName", "onScroll", "maxContentScroll", "children"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useColumnWidth(colWidths, columCount) {
|
|
|
return (0,react.useMemo)(function () {
|
|
|
var cloneColumns = [];
|
|
|
|
|
|
for (var i = 0; i < columCount; i += 1) {
|
|
|
var val = colWidths[i];
|
|
|
|
|
|
if (val !== undefined) {
|
|
|
cloneColumns[i] = val;
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return cloneColumns;
|
|
|
}, [colWidths.join('_'), columCount]);
|
|
|
}
|
|
|
|
|
|
var FixedHolder = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
var className = _ref.className,
|
|
|
noData = _ref.noData,
|
|
|
columns = _ref.columns,
|
|
|
flattenColumns = _ref.flattenColumns,
|
|
|
colWidths = _ref.colWidths,
|
|
|
columCount = _ref.columCount,
|
|
|
stickyOffsets = _ref.stickyOffsets,
|
|
|
direction = _ref.direction,
|
|
|
fixHeader = _ref.fixHeader,
|
|
|
stickyTopOffset = _ref.stickyTopOffset,
|
|
|
stickyBottomOffset = _ref.stickyBottomOffset,
|
|
|
stickyClassName = _ref.stickyClassName,
|
|
|
onScroll = _ref.onScroll,
|
|
|
maxContentScroll = _ref.maxContentScroll,
|
|
|
children = _ref.children,
|
|
|
props = (0,objectWithoutProperties/* default */.Z)(_ref, FixedHolder_excluded);
|
|
|
|
|
|
var _React$useContext = react.useContext(context_TableContext),
|
|
|
prefixCls = _React$useContext.prefixCls,
|
|
|
scrollbarSize = _React$useContext.scrollbarSize,
|
|
|
isSticky = _React$useContext.isSticky;
|
|
|
|
|
|
var combinationScrollBarSize = isSticky && !fixHeader ? 0 : scrollbarSize; // Pass wheel to scroll event
|
|
|
|
|
|
var scrollRef = react.useRef(null);
|
|
|
var setScrollRef = react.useCallback(function (element) {
|
|
|
(0,es_ref/* fillRef */.mH)(ref, element);
|
|
|
(0,es_ref/* fillRef */.mH)(scrollRef, element);
|
|
|
}, []);
|
|
|
react.useEffect(function () {
|
|
|
var _scrollRef$current;
|
|
|
|
|
|
function onWheel(e) {
|
|
|
var currentTarget = e.currentTarget,
|
|
|
deltaX = e.deltaX;
|
|
|
|
|
|
if (deltaX) {
|
|
|
onScroll({
|
|
|
currentTarget: currentTarget,
|
|
|
scrollLeft: currentTarget.scrollLeft + deltaX
|
|
|
});
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
(_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.addEventListener('wheel', onWheel);
|
|
|
return function () {
|
|
|
var _scrollRef$current2;
|
|
|
|
|
|
(_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.removeEventListener('wheel', onWheel);
|
|
|
};
|
|
|
}, []); // Check if all flattenColumns has width
|
|
|
|
|
|
var allFlattenColumnsWithWidth = react.useMemo(function () {
|
|
|
return flattenColumns.every(function (column) {
|
|
|
return column.width >= 0;
|
|
|
});
|
|
|
}, [flattenColumns]); // Add scrollbar column
|
|
|
|
|
|
var lastColumn = flattenColumns[flattenColumns.length - 1];
|
|
|
var ScrollBarColumn = {
|
|
|
fixed: lastColumn ? lastColumn.fixed : null,
|
|
|
scrollbar: true,
|
|
|
onHeaderCell: function onHeaderCell() {
|
|
|
return {
|
|
|
className: "".concat(prefixCls, "-cell-scrollbar")
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
var columnsWithScrollbar = (0,react.useMemo)(function () {
|
|
|
return combinationScrollBarSize ? [].concat((0,toConsumableArray/* default */.Z)(columns), [ScrollBarColumn]) : columns;
|
|
|
}, [combinationScrollBarSize, columns]);
|
|
|
var flattenColumnsWithScrollbar = (0,react.useMemo)(function () {
|
|
|
return combinationScrollBarSize ? [].concat((0,toConsumableArray/* default */.Z)(flattenColumns), [ScrollBarColumn]) : flattenColumns;
|
|
|
}, [combinationScrollBarSize, flattenColumns]); // Calculate the sticky offsets
|
|
|
|
|
|
var headerStickyOffsets = (0,react.useMemo)(function () {
|
|
|
var right = stickyOffsets.right,
|
|
|
left = stickyOffsets.left;
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, stickyOffsets), {}, {
|
|
|
left: direction === 'rtl' ? [].concat((0,toConsumableArray/* default */.Z)(left.map(function (width) {
|
|
|
return width + combinationScrollBarSize;
|
|
|
})), [0]) : left,
|
|
|
right: direction === 'rtl' ? right : [].concat((0,toConsumableArray/* default */.Z)(right.map(function (width) {
|
|
|
return width + combinationScrollBarSize;
|
|
|
})), [0]),
|
|
|
isSticky: isSticky
|
|
|
});
|
|
|
}, [combinationScrollBarSize, stickyOffsets, isSticky]);
|
|
|
var mergedColumnWidth = useColumnWidth(colWidths, columCount);
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
style: (0,objectSpread2/* default */.Z)({
|
|
|
overflow: 'hidden'
|
|
|
}, isSticky ? {
|
|
|
top: stickyTopOffset,
|
|
|
bottom: stickyBottomOffset
|
|
|
} : {}),
|
|
|
ref: setScrollRef,
|
|
|
className: classnames_default()(className, (0,defineProperty/* default */.Z)({}, stickyClassName, !!stickyClassName))
|
|
|
}, /*#__PURE__*/react.createElement("table", {
|
|
|
style: {
|
|
|
tableLayout: 'fixed',
|
|
|
visibility: noData || mergedColumnWidth ? null : 'hidden'
|
|
|
}
|
|
|
}, (!noData || !maxContentScroll || allFlattenColumnsWithWidth) && /*#__PURE__*/react.createElement(es_ColGroup, {
|
|
|
colWidths: mergedColumnWidth ? [].concat((0,toConsumableArray/* default */.Z)(mergedColumnWidth), [combinationScrollBarSize]) : [],
|
|
|
columCount: columCount + 1,
|
|
|
columns: flattenColumnsWithScrollbar
|
|
|
}), children((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
stickyOffsets: headerStickyOffsets,
|
|
|
columns: columnsWithScrollbar,
|
|
|
flattenColumns: flattenColumnsWithScrollbar
|
|
|
}))));
|
|
|
});
|
|
|
FixedHolder.displayName = 'FixedHolder';
|
|
|
/* harmony default export */ var es_FixedHolder = (FixedHolder);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Table.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Feature:
|
|
|
* - fixed not need to set width
|
|
|
* - support `rowExpandable` to config row expand logic
|
|
|
* - add `summary` to support `() => ReactNode`
|
|
|
*
|
|
|
* Update:
|
|
|
* - `dataIndex` is `array[]` now
|
|
|
* - `expandable` wrap all the expand related props
|
|
|
*
|
|
|
* Removed:
|
|
|
* - expandIconAsCell
|
|
|
* - useFixedHeader
|
|
|
* - rowRef
|
|
|
* - columns[number].onCellClick
|
|
|
* - onRowClick
|
|
|
* - onRowDoubleClick
|
|
|
* - onRowMouseEnter
|
|
|
* - onRowMouseLeave
|
|
|
* - getBodyWrapper
|
|
|
* - bodyStyle
|
|
|
*
|
|
|
* Deprecated:
|
|
|
* - All expanded props, move into expandable
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Used for conditions cache
|
|
|
|
|
|
var EMPTY_DATA = []; // Used for customize scroll
|
|
|
|
|
|
var EMPTY_SCROLL_TARGET = {};
|
|
|
var INTERNAL_HOOKS = 'rc-table-internal-hook';
|
|
|
var MemoTableContent = /*#__PURE__*/react.memo(function (_ref) {
|
|
|
var children = _ref.children;
|
|
|
return children;
|
|
|
}, function (prev, next) {
|
|
|
if (!shallowequal_default()(prev.props, next.props)) {
|
|
|
return false;
|
|
|
} // No additional render when pinged status change.
|
|
|
// This is not a bug.
|
|
|
|
|
|
|
|
|
return prev.pingLeft !== next.pingLeft || prev.pingRight !== next.pingRight;
|
|
|
});
|
|
|
|
|
|
function Table(props) {
|
|
|
var _classNames;
|
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
rowClassName = props.rowClassName,
|
|
|
style = props.style,
|
|
|
data = props.data,
|
|
|
rowKey = props.rowKey,
|
|
|
scroll = props.scroll,
|
|
|
tableLayout = props.tableLayout,
|
|
|
direction = props.direction,
|
|
|
title = props.title,
|
|
|
footer = props.footer,
|
|
|
summary = props.summary,
|
|
|
id = props.id,
|
|
|
showHeader = props.showHeader,
|
|
|
components = props.components,
|
|
|
emptyText = props.emptyText,
|
|
|
onRow = props.onRow,
|
|
|
onHeaderRow = props.onHeaderRow,
|
|
|
internalHooks = props.internalHooks,
|
|
|
transformColumns = props.transformColumns,
|
|
|
internalRefs = props.internalRefs,
|
|
|
sticky = props.sticky;
|
|
|
var mergedData = data || EMPTY_DATA;
|
|
|
var hasData = !!mergedData.length; // ===================== Warning ======================
|
|
|
|
|
|
if (false) {} // ==================== Customize =====================
|
|
|
|
|
|
|
|
|
var getComponent = react.useCallback(function (path, defaultComponent) {
|
|
|
return getPathValue(components || {}, path) || defaultComponent;
|
|
|
}, [components]);
|
|
|
var getRowKey = react.useMemo(function () {
|
|
|
if (typeof rowKey === 'function') {
|
|
|
return rowKey;
|
|
|
}
|
|
|
|
|
|
return function (record) {
|
|
|
var key = record && record[rowKey];
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
return key;
|
|
|
};
|
|
|
}, [rowKey]); // ====================== Expand ======================
|
|
|
|
|
|
var expandableConfig = getExpandableProps(props);
|
|
|
var expandIcon = expandableConfig.expandIcon,
|
|
|
expandedRowKeys = expandableConfig.expandedRowKeys,
|
|
|
defaultExpandedRowKeys = expandableConfig.defaultExpandedRowKeys,
|
|
|
defaultExpandAllRows = expandableConfig.defaultExpandAllRows,
|
|
|
expandedRowRender = expandableConfig.expandedRowRender,
|
|
|
columnTitle = expandableConfig.columnTitle,
|
|
|
onExpand = expandableConfig.onExpand,
|
|
|
onExpandedRowsChange = expandableConfig.onExpandedRowsChange,
|
|
|
expandRowByClick = expandableConfig.expandRowByClick,
|
|
|
rowExpandable = expandableConfig.rowExpandable,
|
|
|
expandIconColumnIndex = expandableConfig.expandIconColumnIndex,
|
|
|
expandedRowClassName = expandableConfig.expandedRowClassName,
|
|
|
childrenColumnName = expandableConfig.childrenColumnName,
|
|
|
indentSize = expandableConfig.indentSize;
|
|
|
var mergedExpandIcon = expandIcon || renderExpandIcon;
|
|
|
var mergedChildrenColumnName = childrenColumnName || 'children';
|
|
|
var expandableType = react.useMemo(function () {
|
|
|
if (expandedRowRender) {
|
|
|
return 'row';
|
|
|
}
|
|
|
/* eslint-disable no-underscore-dangle */
|
|
|
|
|
|
/**
|
|
|
* Fix https://github.com/ant-design/ant-design/issues/21154
|
|
|
* This is a workaround to not to break current behavior.
|
|
|
* We can remove follow code after final release.
|
|
|
*
|
|
|
* To other developer:
|
|
|
* Do not use `__PARENT_RENDER_ICON__` in prod since we will remove this when refactor
|
|
|
*/
|
|
|
|
|
|
|
|
|
if (props.expandable && internalHooks === INTERNAL_HOOKS && props.expandable.__PARENT_RENDER_ICON__ || mergedData.some(function (record) {
|
|
|
return record && (0,esm_typeof/* default */.Z)(record) === 'object' && record[mergedChildrenColumnName];
|
|
|
})) {
|
|
|
return 'nest';
|
|
|
}
|
|
|
/* eslint-enable */
|
|
|
|
|
|
|
|
|
return false;
|
|
|
}, [!!expandedRowRender, mergedData]);
|
|
|
|
|
|
var _React$useState = react.useState(function () {
|
|
|
if (defaultExpandedRowKeys) {
|
|
|
return defaultExpandedRowKeys;
|
|
|
}
|
|
|
|
|
|
if (defaultExpandAllRows) {
|
|
|
return findAllChildrenKeys(mergedData, getRowKey, mergedChildrenColumnName);
|
|
|
}
|
|
|
|
|
|
return [];
|
|
|
}),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
innerExpandedKeys = _React$useState2[0],
|
|
|
setInnerExpandedKeys = _React$useState2[1];
|
|
|
|
|
|
var mergedExpandedKeys = react.useMemo(function () {
|
|
|
return new Set(expandedRowKeys || innerExpandedKeys || []);
|
|
|
}, [expandedRowKeys, innerExpandedKeys]);
|
|
|
var onTriggerExpand = react.useCallback(function (record) {
|
|
|
var key = getRowKey(record, mergedData.indexOf(record));
|
|
|
var newExpandedKeys;
|
|
|
var hasKey = mergedExpandedKeys.has(key);
|
|
|
|
|
|
if (hasKey) {
|
|
|
mergedExpandedKeys.delete(key);
|
|
|
newExpandedKeys = (0,toConsumableArray/* default */.Z)(mergedExpandedKeys);
|
|
|
} else {
|
|
|
newExpandedKeys = [].concat((0,toConsumableArray/* default */.Z)(mergedExpandedKeys), [key]);
|
|
|
}
|
|
|
|
|
|
setInnerExpandedKeys(newExpandedKeys);
|
|
|
|
|
|
if (onExpand) {
|
|
|
onExpand(!hasKey, record);
|
|
|
}
|
|
|
|
|
|
if (onExpandedRowsChange) {
|
|
|
onExpandedRowsChange(newExpandedKeys);
|
|
|
}
|
|
|
}, [getRowKey, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange]); // Warning if use `expandedRowRender` and nest children in the same time
|
|
|
|
|
|
if (false) {} // ====================== Column ======================
|
|
|
|
|
|
|
|
|
var _React$useState3 = react.useState(0),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
componentWidth = _React$useState4[0],
|
|
|
setComponentWidth = _React$useState4[1];
|
|
|
|
|
|
var _useColumns = hooks_useColumns((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), expandableConfig), {}, {
|
|
|
expandable: !!expandedRowRender,
|
|
|
columnTitle: columnTitle,
|
|
|
expandedKeys: mergedExpandedKeys,
|
|
|
getRowKey: getRowKey,
|
|
|
// https://github.com/ant-design/ant-design/issues/23894
|
|
|
onTriggerExpand: onTriggerExpand,
|
|
|
expandIcon: mergedExpandIcon,
|
|
|
expandIconColumnIndex: expandIconColumnIndex,
|
|
|
direction: direction
|
|
|
}), internalHooks === INTERNAL_HOOKS ? transformColumns : null),
|
|
|
_useColumns2 = (0,slicedToArray/* default */.Z)(_useColumns, 2),
|
|
|
columns = _useColumns2[0],
|
|
|
flattenColumns = _useColumns2[1];
|
|
|
|
|
|
var columnContext = react.useMemo(function () {
|
|
|
return {
|
|
|
columns: columns,
|
|
|
flattenColumns: flattenColumns
|
|
|
};
|
|
|
}, [columns, flattenColumns]); // ====================== Scroll ======================
|
|
|
|
|
|
var fullTableRef = react.useRef();
|
|
|
var scrollHeaderRef = react.useRef();
|
|
|
var scrollBodyRef = react.useRef();
|
|
|
var scrollBodyContainerRef = react.useRef();
|
|
|
var scrollSummaryRef = react.useRef();
|
|
|
|
|
|
var _React$useState5 = react.useState(false),
|
|
|
_React$useState6 = (0,slicedToArray/* default */.Z)(_React$useState5, 2),
|
|
|
pingedLeft = _React$useState6[0],
|
|
|
setPingedLeft = _React$useState6[1];
|
|
|
|
|
|
var _React$useState7 = react.useState(false),
|
|
|
_React$useState8 = (0,slicedToArray/* default */.Z)(_React$useState7, 2),
|
|
|
pingedRight = _React$useState8[0],
|
|
|
setPingedRight = _React$useState8[1];
|
|
|
|
|
|
var _useLayoutState = useLayoutState(new Map()),
|
|
|
_useLayoutState2 = (0,slicedToArray/* default */.Z)(_useLayoutState, 2),
|
|
|
colsWidths = _useLayoutState2[0],
|
|
|
updateColsWidths = _useLayoutState2[1]; // Convert map to number width
|
|
|
|
|
|
|
|
|
var colsKeys = getColumnsKey(flattenColumns);
|
|
|
var pureColWidths = colsKeys.map(function (columnKey) {
|
|
|
return colsWidths.get(columnKey);
|
|
|
});
|
|
|
var colWidths = react.useMemo(function () {
|
|
|
return pureColWidths;
|
|
|
}, [pureColWidths.join('_')]);
|
|
|
var stickyOffsets = hooks_useStickyOffsets(colWidths, flattenColumns.length, direction);
|
|
|
var fixHeader = scroll && validateValue(scroll.y);
|
|
|
var horizonScroll = scroll && validateValue(scroll.x) || Boolean(expandableConfig.fixed);
|
|
|
var fixColumn = horizonScroll && flattenColumns.some(function (_ref2) {
|
|
|
var fixed = _ref2.fixed;
|
|
|
return fixed;
|
|
|
}); // Sticky
|
|
|
|
|
|
var stickyRef = react.useRef();
|
|
|
|
|
|
var _useSticky = useSticky(sticky, prefixCls),
|
|
|
isSticky = _useSticky.isSticky,
|
|
|
offsetHeader = _useSticky.offsetHeader,
|
|
|
offsetSummary = _useSticky.offsetSummary,
|
|
|
offsetScroll = _useSticky.offsetScroll,
|
|
|
stickyClassName = _useSticky.stickyClassName,
|
|
|
container = _useSticky.container; // Footer (Fix footer must fixed header)
|
|
|
|
|
|
|
|
|
var summaryNode = summary === null || summary === void 0 ? void 0 : summary(mergedData);
|
|
|
var fixFooter = (fixHeader || isSticky) && /*#__PURE__*/react.isValidElement(summaryNode) && summaryNode.type === Footer_Summary && summaryNode.props.fixed; // Scroll
|
|
|
|
|
|
var scrollXStyle;
|
|
|
var scrollYStyle;
|
|
|
var scrollTableStyle;
|
|
|
|
|
|
if (fixHeader) {
|
|
|
scrollYStyle = {
|
|
|
overflowY: 'scroll',
|
|
|
maxHeight: scroll.y
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (horizonScroll) {
|
|
|
scrollXStyle = {
|
|
|
overflowX: 'auto'
|
|
|
}; // When no vertical scrollbar, should hide it
|
|
|
// https://github.com/ant-design/ant-design/pull/20705
|
|
|
// https://github.com/ant-design/ant-design/issues/21879
|
|
|
|
|
|
if (!fixHeader) {
|
|
|
scrollYStyle = {
|
|
|
overflowY: 'hidden'
|
|
|
};
|
|
|
}
|
|
|
|
|
|
scrollTableStyle = {
|
|
|
width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) === true ? 'auto' : scroll === null || scroll === void 0 ? void 0 : scroll.x,
|
|
|
minWidth: '100%'
|
|
|
};
|
|
|
}
|
|
|
|
|
|
var onColumnResize = react.useCallback(function (columnKey, width) {
|
|
|
if ((0,isVisible/* default */.Z)(fullTableRef.current)) {
|
|
|
updateColsWidths(function (widths) {
|
|
|
if (widths.get(columnKey) !== width) {
|
|
|
var newWidths = new Map(widths);
|
|
|
newWidths.set(columnKey, width);
|
|
|
return newWidths;
|
|
|
}
|
|
|
|
|
|
return widths;
|
|
|
});
|
|
|
}
|
|
|
}, []);
|
|
|
|
|
|
var _useTimeoutLock = useTimeoutLock(null),
|
|
|
_useTimeoutLock2 = (0,slicedToArray/* default */.Z)(_useTimeoutLock, 2),
|
|
|
setScrollTarget = _useTimeoutLock2[0],
|
|
|
getScrollTarget = _useTimeoutLock2[1];
|
|
|
|
|
|
function forceScroll(scrollLeft, target) {
|
|
|
if (!target) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (typeof target === 'function') {
|
|
|
target(scrollLeft);
|
|
|
} else if (target.scrollLeft !== scrollLeft) {
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
target.scrollLeft = scrollLeft;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var onScroll = function onScroll(_ref3) {
|
|
|
var currentTarget = _ref3.currentTarget,
|
|
|
scrollLeft = _ref3.scrollLeft;
|
|
|
var isRTL = direction === 'rtl';
|
|
|
var mergedScrollLeft = typeof scrollLeft === 'number' ? scrollLeft : currentTarget.scrollLeft;
|
|
|
var compareTarget = currentTarget || EMPTY_SCROLL_TARGET;
|
|
|
|
|
|
if (!getScrollTarget() || getScrollTarget() === compareTarget) {
|
|
|
var _stickyRef$current;
|
|
|
|
|
|
setScrollTarget(compareTarget);
|
|
|
forceScroll(mergedScrollLeft, scrollHeaderRef.current);
|
|
|
forceScroll(mergedScrollLeft, scrollBodyRef.current);
|
|
|
forceScroll(mergedScrollLeft, scrollSummaryRef.current);
|
|
|
forceScroll(mergedScrollLeft, (_stickyRef$current = stickyRef.current) === null || _stickyRef$current === void 0 ? void 0 : _stickyRef$current.setScrollLeft);
|
|
|
}
|
|
|
|
|
|
if (currentTarget) {
|
|
|
var scrollWidth = currentTarget.scrollWidth,
|
|
|
clientWidth = currentTarget.clientWidth; // There is no space to scroll
|
|
|
|
|
|
if (scrollWidth === clientWidth) {
|
|
|
setPingedLeft(false);
|
|
|
setPingedRight(false);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (isRTL) {
|
|
|
setPingedLeft(-mergedScrollLeft < scrollWidth - clientWidth);
|
|
|
setPingedRight(-mergedScrollLeft > 0);
|
|
|
} else {
|
|
|
setPingedLeft(mergedScrollLeft > 0);
|
|
|
setPingedRight(mergedScrollLeft < scrollWidth - clientWidth);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var triggerOnScroll = function triggerOnScroll() {
|
|
|
if (horizonScroll && scrollBodyRef.current) {
|
|
|
onScroll({
|
|
|
currentTarget: scrollBodyRef.current
|
|
|
});
|
|
|
} else {
|
|
|
setPingedLeft(false);
|
|
|
setPingedRight(false);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var onFullTableResize = function onFullTableResize(_ref4) {
|
|
|
var width = _ref4.width;
|
|
|
|
|
|
if (width !== componentWidth) {
|
|
|
triggerOnScroll();
|
|
|
setComponentWidth(fullTableRef.current ? fullTableRef.current.offsetWidth : width);
|
|
|
}
|
|
|
}; // Sync scroll bar when init or `horizonScroll`, `data` and `columns.length` changed
|
|
|
|
|
|
|
|
|
var mounted = react.useRef(false);
|
|
|
react.useEffect(function () {
|
|
|
// onFullTableResize will be trigger once when ResizeObserver is mounted
|
|
|
// This will reduce one duplicated triggerOnScroll time
|
|
|
if (mounted.current) {
|
|
|
triggerOnScroll();
|
|
|
}
|
|
|
}, [horizonScroll, data, columns.length]);
|
|
|
react.useEffect(function () {
|
|
|
mounted.current = true;
|
|
|
}, []); // ===================== Effects ======================
|
|
|
|
|
|
var _React$useState9 = react.useState(0),
|
|
|
_React$useState10 = (0,slicedToArray/* default */.Z)(_React$useState9, 2),
|
|
|
scrollbarSize = _React$useState10[0],
|
|
|
setScrollbarSize = _React$useState10[1];
|
|
|
|
|
|
var _React$useState11 = react.useState(true),
|
|
|
_React$useState12 = (0,slicedToArray/* default */.Z)(_React$useState11, 2),
|
|
|
supportSticky = _React$useState12[0],
|
|
|
setSupportSticky = _React$useState12[1]; // Only IE not support, we mark as support first
|
|
|
|
|
|
|
|
|
react.useEffect(function () {
|
|
|
if (scrollBodyRef.current instanceof Element) {
|
|
|
setScrollbarSize((0,getScrollBarSize/* getTargetScrollBarSize */.o)(scrollBodyRef.current).width);
|
|
|
} else {
|
|
|
setScrollbarSize((0,getScrollBarSize/* getTargetScrollBarSize */.o)(scrollBodyContainerRef.current).width);
|
|
|
}
|
|
|
|
|
|
setSupportSticky((0,styleChecker/* isStyleSupport */.G)('position', 'sticky'));
|
|
|
}, []); // ================== INTERNAL HOOKS ==================
|
|
|
|
|
|
react.useEffect(function () {
|
|
|
if (internalHooks === INTERNAL_HOOKS && internalRefs) {
|
|
|
internalRefs.body.current = scrollBodyRef.current;
|
|
|
}
|
|
|
}); // ====================== Render ======================
|
|
|
|
|
|
var TableComponent = getComponent(['table'], 'table'); // Table layout
|
|
|
|
|
|
var mergedTableLayout = react.useMemo(function () {
|
|
|
if (tableLayout) {
|
|
|
return tableLayout;
|
|
|
} // https://github.com/ant-design/ant-design/issues/25227
|
|
|
// When scroll.x is max-content, no need to fix table layout
|
|
|
// it's width should stretch out to fit content
|
|
|
|
|
|
|
|
|
if (fixColumn) {
|
|
|
return (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' ? 'auto' : 'fixed';
|
|
|
}
|
|
|
|
|
|
if (fixHeader || isSticky || flattenColumns.some(function (_ref5) {
|
|
|
var ellipsis = _ref5.ellipsis;
|
|
|
return ellipsis;
|
|
|
})) {
|
|
|
return 'fixed';
|
|
|
}
|
|
|
|
|
|
return 'auto';
|
|
|
}, [fixHeader, fixColumn, flattenColumns, tableLayout, isSticky]);
|
|
|
var groupTableNode; // Header props
|
|
|
|
|
|
var headerProps = {
|
|
|
colWidths: colWidths,
|
|
|
columCount: flattenColumns.length,
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
onHeaderRow: onHeaderRow,
|
|
|
fixHeader: fixHeader,
|
|
|
scroll: scroll
|
|
|
}; // Empty
|
|
|
|
|
|
var emptyNode = react.useMemo(function () {
|
|
|
if (hasData) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
if (typeof emptyText === 'function') {
|
|
|
return emptyText();
|
|
|
}
|
|
|
|
|
|
return emptyText;
|
|
|
}, [hasData, emptyText]); // Body
|
|
|
|
|
|
var bodyTable = /*#__PURE__*/react.createElement(es_Body, {
|
|
|
data: mergedData,
|
|
|
measureColumnWidth: fixHeader || horizonScroll || isSticky,
|
|
|
expandedKeys: mergedExpandedKeys,
|
|
|
rowExpandable: rowExpandable,
|
|
|
getRowKey: getRowKey,
|
|
|
onRow: onRow,
|
|
|
emptyNode: emptyNode,
|
|
|
childrenColumnName: mergedChildrenColumnName
|
|
|
});
|
|
|
var bodyColGroup = /*#__PURE__*/react.createElement(es_ColGroup, {
|
|
|
colWidths: flattenColumns.map(function (_ref6) {
|
|
|
var width = _ref6.width;
|
|
|
return width;
|
|
|
}),
|
|
|
columns: flattenColumns
|
|
|
});
|
|
|
var customizeScrollBody = getComponent(['body']);
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
if (fixHeader || isSticky) {
|
|
|
// >>>>>> Fixed Header
|
|
|
var bodyContent;
|
|
|
|
|
|
if (typeof customizeScrollBody === 'function') {
|
|
|
bodyContent = customizeScrollBody(mergedData, {
|
|
|
scrollbarSize: scrollbarSize,
|
|
|
ref: scrollBodyRef,
|
|
|
onScroll: onScroll
|
|
|
});
|
|
|
headerProps.colWidths = flattenColumns.map(function (_ref7, index) {
|
|
|
var width = _ref7.width;
|
|
|
var colWidth = index === columns.length - 1 ? width - scrollbarSize : width;
|
|
|
|
|
|
if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {
|
|
|
return colWidth;
|
|
|
}
|
|
|
|
|
|
(0,es_warning/* default */.ZP)(false, 'When use `components.body` with render props. Each column should have a fixed `width` value.');
|
|
|
return 0;
|
|
|
});
|
|
|
} else {
|
|
|
bodyContent = /*#__PURE__*/react.createElement("div", {
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollXStyle), scrollYStyle),
|
|
|
onScroll: onScroll,
|
|
|
ref: scrollBodyRef,
|
|
|
className: classnames_default()("".concat(prefixCls, "-body"))
|
|
|
}, /*#__PURE__*/react.createElement(TableComponent, {
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollTableStyle), {}, {
|
|
|
tableLayout: mergedTableLayout
|
|
|
})
|
|
|
}, bodyColGroup, bodyTable, !fixFooter && summaryNode && /*#__PURE__*/react.createElement(es_Footer, {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
flattenColumns: flattenColumns
|
|
|
}, summaryNode)));
|
|
|
} // Fixed holder share the props
|
|
|
|
|
|
|
|
|
var fixedHolderProps = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
|
noData: !mergedData.length,
|
|
|
maxContentScroll: horizonScroll && scroll.x === 'max-content'
|
|
|
}, headerProps), columnContext), {}, {
|
|
|
direction: direction,
|
|
|
stickyClassName: stickyClassName,
|
|
|
onScroll: onScroll
|
|
|
});
|
|
|
|
|
|
groupTableNode = /*#__PURE__*/react.createElement(react.Fragment, null, showHeader !== false && /*#__PURE__*/react.createElement(es_FixedHolder, (0,esm_extends/* default */.Z)({}, fixedHolderProps, {
|
|
|
stickyTopOffset: offsetHeader,
|
|
|
className: "".concat(prefixCls, "-header"),
|
|
|
ref: scrollHeaderRef
|
|
|
}), function (fixedHolderPassProps) {
|
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Header_Header, fixedHolderPassProps), fixFooter === 'top' && /*#__PURE__*/react.createElement(es_Footer, fixedHolderPassProps, summaryNode));
|
|
|
}), bodyContent, fixFooter && fixFooter !== 'top' && /*#__PURE__*/react.createElement(es_FixedHolder, (0,esm_extends/* default */.Z)({}, fixedHolderProps, {
|
|
|
stickyBottomOffset: offsetSummary,
|
|
|
className: "".concat(prefixCls, "-summary"),
|
|
|
ref: scrollSummaryRef
|
|
|
}), function (fixedHolderPassProps) {
|
|
|
return /*#__PURE__*/react.createElement(es_Footer, fixedHolderPassProps, summaryNode);
|
|
|
}), isSticky && /*#__PURE__*/react.createElement(stickyScrollBar, {
|
|
|
ref: stickyRef,
|
|
|
offsetScroll: offsetScroll,
|
|
|
scrollBodyRef: scrollBodyRef,
|
|
|
onScroll: onScroll,
|
|
|
container: container
|
|
|
}));
|
|
|
} else {
|
|
|
// >>>>>> Unique table
|
|
|
groupTableNode = /*#__PURE__*/react.createElement("div", {
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollXStyle), scrollYStyle),
|
|
|
className: classnames_default()("".concat(prefixCls, "-content")),
|
|
|
onScroll: onScroll,
|
|
|
ref: scrollBodyRef
|
|
|
}, /*#__PURE__*/react.createElement(TableComponent, {
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollTableStyle), {}, {
|
|
|
tableLayout: mergedTableLayout
|
|
|
})
|
|
|
}, bodyColGroup, showHeader !== false && /*#__PURE__*/react.createElement(Header_Header, (0,esm_extends/* default */.Z)({}, headerProps, columnContext)), bodyTable, summaryNode && /*#__PURE__*/react.createElement(es_Footer, {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
flattenColumns: flattenColumns
|
|
|
}, summaryNode)));
|
|
|
}
|
|
|
|
|
|
var ariaProps = (0,pickAttrs/* default */.Z)(props, {
|
|
|
aria: true,
|
|
|
data: true
|
|
|
});
|
|
|
var fullTable = /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
|
className: classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-ping-left"), pingedLeft), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-ping-right"), pingedRight), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-fixed-header"), fixHeader), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-fixed-column"), fixColumn), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right'), _classNames)),
|
|
|
style: style,
|
|
|
id: id,
|
|
|
ref: fullTableRef
|
|
|
}, ariaProps), /*#__PURE__*/react.createElement(MemoTableContent, {
|
|
|
pingLeft: pingedLeft,
|
|
|
pingRight: pingedRight,
|
|
|
props: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
mergedExpandedKeys: mergedExpandedKeys
|
|
|
})
|
|
|
}, title && /*#__PURE__*/react.createElement(es_Panel, {
|
|
|
className: "".concat(prefixCls, "-title")
|
|
|
}, title(mergedData)), /*#__PURE__*/react.createElement("div", {
|
|
|
ref: scrollBodyContainerRef,
|
|
|
className: "".concat(prefixCls, "-container")
|
|
|
}, groupTableNode), footer && /*#__PURE__*/react.createElement(es_Panel, {
|
|
|
className: "".concat(prefixCls, "-footer")
|
|
|
}, footer(mergedData))));
|
|
|
|
|
|
if (horizonScroll) {
|
|
|
fullTable = /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
|
onResize: onFullTableResize
|
|
|
}, fullTable);
|
|
|
}
|
|
|
|
|
|
var TableContextValue = react.useMemo(function () {
|
|
|
return {
|
|
|
prefixCls: prefixCls,
|
|
|
getComponent: getComponent,
|
|
|
scrollbarSize: scrollbarSize,
|
|
|
direction: direction,
|
|
|
fixedInfoList: flattenColumns.map(function (_, colIndex) {
|
|
|
return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction);
|
|
|
}),
|
|
|
isSticky: isSticky
|
|
|
};
|
|
|
}, [prefixCls, getComponent, scrollbarSize, direction, flattenColumns, stickyOffsets, isSticky]);
|
|
|
var BodyContextValue = react.useMemo(function () {
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, columnContext), {}, {
|
|
|
tableLayout: mergedTableLayout,
|
|
|
rowClassName: rowClassName,
|
|
|
expandedRowClassName: expandedRowClassName,
|
|
|
expandIcon: mergedExpandIcon,
|
|
|
expandableType: expandableType,
|
|
|
expandRowByClick: expandRowByClick,
|
|
|
expandedRowRender: expandedRowRender,
|
|
|
onTriggerExpand: onTriggerExpand,
|
|
|
expandIconColumnIndex: expandIconColumnIndex,
|
|
|
indentSize: indentSize,
|
|
|
allColumnsFixedLeft: columnContext.flattenColumns.every(function (col) {
|
|
|
return col.fixed === 'left';
|
|
|
})
|
|
|
});
|
|
|
}, [columnContext, mergedTableLayout, rowClassName, expandedRowClassName, mergedExpandIcon, expandableType, expandRowByClick, expandedRowRender, onTriggerExpand, expandIconColumnIndex, indentSize]);
|
|
|
var ExpandedRowContextValue = react.useMemo(function () {
|
|
|
return {
|
|
|
componentWidth: componentWidth,
|
|
|
fixHeader: fixHeader,
|
|
|
fixColumn: fixColumn,
|
|
|
horizonScroll: horizonScroll
|
|
|
};
|
|
|
}, [componentWidth, fixHeader, fixColumn, horizonScroll]);
|
|
|
var ResizeContextValue = react.useMemo(function () {
|
|
|
return {
|
|
|
onColumnResize: onColumnResize
|
|
|
};
|
|
|
}, [onColumnResize]);
|
|
|
return /*#__PURE__*/react.createElement(context_StickyContext.Provider, {
|
|
|
value: supportSticky
|
|
|
}, /*#__PURE__*/react.createElement(context_TableContext.Provider, {
|
|
|
value: TableContextValue
|
|
|
}, /*#__PURE__*/react.createElement(context_BodyContext.Provider, {
|
|
|
value: BodyContextValue
|
|
|
}, /*#__PURE__*/react.createElement(context_ExpandedRowContext.Provider, {
|
|
|
value: ExpandedRowContextValue
|
|
|
}, /*#__PURE__*/react.createElement(context_ResizeContext.Provider, {
|
|
|
value: ResizeContextValue
|
|
|
}, fullTable)))));
|
|
|
}
|
|
|
|
|
|
Table.EXPAND_COLUMN = EXPAND_COLUMN;
|
|
|
Table.Column = sugar_Column;
|
|
|
Table.ColumnGroup = sugar_ColumnGroup;
|
|
|
Table.Summary = FooterComponents;
|
|
|
Table.defaultProps = {
|
|
|
rowKey: 'key',
|
|
|
prefixCls: 'rc-table',
|
|
|
emptyText: function emptyText() {
|
|
|
return 'No Data';
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var es_Table = (Table);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_table_es = (es_Table);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(98423);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/defaultRenderEmpty.js
|
|
|
var defaultRenderEmpty = __webpack_require__(88258);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/SizeContext.js
|
|
|
var SizeContext = __webpack_require__(97647);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/grid/hooks/useBreakpoint.js
|
|
|
var useBreakpoint = __webpack_require__(25378);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/locale/en_US.js
|
|
|
var en_US = __webpack_require__(40378);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
|
|
|
var es_pagination = __webpack_require__(260);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js
|
|
|
var spin = __webpack_require__(11382);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/scrollTo.js + 1 modules
|
|
|
var scrollTo = __webpack_require__(58375);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/Column.js
|
|
|
/* istanbul ignore next */
|
|
|
/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
function Column_Column(_) {
|
|
|
return null;
|
|
|
}
|
|
|
/* harmony default export */ var table_Column = (Column_Column);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/ColumnGroup.js
|
|
|
/* istanbul ignore next */
|
|
|
/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
function ColumnGroup_ColumnGroup(_) {
|
|
|
return null;
|
|
|
}
|
|
|
/* harmony default export */ var table_ColumnGroup = (ColumnGroup_ColumnGroup);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/ExpandIcon.js
|
|
|
|
|
|
|
|
|
|
|
|
function ExpandIcon_renderExpandIcon(locale) {
|
|
|
return function expandIcon(_ref) {
|
|
|
var _classNames;
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
onExpand = _ref.onExpand,
|
|
|
record = _ref.record,
|
|
|
expanded = _ref.expanded,
|
|
|
expandable = _ref.expandable;
|
|
|
var iconPrefix = "".concat(prefixCls, "-row-expand-icon");
|
|
|
return /*#__PURE__*/react.createElement("button", {
|
|
|
type: "button",
|
|
|
onClick: function onClick(e) {
|
|
|
onExpand(record, e);
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
className: classnames_default()(iconPrefix, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(iconPrefix, "-spaced"), !expandable), (0,defineProperty/* default */.Z)(_classNames, "".concat(iconPrefix, "-expanded"), expandable && expanded), (0,defineProperty/* default */.Z)(_classNames, "".concat(iconPrefix, "-collapsed"), expandable && !expanded), _classNames)),
|
|
|
"aria-label": expanded ? locale.collapse : locale.expand,
|
|
|
"aria-expanded": expanded
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
/* harmony default export */ var ExpandIcon = (ExpandIcon_renderExpandIcon);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/util.js
|
|
|
function getColumnKey(column, defaultKey) {
|
|
|
if ('key' in column && column.key !== undefined && column.key !== null) {
|
|
|
return column.key;
|
|
|
}
|
|
|
if (column.dataIndex) {
|
|
|
return Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : column.dataIndex;
|
|
|
}
|
|
|
return defaultKey;
|
|
|
}
|
|
|
function getColumnPos(index, pos) {
|
|
|
return pos ? "".concat(pos, "-").concat(index) : "".concat(index);
|
|
|
}
|
|
|
function renderColumnTitle(title, props) {
|
|
|
if (typeof title === 'function') {
|
|
|
return title(props);
|
|
|
}
|
|
|
return title;
|
|
|
}
|
|
|
/**
|
|
|
* Safe get column title
|
|
|
*
|
|
|
* Should filter [object Object]
|
|
|
*
|
|
|
* @param title
|
|
|
* @returns
|
|
|
*/
|
|
|
function safeColumnTitle(title, props) {
|
|
|
var res = renderColumnTitle(title, props);
|
|
|
if (Object.prototype.toString.call(res) === '[object Object]') return '';
|
|
|
return res;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/FilterFilled.js
|
|
|
// This icon file is generated automatically.
|
|
|
var FilterFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z" } }] }, "name": "filter", "theme": "filled" };
|
|
|
/* harmony default export */ var asn_FilterFilled = (FilterFilled);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(93771);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/FilterFilled.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var FilterFilled_FilterFilled = function FilterFilled(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_FilterFilled
|
|
|
}));
|
|
|
};
|
|
|
FilterFilled_FilterFilled.displayName = 'FilterFilled';
|
|
|
/* harmony default export */ var icons_FilterFilled = (/*#__PURE__*/react.forwardRef(FilterFilled_FilterFilled));
|
|
|
// EXTERNAL MODULE: ./node_modules/lodash/isEqual.js
|
|
|
var isEqual = __webpack_require__(18446);
|
|
|
var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 2 modules
|
|
|
var es_checkbox = __webpack_require__(32808);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/index.js
|
|
|
var dropdown = __webpack_require__(13013);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/empty/index.js + 2 modules
|
|
|
var empty = __webpack_require__(62986);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/menu/index.js + 5 modules
|
|
|
var es_menu = __webpack_require__(66516);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/menu/OverrideContext.js
|
|
|
var OverrideContext = __webpack_require__(76529);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
|
|
|
var es_radio = __webpack_require__(29924);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tree/index.js + 9 modules
|
|
|
var tree = __webpack_require__(54205);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/hooks/useForceUpdate.js
|
|
|
var useForceUpdate = __webpack_require__(57838);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/_util/hooks/useSyncState.js
|
|
|
|
|
|
|
|
|
function useSyncState(initialValue) {
|
|
|
var ref = react.useRef(initialValue);
|
|
|
var forceUpdate = (0,useForceUpdate/* default */.Z)();
|
|
|
return [function () {
|
|
|
return ref.current;
|
|
|
}, function (newValue) {
|
|
|
ref.current = newValue;
|
|
|
// re-render
|
|
|
forceUpdate();
|
|
|
}];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/SearchOutlined.js
|
|
|
var SearchOutlined = __webpack_require__(25783);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(75008);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/FilterSearch.js
|
|
|
|
|
|
|
|
|
|
|
|
function FilterSearch(_ref) {
|
|
|
var value = _ref.value,
|
|
|
onChange = _ref.onChange,
|
|
|
filterSearch = _ref.filterSearch,
|
|
|
tablePrefixCls = _ref.tablePrefixCls,
|
|
|
locale = _ref.locale;
|
|
|
if (!filterSearch) {
|
|
|
return null;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(tablePrefixCls, "-filter-dropdown-search")
|
|
|
}, /*#__PURE__*/react.createElement(input/* default */.Z, {
|
|
|
prefix: /*#__PURE__*/react.createElement(SearchOutlined/* default */.Z, null),
|
|
|
placeholder: locale.filterSearchPlaceholder,
|
|
|
onChange: onChange,
|
|
|
value: value,
|
|
|
// for skip min-width of input
|
|
|
htmlSize: 1,
|
|
|
className: "".concat(tablePrefixCls, "-filter-dropdown-search-input")
|
|
|
}));
|
|
|
}
|
|
|
/* harmony default export */ var useFilter_FilterSearch = (FilterSearch);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js
|
|
|
var KeyCode = __webpack_require__(15105);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/FilterWrapper.js
|
|
|
|
|
|
|
|
|
var onKeyDown = function onKeyDown(event) {
|
|
|
var keyCode = event.keyCode;
|
|
|
if (keyCode === KeyCode/* default.ENTER */.Z.ENTER) {
|
|
|
event.stopPropagation();
|
|
|
}
|
|
|
};
|
|
|
var FilterDropdownMenuWrapper = function FilterDropdownMenuWrapper(props) {
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: props.className,
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
},
|
|
|
onKeyDown: onKeyDown
|
|
|
}, props.children);
|
|
|
};
|
|
|
/* harmony default export */ var FilterWrapper = (FilterDropdownMenuWrapper);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hasSubMenu(filters) {
|
|
|
return filters.some(function (_ref) {
|
|
|
var children = _ref.children;
|
|
|
return children;
|
|
|
});
|
|
|
}
|
|
|
function searchValueMatched(searchValue, text) {
|
|
|
if (typeof text === 'string' || typeof text === 'number') {
|
|
|
return text === null || text === void 0 ? void 0 : text.toString().toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
function renderFilterItems(_ref2) {
|
|
|
var filters = _ref2.filters,
|
|
|
prefixCls = _ref2.prefixCls,
|
|
|
filteredKeys = _ref2.filteredKeys,
|
|
|
filterMultiple = _ref2.filterMultiple,
|
|
|
searchValue = _ref2.searchValue,
|
|
|
filterSearch = _ref2.filterSearch;
|
|
|
return filters.map(function (filter, index) {
|
|
|
var key = String(filter.value);
|
|
|
if (filter.children) {
|
|
|
return {
|
|
|
key: key || index,
|
|
|
label: filter.text,
|
|
|
popupClassName: "".concat(prefixCls, "-dropdown-submenu"),
|
|
|
children: renderFilterItems({
|
|
|
filters: filter.children,
|
|
|
prefixCls: prefixCls,
|
|
|
filteredKeys: filteredKeys,
|
|
|
filterMultiple: filterMultiple,
|
|
|
searchValue: searchValue,
|
|
|
filterSearch: filterSearch
|
|
|
})
|
|
|
};
|
|
|
}
|
|
|
var Component = filterMultiple ? es_checkbox/* default */.Z : es_radio/* default */.ZP;
|
|
|
var item = {
|
|
|
key: filter.value !== undefined ? key : index,
|
|
|
label: /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Component, {
|
|
|
checked: filteredKeys.includes(key)
|
|
|
}), /*#__PURE__*/react.createElement("span", null, filter.text))
|
|
|
};
|
|
|
if (searchValue.trim()) {
|
|
|
if (typeof filterSearch === 'function') {
|
|
|
return filterSearch(searchValue, filter) ? item : null;
|
|
|
}
|
|
|
return searchValueMatched(searchValue, filter.text) ? item : null;
|
|
|
}
|
|
|
return item;
|
|
|
});
|
|
|
}
|
|
|
function FilterDropdown(props) {
|
|
|
var _a;
|
|
|
var tablePrefixCls = props.tablePrefixCls,
|
|
|
prefixCls = props.prefixCls,
|
|
|
column = props.column,
|
|
|
dropdownPrefixCls = props.dropdownPrefixCls,
|
|
|
columnKey = props.columnKey,
|
|
|
filterMultiple = props.filterMultiple,
|
|
|
_props$filterMode = props.filterMode,
|
|
|
filterMode = _props$filterMode === void 0 ? 'menu' : _props$filterMode,
|
|
|
_props$filterSearch = props.filterSearch,
|
|
|
filterSearch = _props$filterSearch === void 0 ? false : _props$filterSearch,
|
|
|
filterState = props.filterState,
|
|
|
triggerFilter = props.triggerFilter,
|
|
|
locale = props.locale,
|
|
|
children = props.children,
|
|
|
getPopupContainer = props.getPopupContainer;
|
|
|
var filterDropdownOpen = column.filterDropdownOpen,
|
|
|
onFilterDropdownOpenChange = column.onFilterDropdownOpenChange,
|
|
|
filterDropdownVisible = column.filterDropdownVisible,
|
|
|
onFilterDropdownVisibleChange = column.onFilterDropdownVisibleChange,
|
|
|
filterResetToDefaultFilteredValue = column.filterResetToDefaultFilteredValue,
|
|
|
defaultFilteredValue = column.defaultFilteredValue;
|
|
|
var _React$useState = react.useState(false),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
visible = _React$useState2[0],
|
|
|
setVisible = _React$useState2[1];
|
|
|
var filtered = !!(filterState && (((_a = filterState.filteredKeys) === null || _a === void 0 ? void 0 : _a.length) || filterState.forceFiltered));
|
|
|
var triggerVisible = function triggerVisible(newVisible) {
|
|
|
setVisible(newVisible);
|
|
|
onFilterDropdownOpenChange === null || onFilterDropdownOpenChange === void 0 ? void 0 : onFilterDropdownOpenChange(newVisible);
|
|
|
onFilterDropdownVisibleChange === null || onFilterDropdownVisibleChange === void 0 ? void 0 : onFilterDropdownVisibleChange(newVisible);
|
|
|
};
|
|
|
var mergedVisible;
|
|
|
if (typeof filterDropdownOpen === 'boolean') {
|
|
|
mergedVisible = filterDropdownOpen;
|
|
|
} else {
|
|
|
mergedVisible = typeof filterDropdownVisible === 'boolean' ? filterDropdownVisible : visible;
|
|
|
}
|
|
|
// ===================== Select Keys =====================
|
|
|
var propFilteredKeys = filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys;
|
|
|
var _useSyncState = useSyncState(propFilteredKeys || []),
|
|
|
_useSyncState2 = (0,slicedToArray/* default */.Z)(_useSyncState, 2),
|
|
|
getFilteredKeysSync = _useSyncState2[0],
|
|
|
setFilteredKeysSync = _useSyncState2[1];
|
|
|
var onSelectKeys = function onSelectKeys(_ref3) {
|
|
|
var selectedKeys = _ref3.selectedKeys;
|
|
|
setFilteredKeysSync(selectedKeys);
|
|
|
};
|
|
|
var onCheck = function onCheck(keys, _ref4) {
|
|
|
var node = _ref4.node,
|
|
|
checked = _ref4.checked;
|
|
|
if (!filterMultiple) {
|
|
|
onSelectKeys({
|
|
|
selectedKeys: checked && node.key ? [node.key] : []
|
|
|
});
|
|
|
} else {
|
|
|
onSelectKeys({
|
|
|
selectedKeys: keys
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
react.useEffect(function () {
|
|
|
if (!visible) {
|
|
|
return;
|
|
|
}
|
|
|
onSelectKeys({
|
|
|
selectedKeys: propFilteredKeys || []
|
|
|
});
|
|
|
}, [propFilteredKeys]);
|
|
|
// ====================== Open Keys ======================
|
|
|
var _React$useState3 = react.useState([]),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
openKeys = _React$useState4[0],
|
|
|
setOpenKeys = _React$useState4[1];
|
|
|
var onOpenChange = function onOpenChange(keys) {
|
|
|
setOpenKeys(keys);
|
|
|
};
|
|
|
// search in tree mode column filter
|
|
|
var _React$useState5 = react.useState(''),
|
|
|
_React$useState6 = (0,slicedToArray/* default */.Z)(_React$useState5, 2),
|
|
|
searchValue = _React$useState6[0],
|
|
|
setSearchValue = _React$useState6[1];
|
|
|
var onSearch = function onSearch(e) {
|
|
|
var value = e.target.value;
|
|
|
setSearchValue(value);
|
|
|
};
|
|
|
// clear search value after close filter dropdown
|
|
|
react.useEffect(function () {
|
|
|
if (!visible) {
|
|
|
setSearchValue('');
|
|
|
}
|
|
|
}, [visible]);
|
|
|
// ======================= Submit ========================
|
|
|
var internalTriggerFilter = function internalTriggerFilter(keys) {
|
|
|
var mergedKeys = keys && keys.length ? keys : null;
|
|
|
if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) {
|
|
|
return null;
|
|
|
}
|
|
|
if (isEqual_default()(mergedKeys, filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys)) {
|
|
|
return null;
|
|
|
}
|
|
|
triggerFilter({
|
|
|
column: column,
|
|
|
key: columnKey,
|
|
|
filteredKeys: mergedKeys
|
|
|
});
|
|
|
};
|
|
|
var onConfirm = function onConfirm() {
|
|
|
triggerVisible(false);
|
|
|
internalTriggerFilter(getFilteredKeysSync());
|
|
|
};
|
|
|
var onReset = function onReset() {
|
|
|
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
|
confirm: false,
|
|
|
closeDropdown: false
|
|
|
},
|
|
|
confirm = _ref5.confirm,
|
|
|
closeDropdown = _ref5.closeDropdown;
|
|
|
if (confirm) {
|
|
|
internalTriggerFilter([]);
|
|
|
}
|
|
|
if (closeDropdown) {
|
|
|
triggerVisible(false);
|
|
|
}
|
|
|
setSearchValue('');
|
|
|
if (filterResetToDefaultFilteredValue) {
|
|
|
setFilteredKeysSync((defaultFilteredValue || []).map(function (key) {
|
|
|
return String(key);
|
|
|
}));
|
|
|
} else {
|
|
|
setFilteredKeysSync([]);
|
|
|
}
|
|
|
};
|
|
|
var doFilter = function doFilter() {
|
|
|
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
|
closeDropdown: true
|
|
|
},
|
|
|
closeDropdown = _ref6.closeDropdown;
|
|
|
if (closeDropdown) {
|
|
|
triggerVisible(false);
|
|
|
}
|
|
|
internalTriggerFilter(getFilteredKeysSync());
|
|
|
};
|
|
|
var onVisibleChange = function onVisibleChange(newVisible) {
|
|
|
if (newVisible && propFilteredKeys !== undefined) {
|
|
|
// Sync filteredKeys on appear in controlled mode (propFilteredKeys !== undefiend)
|
|
|
setFilteredKeysSync(propFilteredKeys || []);
|
|
|
}
|
|
|
triggerVisible(newVisible);
|
|
|
// Default will filter when closed
|
|
|
if (!newVisible && !column.filterDropdown) {
|
|
|
onConfirm();
|
|
|
}
|
|
|
};
|
|
|
// ======================== Style ========================
|
|
|
var dropdownMenuClass = classnames_default()((0,defineProperty/* default */.Z)({}, "".concat(dropdownPrefixCls, "-menu-without-submenu"), !hasSubMenu(column.filters || [])));
|
|
|
var onCheckAll = function onCheckAll(e) {
|
|
|
if (e.target.checked) {
|
|
|
var allFilterKeys = flattenKeys(column === null || column === void 0 ? void 0 : column.filters).map(function (key) {
|
|
|
return String(key);
|
|
|
});
|
|
|
setFilteredKeysSync(allFilterKeys);
|
|
|
} else {
|
|
|
setFilteredKeysSync([]);
|
|
|
}
|
|
|
};
|
|
|
var getTreeData = function getTreeData(_ref7) {
|
|
|
var filters = _ref7.filters;
|
|
|
return (filters || []).map(function (filter, index) {
|
|
|
var key = String(filter.value);
|
|
|
var item = {
|
|
|
title: filter.text,
|
|
|
key: filter.value !== undefined ? key : index
|
|
|
};
|
|
|
if (filter.children) {
|
|
|
item.children = getTreeData({
|
|
|
filters: filter.children
|
|
|
});
|
|
|
}
|
|
|
return item;
|
|
|
});
|
|
|
};
|
|
|
var getFilterData = function getFilterData(node) {
|
|
|
var _a;
|
|
|
return (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, node), {
|
|
|
text: node.title,
|
|
|
value: node.key,
|
|
|
children: ((_a = node.children) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
|
return getFilterData(item);
|
|
|
})) || []
|
|
|
});
|
|
|
};
|
|
|
var dropdownContent;
|
|
|
if (typeof column.filterDropdown === 'function') {
|
|
|
dropdownContent = column.filterDropdown({
|
|
|
prefixCls: "".concat(dropdownPrefixCls, "-custom"),
|
|
|
setSelectedKeys: function setSelectedKeys(selectedKeys) {
|
|
|
return onSelectKeys({
|
|
|
selectedKeys: selectedKeys
|
|
|
});
|
|
|
},
|
|
|
selectedKeys: getFilteredKeysSync(),
|
|
|
confirm: doFilter,
|
|
|
clearFilters: onReset,
|
|
|
filters: column.filters,
|
|
|
visible: mergedVisible,
|
|
|
close: function close() {
|
|
|
triggerVisible(false);
|
|
|
}
|
|
|
});
|
|
|
} else if (column.filterDropdown) {
|
|
|
dropdownContent = column.filterDropdown;
|
|
|
} else {
|
|
|
var selectedKeys = getFilteredKeysSync() || [];
|
|
|
var getFilterComponent = function getFilterComponent() {
|
|
|
if ((column.filters || []).length === 0) {
|
|
|
return /*#__PURE__*/react.createElement(empty/* default */.Z, {
|
|
|
image: empty/* default.PRESENTED_IMAGE_SIMPLE */.Z.PRESENTED_IMAGE_SIMPLE,
|
|
|
description: locale.filterEmptyText,
|
|
|
imageStyle: {
|
|
|
height: 24
|
|
|
},
|
|
|
style: {
|
|
|
margin: 0,
|
|
|
padding: '16px 0'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
if (filterMode === 'tree') {
|
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(useFilter_FilterSearch, {
|
|
|
filterSearch: filterSearch,
|
|
|
value: searchValue,
|
|
|
onChange: onSearch,
|
|
|
tablePrefixCls: tablePrefixCls,
|
|
|
locale: locale
|
|
|
}), /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(tablePrefixCls, "-filter-dropdown-tree")
|
|
|
}, filterMultiple ? /*#__PURE__*/react.createElement(es_checkbox/* default */.Z, {
|
|
|
checked: selectedKeys.length === flattenKeys(column.filters).length,
|
|
|
indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column.filters).length,
|
|
|
className: "".concat(tablePrefixCls, "-filter-dropdown-checkall"),
|
|
|
onChange: onCheckAll
|
|
|
}, locale.filterCheckall) : null, /*#__PURE__*/react.createElement(tree/* default */.Z, {
|
|
|
checkable: true,
|
|
|
selectable: false,
|
|
|
blockNode: true,
|
|
|
multiple: filterMultiple,
|
|
|
checkStrictly: !filterMultiple,
|
|
|
className: "".concat(dropdownPrefixCls, "-menu"),
|
|
|
onCheck: onCheck,
|
|
|
checkedKeys: selectedKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
showIcon: false,
|
|
|
treeData: getTreeData({
|
|
|
filters: column.filters
|
|
|
}),
|
|
|
autoExpandParent: true,
|
|
|
defaultExpandAll: true,
|
|
|
filterTreeNode: searchValue.trim() ? function (node) {
|
|
|
if (typeof filterSearch === 'function') {
|
|
|
return filterSearch(searchValue, getFilterData(node));
|
|
|
}
|
|
|
return searchValueMatched(searchValue, node.title);
|
|
|
} : undefined
|
|
|
})));
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(useFilter_FilterSearch, {
|
|
|
filterSearch: filterSearch,
|
|
|
value: searchValue,
|
|
|
onChange: onSearch,
|
|
|
tablePrefixCls: tablePrefixCls,
|
|
|
locale: locale
|
|
|
}), /*#__PURE__*/react.createElement(es_menu/* default */.Z, {
|
|
|
selectable: true,
|
|
|
multiple: filterMultiple,
|
|
|
prefixCls: "".concat(dropdownPrefixCls, "-menu"),
|
|
|
className: dropdownMenuClass,
|
|
|
onSelect: onSelectKeys,
|
|
|
onDeselect: onSelectKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
getPopupContainer: getPopupContainer,
|
|
|
openKeys: openKeys,
|
|
|
onOpenChange: onOpenChange,
|
|
|
items: renderFilterItems({
|
|
|
filters: column.filters || [],
|
|
|
filterSearch: filterSearch,
|
|
|
prefixCls: prefixCls,
|
|
|
filteredKeys: getFilteredKeysSync(),
|
|
|
filterMultiple: filterMultiple,
|
|
|
searchValue: searchValue
|
|
|
})
|
|
|
}));
|
|
|
};
|
|
|
var getResetDisabled = function getResetDisabled() {
|
|
|
if (filterResetToDefaultFilteredValue) {
|
|
|
return isEqual_default()((defaultFilteredValue || []).map(function (key) {
|
|
|
return String(key);
|
|
|
}), selectedKeys);
|
|
|
}
|
|
|
return selectedKeys.length === 0;
|
|
|
};
|
|
|
dropdownContent = /*#__PURE__*/react.createElement(react.Fragment, null, getFilterComponent(), /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(prefixCls, "-dropdown-btns")
|
|
|
}, /*#__PURE__*/react.createElement(es_button/* default */.Z, {
|
|
|
type: "link",
|
|
|
size: "small",
|
|
|
disabled: getResetDisabled(),
|
|
|
onClick: function onClick() {
|
|
|
return onReset();
|
|
|
}
|
|
|
}, locale.filterReset), /*#__PURE__*/react.createElement(es_button/* default */.Z, {
|
|
|
type: "primary",
|
|
|
size: "small",
|
|
|
onClick: onConfirm
|
|
|
}, locale.filterConfirm)));
|
|
|
}
|
|
|
// We should not block customize Menu with additional props
|
|
|
if (column.filterDropdown) {
|
|
|
dropdownContent = /*#__PURE__*/react.createElement(OverrideContext/* OverrideProvider */.J, {
|
|
|
selectable: undefined
|
|
|
}, dropdownContent);
|
|
|
}
|
|
|
var menu = function menu() {
|
|
|
return /*#__PURE__*/react.createElement(FilterWrapper, {
|
|
|
className: "".concat(prefixCls, "-dropdown")
|
|
|
}, dropdownContent);
|
|
|
};
|
|
|
var filterIcon;
|
|
|
if (typeof column.filterIcon === 'function') {
|
|
|
filterIcon = column.filterIcon(filtered);
|
|
|
} else if (column.filterIcon) {
|
|
|
filterIcon = column.filterIcon;
|
|
|
} else {
|
|
|
filterIcon = /*#__PURE__*/react.createElement(icons_FilterFilled, null);
|
|
|
}
|
|
|
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
|
|
|
direction = _React$useContext.direction;
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(prefixCls, "-column")
|
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
|
className: "".concat(tablePrefixCls, "-column-title")
|
|
|
}, children), /*#__PURE__*/react.createElement(dropdown/* default */.Z, {
|
|
|
dropdownRender: menu,
|
|
|
trigger: ['click'],
|
|
|
open: mergedVisible,
|
|
|
onOpenChange: onVisibleChange,
|
|
|
getPopupContainer: getPopupContainer,
|
|
|
placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight'
|
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
|
role: "button",
|
|
|
tabIndex: -1,
|
|
|
className: classnames_default()("".concat(prefixCls, "-trigger"), {
|
|
|
active: filtered
|
|
|
}),
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
}, filterIcon)));
|
|
|
}
|
|
|
/* harmony default export */ var useFilter_FilterDropdown = (FilterDropdown);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function collectFilterStates(columns, init, pos) {
|
|
|
var filterStates = [];
|
|
|
(columns || []).forEach(function (column, index) {
|
|
|
var _a;
|
|
|
var columnPos = getColumnPos(index, pos);
|
|
|
if (column.filters || 'filterDropdown' in column || 'onFilter' in column) {
|
|
|
if ('filteredValue' in column) {
|
|
|
// Controlled
|
|
|
var filteredValues = column.filteredValue;
|
|
|
if (!('filterDropdown' in column)) {
|
|
|
filteredValues = (_a = filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.map(String)) !== null && _a !== void 0 ? _a : filteredValues;
|
|
|
}
|
|
|
filterStates.push({
|
|
|
column: column,
|
|
|
key: getColumnKey(column, columnPos),
|
|
|
filteredKeys: filteredValues,
|
|
|
forceFiltered: column.filtered
|
|
|
});
|
|
|
} else {
|
|
|
// Uncontrolled
|
|
|
filterStates.push({
|
|
|
column: column,
|
|
|
key: getColumnKey(column, columnPos),
|
|
|
filteredKeys: init && column.defaultFilteredValue ? column.defaultFilteredValue : undefined,
|
|
|
forceFiltered: column.filtered
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
if ('children' in column) {
|
|
|
filterStates = [].concat((0,toConsumableArray/* default */.Z)(filterStates), (0,toConsumableArray/* default */.Z)(collectFilterStates(column.children, init, columnPos)));
|
|
|
}
|
|
|
});
|
|
|
return filterStates;
|
|
|
}
|
|
|
function injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, triggerFilter, getPopupContainer, locale, pos) {
|
|
|
return columns.map(function (column, index) {
|
|
|
var columnPos = getColumnPos(index, pos);
|
|
|
var _column$filterMultipl = column.filterMultiple,
|
|
|
filterMultiple = _column$filterMultipl === void 0 ? true : _column$filterMultipl,
|
|
|
filterMode = column.filterMode,
|
|
|
filterSearch = column.filterSearch;
|
|
|
var newColumn = column;
|
|
|
if (newColumn.filters || newColumn.filterDropdown) {
|
|
|
var columnKey = getColumnKey(newColumn, columnPos);
|
|
|
var filterState = filterStates.find(function (_ref) {
|
|
|
var key = _ref.key;
|
|
|
return columnKey === key;
|
|
|
});
|
|
|
newColumn = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, newColumn), {
|
|
|
title: function title(renderProps) {
|
|
|
return /*#__PURE__*/react.createElement(useFilter_FilterDropdown, {
|
|
|
tablePrefixCls: prefixCls,
|
|
|
prefixCls: "".concat(prefixCls, "-filter"),
|
|
|
dropdownPrefixCls: dropdownPrefixCls,
|
|
|
column: newColumn,
|
|
|
columnKey: columnKey,
|
|
|
filterState: filterState,
|
|
|
filterMultiple: filterMultiple,
|
|
|
filterMode: filterMode,
|
|
|
filterSearch: filterSearch,
|
|
|
triggerFilter: triggerFilter,
|
|
|
locale: locale,
|
|
|
getPopupContainer: getPopupContainer
|
|
|
}, renderColumnTitle(column.title, renderProps));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
if ('children' in newColumn) {
|
|
|
newColumn = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, newColumn), {
|
|
|
children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, triggerFilter, getPopupContainer, locale, columnPos)
|
|
|
});
|
|
|
}
|
|
|
return newColumn;
|
|
|
});
|
|
|
}
|
|
|
function flattenKeys(filters) {
|
|
|
var keys = [];
|
|
|
(filters || []).forEach(function (_ref2) {
|
|
|
var value = _ref2.value,
|
|
|
children = _ref2.children;
|
|
|
keys.push(value);
|
|
|
if (children) {
|
|
|
keys = [].concat((0,toConsumableArray/* default */.Z)(keys), (0,toConsumableArray/* default */.Z)(flattenKeys(children)));
|
|
|
}
|
|
|
});
|
|
|
return keys;
|
|
|
}
|
|
|
function generateFilterInfo(filterStates) {
|
|
|
var currentFilters = {};
|
|
|
filterStates.forEach(function (_ref3) {
|
|
|
var key = _ref3.key,
|
|
|
filteredKeys = _ref3.filteredKeys,
|
|
|
column = _ref3.column;
|
|
|
var filters = column.filters,
|
|
|
filterDropdown = column.filterDropdown;
|
|
|
if (filterDropdown) {
|
|
|
currentFilters[key] = filteredKeys || null;
|
|
|
} else if (Array.isArray(filteredKeys)) {
|
|
|
var keys = flattenKeys(filters);
|
|
|
currentFilters[key] = keys.filter(function (originKey) {
|
|
|
return filteredKeys.includes(String(originKey));
|
|
|
});
|
|
|
} else {
|
|
|
currentFilters[key] = null;
|
|
|
}
|
|
|
});
|
|
|
return currentFilters;
|
|
|
}
|
|
|
function getFilterData(data, filterStates) {
|
|
|
return filterStates.reduce(function (currentData, filterState) {
|
|
|
var _filterState$column = filterState.column,
|
|
|
onFilter = _filterState$column.onFilter,
|
|
|
filters = _filterState$column.filters,
|
|
|
filteredKeys = filterState.filteredKeys;
|
|
|
if (onFilter && filteredKeys && filteredKeys.length) {
|
|
|
return currentData.filter(function (record) {
|
|
|
return filteredKeys.some(function (key) {
|
|
|
var keys = flattenKeys(filters);
|
|
|
var keyIndex = keys.findIndex(function (k) {
|
|
|
return String(k) === String(key);
|
|
|
});
|
|
|
var realKey = keyIndex !== -1 ? keys[keyIndex] : key;
|
|
|
return onFilter(realKey, record);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
return currentData;
|
|
|
}, data);
|
|
|
}
|
|
|
function useFilter(_ref4) {
|
|
|
var prefixCls = _ref4.prefixCls,
|
|
|
dropdownPrefixCls = _ref4.dropdownPrefixCls,
|
|
|
mergedColumns = _ref4.mergedColumns,
|
|
|
onFilterChange = _ref4.onFilterChange,
|
|
|
getPopupContainer = _ref4.getPopupContainer,
|
|
|
tableLocale = _ref4.locale;
|
|
|
var _React$useState = react.useState(function () {
|
|
|
return collectFilterStates(mergedColumns, true);
|
|
|
}),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
filterStates = _React$useState2[0],
|
|
|
setFilterStates = _React$useState2[1];
|
|
|
var mergedFilterStates = react.useMemo(function () {
|
|
|
var collectedStates = collectFilterStates(mergedColumns, false);
|
|
|
var filteredKeysIsAllNotControlled = true;
|
|
|
var filteredKeysIsAllControlled = true;
|
|
|
collectedStates.forEach(function (_ref5) {
|
|
|
var filteredKeys = _ref5.filteredKeys;
|
|
|
if (filteredKeys !== undefined) {
|
|
|
filteredKeysIsAllNotControlled = false;
|
|
|
} else {
|
|
|
filteredKeysIsAllControlled = false;
|
|
|
}
|
|
|
});
|
|
|
// Return if not controlled
|
|
|
if (filteredKeysIsAllNotControlled) {
|
|
|
return filterStates;
|
|
|
}
|
|
|
false ? 0 : void 0;
|
|
|
return collectedStates;
|
|
|
}, [mergedColumns, filterStates]);
|
|
|
var filters = react.useMemo(function () {
|
|
|
return generateFilterInfo(mergedFilterStates);
|
|
|
}, [mergedFilterStates]);
|
|
|
var triggerFilter = function triggerFilter(filterState) {
|
|
|
var newFilterStates = mergedFilterStates.filter(function (_ref6) {
|
|
|
var key = _ref6.key;
|
|
|
return key !== filterState.key;
|
|
|
});
|
|
|
newFilterStates.push(filterState);
|
|
|
setFilterStates(newFilterStates);
|
|
|
onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);
|
|
|
};
|
|
|
var transformColumns = function transformColumns(innerColumns) {
|
|
|
return injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, triggerFilter, getPopupContainer, tableLocale);
|
|
|
};
|
|
|
return [transformColumns, mergedFilterStates, filters];
|
|
|
}
|
|
|
/* harmony default export */ var hooks_useFilter = (useFilter);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useLazyKVMap.js
|
|
|
|
|
|
|
|
|
function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
|
var mapCacheRef = react.useRef({});
|
|
|
function getRecordByKey(key) {
|
|
|
if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
|
|
|
var kvMap = new Map();
|
|
|
/* eslint-disable no-inner-declarations */
|
|
|
function dig(records) {
|
|
|
records.forEach(function (record, index) {
|
|
|
var rowKey = getRowKey(record, index);
|
|
|
kvMap.set(rowKey, record);
|
|
|
if (record && (0,esm_typeof/* default */.Z)(record) === 'object' && childrenColumnName in record) {
|
|
|
dig(record[childrenColumnName] || []);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
/* eslint-enable */
|
|
|
dig(data);
|
|
|
mapCacheRef.current = {
|
|
|
data: data,
|
|
|
childrenColumnName: childrenColumnName,
|
|
|
kvMap: kvMap,
|
|
|
getRowKey: getRowKey
|
|
|
};
|
|
|
}
|
|
|
return mapCacheRef.current.kvMap.get(key);
|
|
|
}
|
|
|
return [getRecordByKey];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/usePagination.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;
|
|
|
};
|
|
|
|
|
|
var DEFAULT_PAGE_SIZE = 10;
|
|
|
function getPaginationParam(pagination, mergedPagination) {
|
|
|
var param = {
|
|
|
current: mergedPagination.current,
|
|
|
pageSize: mergedPagination.pageSize
|
|
|
};
|
|
|
var paginationObj = pagination && (0,esm_typeof/* default */.Z)(pagination) === 'object' ? pagination : {};
|
|
|
Object.keys(paginationObj).forEach(function (pageProp) {
|
|
|
var value = mergedPagination[pageProp];
|
|
|
if (typeof value !== 'function') {
|
|
|
param[pageProp] = value;
|
|
|
}
|
|
|
});
|
|
|
return param;
|
|
|
}
|
|
|
function extendsObject() {
|
|
|
var result = {};
|
|
|
for (var _len = arguments.length, list = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
list[_key] = arguments[_key];
|
|
|
}
|
|
|
list.forEach(function (obj) {
|
|
|
if (obj) {
|
|
|
Object.keys(obj).forEach(function (key) {
|
|
|
var val = obj[key];
|
|
|
if (val !== undefined) {
|
|
|
result[key] = val;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
return result;
|
|
|
}
|
|
|
function usePagination(total, pagination, onChange) {
|
|
|
var _a = pagination && (0,esm_typeof/* default */.Z)(pagination) === 'object' ? pagination : {},
|
|
|
_a$total = _a.total,
|
|
|
paginationTotal = _a$total === void 0 ? 0 : _a$total,
|
|
|
paginationObj = __rest(_a, ["total"]);
|
|
|
var _useState = (0,react.useState)(function () {
|
|
|
return {
|
|
|
current: 'defaultCurrent' in paginationObj ? paginationObj.defaultCurrent : 1,
|
|
|
pageSize: 'defaultPageSize' in paginationObj ? paginationObj.defaultPageSize : DEFAULT_PAGE_SIZE
|
|
|
};
|
|
|
}),
|
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
|
innerPagination = _useState2[0],
|
|
|
setInnerPagination = _useState2[1];
|
|
|
// ============ Basic Pagination Config ============
|
|
|
var mergedPagination = extendsObject(innerPagination, paginationObj, {
|
|
|
total: paginationTotal > 0 ? paginationTotal : total
|
|
|
});
|
|
|
// Reset `current` if data length or pageSize changed
|
|
|
var maxPage = Math.ceil((paginationTotal || total) / mergedPagination.pageSize);
|
|
|
if (mergedPagination.current > maxPage) {
|
|
|
// Prevent a maximum page count of 0
|
|
|
mergedPagination.current = maxPage || 1;
|
|
|
}
|
|
|
var refreshPagination = function refreshPagination(current, pageSize) {
|
|
|
setInnerPagination({
|
|
|
current: current !== null && current !== void 0 ? current : 1,
|
|
|
pageSize: pageSize || mergedPagination.pageSize
|
|
|
});
|
|
|
};
|
|
|
var onInternalChange = function onInternalChange(current, pageSize) {
|
|
|
var _a;
|
|
|
if (pagination) {
|
|
|
(_a = pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, current, pageSize);
|
|
|
}
|
|
|
refreshPagination(current, pageSize);
|
|
|
onChange(current, pageSize || (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.pageSize));
|
|
|
};
|
|
|
if (pagination === false) {
|
|
|
return [{}, function () {}];
|
|
|
}
|
|
|
return [(0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, mergedPagination), {
|
|
|
onChange: onInternalChange
|
|
|
}), refreshPagination];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
|
|
|
var esm_toArray = __webpack_require__(84506);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/DownOutlined.js
|
|
|
var DownOutlined = __webpack_require__(13622);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/util.js
|
|
|
var util = __webpack_require__(10225);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/utils/conductUtil.js
|
|
|
var conductUtil = __webpack_require__(17341);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/utils/treeUtil.js
|
|
|
var treeUtil = __webpack_require__(1089);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
var useMergedState = __webpack_require__(21770);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useSelection.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: warning if use ajax!!!
|
|
|
var SELECTION_COLUMN = {};
|
|
|
var SELECTION_ALL = 'SELECT_ALL';
|
|
|
var SELECTION_INVERT = 'SELECT_INVERT';
|
|
|
var SELECTION_NONE = 'SELECT_NONE';
|
|
|
var EMPTY_LIST = [];
|
|
|
function flattenData(data, childrenColumnName) {
|
|
|
var list = [];
|
|
|
(data || []).forEach(function (record) {
|
|
|
list.push(record);
|
|
|
if (record && (0,esm_typeof/* default */.Z)(record) === 'object' && childrenColumnName in record) {
|
|
|
list = [].concat((0,toConsumableArray/* default */.Z)(list), (0,toConsumableArray/* default */.Z)(flattenData(record[childrenColumnName], childrenColumnName)));
|
|
|
}
|
|
|
});
|
|
|
return list;
|
|
|
}
|
|
|
function useSelection(rowSelection, config) {
|
|
|
var _ref = rowSelection || {},
|
|
|
preserveSelectedRowKeys = _ref.preserveSelectedRowKeys,
|
|
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
|
defaultSelectedRowKeys = _ref.defaultSelectedRowKeys,
|
|
|
getCheckboxProps = _ref.getCheckboxProps,
|
|
|
onSelectionChange = _ref.onChange,
|
|
|
onSelect = _ref.onSelect,
|
|
|
onSelectAll = _ref.onSelectAll,
|
|
|
onSelectInvert = _ref.onSelectInvert,
|
|
|
onSelectNone = _ref.onSelectNone,
|
|
|
onSelectMultiple = _ref.onSelectMultiple,
|
|
|
selectionColWidth = _ref.columnWidth,
|
|
|
selectionType = _ref.type,
|
|
|
selections = _ref.selections,
|
|
|
fixed = _ref.fixed,
|
|
|
customizeRenderCell = _ref.renderCell,
|
|
|
hideSelectAll = _ref.hideSelectAll,
|
|
|
_ref$checkStrictly = _ref.checkStrictly,
|
|
|
checkStrictly = _ref$checkStrictly === void 0 ? true : _ref$checkStrictly;
|
|
|
var prefixCls = config.prefixCls,
|
|
|
data = config.data,
|
|
|
pageData = config.pageData,
|
|
|
getRecordByKey = config.getRecordByKey,
|
|
|
getRowKey = config.getRowKey,
|
|
|
expandType = config.expandType,
|
|
|
childrenColumnName = config.childrenColumnName,
|
|
|
tableLocale = config.locale,
|
|
|
getPopupContainer = config.getPopupContainer;
|
|
|
// ========================= Keys =========================
|
|
|
var _useMergedState = (0,useMergedState/* default */.Z)(selectedRowKeys || defaultSelectedRowKeys || EMPTY_LIST, {
|
|
|
value: selectedRowKeys
|
|
|
}),
|
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
|
mergedSelectedKeys = _useMergedState2[0],
|
|
|
setMergedSelectedKeys = _useMergedState2[1];
|
|
|
// ======================== Caches ========================
|
|
|
var preserveRecordsRef = react.useRef(new Map());
|
|
|
var updatePreserveRecordsCache = (0,react.useCallback)(function (keys) {
|
|
|
if (preserveSelectedRowKeys) {
|
|
|
var newCache = new Map();
|
|
|
// Keep key if mark as preserveSelectedRowKeys
|
|
|
keys.forEach(function (key) {
|
|
|
var record = getRecordByKey(key);
|
|
|
if (!record && preserveRecordsRef.current.has(key)) {
|
|
|
record = preserveRecordsRef.current.get(key);
|
|
|
}
|
|
|
newCache.set(key, record);
|
|
|
});
|
|
|
// Refresh to new cache
|
|
|
preserveRecordsRef.current = newCache;
|
|
|
}
|
|
|
}, [getRecordByKey, preserveSelectedRowKeys]);
|
|
|
// Update cache with selectedKeys
|
|
|
react.useEffect(function () {
|
|
|
updatePreserveRecordsCache(mergedSelectedKeys);
|
|
|
}, [mergedSelectedKeys]);
|
|
|
var _useMemo = (0,react.useMemo)(function () {
|
|
|
return checkStrictly ? {
|
|
|
keyEntities: null
|
|
|
} : (0,treeUtil/* convertDataToEntities */.I8)(data, {
|
|
|
externalGetKey: getRowKey,
|
|
|
childrenPropName: childrenColumnName
|
|
|
});
|
|
|
}, [data, getRowKey, checkStrictly, childrenColumnName]),
|
|
|
keyEntities = _useMemo.keyEntities;
|
|
|
// Get flatten data
|
|
|
var flattedData = (0,react.useMemo)(function () {
|
|
|
return flattenData(pageData, childrenColumnName);
|
|
|
}, [pageData, childrenColumnName]);
|
|
|
// Get all checkbox props
|
|
|
var checkboxPropsMap = (0,react.useMemo)(function () {
|
|
|
var map = new Map();
|
|
|
flattedData.forEach(function (record, index) {
|
|
|
var key = getRowKey(record, index);
|
|
|
var checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};
|
|
|
map.set(key, checkboxProps);
|
|
|
false ? 0 : void 0;
|
|
|
});
|
|
|
return map;
|
|
|
}, [flattedData, getRowKey, getCheckboxProps]);
|
|
|
var isCheckboxDisabled = (0,react.useCallback)(function (r) {
|
|
|
var _a;
|
|
|
return !!((_a = checkboxPropsMap.get(getRowKey(r))) === null || _a === void 0 ? void 0 : _a.disabled);
|
|
|
}, [checkboxPropsMap, getRowKey]);
|
|
|
var _useMemo2 = (0,react.useMemo)(function () {
|
|
|
if (checkStrictly) {
|
|
|
return [mergedSelectedKeys || [], []];
|
|
|
}
|
|
|
var _conductCheck = (0,conductUtil/* conductCheck */.S)(mergedSelectedKeys, true, keyEntities, isCheckboxDisabled),
|
|
|
checkedKeys = _conductCheck.checkedKeys,
|
|
|
halfCheckedKeys = _conductCheck.halfCheckedKeys;
|
|
|
return [checkedKeys || [], halfCheckedKeys];
|
|
|
}, [mergedSelectedKeys, checkStrictly, keyEntities, isCheckboxDisabled]),
|
|
|
_useMemo3 = (0,slicedToArray/* default */.Z)(_useMemo2, 2),
|
|
|
derivedSelectedKeys = _useMemo3[0],
|
|
|
derivedHalfSelectedKeys = _useMemo3[1];
|
|
|
var derivedSelectedKeySet = (0,react.useMemo)(function () {
|
|
|
var keys = selectionType === 'radio' ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;
|
|
|
return new Set(keys);
|
|
|
}, [derivedSelectedKeys, selectionType]);
|
|
|
var derivedHalfSelectedKeySet = (0,react.useMemo)(function () {
|
|
|
return selectionType === 'radio' ? new Set() : new Set(derivedHalfSelectedKeys);
|
|
|
}, [derivedHalfSelectedKeys, selectionType]);
|
|
|
// Save last selected key to enable range selection
|
|
|
var _useState = (0,react.useState)(null),
|
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
|
lastSelectedKey = _useState2[0],
|
|
|
setLastSelectedKey = _useState2[1];
|
|
|
// Reset if rowSelection reset
|
|
|
react.useEffect(function () {
|
|
|
if (!rowSelection) {
|
|
|
setMergedSelectedKeys(EMPTY_LIST);
|
|
|
}
|
|
|
}, [!!rowSelection]);
|
|
|
var setSelectedKeys = (0,react.useCallback)(function (keys, method) {
|
|
|
var availableKeys;
|
|
|
var records;
|
|
|
updatePreserveRecordsCache(keys);
|
|
|
if (preserveSelectedRowKeys) {
|
|
|
availableKeys = keys;
|
|
|
records = keys.map(function (key) {
|
|
|
return preserveRecordsRef.current.get(key);
|
|
|
});
|
|
|
} else {
|
|
|
// Filter key which not exist in the `dataSource`
|
|
|
availableKeys = [];
|
|
|
records = [];
|
|
|
keys.forEach(function (key) {
|
|
|
var record = getRecordByKey(key);
|
|
|
if (record !== undefined) {
|
|
|
availableKeys.push(key);
|
|
|
records.push(record);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
setMergedSelectedKeys(availableKeys);
|
|
|
onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(availableKeys, records, {
|
|
|
type: method
|
|
|
});
|
|
|
}, [setMergedSelectedKeys, getRecordByKey, onSelectionChange, preserveSelectedRowKeys]);
|
|
|
// ====================== Selections ======================
|
|
|
// Trigger single `onSelect` event
|
|
|
var triggerSingleSelection = (0,react.useCallback)(function (key, selected, keys, event) {
|
|
|
if (onSelect) {
|
|
|
var rows = keys.map(function (k) {
|
|
|
return getRecordByKey(k);
|
|
|
});
|
|
|
onSelect(getRecordByKey(key), selected, rows, event);
|
|
|
}
|
|
|
setSelectedKeys(keys, 'single');
|
|
|
}, [onSelect, getRecordByKey, setSelectedKeys]);
|
|
|
var mergedSelections = (0,react.useMemo)(function () {
|
|
|
if (!selections || hideSelectAll) {
|
|
|
return null;
|
|
|
}
|
|
|
var selectionList = selections === true ? [SELECTION_ALL, SELECTION_INVERT, SELECTION_NONE] : selections;
|
|
|
return selectionList.map(function (selection) {
|
|
|
if (selection === SELECTION_ALL) {
|
|
|
return {
|
|
|
key: 'all',
|
|
|
text: tableLocale.selectionAll,
|
|
|
onSelect: function onSelect() {
|
|
|
setSelectedKeys(data.map(function (record, index) {
|
|
|
return getRowKey(record, index);
|
|
|
}).filter(function (key) {
|
|
|
var checkProps = checkboxPropsMap.get(key);
|
|
|
return !(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled) || derivedSelectedKeySet.has(key);
|
|
|
}), 'all');
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
if (selection === SELECTION_INVERT) {
|
|
|
return {
|
|
|
key: 'invert',
|
|
|
text: tableLocale.selectInvert,
|
|
|
onSelect: function onSelect() {
|
|
|
var keySet = new Set(derivedSelectedKeySet);
|
|
|
pageData.forEach(function (record, index) {
|
|
|
var key = getRowKey(record, index);
|
|
|
var checkProps = checkboxPropsMap.get(key);
|
|
|
if (!(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled)) {
|
|
|
if (keySet.has(key)) {
|
|
|
keySet["delete"](key);
|
|
|
} else {
|
|
|
keySet.add(key);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
var keys = Array.from(keySet);
|
|
|
if (onSelectInvert) {
|
|
|
false ? 0 : void 0;
|
|
|
onSelectInvert(keys);
|
|
|
}
|
|
|
setSelectedKeys(keys, 'invert');
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
if (selection === SELECTION_NONE) {
|
|
|
return {
|
|
|
key: 'none',
|
|
|
text: tableLocale.selectNone,
|
|
|
onSelect: function onSelect() {
|
|
|
onSelectNone === null || onSelectNone === void 0 ? void 0 : onSelectNone();
|
|
|
setSelectedKeys(Array.from(derivedSelectedKeySet).filter(function (key) {
|
|
|
var checkProps = checkboxPropsMap.get(key);
|
|
|
return checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled;
|
|
|
}), 'none');
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
return selection;
|
|
|
}).map(function (selection) {
|
|
|
return (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, selection), {
|
|
|
onSelect: function onSelect() {
|
|
|
var _a2;
|
|
|
var _a;
|
|
|
for (var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
rest[_key] = arguments[_key];
|
|
|
}
|
|
|
(_a = selection.onSelect) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [selection].concat(rest));
|
|
|
setLastSelectedKey(null);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}, [selections, derivedSelectedKeySet, pageData, getRowKey, onSelectInvert, setSelectedKeys]);
|
|
|
// ======================= Columns ========================
|
|
|
var transformColumns = (0,react.useCallback)(function (columns) {
|
|
|
var _a;
|
|
|
// >>>>>>>>>>> Skip if not exists `rowSelection`
|
|
|
if (!rowSelection) {
|
|
|
false ? 0 : void 0;
|
|
|
return columns.filter(function (col) {
|
|
|
return col !== SELECTION_COLUMN;
|
|
|
});
|
|
|
}
|
|
|
// >>>>>>>>>>> Support selection
|
|
|
var cloneColumns = (0,toConsumableArray/* default */.Z)(columns);
|
|
|
var keySet = new Set(derivedSelectedKeySet);
|
|
|
// Record key only need check with enabled
|
|
|
var recordKeys = flattedData.map(getRowKey).filter(function (key) {
|
|
|
return !checkboxPropsMap.get(key).disabled;
|
|
|
});
|
|
|
var checkedCurrentAll = recordKeys.every(function (key) {
|
|
|
return keySet.has(key);
|
|
|
});
|
|
|
var checkedCurrentSome = recordKeys.some(function (key) {
|
|
|
return keySet.has(key);
|
|
|
});
|
|
|
var onSelectAllChange = function onSelectAllChange() {
|
|
|
var changeKeys = [];
|
|
|
if (checkedCurrentAll) {
|
|
|
recordKeys.forEach(function (key) {
|
|
|
keySet["delete"](key);
|
|
|
changeKeys.push(key);
|
|
|
});
|
|
|
} else {
|
|
|
recordKeys.forEach(function (key) {
|
|
|
if (!keySet.has(key)) {
|
|
|
keySet.add(key);
|
|
|
changeKeys.push(key);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var keys = Array.from(keySet);
|
|
|
onSelectAll === null || onSelectAll === void 0 ? void 0 : onSelectAll(!checkedCurrentAll, keys.map(function (k) {
|
|
|
return getRecordByKey(k);
|
|
|
}), changeKeys.map(function (k) {
|
|
|
return getRecordByKey(k);
|
|
|
}));
|
|
|
setSelectedKeys(keys, 'all');
|
|
|
setLastSelectedKey(null);
|
|
|
};
|
|
|
// ===================== Render =====================
|
|
|
// Title Cell
|
|
|
var title;
|
|
|
if (selectionType !== 'radio') {
|
|
|
var customizeSelections;
|
|
|
if (mergedSelections) {
|
|
|
var menu = {
|
|
|
getPopupContainer: getPopupContainer,
|
|
|
items: mergedSelections.map(function (selection, index) {
|
|
|
var key = selection.key,
|
|
|
text = selection.text,
|
|
|
onSelectionClick = selection.onSelect;
|
|
|
return {
|
|
|
key: key || index,
|
|
|
onClick: function onClick() {
|
|
|
onSelectionClick === null || onSelectionClick === void 0 ? void 0 : onSelectionClick(recordKeys);
|
|
|
},
|
|
|
label: text
|
|
|
};
|
|
|
})
|
|
|
};
|
|
|
customizeSelections = /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(prefixCls, "-selection-extra")
|
|
|
}, /*#__PURE__*/react.createElement(dropdown/* default */.Z, {
|
|
|
menu: menu,
|
|
|
getPopupContainer: getPopupContainer
|
|
|
}, /*#__PURE__*/react.createElement("span", null, /*#__PURE__*/react.createElement(DownOutlined/* default */.Z, null))));
|
|
|
}
|
|
|
var allDisabledData = flattedData.map(function (record, index) {
|
|
|
var key = getRowKey(record, index);
|
|
|
var checkboxProps = checkboxPropsMap.get(key) || {};
|
|
|
return (0,esm_extends/* default */.Z)({
|
|
|
checked: keySet.has(key)
|
|
|
}, checkboxProps);
|
|
|
}).filter(function (_ref2) {
|
|
|
var disabled = _ref2.disabled;
|
|
|
return disabled;
|
|
|
});
|
|
|
var allDisabled = !!allDisabledData.length && allDisabledData.length === flattedData.length;
|
|
|
var allDisabledAndChecked = allDisabled && allDisabledData.every(function (_ref3) {
|
|
|
var checked = _ref3.checked;
|
|
|
return checked;
|
|
|
});
|
|
|
var allDisabledSomeChecked = allDisabled && allDisabledData.some(function (_ref4) {
|
|
|
var checked = _ref4.checked;
|
|
|
return checked;
|
|
|
});
|
|
|
title = !hideSelectAll && /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(prefixCls, "-selection")
|
|
|
}, /*#__PURE__*/react.createElement(es_checkbox/* default */.Z, {
|
|
|
checked: !allDisabled ? !!flattedData.length && checkedCurrentAll : allDisabledAndChecked,
|
|
|
indeterminate: !allDisabled ? !checkedCurrentAll && checkedCurrentSome : !allDisabledAndChecked && allDisabledSomeChecked,
|
|
|
onChange: onSelectAllChange,
|
|
|
disabled: flattedData.length === 0 || allDisabled,
|
|
|
"aria-label": customizeSelections ? 'Custom selection' : 'Select all',
|
|
|
skipGroup: true
|
|
|
}), customizeSelections);
|
|
|
}
|
|
|
// Body Cell
|
|
|
var renderCell;
|
|
|
if (selectionType === 'radio') {
|
|
|
renderCell = function renderCell(_, record, index) {
|
|
|
var key = getRowKey(record, index);
|
|
|
var checked = keySet.has(key);
|
|
|
return {
|
|
|
node: /*#__PURE__*/react.createElement(es_radio/* default */.ZP, (0,esm_extends/* default */.Z)({}, checkboxPropsMap.get(key), {
|
|
|
checked: checked,
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
},
|
|
|
onChange: function onChange(event) {
|
|
|
if (!keySet.has(key)) {
|
|
|
triggerSingleSelection(key, true, [key], event.nativeEvent);
|
|
|
}
|
|
|
}
|
|
|
})),
|
|
|
checked: checked
|
|
|
};
|
|
|
};
|
|
|
} else {
|
|
|
renderCell = function renderCell(_, record, index) {
|
|
|
var _a;
|
|
|
var key = getRowKey(record, index);
|
|
|
var checked = keySet.has(key);
|
|
|
var indeterminate = derivedHalfSelectedKeySet.has(key);
|
|
|
var checkboxProps = checkboxPropsMap.get(key);
|
|
|
var mergedIndeterminate;
|
|
|
if (expandType === 'nest') {
|
|
|
mergedIndeterminate = indeterminate;
|
|
|
false ? 0 : void 0;
|
|
|
} else {
|
|
|
mergedIndeterminate = (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.indeterminate) !== null && _a !== void 0 ? _a : indeterminate;
|
|
|
}
|
|
|
// Record checked
|
|
|
return {
|
|
|
node: /*#__PURE__*/react.createElement(es_checkbox/* default */.Z, (0,esm_extends/* default */.Z)({}, checkboxProps, {
|
|
|
indeterminate: mergedIndeterminate,
|
|
|
checked: checked,
|
|
|
skipGroup: true,
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
},
|
|
|
onChange: function onChange(_ref5) {
|
|
|
var nativeEvent = _ref5.nativeEvent;
|
|
|
var shiftKey = nativeEvent.shiftKey;
|
|
|
var startIndex = -1;
|
|
|
var endIndex = -1;
|
|
|
// Get range of this
|
|
|
if (shiftKey && checkStrictly) {
|
|
|
var pointKeys = new Set([lastSelectedKey, key]);
|
|
|
recordKeys.some(function (recordKey, recordIndex) {
|
|
|
if (pointKeys.has(recordKey)) {
|
|
|
if (startIndex === -1) {
|
|
|
startIndex = recordIndex;
|
|
|
} else {
|
|
|
endIndex = recordIndex;
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
});
|
|
|
}
|
|
|
if (endIndex !== -1 && startIndex !== endIndex && checkStrictly) {
|
|
|
// Batch update selections
|
|
|
var rangeKeys = recordKeys.slice(startIndex, endIndex + 1);
|
|
|
var changedKeys = [];
|
|
|
if (checked) {
|
|
|
rangeKeys.forEach(function (recordKey) {
|
|
|
if (keySet.has(recordKey)) {
|
|
|
changedKeys.push(recordKey);
|
|
|
keySet["delete"](recordKey);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
rangeKeys.forEach(function (recordKey) {
|
|
|
if (!keySet.has(recordKey)) {
|
|
|
changedKeys.push(recordKey);
|
|
|
keySet.add(recordKey);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var keys = Array.from(keySet);
|
|
|
onSelectMultiple === null || onSelectMultiple === void 0 ? void 0 : onSelectMultiple(!checked, keys.map(function (recordKey) {
|
|
|
return getRecordByKey(recordKey);
|
|
|
}), changedKeys.map(function (recordKey) {
|
|
|
return getRecordByKey(recordKey);
|
|
|
}));
|
|
|
setSelectedKeys(keys, 'multiple');
|
|
|
} else {
|
|
|
// Single record selected
|
|
|
var originCheckedKeys = derivedSelectedKeys;
|
|
|
if (checkStrictly) {
|
|
|
var checkedKeys = checked ? (0,util/* arrDel */._5)(originCheckedKeys, key) : (0,util/* arrAdd */.L0)(originCheckedKeys, key);
|
|
|
triggerSingleSelection(key, !checked, checkedKeys, nativeEvent);
|
|
|
} else {
|
|
|
// Always fill first
|
|
|
var result = (0,conductUtil/* conductCheck */.S)([].concat((0,toConsumableArray/* default */.Z)(originCheckedKeys), [key]), true, keyEntities, isCheckboxDisabled);
|
|
|
var _checkedKeys = result.checkedKeys,
|
|
|
halfCheckedKeys = result.halfCheckedKeys;
|
|
|
var nextCheckedKeys = _checkedKeys;
|
|
|
// If remove, we do it again to correction
|
|
|
if (checked) {
|
|
|
var tempKeySet = new Set(_checkedKeys);
|
|
|
tempKeySet["delete"](key);
|
|
|
nextCheckedKeys = (0,conductUtil/* conductCheck */.S)(Array.from(tempKeySet), {
|
|
|
checked: false,
|
|
|
halfCheckedKeys: halfCheckedKeys
|
|
|
}, keyEntities, isCheckboxDisabled).checkedKeys;
|
|
|
}
|
|
|
triggerSingleSelection(key, !checked, nextCheckedKeys, nativeEvent);
|
|
|
}
|
|
|
}
|
|
|
if (checked) {
|
|
|
setLastSelectedKey(null);
|
|
|
} else {
|
|
|
setLastSelectedKey(key);
|
|
|
}
|
|
|
}
|
|
|
})),
|
|
|
checked: checked
|
|
|
};
|
|
|
};
|
|
|
}
|
|
|
var renderSelectionCell = function renderSelectionCell(_, record, index) {
|
|
|
var _renderCell = renderCell(_, record, index),
|
|
|
node = _renderCell.node,
|
|
|
checked = _renderCell.checked;
|
|
|
if (customizeRenderCell) {
|
|
|
return customizeRenderCell(checked, record, index, node);
|
|
|
}
|
|
|
return node;
|
|
|
};
|
|
|
// Insert selection column if not exist
|
|
|
if (!cloneColumns.includes(SELECTION_COLUMN)) {
|
|
|
// Always after expand icon
|
|
|
if (cloneColumns.findIndex(function (col) {
|
|
|
var _a;
|
|
|
return ((_a = col[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN';
|
|
|
}) === 0) {
|
|
|
var _cloneColumns = cloneColumns,
|
|
|
_cloneColumns2 = (0,esm_toArray/* default */.Z)(_cloneColumns),
|
|
|
expandColumn = _cloneColumns2[0],
|
|
|
restColumns = _cloneColumns2.slice(1);
|
|
|
cloneColumns = [expandColumn, SELECTION_COLUMN].concat((0,toConsumableArray/* default */.Z)(restColumns));
|
|
|
} else {
|
|
|
// Normal insert at first column
|
|
|
cloneColumns = [SELECTION_COLUMN].concat((0,toConsumableArray/* default */.Z)(cloneColumns));
|
|
|
}
|
|
|
}
|
|
|
// Deduplicate selection column
|
|
|
var selectionColumnIndex = cloneColumns.indexOf(SELECTION_COLUMN);
|
|
|
false ? 0 : void 0;
|
|
|
cloneColumns = cloneColumns.filter(function (column, index) {
|
|
|
return column !== SELECTION_COLUMN || index === selectionColumnIndex;
|
|
|
});
|
|
|
// Fixed column logic
|
|
|
var prevCol = cloneColumns[selectionColumnIndex - 1];
|
|
|
var nextCol = cloneColumns[selectionColumnIndex + 1];
|
|
|
var mergedFixed = fixed;
|
|
|
if (mergedFixed === undefined) {
|
|
|
if ((nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed) !== undefined) {
|
|
|
mergedFixed = nextCol.fixed;
|
|
|
} else if ((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) !== undefined) {
|
|
|
mergedFixed = prevCol.fixed;
|
|
|
}
|
|
|
}
|
|
|
if (mergedFixed && prevCol && ((_a = prevCol[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN' && prevCol.fixed === undefined) {
|
|
|
prevCol.fixed = mergedFixed;
|
|
|
}
|
|
|
// Replace with real selection column
|
|
|
var selectionColumn = (0,defineProperty/* default */.Z)({
|
|
|
fixed: mergedFixed,
|
|
|
width: selectionColWidth,
|
|
|
className: "".concat(prefixCls, "-selection-column"),
|
|
|
title: rowSelection.columnTitle || title,
|
|
|
render: renderSelectionCell
|
|
|
}, INTERNAL_COL_DEFINE, {
|
|
|
className: "".concat(prefixCls, "-selection-col")
|
|
|
});
|
|
|
return cloneColumns.map(function (col) {
|
|
|
return col === SELECTION_COLUMN ? selectionColumn : col;
|
|
|
});
|
|
|
}, [getRowKey, flattedData, rowSelection, derivedSelectedKeys, derivedSelectedKeySet, derivedHalfSelectedKeySet, selectionColWidth, mergedSelections, expandType, lastSelectedKey, checkboxPropsMap, onSelectMultiple, triggerSingleSelection, isCheckboxDisabled]);
|
|
|
return [transformColumns, derivedSelectedKeySet];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons-svg/es/asn/CaretDownOutlined.js
|
|
|
var asn_CaretDownOutlined = __webpack_require__(57727);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var CaretDownOutlined = function CaretDownOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_CaretDownOutlined/* default */.Z
|
|
|
}));
|
|
|
};
|
|
|
CaretDownOutlined.displayName = 'CaretDownOutlined';
|
|
|
/* harmony default export */ var icons_CaretDownOutlined = (/*#__PURE__*/react.forwardRef(CaretDownOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons-svg/es/asn/CaretUpOutlined.js
|
|
|
var asn_CaretUpOutlined = __webpack_require__(54200);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/CaretUpOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var CaretUpOutlined = function CaretUpOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_CaretUpOutlined/* default */.Z
|
|
|
}));
|
|
|
};
|
|
|
CaretUpOutlined.displayName = 'CaretUpOutlined';
|
|
|
/* harmony default export */ var icons_CaretUpOutlined = (/*#__PURE__*/react.forwardRef(CaretUpOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(84908);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useSorter.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ASCEND = 'ascend';
|
|
|
var DESCEND = 'descend';
|
|
|
function getMultiplePriority(column) {
|
|
|
if ((0,esm_typeof/* default */.Z)(column.sorter) === 'object' && typeof column.sorter.multiple === 'number') {
|
|
|
return column.sorter.multiple;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
function getSortFunction(sorter) {
|
|
|
if (typeof sorter === 'function') {
|
|
|
return sorter;
|
|
|
}
|
|
|
if (sorter && (0,esm_typeof/* default */.Z)(sorter) === 'object' && sorter.compare) {
|
|
|
return sorter.compare;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
function nextSortDirection(sortDirections, current) {
|
|
|
if (!current) {
|
|
|
return sortDirections[0];
|
|
|
}
|
|
|
return sortDirections[sortDirections.indexOf(current) + 1];
|
|
|
}
|
|
|
function collectSortStates(columns, init, pos) {
|
|
|
var sortStates = [];
|
|
|
function pushState(column, columnPos) {
|
|
|
sortStates.push({
|
|
|
column: column,
|
|
|
key: getColumnKey(column, columnPos),
|
|
|
multiplePriority: getMultiplePriority(column),
|
|
|
sortOrder: column.sortOrder
|
|
|
});
|
|
|
}
|
|
|
(columns || []).forEach(function (column, index) {
|
|
|
var columnPos = getColumnPos(index, pos);
|
|
|
if (column.children) {
|
|
|
if ('sortOrder' in column) {
|
|
|
// Controlled
|
|
|
pushState(column, columnPos);
|
|
|
}
|
|
|
sortStates = [].concat((0,toConsumableArray/* default */.Z)(sortStates), (0,toConsumableArray/* default */.Z)(collectSortStates(column.children, init, columnPos)));
|
|
|
} else if (column.sorter) {
|
|
|
if ('sortOrder' in column) {
|
|
|
// Controlled
|
|
|
pushState(column, columnPos);
|
|
|
} else if (init && column.defaultSortOrder) {
|
|
|
// Default sorter
|
|
|
sortStates.push({
|
|
|
column: column,
|
|
|
key: getColumnKey(column, columnPos),
|
|
|
multiplePriority: getMultiplePriority(column),
|
|
|
sortOrder: column.defaultSortOrder
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return sortStates;
|
|
|
}
|
|
|
function injectSorter(prefixCls, columns, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, pos) {
|
|
|
return (columns || []).map(function (column, index) {
|
|
|
var columnPos = getColumnPos(index, pos);
|
|
|
var newColumn = column;
|
|
|
if (newColumn.sorter) {
|
|
|
var sortDirections = newColumn.sortDirections || defaultSortDirections;
|
|
|
var showSorterTooltip = newColumn.showSorterTooltip === undefined ? tableShowSorterTooltip : newColumn.showSorterTooltip;
|
|
|
var columnKey = getColumnKey(newColumn, columnPos);
|
|
|
var sorterState = sorterStates.find(function (_ref) {
|
|
|
var key = _ref.key;
|
|
|
return key === columnKey;
|
|
|
});
|
|
|
var sorterOrder = sorterState ? sorterState.sortOrder : null;
|
|
|
var nextSortOrder = nextSortDirection(sortDirections, sorterOrder);
|
|
|
var upNode = sortDirections.includes(ASCEND) && /*#__PURE__*/react.createElement(icons_CaretUpOutlined, {
|
|
|
className: classnames_default()("".concat(prefixCls, "-column-sorter-up"), {
|
|
|
active: sorterOrder === ASCEND
|
|
|
}),
|
|
|
role: "presentation"
|
|
|
});
|
|
|
var downNode = sortDirections.includes(DESCEND) && /*#__PURE__*/react.createElement(icons_CaretDownOutlined, {
|
|
|
className: classnames_default()("".concat(prefixCls, "-column-sorter-down"), {
|
|
|
active: sorterOrder === DESCEND
|
|
|
}),
|
|
|
role: "presentation"
|
|
|
});
|
|
|
var _ref2 = tableLocale || {},
|
|
|
cancelSort = _ref2.cancelSort,
|
|
|
triggerAsc = _ref2.triggerAsc,
|
|
|
triggerDesc = _ref2.triggerDesc;
|
|
|
var sortTip = cancelSort;
|
|
|
if (nextSortOrder === DESCEND) {
|
|
|
sortTip = triggerDesc;
|
|
|
} else if (nextSortOrder === ASCEND) {
|
|
|
sortTip = triggerAsc;
|
|
|
}
|
|
|
var tooltipProps = (0,esm_typeof/* default */.Z)(showSorterTooltip) === 'object' ? showSorterTooltip : {
|
|
|
title: sortTip
|
|
|
};
|
|
|
newColumn = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, newColumn), {
|
|
|
className: classnames_default()(newColumn.className, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-column-sort"), sorterOrder)),
|
|
|
title: function title(renderProps) {
|
|
|
var renderSortTitle = /*#__PURE__*/react.createElement("div", {
|
|
|
className: "".concat(prefixCls, "-column-sorters")
|
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
|
className: "".concat(prefixCls, "-column-title")
|
|
|
}, renderColumnTitle(column.title, renderProps)), /*#__PURE__*/react.createElement("span", {
|
|
|
className: classnames_default()("".concat(prefixCls, "-column-sorter"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-column-sorter-full"), !!(upNode && downNode)))
|
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
|
className: "".concat(prefixCls, "-column-sorter-inner")
|
|
|
}, upNode, downNode)));
|
|
|
return showSorterTooltip ? /*#__PURE__*/react.createElement(tooltip/* default */.Z, (0,esm_extends/* default */.Z)({}, tooltipProps), renderSortTitle) : renderSortTitle;
|
|
|
},
|
|
|
onHeaderCell: function onHeaderCell(col) {
|
|
|
var cell = column.onHeaderCell && column.onHeaderCell(col) || {};
|
|
|
var originOnClick = cell.onClick;
|
|
|
var originOKeyDown = cell.onKeyDown;
|
|
|
cell.onClick = function (event) {
|
|
|
triggerSorter({
|
|
|
column: column,
|
|
|
key: columnKey,
|
|
|
sortOrder: nextSortOrder,
|
|
|
multiplePriority: getMultiplePriority(column)
|
|
|
});
|
|
|
originOnClick === null || originOnClick === void 0 ? void 0 : originOnClick(event);
|
|
|
};
|
|
|
cell.onKeyDown = function (event) {
|
|
|
if (event.keyCode === KeyCode/* default.ENTER */.Z.ENTER) {
|
|
|
triggerSorter({
|
|
|
column: column,
|
|
|
key: columnKey,
|
|
|
sortOrder: nextSortOrder,
|
|
|
multiplePriority: getMultiplePriority(column)
|
|
|
});
|
|
|
originOKeyDown === null || originOKeyDown === void 0 ? void 0 : originOKeyDown(event);
|
|
|
}
|
|
|
};
|
|
|
var renderTitle = safeColumnTitle(column.title, {});
|
|
|
var displayTitle = renderTitle === null || renderTitle === void 0 ? void 0 : renderTitle.toString();
|
|
|
// Inform the screen-reader so it can tell the visually impaired user which column is sorted
|
|
|
if (sorterOrder) {
|
|
|
cell['aria-sort'] = sorterOrder === 'ascend' ? 'ascending' : 'descending';
|
|
|
} else {
|
|
|
cell['aria-label'] = displayTitle || '';
|
|
|
}
|
|
|
cell.className = classnames_default()(cell.className, "".concat(prefixCls, "-column-has-sorters"));
|
|
|
cell.tabIndex = 0;
|
|
|
if (column.ellipsis) {
|
|
|
cell.title = (renderTitle !== null && renderTitle !== void 0 ? renderTitle : '').toString();
|
|
|
}
|
|
|
return cell;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
if ('children' in newColumn) {
|
|
|
newColumn = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, newColumn), {
|
|
|
children: injectSorter(prefixCls, newColumn.children, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, columnPos)
|
|
|
});
|
|
|
}
|
|
|
return newColumn;
|
|
|
});
|
|
|
}
|
|
|
function stateToInfo(sorterStates) {
|
|
|
var column = sorterStates.column,
|
|
|
sortOrder = sorterStates.sortOrder;
|
|
|
return {
|
|
|
column: column,
|
|
|
order: sortOrder,
|
|
|
field: column.dataIndex,
|
|
|
columnKey: column.key
|
|
|
};
|
|
|
}
|
|
|
function generateSorterInfo(sorterStates) {
|
|
|
var list = sorterStates.filter(function (_ref3) {
|
|
|
var sortOrder = _ref3.sortOrder;
|
|
|
return sortOrder;
|
|
|
}).map(stateToInfo);
|
|
|
// =========== Legacy compatible support ===========
|
|
|
// https://github.com/ant-design/ant-design/pull/19226
|
|
|
if (list.length === 0 && sorterStates.length) {
|
|
|
return (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, stateToInfo(sorterStates[sorterStates.length - 1])), {
|
|
|
column: undefined
|
|
|
});
|
|
|
}
|
|
|
if (list.length <= 1) {
|
|
|
return list[0] || {};
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
function getSortData(data, sortStates, childrenColumnName) {
|
|
|
var innerSorterStates = sortStates.slice().sort(function (a, b) {
|
|
|
return b.multiplePriority - a.multiplePriority;
|
|
|
});
|
|
|
var cloneData = data.slice();
|
|
|
var runningSorters = innerSorterStates.filter(function (_ref4) {
|
|
|
var sorter = _ref4.column.sorter,
|
|
|
sortOrder = _ref4.sortOrder;
|
|
|
return getSortFunction(sorter) && sortOrder;
|
|
|
});
|
|
|
// Skip if no sorter needed
|
|
|
if (!runningSorters.length) {
|
|
|
return cloneData;
|
|
|
}
|
|
|
return cloneData.sort(function (record1, record2) {
|
|
|
for (var i = 0; i < runningSorters.length; i += 1) {
|
|
|
var sorterState = runningSorters[i];
|
|
|
var sorter = sorterState.column.sorter,
|
|
|
sortOrder = sorterState.sortOrder;
|
|
|
var compareFn = getSortFunction(sorter);
|
|
|
if (compareFn && sortOrder) {
|
|
|
var compareResult = compareFn(record1, record2, sortOrder);
|
|
|
if (compareResult !== 0) {
|
|
|
return sortOrder === ASCEND ? compareResult : -compareResult;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return 0;
|
|
|
}).map(function (record) {
|
|
|
var subRecords = record[childrenColumnName];
|
|
|
if (subRecords) {
|
|
|
return (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, record), (0,defineProperty/* default */.Z)({}, childrenColumnName, getSortData(subRecords, sortStates, childrenColumnName)));
|
|
|
}
|
|
|
return record;
|
|
|
});
|
|
|
}
|
|
|
function useFilterSorter(_ref5) {
|
|
|
var prefixCls = _ref5.prefixCls,
|
|
|
mergedColumns = _ref5.mergedColumns,
|
|
|
onSorterChange = _ref5.onSorterChange,
|
|
|
sortDirections = _ref5.sortDirections,
|
|
|
tableLocale = _ref5.tableLocale,
|
|
|
showSorterTooltip = _ref5.showSorterTooltip;
|
|
|
var _React$useState = react.useState(collectSortStates(mergedColumns, true)),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
sortStates = _React$useState2[0],
|
|
|
setSortStates = _React$useState2[1];
|
|
|
var mergedSorterStates = react.useMemo(function () {
|
|
|
var validate = true;
|
|
|
var collectedStates = collectSortStates(mergedColumns, false);
|
|
|
// Return if not controlled
|
|
|
if (!collectedStates.length) {
|
|
|
return sortStates;
|
|
|
}
|
|
|
var validateStates = [];
|
|
|
function patchStates(state) {
|
|
|
if (validate) {
|
|
|
validateStates.push(state);
|
|
|
} else {
|
|
|
validateStates.push((0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, state), {
|
|
|
sortOrder: null
|
|
|
}));
|
|
|
}
|
|
|
}
|
|
|
var multipleMode = null;
|
|
|
collectedStates.forEach(function (state) {
|
|
|
if (multipleMode === null) {
|
|
|
patchStates(state);
|
|
|
if (state.sortOrder) {
|
|
|
if (state.multiplePriority === false) {
|
|
|
validate = false;
|
|
|
} else {
|
|
|
multipleMode = true;
|
|
|
}
|
|
|
}
|
|
|
} else if (multipleMode && state.multiplePriority !== false) {
|
|
|
patchStates(state);
|
|
|
} else {
|
|
|
validate = false;
|
|
|
patchStates(state);
|
|
|
}
|
|
|
});
|
|
|
return validateStates;
|
|
|
}, [mergedColumns, sortStates]);
|
|
|
// Get render columns title required props
|
|
|
var columnTitleSorterProps = react.useMemo(function () {
|
|
|
var sortColumns = mergedSorterStates.map(function (_ref6) {
|
|
|
var column = _ref6.column,
|
|
|
sortOrder = _ref6.sortOrder;
|
|
|
return {
|
|
|
column: column,
|
|
|
order: sortOrder
|
|
|
};
|
|
|
});
|
|
|
return {
|
|
|
sortColumns: sortColumns,
|
|
|
// Legacy
|
|
|
sortColumn: sortColumns[0] && sortColumns[0].column,
|
|
|
sortOrder: sortColumns[0] && sortColumns[0].order
|
|
|
};
|
|
|
}, [mergedSorterStates]);
|
|
|
function triggerSorter(sortState) {
|
|
|
var newSorterStates;
|
|
|
if (sortState.multiplePriority === false || !mergedSorterStates.length || mergedSorterStates[0].multiplePriority === false) {
|
|
|
newSorterStates = [sortState];
|
|
|
} else {
|
|
|
newSorterStates = [].concat((0,toConsumableArray/* default */.Z)(mergedSorterStates.filter(function (_ref7) {
|
|
|
var key = _ref7.key;
|
|
|
return key !== sortState.key;
|
|
|
})), [sortState]);
|
|
|
}
|
|
|
setSortStates(newSorterStates);
|
|
|
onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);
|
|
|
}
|
|
|
var transformColumns = function transformColumns(innerColumns) {
|
|
|
return injectSorter(prefixCls, innerColumns, mergedSorterStates, triggerSorter, sortDirections, tableLocale, showSorterTooltip);
|
|
|
};
|
|
|
var getSorters = function getSorters() {
|
|
|
return generateSorterInfo(mergedSorterStates);
|
|
|
};
|
|
|
return [transformColumns, mergedSorterStates, columnTitleSorterProps, getSorters];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useTitleColumns.js
|
|
|
|
|
|
|
|
|
|
|
|
function fillTitle(columns, columnTitleProps) {
|
|
|
return columns.map(function (column) {
|
|
|
var cloneColumn = (0,esm_extends/* default */.Z)({}, column);
|
|
|
cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);
|
|
|
if ('children' in cloneColumn) {
|
|
|
cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
|
|
|
}
|
|
|
return cloneColumn;
|
|
|
});
|
|
|
}
|
|
|
function useTitleColumns(columnTitleProps) {
|
|
|
var filledColumns = react.useCallback(function (columns) {
|
|
|
return fillTitle(columns, columnTitleProps);
|
|
|
}, [columnTitleProps]);
|
|
|
return [filledColumns];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/Table.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Table_EMPTY_LIST = [];
|
|
|
function InternalTable(props, ref) {
|
|
|
var _classNames3;
|
|
|
var customizePrefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
style = props.style,
|
|
|
customizeSize = props.size,
|
|
|
bordered = props.bordered,
|
|
|
customizeDropdownPrefixCls = props.dropdownPrefixCls,
|
|
|
dataSource = props.dataSource,
|
|
|
pagination = props.pagination,
|
|
|
rowSelection = props.rowSelection,
|
|
|
_props$rowKey = props.rowKey,
|
|
|
rowKey = _props$rowKey === void 0 ? 'key' : _props$rowKey,
|
|
|
rowClassName = props.rowClassName,
|
|
|
columns = props.columns,
|
|
|
children = props.children,
|
|
|
legacyChildrenColumnName = props.childrenColumnName,
|
|
|
onChange = props.onChange,
|
|
|
getPopupContainer = props.getPopupContainer,
|
|
|
loading = props.loading,
|
|
|
expandIcon = props.expandIcon,
|
|
|
expandable = props.expandable,
|
|
|
expandedRowRender = props.expandedRowRender,
|
|
|
expandIconColumnIndex = props.expandIconColumnIndex,
|
|
|
indentSize = props.indentSize,
|
|
|
scroll = props.scroll,
|
|
|
sortDirections = props.sortDirections,
|
|
|
locale = props.locale,
|
|
|
_props$showSorterTool = props.showSorterTooltip,
|
|
|
showSorterTooltip = _props$showSorterTool === void 0 ? true : _props$showSorterTool;
|
|
|
false ? 0 : void 0;
|
|
|
[['filterDropdownVisible', 'filterDropdownOpen'], ['onFilterDropdownVisibleChange', 'onFilterDropdownOpenChange']].forEach(function (_ref) {
|
|
|
var _ref2 = (0,slicedToArray/* default */.Z)(_ref, 2),
|
|
|
deprecatedName = _ref2[0],
|
|
|
newName = _ref2[1];
|
|
|
false ? 0 : void 0;
|
|
|
});
|
|
|
var baseColumns = react.useMemo(function () {
|
|
|
return columns || convertChildrenToColumns(children);
|
|
|
}, [columns, children]);
|
|
|
var needResponsive = react.useMemo(function () {
|
|
|
return baseColumns.some(function (col) {
|
|
|
return col.responsive;
|
|
|
});
|
|
|
}, [baseColumns]);
|
|
|
var screens = (0,useBreakpoint/* default */.Z)(needResponsive);
|
|
|
var mergedColumns = react.useMemo(function () {
|
|
|
var matched = new Set(Object.keys(screens).filter(function (m) {
|
|
|
return screens[m];
|
|
|
}));
|
|
|
return baseColumns.filter(function (c) {
|
|
|
return !c.responsive || c.responsive.some(function (r) {
|
|
|
return matched.has(r);
|
|
|
});
|
|
|
});
|
|
|
}, [baseColumns, screens]);
|
|
|
var tableProps = (0,omit/* default */.Z)(props, ['className', 'style', 'columns']);
|
|
|
var size = react.useContext(SizeContext/* default */.Z);
|
|
|
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
|
|
|
_React$useContext$loc = _React$useContext.locale,
|
|
|
contextLocale = _React$useContext$loc === void 0 ? en_US/* default */.Z : _React$useContext$loc,
|
|
|
renderEmpty = _React$useContext.renderEmpty,
|
|
|
direction = _React$useContext.direction;
|
|
|
var mergedSize = customizeSize || size;
|
|
|
var tableLocale = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, contextLocale.Table), locale);
|
|
|
var rawData = dataSource || Table_EMPTY_LIST;
|
|
|
var _React$useContext2 = react.useContext(context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _React$useContext2.getPrefixCls;
|
|
|
var prefixCls = getPrefixCls('table', customizePrefixCls);
|
|
|
var dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);
|
|
|
var mergedExpandable = (0,esm_extends/* default */.Z)({
|
|
|
childrenColumnName: legacyChildrenColumnName,
|
|
|
expandIconColumnIndex: expandIconColumnIndex
|
|
|
}, expandable);
|
|
|
var _mergedExpandable$chi = mergedExpandable.childrenColumnName,
|
|
|
childrenColumnName = _mergedExpandable$chi === void 0 ? 'children' : _mergedExpandable$chi;
|
|
|
var expandType = react.useMemo(function () {
|
|
|
if (rawData.some(function (item) {
|
|
|
return item === null || item === void 0 ? void 0 : item[childrenColumnName];
|
|
|
})) {
|
|
|
return 'nest';
|
|
|
}
|
|
|
if (expandedRowRender || expandable && expandable.expandedRowRender) {
|
|
|
return 'row';
|
|
|
}
|
|
|
return null;
|
|
|
}, [rawData]);
|
|
|
var internalRefs = {
|
|
|
body: react.useRef()
|
|
|
};
|
|
|
// ============================ RowKey ============================
|
|
|
var getRowKey = react.useMemo(function () {
|
|
|
if (typeof rowKey === 'function') {
|
|
|
return rowKey;
|
|
|
}
|
|
|
return function (record) {
|
|
|
return record === null || record === void 0 ? void 0 : record[rowKey];
|
|
|
};
|
|
|
}, [rowKey]);
|
|
|
var _useLazyKVMap = useLazyKVMap(rawData, childrenColumnName, getRowKey),
|
|
|
_useLazyKVMap2 = (0,slicedToArray/* default */.Z)(_useLazyKVMap, 1),
|
|
|
getRecordByKey = _useLazyKVMap2[0];
|
|
|
// ============================ Events =============================
|
|
|
var changeEventInfo = {};
|
|
|
var triggerOnChange = function triggerOnChange(info, action) {
|
|
|
var reset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
|
var changeInfo = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, changeEventInfo), info);
|
|
|
if (reset) {
|
|
|
changeEventInfo.resetPagination();
|
|
|
// Reset event param
|
|
|
if (changeInfo.pagination.current) {
|
|
|
changeInfo.pagination.current = 1;
|
|
|
}
|
|
|
// Trigger pagination events
|
|
|
if (pagination && pagination.onChange) {
|
|
|
pagination.onChange(1, changeInfo.pagination.pageSize);
|
|
|
}
|
|
|
}
|
|
|
if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {
|
|
|
(0,scrollTo/* default */.Z)(0, {
|
|
|
getContainer: function getContainer() {
|
|
|
return internalRefs.body.current;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {
|
|
|
currentDataSource: getFilterData(getSortData(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates),
|
|
|
action: action
|
|
|
});
|
|
|
};
|
|
|
/**
|
|
|
* Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read
|
|
|
* state out and then put it back to title render. Move these code into `hooks` but still too
|
|
|
* complex. We should provides Table props like `sorter` & `filter` to handle control in next big
|
|
|
* version.
|
|
|
*/
|
|
|
// ============================ Sorter =============================
|
|
|
var onSorterChange = function onSorterChange(sorter, sorterStates) {
|
|
|
triggerOnChange({
|
|
|
sorter: sorter,
|
|
|
sorterStates: sorterStates
|
|
|
}, 'sort', false);
|
|
|
};
|
|
|
var _useSorter = useFilterSorter({
|
|
|
prefixCls: prefixCls,
|
|
|
mergedColumns: mergedColumns,
|
|
|
onSorterChange: onSorterChange,
|
|
|
sortDirections: sortDirections || ['ascend', 'descend'],
|
|
|
tableLocale: tableLocale,
|
|
|
showSorterTooltip: showSorterTooltip
|
|
|
}),
|
|
|
_useSorter2 = (0,slicedToArray/* default */.Z)(_useSorter, 4),
|
|
|
transformSorterColumns = _useSorter2[0],
|
|
|
sortStates = _useSorter2[1],
|
|
|
sorterTitleProps = _useSorter2[2],
|
|
|
getSorters = _useSorter2[3];
|
|
|
var sortedData = react.useMemo(function () {
|
|
|
return getSortData(rawData, sortStates, childrenColumnName);
|
|
|
}, [rawData, sortStates]);
|
|
|
changeEventInfo.sorter = getSorters();
|
|
|
changeEventInfo.sorterStates = sortStates;
|
|
|
// ============================ Filter ============================
|
|
|
var onFilterChange = function onFilterChange(filters, filterStates) {
|
|
|
triggerOnChange({
|
|
|
filters: filters,
|
|
|
filterStates: filterStates
|
|
|
}, 'filter', true);
|
|
|
};
|
|
|
var _useFilter = hooks_useFilter({
|
|
|
prefixCls: prefixCls,
|
|
|
locale: tableLocale,
|
|
|
dropdownPrefixCls: dropdownPrefixCls,
|
|
|
mergedColumns: mergedColumns,
|
|
|
onFilterChange: onFilterChange,
|
|
|
getPopupContainer: getPopupContainer
|
|
|
}),
|
|
|
_useFilter2 = (0,slicedToArray/* default */.Z)(_useFilter, 3),
|
|
|
transformFilterColumns = _useFilter2[0],
|
|
|
filterStates = _useFilter2[1],
|
|
|
filters = _useFilter2[2];
|
|
|
var mergedData = getFilterData(sortedData, filterStates);
|
|
|
changeEventInfo.filters = filters;
|
|
|
changeEventInfo.filterStates = filterStates;
|
|
|
// ============================ Column ============================
|
|
|
var columnTitleProps = react.useMemo(function () {
|
|
|
var mergedFilters = {};
|
|
|
Object.keys(filters).forEach(function (filterKey) {
|
|
|
if (filters[filterKey] !== null) {
|
|
|
mergedFilters[filterKey] = filters[filterKey];
|
|
|
}
|
|
|
});
|
|
|
return (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, sorterTitleProps), {
|
|
|
filters: mergedFilters
|
|
|
});
|
|
|
}, [sorterTitleProps, filters]);
|
|
|
var _useTitleColumns = useTitleColumns(columnTitleProps),
|
|
|
_useTitleColumns2 = (0,slicedToArray/* default */.Z)(_useTitleColumns, 1),
|
|
|
transformTitleColumns = _useTitleColumns2[0];
|
|
|
// ========================== Pagination ==========================
|
|
|
var onPaginationChange = function onPaginationChange(current, pageSize) {
|
|
|
triggerOnChange({
|
|
|
pagination: (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, changeEventInfo.pagination), {
|
|
|
current: current,
|
|
|
pageSize: pageSize
|
|
|
})
|
|
|
}, 'paginate');
|
|
|
};
|
|
|
var _usePagination = usePagination(mergedData.length, pagination, onPaginationChange),
|
|
|
_usePagination2 = (0,slicedToArray/* default */.Z)(_usePagination, 2),
|
|
|
mergedPagination = _usePagination2[0],
|
|
|
resetPagination = _usePagination2[1];
|
|
|
changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(pagination, mergedPagination);
|
|
|
changeEventInfo.resetPagination = resetPagination;
|
|
|
// ============================= Data =============================
|
|
|
var pageData = react.useMemo(function () {
|
|
|
if (pagination === false || !mergedPagination.pageSize) {
|
|
|
return mergedData;
|
|
|
}
|
|
|
var _mergedPagination$cur = mergedPagination.current,
|
|
|
current = _mergedPagination$cur === void 0 ? 1 : _mergedPagination$cur,
|
|
|
total = mergedPagination.total,
|
|
|
_mergedPagination$pag = mergedPagination.pageSize,
|
|
|
pageSize = _mergedPagination$pag === void 0 ? DEFAULT_PAGE_SIZE : _mergedPagination$pag;
|
|
|
false ? 0 : void 0;
|
|
|
// Dynamic table data
|
|
|
if (mergedData.length < total) {
|
|
|
if (mergedData.length > pageSize) {
|
|
|
false ? 0 : void 0;
|
|
|
return mergedData.slice((current - 1) * pageSize, current * pageSize);
|
|
|
}
|
|
|
return mergedData;
|
|
|
}
|
|
|
return mergedData.slice((current - 1) * pageSize, current * pageSize);
|
|
|
}, [!!pagination, mergedData, mergedPagination && mergedPagination.current, mergedPagination && mergedPagination.pageSize, mergedPagination && mergedPagination.total]);
|
|
|
// ========================== Selections ==========================
|
|
|
var _useSelection = useSelection(rowSelection, {
|
|
|
prefixCls: prefixCls,
|
|
|
data: mergedData,
|
|
|
pageData: pageData,
|
|
|
getRowKey: getRowKey,
|
|
|
getRecordByKey: getRecordByKey,
|
|
|
expandType: expandType,
|
|
|
childrenColumnName: childrenColumnName,
|
|
|
locale: tableLocale,
|
|
|
getPopupContainer: getPopupContainer
|
|
|
}),
|
|
|
_useSelection2 = (0,slicedToArray/* default */.Z)(_useSelection, 2),
|
|
|
transformSelectionColumns = _useSelection2[0],
|
|
|
selectedKeySet = _useSelection2[1];
|
|
|
var internalRowClassName = function internalRowClassName(record, index, indent) {
|
|
|
var mergedRowClassName;
|
|
|
if (typeof rowClassName === 'function') {
|
|
|
mergedRowClassName = classnames_default()(rowClassName(record, index, indent));
|
|
|
} else {
|
|
|
mergedRowClassName = classnames_default()(rowClassName);
|
|
|
}
|
|
|
return classnames_default()((0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-row-selected"), selectedKeySet.has(getRowKey(record, index))), mergedRowClassName);
|
|
|
};
|
|
|
// ========================== Expandable ==========================
|
|
|
// Pass origin render status into `rc-table`, this can be removed when refactor with `rc-table`
|
|
|
mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
|
|
|
// Customize expandable icon
|
|
|
mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || ExpandIcon(tableLocale);
|
|
|
// Adjust expand icon index, no overwrite expandIconColumnIndex if set.
|
|
|
if (expandType === 'nest' && mergedExpandable.expandIconColumnIndex === undefined) {
|
|
|
mergedExpandable.expandIconColumnIndex = rowSelection ? 1 : 0;
|
|
|
} else if (mergedExpandable.expandIconColumnIndex > 0 && rowSelection) {
|
|
|
mergedExpandable.expandIconColumnIndex -= 1;
|
|
|
}
|
|
|
// Indent size
|
|
|
if (typeof mergedExpandable.indentSize !== 'number') {
|
|
|
mergedExpandable.indentSize = typeof indentSize === 'number' ? indentSize : 15;
|
|
|
}
|
|
|
// ============================ Render ============================
|
|
|
var transformColumns = react.useCallback(function (innerColumns) {
|
|
|
return transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns))));
|
|
|
}, [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);
|
|
|
var topPaginationNode;
|
|
|
var bottomPaginationNode;
|
|
|
if (pagination !== false && (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.total)) {
|
|
|
var paginationSize;
|
|
|
if (mergedPagination.size) {
|
|
|
paginationSize = mergedPagination.size;
|
|
|
} else {
|
|
|
paginationSize = mergedSize === 'small' || mergedSize === 'middle' ? 'small' : undefined;
|
|
|
}
|
|
|
var renderPagination = function renderPagination(position) {
|
|
|
return /*#__PURE__*/react.createElement(es_pagination/* default */.Z, (0,esm_extends/* default */.Z)({}, mergedPagination, {
|
|
|
className: classnames_default()("".concat(prefixCls, "-pagination ").concat(prefixCls, "-pagination-").concat(position), mergedPagination.className),
|
|
|
size: paginationSize
|
|
|
}));
|
|
|
};
|
|
|
var defaultPosition = direction === 'rtl' ? 'left' : 'right';
|
|
|
var position = mergedPagination.position;
|
|
|
if (position !== null && Array.isArray(position)) {
|
|
|
var topPos = position.find(function (p) {
|
|
|
return p.includes('top');
|
|
|
});
|
|
|
var bottomPos = position.find(function (p) {
|
|
|
return p.includes('bottom');
|
|
|
});
|
|
|
var isDisable = position.every(function (p) {
|
|
|
return "".concat(p) === 'none';
|
|
|
});
|
|
|
if (!topPos && !bottomPos && !isDisable) {
|
|
|
bottomPaginationNode = renderPagination(defaultPosition);
|
|
|
}
|
|
|
if (topPos) {
|
|
|
topPaginationNode = renderPagination(topPos.toLowerCase().replace('top', ''));
|
|
|
}
|
|
|
if (bottomPos) {
|
|
|
bottomPaginationNode = renderPagination(bottomPos.toLowerCase().replace('bottom', ''));
|
|
|
}
|
|
|
} else {
|
|
|
bottomPaginationNode = renderPagination(defaultPosition);
|
|
|
}
|
|
|
}
|
|
|
// >>>>>>>>> Spinning
|
|
|
var spinProps;
|
|
|
if (typeof loading === 'boolean') {
|
|
|
spinProps = {
|
|
|
spinning: loading
|
|
|
};
|
|
|
} else if ((0,esm_typeof/* default */.Z)(loading) === 'object') {
|
|
|
spinProps = (0,esm_extends/* default */.Z)({
|
|
|
spinning: true
|
|
|
}, loading);
|
|
|
}
|
|
|
var wrapperClassNames = classnames_default()("".concat(prefixCls, "-wrapper"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-wrapper-rtl"), direction === 'rtl'), className);
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
ref: ref,
|
|
|
className: wrapperClassNames,
|
|
|
style: style
|
|
|
}, /*#__PURE__*/react.createElement(spin/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
spinning: false
|
|
|
}, spinProps), topPaginationNode, /*#__PURE__*/react.createElement(rc_table_es, (0,esm_extends/* default */.Z)({}, tableProps, {
|
|
|
columns: mergedColumns,
|
|
|
direction: direction,
|
|
|
expandable: mergedExpandable,
|
|
|
prefixCls: prefixCls,
|
|
|
className: classnames_default()((_classNames3 = {}, (0,defineProperty/* default */.Z)(_classNames3, "".concat(prefixCls, "-middle"), mergedSize === 'middle'), (0,defineProperty/* default */.Z)(_classNames3, "".concat(prefixCls, "-small"), mergedSize === 'small'), (0,defineProperty/* default */.Z)(_classNames3, "".concat(prefixCls, "-bordered"), bordered), (0,defineProperty/* default */.Z)(_classNames3, "".concat(prefixCls, "-empty"), rawData.length === 0), _classNames3)),
|
|
|
data: pageData,
|
|
|
rowKey: getRowKey,
|
|
|
rowClassName: internalRowClassName,
|
|
|
emptyText: locale && locale.emptyText || (renderEmpty || defaultRenderEmpty/* default */.Z)('Table'),
|
|
|
// Internal
|
|
|
internalHooks: INTERNAL_HOOKS,
|
|
|
internalRefs: internalRefs,
|
|
|
transformColumns: transformColumns
|
|
|
})), bottomPaginationNode));
|
|
|
}
|
|
|
var ForwardTable = /*#__PURE__*/react.forwardRef(InternalTable);
|
|
|
var Table_Table = ForwardTable;
|
|
|
Table_Table.SELECTION_COLUMN = SELECTION_COLUMN;
|
|
|
Table_Table.EXPAND_COLUMN = rc_table_es.EXPAND_COLUMN;
|
|
|
Table_Table.SELECTION_ALL = SELECTION_ALL;
|
|
|
Table_Table.SELECTION_INVERT = SELECTION_INVERT;
|
|
|
Table_Table.SELECTION_NONE = SELECTION_NONE;
|
|
|
Table_Table.Column = table_Column;
|
|
|
Table_Table.ColumnGroup = table_ColumnGroup;
|
|
|
Table_Table.Summary = FooterComponents;
|
|
|
/* harmony default export */ var table_Table = (Table_Table);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/index.js
|
|
|
|
|
|
/* harmony default export */ var table = (table_Table);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 71854:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/antd/es/table/style/index.js + 1 modules ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/default.less
|
|
|
var style_default = __webpack_require__(43146);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/style/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(29913);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js + 1 modules
|
|
|
var checkbox_style = __webpack_require__(82000);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/style/index.js + 1 modules
|
|
|
var dropdown_style = __webpack_require__(68018);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/empty/style/index.js + 1 modules
|
|
|
var empty_style = __webpack_require__(81151);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
|
var input_style = __webpack_require__(69463);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
|
|
|
var pagination_style = __webpack_require__(14182);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/style/index.js + 1 modules
|
|
|
var radio_style = __webpack_require__(83822);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules
|
|
|
var spin_style = __webpack_require__(22536);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
|
|
|
var tooltip_style = __webpack_require__(38390);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tree/style/index.js + 1 modules
|
|
|
var tree_style = __webpack_require__(62216);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/style/index.js
|
|
|
|
|
|
|
|
|
// style dependencies
|
|
|
// deps-lint-skip: menu
|
|
|
// deps-lint-skip: grid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 54205:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/antd/es/tree/index.js + 9 modules ***!
|
|
|
\********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ tree; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/index.js + 6 modules
|
|
|
var es = __webpack_require__(31343);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(4942);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__(71002);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/HolderOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var HolderOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z" } }] }, "name": "holder", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_HolderOutlined = (HolderOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(93771);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/HolderOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var HolderOutlined_HolderOutlined = function HolderOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_HolderOutlined
|
|
|
}));
|
|
|
};
|
|
|
HolderOutlined_HolderOutlined.displayName = 'HolderOutlined';
|
|
|
/* harmony default export */ var icons_HolderOutlined = (/*#__PURE__*/react.forwardRef(HolderOutlined_HolderOutlined));
|
|
|
// 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/es/config-provider/context.js
|
|
|
var context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/motion.js
|
|
|
var _util_motion = __webpack_require__(33603);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/utils/dropIndicator.js
|
|
|
|
|
|
|
|
|
var offset = 4;
|
|
|
function dropIndicatorRender(props) {
|
|
|
var _style;
|
|
|
var dropPosition = props.dropPosition,
|
|
|
dropLevelOffset = props.dropLevelOffset,
|
|
|
prefixCls = props.prefixCls,
|
|
|
indent = props.indent,
|
|
|
_props$direction = props.direction,
|
|
|
direction = _props$direction === void 0 ? 'ltr' : _props$direction;
|
|
|
var startPosition = direction === 'ltr' ? 'left' : 'right';
|
|
|
var endPosition = direction === 'ltr' ? 'right' : 'left';
|
|
|
var style = (_style = {}, (0,defineProperty/* default */.Z)(_style, startPosition, -dropLevelOffset * indent + offset), (0,defineProperty/* default */.Z)(_style, endPosition, 0), _style);
|
|
|
switch (dropPosition) {
|
|
|
case -1:
|
|
|
style.top = -3;
|
|
|
break;
|
|
|
case 1:
|
|
|
style.bottom = -3;
|
|
|
break;
|
|
|
default:
|
|
|
// dropPosition === 0
|
|
|
style.bottom = -3;
|
|
|
style[startPosition] = indent + offset;
|
|
|
break;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
style: style,
|
|
|
className: "".concat(prefixCls, "-drop-indicator")
|
|
|
});
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tree/utils/iconUtil.js + 4 modules
|
|
|
var iconUtil = __webpack_require__(84050);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/Tree.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Tree = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
var _classNames;
|
|
|
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
|
direction = _React$useContext.direction,
|
|
|
virtual = _React$useContext.virtual;
|
|
|
var customizePrefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
_props$showIcon = props.showIcon,
|
|
|
showIcon = _props$showIcon === void 0 ? false : _props$showIcon,
|
|
|
showLine = props.showLine,
|
|
|
_switcherIcon = props.switcherIcon,
|
|
|
_props$blockNode = props.blockNode,
|
|
|
blockNode = _props$blockNode === void 0 ? false : _props$blockNode,
|
|
|
children = props.children,
|
|
|
_props$checkable = props.checkable,
|
|
|
checkable = _props$checkable === void 0 ? false : _props$checkable,
|
|
|
_props$selectable = props.selectable,
|
|
|
selectable = _props$selectable === void 0 ? true : _props$selectable,
|
|
|
draggable = props.draggable,
|
|
|
_props$motion = props.motion,
|
|
|
motion = _props$motion === void 0 ? (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, _util_motion/* default */.ZP), {
|
|
|
motionAppear: false
|
|
|
}) : _props$motion;
|
|
|
var prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
|
var newProps = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, props), {
|
|
|
checkable: checkable,
|
|
|
selectable: selectable,
|
|
|
showIcon: showIcon,
|
|
|
motion: motion,
|
|
|
blockNode: blockNode,
|
|
|
showLine: Boolean(showLine),
|
|
|
dropIndicatorRender: dropIndicatorRender
|
|
|
});
|
|
|
var draggableConfig = react.useMemo(function () {
|
|
|
if (!draggable) {
|
|
|
return false;
|
|
|
}
|
|
|
var mergedDraggable = {};
|
|
|
switch ((0,esm_typeof/* default */.Z)(draggable)) {
|
|
|
case 'function':
|
|
|
mergedDraggable.nodeDraggable = draggable;
|
|
|
break;
|
|
|
case 'object':
|
|
|
mergedDraggable = (0,esm_extends/* default */.Z)({}, draggable);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
// Do nothing
|
|
|
}
|
|
|
|
|
|
if (mergedDraggable.icon !== false) {
|
|
|
mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/react.createElement(icons_HolderOutlined, null);
|
|
|
}
|
|
|
return mergedDraggable;
|
|
|
}, [draggable]);
|
|
|
return /*#__PURE__*/react.createElement(es/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
itemHeight: 20,
|
|
|
ref: ref,
|
|
|
virtual: virtual
|
|
|
}, newProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
className: classnames_default()((_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-icon-hide"), !showIcon), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-block-node"), blockNode), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-unselectable"), !selectable), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames), className),
|
|
|
direction: direction,
|
|
|
checkable: checkable ? /*#__PURE__*/react.createElement("span", {
|
|
|
className: "".concat(prefixCls, "-checkbox-inner")
|
|
|
}) : checkable,
|
|
|
selectable: selectable,
|
|
|
switcherIcon: function switcherIcon(nodeProps) {
|
|
|
return (0,iconUtil/* default */.Z)(prefixCls, _switcherIcon, showLine, nodeProps);
|
|
|
},
|
|
|
draggable: draggableConfig
|
|
|
}), children);
|
|
|
});
|
|
|
/* harmony default export */ var tree_Tree = (Tree);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__(97685);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/FileOutlined.js + 1 modules
|
|
|
var FileOutlined = __webpack_require__(5309);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons-svg/es/asn/FolderOpenOutlined.js
|
|
|
var asn_FolderOpenOutlined = __webpack_require__(48898);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/FolderOpenOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var FolderOpenOutlined = function FolderOpenOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_FolderOpenOutlined/* default */.Z
|
|
|
}));
|
|
|
};
|
|
|
FolderOpenOutlined.displayName = 'FolderOpenOutlined';
|
|
|
/* harmony default export */ var icons_FolderOpenOutlined = (/*#__PURE__*/react.forwardRef(FolderOpenOutlined));
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/FolderOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var FolderOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, "name": "folder", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_FolderOutlined = (FolderOutlined);
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/FolderOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var FolderOutlined_FolderOutlined = function FolderOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_FolderOutlined
|
|
|
}));
|
|
|
};
|
|
|
FolderOutlined_FolderOutlined.displayName = 'FolderOutlined';
|
|
|
/* harmony default export */ var icons_FolderOutlined = (/*#__PURE__*/react.forwardRef(FolderOutlined_FolderOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/util.js
|
|
|
var util = __webpack_require__(10225);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-tree/es/utils/treeUtil.js
|
|
|
var treeUtil = __webpack_require__(1089);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/utils/dictUtil.js
|
|
|
|
|
|
var Record;
|
|
|
(function (Record) {
|
|
|
Record[Record["None"] = 0] = "None";
|
|
|
Record[Record["Start"] = 1] = "Start";
|
|
|
Record[Record["End"] = 2] = "End";
|
|
|
})(Record || (Record = {}));
|
|
|
function traverseNodesKey(treeData, callback) {
|
|
|
function processNode(dataNode) {
|
|
|
var key = dataNode.key,
|
|
|
children = dataNode.children;
|
|
|
if (callback(key, dataNode) !== false) {
|
|
|
traverseNodesKey(children || [], callback);
|
|
|
}
|
|
|
}
|
|
|
treeData.forEach(processNode);
|
|
|
}
|
|
|
/** 计算选中范围,只考虑expanded情况以优化性能 */
|
|
|
function calcRangeKeys(_ref) {
|
|
|
var treeData = _ref.treeData,
|
|
|
expandedKeys = _ref.expandedKeys,
|
|
|
startKey = _ref.startKey,
|
|
|
endKey = _ref.endKey;
|
|
|
var keys = [];
|
|
|
var record = Record.None;
|
|
|
if (startKey && startKey === endKey) {
|
|
|
return [startKey];
|
|
|
}
|
|
|
if (!startKey || !endKey) {
|
|
|
return [];
|
|
|
}
|
|
|
function matchKey(key) {
|
|
|
return key === startKey || key === endKey;
|
|
|
}
|
|
|
traverseNodesKey(treeData, function (key) {
|
|
|
if (record === Record.End) {
|
|
|
return false;
|
|
|
}
|
|
|
if (matchKey(key)) {
|
|
|
// Match test
|
|
|
keys.push(key);
|
|
|
if (record === Record.None) {
|
|
|
record = Record.Start;
|
|
|
} else if (record === Record.Start) {
|
|
|
record = Record.End;
|
|
|
return false;
|
|
|
}
|
|
|
} else if (record === Record.Start) {
|
|
|
// Append selection
|
|
|
keys.push(key);
|
|
|
}
|
|
|
return expandedKeys.includes(key);
|
|
|
});
|
|
|
return keys;
|
|
|
}
|
|
|
function convertDirectoryKeysToNodes(treeData, keys) {
|
|
|
var restKeys = (0,toConsumableArray/* default */.Z)(keys);
|
|
|
var nodes = [];
|
|
|
traverseNodesKey(treeData, function (key, node) {
|
|
|
var index = restKeys.indexOf(key);
|
|
|
if (index !== -1) {
|
|
|
nodes.push(node);
|
|
|
restKeys.splice(index, 1);
|
|
|
}
|
|
|
return !!restKeys.length;
|
|
|
});
|
|
|
return nodes;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/DirectoryTree.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 getIcon(props) {
|
|
|
var isLeaf = props.isLeaf,
|
|
|
expanded = props.expanded;
|
|
|
if (isLeaf) {
|
|
|
return /*#__PURE__*/react.createElement(FileOutlined/* default */.Z, null);
|
|
|
}
|
|
|
return expanded ? /*#__PURE__*/react.createElement(icons_FolderOpenOutlined, null) : /*#__PURE__*/react.createElement(icons_FolderOutlined, null);
|
|
|
}
|
|
|
function getTreeData(_ref) {
|
|
|
var treeData = _ref.treeData,
|
|
|
children = _ref.children;
|
|
|
return treeData || (0,treeUtil/* convertTreeToData */.zn)(children);
|
|
|
}
|
|
|
var DirectoryTree = function DirectoryTree(_a, ref) {
|
|
|
var defaultExpandAll = _a.defaultExpandAll,
|
|
|
defaultExpandParent = _a.defaultExpandParent,
|
|
|
defaultExpandedKeys = _a.defaultExpandedKeys,
|
|
|
props = __rest(_a, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]);
|
|
|
// Shift click usage
|
|
|
var lastSelectedKey = react.useRef();
|
|
|
var cachedSelectedKeys = react.useRef();
|
|
|
var getInitExpandedKeys = function getInitExpandedKeys() {
|
|
|
var _convertDataToEntitie = (0,treeUtil/* convertDataToEntities */.I8)(getTreeData(props)),
|
|
|
keyEntities = _convertDataToEntitie.keyEntities;
|
|
|
var initExpandedKeys;
|
|
|
// Expanded keys
|
|
|
if (defaultExpandAll) {
|
|
|
initExpandedKeys = Object.keys(keyEntities);
|
|
|
} else if (defaultExpandParent) {
|
|
|
initExpandedKeys = (0,util/* conductExpandParent */.r7)(props.expandedKeys || defaultExpandedKeys || [], keyEntities);
|
|
|
} else {
|
|
|
initExpandedKeys = props.expandedKeys || defaultExpandedKeys;
|
|
|
}
|
|
|
return initExpandedKeys;
|
|
|
};
|
|
|
var _React$useState = react.useState(props.selectedKeys || props.defaultSelectedKeys || []),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
selectedKeys = _React$useState2[0],
|
|
|
setSelectedKeys = _React$useState2[1];
|
|
|
var _React$useState3 = react.useState(function () {
|
|
|
return getInitExpandedKeys();
|
|
|
}),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
expandedKeys = _React$useState4[0],
|
|
|
setExpandedKeys = _React$useState4[1];
|
|
|
react.useEffect(function () {
|
|
|
if ('selectedKeys' in props) {
|
|
|
setSelectedKeys(props.selectedKeys);
|
|
|
}
|
|
|
}, [props.selectedKeys]);
|
|
|
react.useEffect(function () {
|
|
|
if ('expandedKeys' in props) {
|
|
|
setExpandedKeys(props.expandedKeys);
|
|
|
}
|
|
|
}, [props.expandedKeys]);
|
|
|
var onExpand = function onExpand(keys, info) {
|
|
|
var _a;
|
|
|
if (!('expandedKeys' in props)) {
|
|
|
setExpandedKeys(keys);
|
|
|
}
|
|
|
// Call origin function
|
|
|
return (_a = props.onExpand) === null || _a === void 0 ? void 0 : _a.call(props, keys, info);
|
|
|
};
|
|
|
var onSelect = function onSelect(keys, event) {
|
|
|
var _a;
|
|
|
var multiple = props.multiple;
|
|
|
var node = event.node,
|
|
|
nativeEvent = event.nativeEvent;
|
|
|
var _node$key = node.key,
|
|
|
key = _node$key === void 0 ? '' : _node$key;
|
|
|
var treeData = getTreeData(props);
|
|
|
// const newState: DirectoryTreeState = {};
|
|
|
// We need wrap this event since some value is not same
|
|
|
var newEvent = (0,esm_extends/* default */.Z)((0,esm_extends/* default */.Z)({}, event), {
|
|
|
selected: true
|
|
|
});
|
|
|
// Windows / Mac single pick
|
|
|
var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
|
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
|
// Generate new selected keys
|
|
|
var newSelectedKeys;
|
|
|
if (multiple && ctrlPick) {
|
|
|
// Control click
|
|
|
newSelectedKeys = keys;
|
|
|
lastSelectedKey.current = key;
|
|
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
|
|
|
} else if (multiple && shiftPick) {
|
|
|
// Shift click
|
|
|
newSelectedKeys = Array.from(new Set([].concat((0,toConsumableArray/* default */.Z)(cachedSelectedKeys.current || []), (0,toConsumableArray/* default */.Z)(calcRangeKeys({
|
|
|
treeData: treeData,
|
|
|
expandedKeys: expandedKeys,
|
|
|
startKey: key,
|
|
|
endKey: lastSelectedKey.current
|
|
|
})))));
|
|
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
|
|
|
} else {
|
|
|
// Single click
|
|
|
newSelectedKeys = [key];
|
|
|
lastSelectedKey.current = key;
|
|
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
|
|
|
}
|
|
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, newSelectedKeys, newEvent);
|
|
|
if (!('selectedKeys' in props)) {
|
|
|
setSelectedKeys(newSelectedKeys);
|
|
|
}
|
|
|
};
|
|
|
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
|
direction = _React$useContext.direction;
|
|
|
var customizePrefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
_props$showIcon = props.showIcon,
|
|
|
showIcon = _props$showIcon === void 0 ? true : _props$showIcon,
|
|
|
_props$expandAction = props.expandAction,
|
|
|
expandAction = _props$expandAction === void 0 ? 'click' : _props$expandAction,
|
|
|
otherProps = __rest(props, ["prefixCls", "className", "showIcon", "expandAction"]);
|
|
|
var prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
|
var connectClassName = classnames_default()("".concat(prefixCls, "-directory"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-directory-rtl"), direction === 'rtl'), className);
|
|
|
return /*#__PURE__*/react.createElement(tree_Tree, (0,esm_extends/* default */.Z)({
|
|
|
icon: getIcon,
|
|
|
ref: ref,
|
|
|
blockNode: true
|
|
|
}, otherProps, {
|
|
|
showIcon: showIcon,
|
|
|
expandAction: expandAction,
|
|
|
prefixCls: prefixCls,
|
|
|
className: connectClassName,
|
|
|
expandedKeys: expandedKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
onSelect: onSelect,
|
|
|
onExpand: onExpand
|
|
|
}));
|
|
|
};
|
|
|
var ForwardDirectoryTree = /*#__PURE__*/react.forwardRef(DirectoryTree);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var tree_DirectoryTree = (ForwardDirectoryTree);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/index.js
|
|
|
|
|
|
|
|
|
|
|
|
var es_tree_Tree = tree_Tree;
|
|
|
es_tree_Tree.DirectoryTree = tree_DirectoryTree;
|
|
|
es_tree_Tree.TreeNode = es/* TreeNode */.O;
|
|
|
/* harmony default export */ var tree = (es_tree_Tree);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 62216:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/antd/es/tree/style/index.js + 1 modules ***!
|
|
|
\**************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/default.less
|
|
|
var style_default = __webpack_require__(43146);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/style/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/tree/style/index.js
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 7124:
|
|
|
/*!**********************************************************************************************!*\
|
|
|
!*** ./node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeOutlined.js + 1 modules ***!
|
|
|
\**********************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_EyeOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/EyeOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeOutlined = (EyeOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(93771);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
var EyeOutlined_EyeOutlined = function EyeOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeOutlined
|
|
|
}));
|
|
|
};
|
|
|
EyeOutlined_EyeOutlined.displayName = 'EyeOutlined';
|
|
|
/* harmony default export */ var icons_EyeOutlined = (/*#__PURE__*/react.forwardRef(EyeOutlined_EyeOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 18552:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_DataView.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getNative = __webpack_require__(/*! ./_getNative */ 10852),
|
|
|
root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/* Built-in method references that are verified to be native. */
|
|
|
var DataView = getNative(root, 'DataView');
|
|
|
|
|
|
module.exports = DataView;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1989:
|
|
|
/*!**************************************!*\
|
|
|
!*** ./node_modules/lodash/_Hash.js ***!
|
|
|
\**************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var hashClear = __webpack_require__(/*! ./_hashClear */ 51789),
|
|
|
hashDelete = __webpack_require__(/*! ./_hashDelete */ 80401),
|
|
|
hashGet = __webpack_require__(/*! ./_hashGet */ 57667),
|
|
|
hashHas = __webpack_require__(/*! ./_hashHas */ 21327),
|
|
|
hashSet = __webpack_require__(/*! ./_hashSet */ 81866);
|
|
|
|
|
|
/**
|
|
|
* Creates a hash object.
|
|
|
*
|
|
|
* @private
|
|
|
* @constructor
|
|
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
|
*/
|
|
|
function Hash(entries) {
|
|
|
var index = -1,
|
|
|
length = entries == null ? 0 : entries.length;
|
|
|
|
|
|
this.clear();
|
|
|
while (++index < length) {
|
|
|
var entry = entries[index];
|
|
|
this.set(entry[0], entry[1]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Add methods to `Hash`.
|
|
|
Hash.prototype.clear = hashClear;
|
|
|
Hash.prototype['delete'] = hashDelete;
|
|
|
Hash.prototype.get = hashGet;
|
|
|
Hash.prototype.has = hashHas;
|
|
|
Hash.prototype.set = hashSet;
|
|
|
|
|
|
module.exports = Hash;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38407:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_ListCache.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ 27040),
|
|
|
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ 14125),
|
|
|
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ 82117),
|
|
|
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ 67518),
|
|
|
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ 54705);
|
|
|
|
|
|
/**
|
|
|
* Creates an list cache object.
|
|
|
*
|
|
|
* @private
|
|
|
* @constructor
|
|
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
|
*/
|
|
|
function ListCache(entries) {
|
|
|
var index = -1,
|
|
|
length = entries == null ? 0 : entries.length;
|
|
|
|
|
|
this.clear();
|
|
|
while (++index < length) {
|
|
|
var entry = entries[index];
|
|
|
this.set(entry[0], entry[1]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Add methods to `ListCache`.
|
|
|
ListCache.prototype.clear = listCacheClear;
|
|
|
ListCache.prototype['delete'] = listCacheDelete;
|
|
|
ListCache.prototype.get = listCacheGet;
|
|
|
ListCache.prototype.has = listCacheHas;
|
|
|
ListCache.prototype.set = listCacheSet;
|
|
|
|
|
|
module.exports = ListCache;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 57071:
|
|
|
/*!*************************************!*\
|
|
|
!*** ./node_modules/lodash/_Map.js ***!
|
|
|
\*************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getNative = __webpack_require__(/*! ./_getNative */ 10852),
|
|
|
root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/* Built-in method references that are verified to be native. */
|
|
|
var Map = getNative(root, 'Map');
|
|
|
|
|
|
module.exports = Map;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 83369:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_MapCache.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ 24785),
|
|
|
mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ 11285),
|
|
|
mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ 96000),
|
|
|
mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ 49916),
|
|
|
mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ 95265);
|
|
|
|
|
|
/**
|
|
|
* Creates a map cache object to store key-value pairs.
|
|
|
*
|
|
|
* @private
|
|
|
* @constructor
|
|
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
|
*/
|
|
|
function MapCache(entries) {
|
|
|
var index = -1,
|
|
|
length = entries == null ? 0 : entries.length;
|
|
|
|
|
|
this.clear();
|
|
|
while (++index < length) {
|
|
|
var entry = entries[index];
|
|
|
this.set(entry[0], entry[1]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Add methods to `MapCache`.
|
|
|
MapCache.prototype.clear = mapCacheClear;
|
|
|
MapCache.prototype['delete'] = mapCacheDelete;
|
|
|
MapCache.prototype.get = mapCacheGet;
|
|
|
MapCache.prototype.has = mapCacheHas;
|
|
|
MapCache.prototype.set = mapCacheSet;
|
|
|
|
|
|
module.exports = MapCache;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 53818:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_Promise.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getNative = __webpack_require__(/*! ./_getNative */ 10852),
|
|
|
root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/* Built-in method references that are verified to be native. */
|
|
|
var Promise = getNative(root, 'Promise');
|
|
|
|
|
|
module.exports = Promise;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 58525:
|
|
|
/*!*************************************!*\
|
|
|
!*** ./node_modules/lodash/_Set.js ***!
|
|
|
\*************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getNative = __webpack_require__(/*! ./_getNative */ 10852),
|
|
|
root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/* Built-in method references that are verified to be native. */
|
|
|
var Set = getNative(root, 'Set');
|
|
|
|
|
|
module.exports = Set;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 88668:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_SetCache.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var MapCache = __webpack_require__(/*! ./_MapCache */ 83369),
|
|
|
setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ 90619),
|
|
|
setCacheHas = __webpack_require__(/*! ./_setCacheHas */ 72385);
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* Creates an array cache object to store unique values.
|
|
|
*
|
|
|
* @private
|
|
|
* @constructor
|
|
|
* @param {Array} [values] The values to cache.
|
|
|
*/
|
|
|
function SetCache(values) {
|
|
|
var index = -1,
|
|
|
length = values == null ? 0 : values.length;
|
|
|
|
|
|
this.__data__ = new MapCache;
|
|
|
while (++index < length) {
|
|
|
this.add(values[index]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Add methods to `SetCache`.
|
|
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
|
SetCache.prototype.has = setCacheHas;
|
|
|
|
|
|
module.exports = SetCache;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 46384:
|
|
|
/*!***************************************!*\
|
|
|
!*** ./node_modules/lodash/_Stack.js ***!
|
|
|
\***************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var ListCache = __webpack_require__(/*! ./_ListCache */ 38407),
|
|
|
stackClear = __webpack_require__(/*! ./_stackClear */ 37465),
|
|
|
stackDelete = __webpack_require__(/*! ./_stackDelete */ 63779),
|
|
|
stackGet = __webpack_require__(/*! ./_stackGet */ 67599),
|
|
|
stackHas = __webpack_require__(/*! ./_stackHas */ 44758),
|
|
|
stackSet = __webpack_require__(/*! ./_stackSet */ 34309);
|
|
|
|
|
|
/**
|
|
|
* Creates a stack cache object to store key-value pairs.
|
|
|
*
|
|
|
* @private
|
|
|
* @constructor
|
|
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
|
*/
|
|
|
function Stack(entries) {
|
|
|
var data = this.__data__ = new ListCache(entries);
|
|
|
this.size = data.size;
|
|
|
}
|
|
|
|
|
|
// Add methods to `Stack`.
|
|
|
Stack.prototype.clear = stackClear;
|
|
|
Stack.prototype['delete'] = stackDelete;
|
|
|
Stack.prototype.get = stackGet;
|
|
|
Stack.prototype.has = stackHas;
|
|
|
Stack.prototype.set = stackSet;
|
|
|
|
|
|
module.exports = Stack;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 11149:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_Uint8Array.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/** Built-in value references. */
|
|
|
var Uint8Array = root.Uint8Array;
|
|
|
|
|
|
module.exports = Uint8Array;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 70577:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_WeakMap.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getNative = __webpack_require__(/*! ./_getNative */ 10852),
|
|
|
root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/* Built-in method references that are verified to be native. */
|
|
|
var WeakMap = getNative(root, 'WeakMap');
|
|
|
|
|
|
module.exports = WeakMap;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 34963:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_arrayFilter.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* A specialized version of `_.filter` for arrays without support for
|
|
|
* iteratee shorthands.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Array} [array] The array to iterate over.
|
|
|
* @param {Function} predicate The function invoked per iteration.
|
|
|
* @returns {Array} Returns the new filtered array.
|
|
|
*/
|
|
|
function arrayFilter(array, predicate) {
|
|
|
var index = -1,
|
|
|
length = array == null ? 0 : array.length,
|
|
|
resIndex = 0,
|
|
|
result = [];
|
|
|
|
|
|
while (++index < length) {
|
|
|
var value = array[index];
|
|
|
if (predicate(value, index, array)) {
|
|
|
result[resIndex++] = value;
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = arrayFilter;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 14636:
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./node_modules/lodash/_arrayLikeKeys.js ***!
|
|
|
\***********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseTimes = __webpack_require__(/*! ./_baseTimes */ 22545),
|
|
|
isArguments = __webpack_require__(/*! ./isArguments */ 35694),
|
|
|
isArray = __webpack_require__(/*! ./isArray */ 1469),
|
|
|
isBuffer = __webpack_require__(/*! ./isBuffer */ 44144),
|
|
|
isIndex = __webpack_require__(/*! ./_isIndex */ 65776),
|
|
|
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 36719);
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/**
|
|
|
* Creates an array of the enumerable property names of the array-like `value`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to query.
|
|
|
* @param {boolean} inherited Specify returning inherited property names.
|
|
|
* @returns {Array} Returns the array of property names.
|
|
|
*/
|
|
|
function arrayLikeKeys(value, inherited) {
|
|
|
var isArr = isArray(value),
|
|
|
isArg = !isArr && isArguments(value),
|
|
|
isBuff = !isArr && !isArg && isBuffer(value),
|
|
|
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
|
|
skipIndexes = isArr || isArg || isBuff || isType,
|
|
|
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
|
length = result.length;
|
|
|
|
|
|
for (var key in value) {
|
|
|
if ((inherited || hasOwnProperty.call(value, key)) &&
|
|
|
!(skipIndexes && (
|
|
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
|
key == 'length' ||
|
|
|
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
|
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
|
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
|
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
|
// Skip index properties.
|
|
|
isIndex(key, length)
|
|
|
))) {
|
|
|
result.push(key);
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = arrayLikeKeys;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 62488:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_arrayPush.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Appends the elements of `values` to `array`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Array} array The array to modify.
|
|
|
* @param {Array} values The values to append.
|
|
|
* @returns {Array} Returns `array`.
|
|
|
*/
|
|
|
function arrayPush(array, values) {
|
|
|
var index = -1,
|
|
|
length = values.length,
|
|
|
offset = array.length;
|
|
|
|
|
|
while (++index < length) {
|
|
|
array[offset + index] = values[index];
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
module.exports = arrayPush;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82908:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_arraySome.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* A specialized version of `_.some` for arrays without support for iteratee
|
|
|
* shorthands.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Array} [array] The array to iterate over.
|
|
|
* @param {Function} predicate The function invoked per iteration.
|
|
|
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
|
* else `false`.
|
|
|
*/
|
|
|
function arraySome(array, predicate) {
|
|
|
var index = -1,
|
|
|
length = array == null ? 0 : array.length;
|
|
|
|
|
|
while (++index < length) {
|
|
|
if (predicate(array[index], index, array)) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
module.exports = arraySome;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 18470:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_assocIndexOf.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var eq = __webpack_require__(/*! ./eq */ 77813);
|
|
|
|
|
|
/**
|
|
|
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Array} array The array to inspect.
|
|
|
* @param {*} key The key to search for.
|
|
|
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
|
*/
|
|
|
function assocIndexOf(array, key) {
|
|
|
var length = array.length;
|
|
|
while (length--) {
|
|
|
if (eq(array[length][0], key)) {
|
|
|
return length;
|
|
|
}
|
|
|
}
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
module.exports = assocIndexOf;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 68866:
|
|
|
/*!************************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseGetAllKeys.js ***!
|
|
|
\************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 62488),
|
|
|
isArray = __webpack_require__(/*! ./isArray */ 1469);
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
|
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
|
* symbols of `object`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to query.
|
|
|
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
|
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
|
* @returns {Array} Returns the array of property names and symbols.
|
|
|
*/
|
|
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
|
var result = keysFunc(object);
|
|
|
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
|
}
|
|
|
|
|
|
module.exports = baseGetAllKeys;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 9454:
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseIsArguments.js ***!
|
|
|
\*************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 44239),
|
|
|
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 37005);
|
|
|
|
|
|
/** `Object#toString` result references. */
|
|
|
var argsTag = '[object Arguments]';
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.isArguments`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
|
*/
|
|
|
function baseIsArguments(value) {
|
|
|
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
|
}
|
|
|
|
|
|
module.exports = baseIsArguments;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 90939:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseIsEqual.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ 2492),
|
|
|
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 37005);
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.isEqual` which supports partial comparisons
|
|
|
* and tracks traversed objects.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to compare.
|
|
|
* @param {*} other The other value to compare.
|
|
|
* @param {boolean} bitmask The bitmask flags.
|
|
|
* 1 - Unordered comparison
|
|
|
* 2 - Partial comparison
|
|
|
* @param {Function} [customizer] The function to customize comparisons.
|
|
|
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
|
*/
|
|
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
if (value === other) {
|
|
|
return true;
|
|
|
}
|
|
|
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
|
|
|
return value !== value && other !== other;
|
|
|
}
|
|
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
|
}
|
|
|
|
|
|
module.exports = baseIsEqual;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 2492:
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseIsEqualDeep.js ***!
|
|
|
\*************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var Stack = __webpack_require__(/*! ./_Stack */ 46384),
|
|
|
equalArrays = __webpack_require__(/*! ./_equalArrays */ 67114),
|
|
|
equalByTag = __webpack_require__(/*! ./_equalByTag */ 18351),
|
|
|
equalObjects = __webpack_require__(/*! ./_equalObjects */ 16096),
|
|
|
getTag = __webpack_require__(/*! ./_getTag */ 64160),
|
|
|
isArray = __webpack_require__(/*! ./isArray */ 1469),
|
|
|
isBuffer = __webpack_require__(/*! ./isBuffer */ 44144),
|
|
|
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 36719);
|
|
|
|
|
|
/** Used to compose bitmasks for value comparisons. */
|
|
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
|
|
|
|
/** `Object#toString` result references. */
|
|
|
var argsTag = '[object Arguments]',
|
|
|
arrayTag = '[object Array]',
|
|
|
objectTag = '[object Object]';
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/**
|
|
|
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
|
* deep comparisons and tracks traversed objects enabling objects with circular
|
|
|
* references to be compared.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to compare.
|
|
|
* @param {Object} other The other object to compare.
|
|
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
|
* @param {Function} customizer The function to customize comparisons.
|
|
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
|
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
|
*/
|
|
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
var objIsArr = isArray(object),
|
|
|
othIsArr = isArray(other),
|
|
|
objTag = objIsArr ? arrayTag : getTag(object),
|
|
|
othTag = othIsArr ? arrayTag : getTag(other);
|
|
|
|
|
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
|
|
|
|
var objIsObj = objTag == objectTag,
|
|
|
othIsObj = othTag == objectTag,
|
|
|
isSameTag = objTag == othTag;
|
|
|
|
|
|
if (isSameTag && isBuffer(object)) {
|
|
|
if (!isBuffer(other)) {
|
|
|
return false;
|
|
|
}
|
|
|
objIsArr = true;
|
|
|
objIsObj = false;
|
|
|
}
|
|
|
if (isSameTag && !objIsObj) {
|
|
|
stack || (stack = new Stack);
|
|
|
return (objIsArr || isTypedArray(object))
|
|
|
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
|
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
|
}
|
|
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
|
|
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
|
|
|
|
|
if (objIsWrapped || othIsWrapped) {
|
|
|
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
|
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
|
|
|
|
stack || (stack = new Stack);
|
|
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
|
}
|
|
|
}
|
|
|
if (!isSameTag) {
|
|
|
return false;
|
|
|
}
|
|
|
stack || (stack = new Stack);
|
|
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
|
}
|
|
|
|
|
|
module.exports = baseIsEqualDeep;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 28458:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseIsNative.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var isFunction = __webpack_require__(/*! ./isFunction */ 23560),
|
|
|
isMasked = __webpack_require__(/*! ./_isMasked */ 15346),
|
|
|
isObject = __webpack_require__(/*! ./isObject */ 13218),
|
|
|
toSource = __webpack_require__(/*! ./_toSource */ 80346);
|
|
|
|
|
|
/**
|
|
|
* Used to match `RegExp`
|
|
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
|
*/
|
|
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
|
|
|
|
/** Used to detect host constructors (Safari). */
|
|
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var funcProto = Function.prototype,
|
|
|
objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to resolve the decompiled source of functions. */
|
|
|
var funcToString = funcProto.toString;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/** Used to detect if a method is native. */
|
|
|
var reIsNative = RegExp('^' +
|
|
|
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
|
);
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.isNative` without bad shim checks.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
|
* else `false`.
|
|
|
*/
|
|
|
function baseIsNative(value) {
|
|
|
if (!isObject(value) || isMasked(value)) {
|
|
|
return false;
|
|
|
}
|
|
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
|
return pattern.test(toSource(value));
|
|
|
}
|
|
|
|
|
|
module.exports = baseIsNative;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38749:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseIsTypedArray.js ***!
|
|
|
\**************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 44239),
|
|
|
isLength = __webpack_require__(/*! ./isLength */ 41780),
|
|
|
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 37005);
|
|
|
|
|
|
/** `Object#toString` result references. */
|
|
|
var argsTag = '[object Arguments]',
|
|
|
arrayTag = '[object Array]',
|
|
|
boolTag = '[object Boolean]',
|
|
|
dateTag = '[object Date]',
|
|
|
errorTag = '[object Error]',
|
|
|
funcTag = '[object Function]',
|
|
|
mapTag = '[object Map]',
|
|
|
numberTag = '[object Number]',
|
|
|
objectTag = '[object Object]',
|
|
|
regexpTag = '[object RegExp]',
|
|
|
setTag = '[object Set]',
|
|
|
stringTag = '[object String]',
|
|
|
weakMapTag = '[object WeakMap]';
|
|
|
|
|
|
var arrayBufferTag = '[object ArrayBuffer]',
|
|
|
dataViewTag = '[object DataView]',
|
|
|
float32Tag = '[object Float32Array]',
|
|
|
float64Tag = '[object Float64Array]',
|
|
|
int8Tag = '[object Int8Array]',
|
|
|
int16Tag = '[object Int16Array]',
|
|
|
int32Tag = '[object Int32Array]',
|
|
|
uint8Tag = '[object Uint8Array]',
|
|
|
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
|
uint16Tag = '[object Uint16Array]',
|
|
|
uint32Tag = '[object Uint32Array]';
|
|
|
|
|
|
/** Used to identify `toStringTag` values of typed arrays. */
|
|
|
var typedArrayTags = {};
|
|
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
|
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
|
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
|
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
|
typedArrayTags[uint32Tag] = true;
|
|
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
|
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
|
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
|
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
|
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
|
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
|
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
|
|
typedArrayTags[weakMapTag] = false;
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
|
*/
|
|
|
function baseIsTypedArray(value) {
|
|
|
return isObjectLike(value) &&
|
|
|
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
|
}
|
|
|
|
|
|
module.exports = baseIsTypedArray;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 280:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseKeys.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var isPrototype = __webpack_require__(/*! ./_isPrototype */ 25726),
|
|
|
nativeKeys = __webpack_require__(/*! ./_nativeKeys */ 86916);
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to query.
|
|
|
* @returns {Array} Returns the array of property names.
|
|
|
*/
|
|
|
function baseKeys(object) {
|
|
|
if (!isPrototype(object)) {
|
|
|
return nativeKeys(object);
|
|
|
}
|
|
|
var result = [];
|
|
|
for (var key in Object(object)) {
|
|
|
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
|
|
result.push(key);
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = baseKeys;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 22545:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseTimes.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.times` without support for iteratee shorthands
|
|
|
* or max array length checks.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {number} n The number of times to invoke `iteratee`.
|
|
|
* @param {Function} iteratee The function invoked per iteration.
|
|
|
* @returns {Array} Returns the array of results.
|
|
|
*/
|
|
|
function baseTimes(n, iteratee) {
|
|
|
var index = -1,
|
|
|
result = Array(n);
|
|
|
|
|
|
while (++index < n) {
|
|
|
result[index] = iteratee(index);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = baseTimes;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 7518:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_baseUnary.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* The base implementation of `_.unary` without support for storing metadata.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Function} func The function to cap arguments for.
|
|
|
* @returns {Function} Returns the new capped function.
|
|
|
*/
|
|
|
function baseUnary(func) {
|
|
|
return function(value) {
|
|
|
return func(value);
|
|
|
};
|
|
|
}
|
|
|
|
|
|
module.exports = baseUnary;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 74757:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_cacheHas.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Checks if a `cache` value for `key` exists.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} cache The cache to query.
|
|
|
* @param {string} key The key of the entry to check.
|
|
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
|
*/
|
|
|
function cacheHas(cache, key) {
|
|
|
return cache.has(key);
|
|
|
}
|
|
|
|
|
|
module.exports = cacheHas;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 14429:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_coreJsData.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var root = __webpack_require__(/*! ./_root */ 55639);
|
|
|
|
|
|
/** Used to detect overreaching core-js shims. */
|
|
|
var coreJsData = root['__core-js_shared__'];
|
|
|
|
|
|
module.exports = coreJsData;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 67114:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_equalArrays.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var SetCache = __webpack_require__(/*! ./_SetCache */ 88668),
|
|
|
arraySome = __webpack_require__(/*! ./_arraySome */ 82908),
|
|
|
cacheHas = __webpack_require__(/*! ./_cacheHas */ 74757);
|
|
|
|
|
|
/** Used to compose bitmasks for value comparisons. */
|
|
|
var COMPARE_PARTIAL_FLAG = 1,
|
|
|
COMPARE_UNORDERED_FLAG = 2;
|
|
|
|
|
|
/**
|
|
|
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
|
* partial deep comparisons.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Array} array The array to compare.
|
|
|
* @param {Array} other The other array to compare.
|
|
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
|
* @param {Function} customizer The function to customize comparisons.
|
|
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
|
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
|
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
|
*/
|
|
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
|
|
arrLength = array.length,
|
|
|
othLength = other.length;
|
|
|
|
|
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
|
return false;
|
|
|
}
|
|
|
// Check that cyclic values are equal.
|
|
|
var arrStacked = stack.get(array);
|
|
|
var othStacked = stack.get(other);
|
|
|
if (arrStacked && othStacked) {
|
|
|
return arrStacked == other && othStacked == array;
|
|
|
}
|
|
|
var index = -1,
|
|
|
result = true,
|
|
|
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
|
|
|
|
|
|
stack.set(array, other);
|
|
|
stack.set(other, array);
|
|
|
|
|
|
// Ignore non-index properties.
|
|
|
while (++index < arrLength) {
|
|
|
var arrValue = array[index],
|
|
|
othValue = other[index];
|
|
|
|
|
|
if (customizer) {
|
|
|
var compared = isPartial
|
|
|
? customizer(othValue, arrValue, index, other, array, stack)
|
|
|
: customizer(arrValue, othValue, index, array, other, stack);
|
|
|
}
|
|
|
if (compared !== undefined) {
|
|
|
if (compared) {
|
|
|
continue;
|
|
|
}
|
|
|
result = false;
|
|
|
break;
|
|
|
}
|
|
|
// Recursively compare arrays (susceptible to call stack limits).
|
|
|
if (seen) {
|
|
|
if (!arraySome(other, function(othValue, othIndex) {
|
|
|
if (!cacheHas(seen, othIndex) &&
|
|
|
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
|
return seen.push(othIndex);
|
|
|
}
|
|
|
})) {
|
|
|
result = false;
|
|
|
break;
|
|
|
}
|
|
|
} else if (!(
|
|
|
arrValue === othValue ||
|
|
|
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
|
)) {
|
|
|
result = false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
stack['delete'](array);
|
|
|
stack['delete'](other);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = equalArrays;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 18351:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_equalByTag.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var Symbol = __webpack_require__(/*! ./_Symbol */ 62705),
|
|
|
Uint8Array = __webpack_require__(/*! ./_Uint8Array */ 11149),
|
|
|
eq = __webpack_require__(/*! ./eq */ 77813),
|
|
|
equalArrays = __webpack_require__(/*! ./_equalArrays */ 67114),
|
|
|
mapToArray = __webpack_require__(/*! ./_mapToArray */ 68776),
|
|
|
setToArray = __webpack_require__(/*! ./_setToArray */ 21814);
|
|
|
|
|
|
/** Used to compose bitmasks for value comparisons. */
|
|
|
var COMPARE_PARTIAL_FLAG = 1,
|
|
|
COMPARE_UNORDERED_FLAG = 2;
|
|
|
|
|
|
/** `Object#toString` result references. */
|
|
|
var boolTag = '[object Boolean]',
|
|
|
dateTag = '[object Date]',
|
|
|
errorTag = '[object Error]',
|
|
|
mapTag = '[object Map]',
|
|
|
numberTag = '[object Number]',
|
|
|
regexpTag = '[object RegExp]',
|
|
|
setTag = '[object Set]',
|
|
|
stringTag = '[object String]',
|
|
|
symbolTag = '[object Symbol]';
|
|
|
|
|
|
var arrayBufferTag = '[object ArrayBuffer]',
|
|
|
dataViewTag = '[object DataView]';
|
|
|
|
|
|
/** Used to convert symbols to primitives and strings. */
|
|
|
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
|
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
|
|
|
|
/**
|
|
|
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
|
* the same `toStringTag`.
|
|
|
*
|
|
|
* **Note:** This function only supports comparing values with tags of
|
|
|
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to compare.
|
|
|
* @param {Object} other The other object to compare.
|
|
|
* @param {string} tag The `toStringTag` of the objects to compare.
|
|
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
|
* @param {Function} customizer The function to customize comparisons.
|
|
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
|
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
|
*/
|
|
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
switch (tag) {
|
|
|
case dataViewTag:
|
|
|
if ((object.byteLength != other.byteLength) ||
|
|
|
(object.byteOffset != other.byteOffset)) {
|
|
|
return false;
|
|
|
}
|
|
|
object = object.buffer;
|
|
|
other = other.buffer;
|
|
|
|
|
|
case arrayBufferTag:
|
|
|
if ((object.byteLength != other.byteLength) ||
|
|
|
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
|
|
|
case boolTag:
|
|
|
case dateTag:
|
|
|
case numberTag:
|
|
|
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
|
// Invalid dates are coerced to `NaN`.
|
|
|
return eq(+object, +other);
|
|
|
|
|
|
case errorTag:
|
|
|
return object.name == other.name && object.message == other.message;
|
|
|
|
|
|
case regexpTag:
|
|
|
case stringTag:
|
|
|
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
|
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
|
// for more details.
|
|
|
return object == (other + '');
|
|
|
|
|
|
case mapTag:
|
|
|
var convert = mapToArray;
|
|
|
|
|
|
case setTag:
|
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
|
convert || (convert = setToArray);
|
|
|
|
|
|
if (object.size != other.size && !isPartial) {
|
|
|
return false;
|
|
|
}
|
|
|
// Assume cyclic values are equal.
|
|
|
var stacked = stack.get(object);
|
|
|
if (stacked) {
|
|
|
return stacked == other;
|
|
|
}
|
|
|
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
|
|
|
|
// Recursively compare objects (susceptible to call stack limits).
|
|
|
stack.set(object, other);
|
|
|
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
|
stack['delete'](object);
|
|
|
return result;
|
|
|
|
|
|
case symbolTag:
|
|
|
if (symbolValueOf) {
|
|
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
module.exports = equalByTag;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 16096:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_equalObjects.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ 58234);
|
|
|
|
|
|
/** Used to compose bitmasks for value comparisons. */
|
|
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/**
|
|
|
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
|
* partial deep comparisons.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to compare.
|
|
|
* @param {Object} other The other object to compare.
|
|
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
|
* @param {Function} customizer The function to customize comparisons.
|
|
|
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
|
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
|
*/
|
|
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
|
|
objProps = getAllKeys(object),
|
|
|
objLength = objProps.length,
|
|
|
othProps = getAllKeys(other),
|
|
|
othLength = othProps.length;
|
|
|
|
|
|
if (objLength != othLength && !isPartial) {
|
|
|
return false;
|
|
|
}
|
|
|
var index = objLength;
|
|
|
while (index--) {
|
|
|
var key = objProps[index];
|
|
|
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
// Check that cyclic values are equal.
|
|
|
var objStacked = stack.get(object);
|
|
|
var othStacked = stack.get(other);
|
|
|
if (objStacked && othStacked) {
|
|
|
return objStacked == other && othStacked == object;
|
|
|
}
|
|
|
var result = true;
|
|
|
stack.set(object, other);
|
|
|
stack.set(other, object);
|
|
|
|
|
|
var skipCtor = isPartial;
|
|
|
while (++index < objLength) {
|
|
|
key = objProps[index];
|
|
|
var objValue = object[key],
|
|
|
othValue = other[key];
|
|
|
|
|
|
if (customizer) {
|
|
|
var compared = isPartial
|
|
|
? customizer(othValue, objValue, key, other, object, stack)
|
|
|
: customizer(objValue, othValue, key, object, other, stack);
|
|
|
}
|
|
|
// Recursively compare objects (susceptible to call stack limits).
|
|
|
if (!(compared === undefined
|
|
|
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
|
: compared
|
|
|
)) {
|
|
|
result = false;
|
|
|
break;
|
|
|
}
|
|
|
skipCtor || (skipCtor = key == 'constructor');
|
|
|
}
|
|
|
if (result && !skipCtor) {
|
|
|
var objCtor = object.constructor,
|
|
|
othCtor = other.constructor;
|
|
|
|
|
|
// Non `Object` object instances with different constructors are not equal.
|
|
|
if (objCtor != othCtor &&
|
|
|
('constructor' in object && 'constructor' in other) &&
|
|
|
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
|
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
|
result = false;
|
|
|
}
|
|
|
}
|
|
|
stack['delete'](object);
|
|
|
stack['delete'](other);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = equalObjects;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 58234:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_getAllKeys.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ 68866),
|
|
|
getSymbols = __webpack_require__(/*! ./_getSymbols */ 99551),
|
|
|
keys = __webpack_require__(/*! ./keys */ 3674);
|
|
|
|
|
|
/**
|
|
|
* Creates an array of own enumerable property names and symbols of `object`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to query.
|
|
|
* @returns {Array} Returns the array of property names and symbols.
|
|
|
*/
|
|
|
function getAllKeys(object) {
|
|
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
|
}
|
|
|
|
|
|
module.exports = getAllKeys;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 45050:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_getMapData.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var isKeyable = __webpack_require__(/*! ./_isKeyable */ 37019);
|
|
|
|
|
|
/**
|
|
|
* Gets the data for `map`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} map The map to query.
|
|
|
* @param {string} key The reference key.
|
|
|
* @returns {*} Returns the map data.
|
|
|
*/
|
|
|
function getMapData(map, key) {
|
|
|
var data = map.__data__;
|
|
|
return isKeyable(key)
|
|
|
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
|
: data.map;
|
|
|
}
|
|
|
|
|
|
module.exports = getMapData;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 10852:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_getNative.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ 28458),
|
|
|
getValue = __webpack_require__(/*! ./_getValue */ 47801);
|
|
|
|
|
|
/**
|
|
|
* Gets the native function at `key` of `object`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to query.
|
|
|
* @param {string} key The key of the method to get.
|
|
|
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
|
*/
|
|
|
function getNative(object, key) {
|
|
|
var value = getValue(object, key);
|
|
|
return baseIsNative(value) ? value : undefined;
|
|
|
}
|
|
|
|
|
|
module.exports = getNative;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 99551:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_getSymbols.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ 34963),
|
|
|
stubArray = __webpack_require__(/*! ./stubArray */ 70479);
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Built-in value references. */
|
|
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
|
|
|
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
|
|
|
|
/**
|
|
|
* Creates an array of the own enumerable symbols of `object`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} object The object to query.
|
|
|
* @returns {Array} Returns the array of symbols.
|
|
|
*/
|
|
|
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
|
if (object == null) {
|
|
|
return [];
|
|
|
}
|
|
|
object = Object(object);
|
|
|
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
|
return propertyIsEnumerable.call(object, symbol);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = getSymbols;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 64160:
|
|
|
/*!****************************************!*\
|
|
|
!*** ./node_modules/lodash/_getTag.js ***!
|
|
|
\****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var DataView = __webpack_require__(/*! ./_DataView */ 18552),
|
|
|
Map = __webpack_require__(/*! ./_Map */ 57071),
|
|
|
Promise = __webpack_require__(/*! ./_Promise */ 53818),
|
|
|
Set = __webpack_require__(/*! ./_Set */ 58525),
|
|
|
WeakMap = __webpack_require__(/*! ./_WeakMap */ 70577),
|
|
|
baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 44239),
|
|
|
toSource = __webpack_require__(/*! ./_toSource */ 80346);
|
|
|
|
|
|
/** `Object#toString` result references. */
|
|
|
var mapTag = '[object Map]',
|
|
|
objectTag = '[object Object]',
|
|
|
promiseTag = '[object Promise]',
|
|
|
setTag = '[object Set]',
|
|
|
weakMapTag = '[object WeakMap]';
|
|
|
|
|
|
var dataViewTag = '[object DataView]';
|
|
|
|
|
|
/** Used to detect maps, sets, and weakmaps. */
|
|
|
var dataViewCtorString = toSource(DataView),
|
|
|
mapCtorString = toSource(Map),
|
|
|
promiseCtorString = toSource(Promise),
|
|
|
setCtorString = toSource(Set),
|
|
|
weakMapCtorString = toSource(WeakMap);
|
|
|
|
|
|
/**
|
|
|
* Gets the `toStringTag` of `value`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to query.
|
|
|
* @returns {string} Returns the `toStringTag`.
|
|
|
*/
|
|
|
var getTag = baseGetTag;
|
|
|
|
|
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
|
(Map && getTag(new Map) != mapTag) ||
|
|
|
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
|
|
(Set && getTag(new Set) != setTag) ||
|
|
|
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
|
|
getTag = function(value) {
|
|
|
var result = baseGetTag(value),
|
|
|
Ctor = result == objectTag ? value.constructor : undefined,
|
|
|
ctorString = Ctor ? toSource(Ctor) : '';
|
|
|
|
|
|
if (ctorString) {
|
|
|
switch (ctorString) {
|
|
|
case dataViewCtorString: return dataViewTag;
|
|
|
case mapCtorString: return mapTag;
|
|
|
case promiseCtorString: return promiseTag;
|
|
|
case setCtorString: return setTag;
|
|
|
case weakMapCtorString: return weakMapTag;
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
};
|
|
|
}
|
|
|
|
|
|
module.exports = getTag;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 47801:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_getValue.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Gets the value at `key` of `object`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} [object] The object to query.
|
|
|
* @param {string} key The key of the property to get.
|
|
|
* @returns {*} Returns the property value.
|
|
|
*/
|
|
|
function getValue(object, key) {
|
|
|
return object == null ? undefined : object[key];
|
|
|
}
|
|
|
|
|
|
module.exports = getValue;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 51789:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_hashClear.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 94536);
|
|
|
|
|
|
/**
|
|
|
* Removes all key-value entries from the hash.
|
|
|
*
|
|
|
* @private
|
|
|
* @name clear
|
|
|
* @memberOf Hash
|
|
|
*/
|
|
|
function hashClear() {
|
|
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
|
this.size = 0;
|
|
|
}
|
|
|
|
|
|
module.exports = hashClear;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 80401:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_hashDelete.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Removes `key` and its value from the hash.
|
|
|
*
|
|
|
* @private
|
|
|
* @name delete
|
|
|
* @memberOf Hash
|
|
|
* @param {Object} hash The hash to modify.
|
|
|
* @param {string} key The key of the value to remove.
|
|
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
|
*/
|
|
|
function hashDelete(key) {
|
|
|
var result = this.has(key) && delete this.__data__[key];
|
|
|
this.size -= result ? 1 : 0;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = hashDelete;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 57667:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_hashGet.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 94536);
|
|
|
|
|
|
/** Used to stand-in for `undefined` hash values. */
|
|
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/**
|
|
|
* Gets the hash value for `key`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name get
|
|
|
* @memberOf Hash
|
|
|
* @param {string} key The key of the value to get.
|
|
|
* @returns {*} Returns the entry value.
|
|
|
*/
|
|
|
function hashGet(key) {
|
|
|
var data = this.__data__;
|
|
|
if (nativeCreate) {
|
|
|
var result = data[key];
|
|
|
return result === HASH_UNDEFINED ? undefined : result;
|
|
|
}
|
|
|
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
|
}
|
|
|
|
|
|
module.exports = hashGet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 21327:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_hashHas.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 94536);
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/**
|
|
|
* Checks if a hash value for `key` exists.
|
|
|
*
|
|
|
* @private
|
|
|
* @name has
|
|
|
* @memberOf Hash
|
|
|
* @param {string} key The key of the entry to check.
|
|
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
|
*/
|
|
|
function hashHas(key) {
|
|
|
var data = this.__data__;
|
|
|
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
|
}
|
|
|
|
|
|
module.exports = hashHas;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 81866:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_hashSet.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 94536);
|
|
|
|
|
|
/** Used to stand-in for `undefined` hash values. */
|
|
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
|
|
|
|
/**
|
|
|
* Sets the hash `key` to `value`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name set
|
|
|
* @memberOf Hash
|
|
|
* @param {string} key The key of the value to set.
|
|
|
* @param {*} value The value to set.
|
|
|
* @returns {Object} Returns the hash instance.
|
|
|
*/
|
|
|
function hashSet(key, value) {
|
|
|
var data = this.__data__;
|
|
|
this.size += this.has(key) ? 0 : 1;
|
|
|
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
module.exports = hashSet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 65776:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_isIndex.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/** Used as references for various `Number` constants. */
|
|
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
|
|
|
/** Used to detect unsigned integer values. */
|
|
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is a valid array-like index.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to check.
|
|
|
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
|
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
|
*/
|
|
|
function isIndex(value, length) {
|
|
|
var type = typeof value;
|
|
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
|
|
|
|
return !!length &&
|
|
|
(type == 'number' ||
|
|
|
(type != 'symbol' && reIsUint.test(value))) &&
|
|
|
(value > -1 && value % 1 == 0 && value < length);
|
|
|
}
|
|
|
|
|
|
module.exports = isIndex;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 37019:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/_isKeyable.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is suitable for use as unique object key.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
|
*/
|
|
|
function isKeyable(value) {
|
|
|
var type = typeof value;
|
|
|
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
|
? (value !== '__proto__')
|
|
|
: (value === null);
|
|
|
}
|
|
|
|
|
|
module.exports = isKeyable;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 15346:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_isMasked.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var coreJsData = __webpack_require__(/*! ./_coreJsData */ 14429);
|
|
|
|
|
|
/** Used to detect methods masquerading as native. */
|
|
|
var maskSrcKey = (function() {
|
|
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
|
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
|
}());
|
|
|
|
|
|
/**
|
|
|
* Checks if `func` has its source masked.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Function} func The function to check.
|
|
|
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
|
*/
|
|
|
function isMasked(func) {
|
|
|
return !!maskSrcKey && (maskSrcKey in func);
|
|
|
}
|
|
|
|
|
|
module.exports = isMasked;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 25726:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_isPrototype.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is likely a prototype object.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
|
*/
|
|
|
function isPrototype(value) {
|
|
|
var Ctor = value && value.constructor,
|
|
|
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
|
|
|
|
return value === proto;
|
|
|
}
|
|
|
|
|
|
module.exports = isPrototype;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 27040:
|
|
|
/*!************************************************!*\
|
|
|
!*** ./node_modules/lodash/_listCacheClear.js ***!
|
|
|
\************************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Removes all key-value entries from the list cache.
|
|
|
*
|
|
|
* @private
|
|
|
* @name clear
|
|
|
* @memberOf ListCache
|
|
|
*/
|
|
|
function listCacheClear() {
|
|
|
this.__data__ = [];
|
|
|
this.size = 0;
|
|
|
}
|
|
|
|
|
|
module.exports = listCacheClear;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 14125:
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/lodash/_listCacheDelete.js ***!
|
|
|
\*************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 18470);
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var arrayProto = Array.prototype;
|
|
|
|
|
|
/** Built-in value references. */
|
|
|
var splice = arrayProto.splice;
|
|
|
|
|
|
/**
|
|
|
* Removes `key` and its value from the list cache.
|
|
|
*
|
|
|
* @private
|
|
|
* @name delete
|
|
|
* @memberOf ListCache
|
|
|
* @param {string} key The key of the value to remove.
|
|
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
|
*/
|
|
|
function listCacheDelete(key) {
|
|
|
var data = this.__data__,
|
|
|
index = assocIndexOf(data, key);
|
|
|
|
|
|
if (index < 0) {
|
|
|
return false;
|
|
|
}
|
|
|
var lastIndex = data.length - 1;
|
|
|
if (index == lastIndex) {
|
|
|
data.pop();
|
|
|
} else {
|
|
|
splice.call(data, index, 1);
|
|
|
}
|
|
|
--this.size;
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
module.exports = listCacheDelete;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82117:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_listCacheGet.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 18470);
|
|
|
|
|
|
/**
|
|
|
* Gets the list cache value for `key`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name get
|
|
|
* @memberOf ListCache
|
|
|
* @param {string} key The key of the value to get.
|
|
|
* @returns {*} Returns the entry value.
|
|
|
*/
|
|
|
function listCacheGet(key) {
|
|
|
var data = this.__data__,
|
|
|
index = assocIndexOf(data, key);
|
|
|
|
|
|
return index < 0 ? undefined : data[index][1];
|
|
|
}
|
|
|
|
|
|
module.exports = listCacheGet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 67518:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_listCacheHas.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 18470);
|
|
|
|
|
|
/**
|
|
|
* Checks if a list cache value for `key` exists.
|
|
|
*
|
|
|
* @private
|
|
|
* @name has
|
|
|
* @memberOf ListCache
|
|
|
* @param {string} key The key of the entry to check.
|
|
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
|
*/
|
|
|
function listCacheHas(key) {
|
|
|
return assocIndexOf(this.__data__, key) > -1;
|
|
|
}
|
|
|
|
|
|
module.exports = listCacheHas;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 54705:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_listCacheSet.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 18470);
|
|
|
|
|
|
/**
|
|
|
* Sets the list cache `key` to `value`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name set
|
|
|
* @memberOf ListCache
|
|
|
* @param {string} key The key of the value to set.
|
|
|
* @param {*} value The value to set.
|
|
|
* @returns {Object} Returns the list cache instance.
|
|
|
*/
|
|
|
function listCacheSet(key, value) {
|
|
|
var data = this.__data__,
|
|
|
index = assocIndexOf(data, key);
|
|
|
|
|
|
if (index < 0) {
|
|
|
++this.size;
|
|
|
data.push([key, value]);
|
|
|
} else {
|
|
|
data[index][1] = value;
|
|
|
}
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
module.exports = listCacheSet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24785:
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./node_modules/lodash/_mapCacheClear.js ***!
|
|
|
\***********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var Hash = __webpack_require__(/*! ./_Hash */ 1989),
|
|
|
ListCache = __webpack_require__(/*! ./_ListCache */ 38407),
|
|
|
Map = __webpack_require__(/*! ./_Map */ 57071);
|
|
|
|
|
|
/**
|
|
|
* Removes all key-value entries from the map.
|
|
|
*
|
|
|
* @private
|
|
|
* @name clear
|
|
|
* @memberOf MapCache
|
|
|
*/
|
|
|
function mapCacheClear() {
|
|
|
this.size = 0;
|
|
|
this.__data__ = {
|
|
|
'hash': new Hash,
|
|
|
'map': new (Map || ListCache),
|
|
|
'string': new Hash
|
|
|
};
|
|
|
}
|
|
|
|
|
|
module.exports = mapCacheClear;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 11285:
|
|
|
/*!************************************************!*\
|
|
|
!*** ./node_modules/lodash/_mapCacheDelete.js ***!
|
|
|
\************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getMapData = __webpack_require__(/*! ./_getMapData */ 45050);
|
|
|
|
|
|
/**
|
|
|
* Removes `key` and its value from the map.
|
|
|
*
|
|
|
* @private
|
|
|
* @name delete
|
|
|
* @memberOf MapCache
|
|
|
* @param {string} key The key of the value to remove.
|
|
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
|
*/
|
|
|
function mapCacheDelete(key) {
|
|
|
var result = getMapData(this, key)['delete'](key);
|
|
|
this.size -= result ? 1 : 0;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = mapCacheDelete;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 96000:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_mapCacheGet.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getMapData = __webpack_require__(/*! ./_getMapData */ 45050);
|
|
|
|
|
|
/**
|
|
|
* Gets the map value for `key`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name get
|
|
|
* @memberOf MapCache
|
|
|
* @param {string} key The key of the value to get.
|
|
|
* @returns {*} Returns the entry value.
|
|
|
*/
|
|
|
function mapCacheGet(key) {
|
|
|
return getMapData(this, key).get(key);
|
|
|
}
|
|
|
|
|
|
module.exports = mapCacheGet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 49916:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_mapCacheHas.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getMapData = __webpack_require__(/*! ./_getMapData */ 45050);
|
|
|
|
|
|
/**
|
|
|
* Checks if a map value for `key` exists.
|
|
|
*
|
|
|
* @private
|
|
|
* @name has
|
|
|
* @memberOf MapCache
|
|
|
* @param {string} key The key of the entry to check.
|
|
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
|
*/
|
|
|
function mapCacheHas(key) {
|
|
|
return getMapData(this, key).has(key);
|
|
|
}
|
|
|
|
|
|
module.exports = mapCacheHas;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 95265:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_mapCacheSet.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getMapData = __webpack_require__(/*! ./_getMapData */ 45050);
|
|
|
|
|
|
/**
|
|
|
* Sets the map `key` to `value`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name set
|
|
|
* @memberOf MapCache
|
|
|
* @param {string} key The key of the value to set.
|
|
|
* @param {*} value The value to set.
|
|
|
* @returns {Object} Returns the map cache instance.
|
|
|
*/
|
|
|
function mapCacheSet(key, value) {
|
|
|
var data = getMapData(this, key),
|
|
|
size = data.size;
|
|
|
|
|
|
data.set(key, value);
|
|
|
this.size += data.size == size ? 0 : 1;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
module.exports = mapCacheSet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 68776:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_mapToArray.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Converts `map` to its key-value pairs.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} map The map to convert.
|
|
|
* @returns {Array} Returns the key-value pairs.
|
|
|
*/
|
|
|
function mapToArray(map) {
|
|
|
var index = -1,
|
|
|
result = Array(map.size);
|
|
|
|
|
|
map.forEach(function(value, key) {
|
|
|
result[++index] = [key, value];
|
|
|
});
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = mapToArray;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 94536:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/lodash/_nativeCreate.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var getNative = __webpack_require__(/*! ./_getNative */ 10852);
|
|
|
|
|
|
/* Built-in method references that are verified to be native. */
|
|
|
var nativeCreate = getNative(Object, 'create');
|
|
|
|
|
|
module.exports = nativeCreate;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 86916:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_nativeKeys.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var overArg = __webpack_require__(/*! ./_overArg */ 5569);
|
|
|
|
|
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
|
var nativeKeys = overArg(Object.keys, Object);
|
|
|
|
|
|
module.exports = nativeKeys;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 31167:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_nodeUtil.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
|
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 31957);
|
|
|
|
|
|
/** Detect free variable `exports`. */
|
|
|
var freeExports = true && exports && !exports.nodeType && exports;
|
|
|
|
|
|
/** Detect free variable `module`. */
|
|
|
var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
|
|
|
|
|
|
/** Detect the popular CommonJS extension `module.exports`. */
|
|
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
|
|
|
|
/** Detect free variable `process` from Node.js. */
|
|
|
var freeProcess = moduleExports && freeGlobal.process;
|
|
|
|
|
|
/** Used to access faster Node.js helpers. */
|
|
|
var nodeUtil = (function() {
|
|
|
try {
|
|
|
// Use `util.types` for Node.js 10+.
|
|
|
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
|
|
|
|
if (types) {
|
|
|
return types;
|
|
|
}
|
|
|
|
|
|
// Legacy `process.binding('util')` for Node.js < 10.
|
|
|
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
|
} catch (e) {}
|
|
|
}());
|
|
|
|
|
|
module.exports = nodeUtil;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 5569:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/_overArg.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Creates a unary function that invokes `func` with its argument transformed.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Function} func The function to wrap.
|
|
|
* @param {Function} transform The argument transform.
|
|
|
* @returns {Function} Returns the new function.
|
|
|
*/
|
|
|
function overArg(func, transform) {
|
|
|
return function(arg) {
|
|
|
return func(transform(arg));
|
|
|
};
|
|
|
}
|
|
|
|
|
|
module.exports = overArg;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 90619:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_setCacheAdd.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/** Used to stand-in for `undefined` hash values. */
|
|
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
|
|
|
|
/**
|
|
|
* Adds `value` to the array cache.
|
|
|
*
|
|
|
* @private
|
|
|
* @name add
|
|
|
* @memberOf SetCache
|
|
|
* @alias push
|
|
|
* @param {*} value The value to cache.
|
|
|
* @returns {Object} Returns the cache instance.
|
|
|
*/
|
|
|
function setCacheAdd(value) {
|
|
|
this.__data__.set(value, HASH_UNDEFINED);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
module.exports = setCacheAdd;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 72385:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_setCacheHas.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is in the array cache.
|
|
|
*
|
|
|
* @private
|
|
|
* @name has
|
|
|
* @memberOf SetCache
|
|
|
* @param {*} value The value to search for.
|
|
|
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
|
*/
|
|
|
function setCacheHas(value) {
|
|
|
return this.__data__.has(value);
|
|
|
}
|
|
|
|
|
|
module.exports = setCacheHas;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 21814:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_setToArray.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Converts `set` to an array of its values.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Object} set The set to convert.
|
|
|
* @returns {Array} Returns the values.
|
|
|
*/
|
|
|
function setToArray(set) {
|
|
|
var index = -1,
|
|
|
result = Array(set.size);
|
|
|
|
|
|
set.forEach(function(value) {
|
|
|
result[++index] = value;
|
|
|
});
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = setToArray;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 37465:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/_stackClear.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var ListCache = __webpack_require__(/*! ./_ListCache */ 38407);
|
|
|
|
|
|
/**
|
|
|
* Removes all key-value entries from the stack.
|
|
|
*
|
|
|
* @private
|
|
|
* @name clear
|
|
|
* @memberOf Stack
|
|
|
*/
|
|
|
function stackClear() {
|
|
|
this.__data__ = new ListCache;
|
|
|
this.size = 0;
|
|
|
}
|
|
|
|
|
|
module.exports = stackClear;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 63779:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/_stackDelete.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Removes `key` and its value from the stack.
|
|
|
*
|
|
|
* @private
|
|
|
* @name delete
|
|
|
* @memberOf Stack
|
|
|
* @param {string} key The key of the value to remove.
|
|
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
|
*/
|
|
|
function stackDelete(key) {
|
|
|
var data = this.__data__,
|
|
|
result = data['delete'](key);
|
|
|
|
|
|
this.size = data.size;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = stackDelete;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 67599:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_stackGet.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Gets the stack value for `key`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name get
|
|
|
* @memberOf Stack
|
|
|
* @param {string} key The key of the value to get.
|
|
|
* @returns {*} Returns the entry value.
|
|
|
*/
|
|
|
function stackGet(key) {
|
|
|
return this.__data__.get(key);
|
|
|
}
|
|
|
|
|
|
module.exports = stackGet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 44758:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_stackHas.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Checks if a stack value for `key` exists.
|
|
|
*
|
|
|
* @private
|
|
|
* @name has
|
|
|
* @memberOf Stack
|
|
|
* @param {string} key The key of the entry to check.
|
|
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
|
*/
|
|
|
function stackHas(key) {
|
|
|
return this.__data__.has(key);
|
|
|
}
|
|
|
|
|
|
module.exports = stackHas;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 34309:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_stackSet.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var ListCache = __webpack_require__(/*! ./_ListCache */ 38407),
|
|
|
Map = __webpack_require__(/*! ./_Map */ 57071),
|
|
|
MapCache = __webpack_require__(/*! ./_MapCache */ 83369);
|
|
|
|
|
|
/** Used as the size to enable large array optimizations. */
|
|
|
var LARGE_ARRAY_SIZE = 200;
|
|
|
|
|
|
/**
|
|
|
* Sets the stack `key` to `value`.
|
|
|
*
|
|
|
* @private
|
|
|
* @name set
|
|
|
* @memberOf Stack
|
|
|
* @param {string} key The key of the value to set.
|
|
|
* @param {*} value The value to set.
|
|
|
* @returns {Object} Returns the stack cache instance.
|
|
|
*/
|
|
|
function stackSet(key, value) {
|
|
|
var data = this.__data__;
|
|
|
if (data instanceof ListCache) {
|
|
|
var pairs = data.__data__;
|
|
|
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
|
pairs.push([key, value]);
|
|
|
this.size = ++data.size;
|
|
|
return this;
|
|
|
}
|
|
|
data = this.__data__ = new MapCache(pairs);
|
|
|
}
|
|
|
data.set(key, value);
|
|
|
this.size = data.size;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
module.exports = stackSet;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 80346:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/_toSource.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var funcProto = Function.prototype;
|
|
|
|
|
|
/** Used to resolve the decompiled source of functions. */
|
|
|
var funcToString = funcProto.toString;
|
|
|
|
|
|
/**
|
|
|
* Converts `func` to its source code.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Function} func The function to convert.
|
|
|
* @returns {string} Returns the source code.
|
|
|
*/
|
|
|
function toSource(func) {
|
|
|
if (func != null) {
|
|
|
try {
|
|
|
return funcToString.call(func);
|
|
|
} catch (e) {}
|
|
|
try {
|
|
|
return (func + '');
|
|
|
} catch (e) {}
|
|
|
}
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
module.exports = toSource;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 77813:
|
|
|
/*!***********************************!*\
|
|
|
!*** ./node_modules/lodash/eq.js ***!
|
|
|
\***********************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Performs a
|
|
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
|
* comparison between two values to determine if they are equivalent.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 4.0.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to compare.
|
|
|
* @param {*} other The other value to compare.
|
|
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* var object = { 'a': 1 };
|
|
|
* var other = { 'a': 1 };
|
|
|
*
|
|
|
* _.eq(object, object);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.eq(object, other);
|
|
|
* // => false
|
|
|
*
|
|
|
* _.eq('a', 'a');
|
|
|
* // => true
|
|
|
*
|
|
|
* _.eq('a', Object('a'));
|
|
|
* // => false
|
|
|
*
|
|
|
* _.eq(NaN, NaN);
|
|
|
* // => true
|
|
|
*/
|
|
|
function eq(value, other) {
|
|
|
return value === other || (value !== value && other !== other);
|
|
|
}
|
|
|
|
|
|
module.exports = eq;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 35694:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/isArguments.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ 9454),
|
|
|
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 37005);
|
|
|
|
|
|
/** Used for built-in method references. */
|
|
|
var objectProto = Object.prototype;
|
|
|
|
|
|
/** Used to check objects for own properties. */
|
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
|
|
/** Built-in value references. */
|
|
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is likely an `arguments` object.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 0.1.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
|
* else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isArguments(function() { return arguments; }());
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isArguments([1, 2, 3]);
|
|
|
* // => false
|
|
|
*/
|
|
|
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
|
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
|
|
!propertyIsEnumerable.call(value, 'callee');
|
|
|
};
|
|
|
|
|
|
module.exports = isArguments;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1469:
|
|
|
/*!****************************************!*\
|
|
|
!*** ./node_modules/lodash/isArray.js ***!
|
|
|
\****************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is classified as an `Array` object.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 0.1.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isArray([1, 2, 3]);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isArray(document.body.children);
|
|
|
* // => false
|
|
|
*
|
|
|
* _.isArray('abc');
|
|
|
* // => false
|
|
|
*
|
|
|
* _.isArray(_.noop);
|
|
|
* // => false
|
|
|
*/
|
|
|
var isArray = Array.isArray;
|
|
|
|
|
|
module.exports = isArray;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 98612:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/lodash/isArrayLike.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var isFunction = __webpack_require__(/*! ./isFunction */ 23560),
|
|
|
isLength = __webpack_require__(/*! ./isLength */ 41780);
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
|
* not a function and has a `value.length` that's an integer greater than or
|
|
|
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 4.0.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isArrayLike([1, 2, 3]);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isArrayLike(document.body.children);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isArrayLike('abc');
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isArrayLike(_.noop);
|
|
|
* // => false
|
|
|
*/
|
|
|
function isArrayLike(value) {
|
|
|
return value != null && isLength(value.length) && !isFunction(value);
|
|
|
}
|
|
|
|
|
|
module.exports = isArrayLike;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 44144:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/isBuffer.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
|
var root = __webpack_require__(/*! ./_root */ 55639),
|
|
|
stubFalse = __webpack_require__(/*! ./stubFalse */ 95062);
|
|
|
|
|
|
/** Detect free variable `exports`. */
|
|
|
var freeExports = true && exports && !exports.nodeType && exports;
|
|
|
|
|
|
/** Detect free variable `module`. */
|
|
|
var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
|
|
|
|
|
|
/** Detect the popular CommonJS extension `module.exports`. */
|
|
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
|
|
|
|
/** Built-in value references. */
|
|
|
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
|
|
|
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
|
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is a buffer.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 4.3.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isBuffer(new Buffer(2));
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isBuffer(new Uint8Array(2));
|
|
|
* // => false
|
|
|
*/
|
|
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
|
|
|
|
module.exports = isBuffer;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 18446:
|
|
|
/*!****************************************!*\
|
|
|
!*** ./node_modules/lodash/isEqual.js ***!
|
|
|
\****************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 90939);
|
|
|
|
|
|
/**
|
|
|
* Performs a deep comparison between two values to determine if they are
|
|
|
* equivalent.
|
|
|
*
|
|
|
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
|
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
|
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
|
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
|
* nodes are compared by strict equality, i.e. `===`.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 0.1.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to compare.
|
|
|
* @param {*} other The other value to compare.
|
|
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* var object = { 'a': 1 };
|
|
|
* var other = { 'a': 1 };
|
|
|
*
|
|
|
* _.isEqual(object, other);
|
|
|
* // => true
|
|
|
*
|
|
|
* object === other;
|
|
|
* // => false
|
|
|
*/
|
|
|
function isEqual(value, other) {
|
|
|
return baseIsEqual(value, other);
|
|
|
}
|
|
|
|
|
|
module.exports = isEqual;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 23560:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/lodash/isFunction.js ***!
|
|
|
\*******************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 44239),
|
|
|
isObject = __webpack_require__(/*! ./isObject */ 13218);
|
|
|
|
|
|
/** `Object#toString` result references. */
|
|
|
var asyncTag = '[object AsyncFunction]',
|
|
|
funcTag = '[object Function]',
|
|
|
genTag = '[object GeneratorFunction]',
|
|
|
proxyTag = '[object Proxy]';
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is classified as a `Function` object.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 0.1.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isFunction(_);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isFunction(/abc/);
|
|
|
* // => false
|
|
|
*/
|
|
|
function isFunction(value) {
|
|
|
if (!isObject(value)) {
|
|
|
return false;
|
|
|
}
|
|
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
|
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
|
var tag = baseGetTag(value);
|
|
|
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
|
}
|
|
|
|
|
|
module.exports = isFunction;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 41780:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/lodash/isLength.js ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/** Used as references for various `Number` constants. */
|
|
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is a valid array-like length.
|
|
|
*
|
|
|
* **Note:** This method is loosely based on
|
|
|
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 4.0.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isLength(3);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isLength(Number.MIN_VALUE);
|
|
|
* // => false
|
|
|
*
|
|
|
* _.isLength(Infinity);
|
|
|
* // => false
|
|
|
*
|
|
|
* _.isLength('3');
|
|
|
* // => false
|
|
|
*/
|
|
|
function isLength(value) {
|
|
|
return typeof value == 'number' &&
|
|
|
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
|
}
|
|
|
|
|
|
module.exports = isLength;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 36719:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/lodash/isTypedArray.js ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ 38749),
|
|
|
baseUnary = __webpack_require__(/*! ./_baseUnary */ 7518),
|
|
|
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ 31167);
|
|
|
|
|
|
/* Node.js helper references. */
|
|
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
|
|
|
|
/**
|
|
|
* Checks if `value` is classified as a typed array.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 3.0.0
|
|
|
* @category Lang
|
|
|
* @param {*} value The value to check.
|
|
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.isTypedArray(new Uint8Array);
|
|
|
* // => true
|
|
|
*
|
|
|
* _.isTypedArray([]);
|
|
|
* // => false
|
|
|
*/
|
|
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
|
|
|
|
module.exports = isTypedArray;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 3674:
|
|
|
/*!*************************************!*\
|
|
|
!*** ./node_modules/lodash/keys.js ***!
|
|
|
\*************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ 14636),
|
|
|
baseKeys = __webpack_require__(/*! ./_baseKeys */ 280),
|
|
|
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 98612);
|
|
|
|
|
|
/**
|
|
|
* Creates an array of the own enumerable property names of `object`.
|
|
|
*
|
|
|
* **Note:** Non-object values are coerced to objects. See the
|
|
|
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
|
* for more details.
|
|
|
*
|
|
|
* @static
|
|
|
* @since 0.1.0
|
|
|
* @memberOf _
|
|
|
* @category Object
|
|
|
* @param {Object} object The object to query.
|
|
|
* @returns {Array} Returns the array of property names.
|
|
|
* @example
|
|
|
*
|
|
|
* function Foo() {
|
|
|
* this.a = 1;
|
|
|
* this.b = 2;
|
|
|
* }
|
|
|
*
|
|
|
* Foo.prototype.c = 3;
|
|
|
*
|
|
|
* _.keys(new Foo);
|
|
|
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
|
*
|
|
|
* _.keys('hi');
|
|
|
* // => ['0', '1']
|
|
|
*/
|
|
|
function keys(object) {
|
|
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
|
}
|
|
|
|
|
|
module.exports = keys;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 70479:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/stubArray.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* This method returns a new empty array.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 4.13.0
|
|
|
* @category Util
|
|
|
* @returns {Array} Returns the new empty array.
|
|
|
* @example
|
|
|
*
|
|
|
* var arrays = _.times(2, _.stubArray);
|
|
|
*
|
|
|
* console.log(arrays);
|
|
|
* // => [[], []]
|
|
|
*
|
|
|
* console.log(arrays[0] === arrays[1]);
|
|
|
* // => false
|
|
|
*/
|
|
|
function stubArray() {
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
module.exports = stubArray;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 95062:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/lodash/stubFalse.js ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
/**
|
|
|
* This method returns `false`.
|
|
|
*
|
|
|
* @static
|
|
|
* @memberOf _
|
|
|
* @since 4.13.0
|
|
|
* @category Util
|
|
|
* @returns {boolean} Returns `false`.
|
|
|
* @example
|
|
|
*
|
|
|
* _.times(2, _.stubFalse);
|
|
|
* // => [false, false]
|
|
|
*/
|
|
|
function stubFalse() {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
module.exports = stubFalse;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 27678:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/css.js ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "g1": function() { return /* binding */ getClientSize; },
|
|
|
/* harmony export */ "os": function() { return /* binding */ getOffset; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony exports get, set, getOuterWidth, getOuterHeight, getDocSize, getScroll */
|
|
|
/* eslint-disable no-nested-ternary */
|
|
|
var PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;
|
|
|
var removePixel = {
|
|
|
left: true,
|
|
|
top: true
|
|
|
};
|
|
|
var floatMap = {
|
|
|
cssFloat: 1,
|
|
|
styleFloat: 1,
|
|
|
float: 1
|
|
|
};
|
|
|
function getComputedStyle(node) {
|
|
|
return node.nodeType === 1 ? node.ownerDocument.defaultView.getComputedStyle(node, null) : {};
|
|
|
}
|
|
|
function getStyleValue(node, type, value) {
|
|
|
type = type.toLowerCase();
|
|
|
if (value === 'auto') {
|
|
|
if (type === 'height') {
|
|
|
return node.offsetHeight;
|
|
|
}
|
|
|
if (type === 'width') {
|
|
|
return node.offsetWidth;
|
|
|
}
|
|
|
}
|
|
|
if (!(type in removePixel)) {
|
|
|
removePixel[type] = PIXEL_PATTERN.test(type);
|
|
|
}
|
|
|
return removePixel[type] ? parseFloat(value) || 0 : value;
|
|
|
}
|
|
|
function get(node, name) {
|
|
|
var length = arguments.length;
|
|
|
var style = getComputedStyle(node);
|
|
|
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
|
|
|
return length === 1 ? style : getStyleValue(node, name, style[name] || node.style[name]);
|
|
|
}
|
|
|
function set(node, name, value) {
|
|
|
var length = arguments.length;
|
|
|
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
|
|
|
if (length === 3) {
|
|
|
if (typeof value === 'number' && PIXEL_PATTERN.test(name)) {
|
|
|
value = "".concat(value, "px");
|
|
|
}
|
|
|
node.style[name] = value; // Number
|
|
|
return value;
|
|
|
}
|
|
|
for (var x in name) {
|
|
|
if (name.hasOwnProperty(x)) {
|
|
|
set(node, x, name[x]);
|
|
|
}
|
|
|
}
|
|
|
return getComputedStyle(node);
|
|
|
}
|
|
|
function getOuterWidth(el) {
|
|
|
if (el === document.body) {
|
|
|
return document.documentElement.clientWidth;
|
|
|
}
|
|
|
return el.offsetWidth;
|
|
|
}
|
|
|
function getOuterHeight(el) {
|
|
|
if (el === document.body) {
|
|
|
return window.innerHeight || document.documentElement.clientHeight;
|
|
|
}
|
|
|
return el.offsetHeight;
|
|
|
}
|
|
|
function getDocSize() {
|
|
|
var width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
|
|
|
var height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
|
|
|
return {
|
|
|
width: width,
|
|
|
height: height
|
|
|
};
|
|
|
}
|
|
|
function getClientSize() {
|
|
|
var width = document.documentElement.clientWidth;
|
|
|
var height = window.innerHeight || document.documentElement.clientHeight;
|
|
|
return {
|
|
|
width: width,
|
|
|
height: height
|
|
|
};
|
|
|
}
|
|
|
function getScroll() {
|
|
|
return {
|
|
|
scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),
|
|
|
scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)
|
|
|
};
|
|
|
}
|
|
|
function getOffset(node) {
|
|
|
var box = node.getBoundingClientRect();
|
|
|
var docElem = document.documentElement;
|
|
|
|
|
|
// < ie8 不支持 win.pageXOffset, 则使用 docElem.scrollLeft
|
|
|
return {
|
|
|
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
|
|
|
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
|
|
|
};
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 79370:
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/styleChecker.js ***!
|
|
|
\*****************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "G": function() { return /* binding */ isStyleSupport; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _canUseDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./canUseDom */ 98924);
|
|
|
|
|
|
var isStyleNameSupport = function isStyleNameSupport(styleName) {
|
|
|
if ((0,_canUseDom__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)() && window.document.documentElement) {
|
|
|
var styleNameList = Array.isArray(styleName) ? styleName : [styleName];
|
|
|
var documentElement = window.document.documentElement;
|
|
|
return styleNameList.some(function (name) {
|
|
|
return name in documentElement.style;
|
|
|
});
|
|
|
}
|
|
|
return false;
|
|
|
};
|
|
|
var isStyleValueSupport = function isStyleValueSupport(styleName, value) {
|
|
|
if (!isStyleNameSupport(styleName)) {
|
|
|
return false;
|
|
|
}
|
|
|
var ele = document.createElement('div');
|
|
|
var origin = ele.style[styleName];
|
|
|
ele.style[styleName] = value;
|
|
|
return ele.style[styleName] !== origin;
|
|
|
};
|
|
|
function isStyleSupport(styleName, styleValue) {
|
|
|
if (!Array.isArray(styleName) && styleValue !== undefined) {
|
|
|
return isStyleValueSupport(styleName, styleValue);
|
|
|
}
|
|
|
return isStyleNameSupport(styleName);
|
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |