|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1710],{
|
|
|
|
|
|
/***/ 59477:
|
|
|
/*!*********************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CaretUpOutlined.js + 1 modules ***!
|
|
|
\*********************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_CaretUpOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(14809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/CaretUpOutlined.js
|
|
|
// 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 */ var asn_CaretUpOutlined = (CaretUpOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(7657);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CaretUpOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CaretUpOutlined_CaretUpOutlined = function CaretUpOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_CaretUpOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(CaretUpOutlined_CaretUpOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_CaretUpOutlined = (RefIcon);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8657:
|
|
|
/*!************************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/FolderOpenOutlined.js + 1 modules ***!
|
|
|
\************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_FolderOpenOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(14809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/FolderOpenOutlined.js
|
|
|
// 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 */ var asn_FolderOpenOutlined = (FolderOpenOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(7657);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/FolderOpenOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FolderOpenOutlined_FolderOpenOutlined = function FolderOpenOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_FolderOpenOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(FolderOpenOutlined_FolderOpenOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_FolderOpenOutlined = (RefIcon);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 50371:
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/extendsObject.js ***!
|
|
|
\*****************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
function extendsObject() {
|
|
|
const result = Object.assign({}, arguments.length <= 0 ? undefined : arguments[0]);
|
|
|
for (let i = 1; i < arguments.length; i++) {
|
|
|
const obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
|
|
|
if (obj) {
|
|
|
Object.keys(obj).forEach(key => {
|
|
|
const val = obj[key];
|
|
|
if (val !== undefined) {
|
|
|
result[key] = val;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
/* harmony default export */ __webpack_exports__.Z = (extendsObject);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 13845:
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/getScroll.js ***!
|
|
|
\*************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* 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;
|
|
|
}
|
|
|
const method = top ? 'scrollTop' : 'scrollLeft';
|
|
|
let 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;
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 68031:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/scrollTo.js + 1 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ scrollTo; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/raf.js
|
|
|
var raf = __webpack_require__(16089);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/easings.js
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
|
function easeInOutCubic(t, b, c, d) {
|
|
|
const 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@5.9.0@antd/es/_util/getScroll.js
|
|
|
var getScroll = __webpack_require__(13845);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/scrollTo.js
|
|
|
|
|
|
|
|
|
|
|
|
function scrollTo(y) {
|
|
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
|
const {
|
|
|
getContainer = () => window,
|
|
|
callback,
|
|
|
duration = 450
|
|
|
} = options;
|
|
|
const container = getContainer();
|
|
|
const scrollTop = (0,getScroll/* default */.Z)(container, true);
|
|
|
const startTime = Date.now();
|
|
|
const frameFunc = () => {
|
|
|
const timestamp = Date.now();
|
|
|
const time = timestamp - startTime;
|
|
|
const 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);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24905:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_checkbox; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js
|
|
|
var es = __webpack_require__(5630);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var config_provider_context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
|
var DisabledContext = __webpack_require__(1684);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
|
|
|
var context = __webpack_require__(32441);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/GroupContext.js
|
|
|
|
|
|
const GroupContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
|
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js
|
|
|
var checkbox_style = __webpack_require__(98447);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
|
var wave = __webpack_require__(14088);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/interface.js
|
|
|
var wave_interface = __webpack_require__(4572);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Checkbox.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalCheckbox = (props, ref) => {
|
|
|
var _a;
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
indeterminate = false,
|
|
|
style,
|
|
|
onMouseEnter,
|
|
|
onMouseLeave,
|
|
|
skipGroup = false,
|
|
|
disabled
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
checkbox
|
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const checkboxGroup = _react_17_0_2_react.useContext(checkbox_GroupContext);
|
|
|
const {
|
|
|
isFormItemInput
|
|
|
} = _react_17_0_2_react.useContext(context/* FormItemInputContext */.aM);
|
|
|
const contextDisabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
|
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
|
|
|
const prevValue = _react_17_0_2_react.useRef(restProps.value);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
false ? 0 : void 0;
|
|
|
}, []);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (skipGroup) {
|
|
|
return;
|
|
|
}
|
|
|
if (restProps.value !== prevValue.current) {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
prevValue.current = restProps.value;
|
|
|
}
|
|
|
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
|
}, [restProps.value]);
|
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
|
const checkboxProps = Object.assign({}, restProps);
|
|
|
if (checkboxGroup && !skipGroup) {
|
|
|
checkboxProps.onChange = function () {
|
|
|
if (restProps.onChange) {
|
|
|
restProps.onChange.apply(restProps, arguments);
|
|
|
}
|
|
|
if (checkboxGroup.toggleOption) {
|
|
|
checkboxGroup.toggleOption({
|
|
|
label: children,
|
|
|
value: restProps.value
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
checkboxProps.name = checkboxGroup.name;
|
|
|
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
|
|
|
}
|
|
|
const classString = _classnames_2_5_1_classnames_default()(`${prefixCls}-wrapper`, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
|
|
|
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
|
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
|
|
|
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
|
|
|
const checkboxClass = _classnames_2_5_1_classnames_default()({
|
|
|
[`${prefixCls}-indeterminate`]: indeterminate
|
|
|
}, wave_interface/* TARGET_CLS */.A, hashId);
|
|
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
|
component: "Checkbox",
|
|
|
disabled: mergedDisabled
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("label", {
|
|
|
className: classString,
|
|
|
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
|
|
|
"aria-checked": ariaChecked
|
|
|
}, checkboxProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
className: checkboxClass,
|
|
|
disabled: mergedDisabled,
|
|
|
ref: ref
|
|
|
})), children !== undefined && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children))));
|
|
|
};
|
|
|
const Checkbox = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalCheckbox);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(95190);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(2738);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Group.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
var Group_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalGroup = (props, ref) => {
|
|
|
const {
|
|
|
defaultValue,
|
|
|
children,
|
|
|
options = [],
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
onChange
|
|
|
} = props,
|
|
|
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const [value, setValue] = _react_17_0_2_react.useState(restProps.value || defaultValue || []);
|
|
|
const [registeredValues, setRegisteredValues] = _react_17_0_2_react.useState([]);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('value' in restProps) {
|
|
|
setValue(restProps.value || []);
|
|
|
}
|
|
|
}, [restProps.value]);
|
|
|
const memoOptions = _react_17_0_2_react.useMemo(() => options.map(option => {
|
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
|
return {
|
|
|
label: option,
|
|
|
value: option
|
|
|
};
|
|
|
}
|
|
|
return option;
|
|
|
}), [options]);
|
|
|
const cancelValue = val => {
|
|
|
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
|
|
|
};
|
|
|
const registerValue = val => {
|
|
|
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
|
|
|
};
|
|
|
const toggleOption = option => {
|
|
|
const optionIndex = value.indexOf(option.value);
|
|
|
const newValue = (0,toConsumableArray/* default */.Z)(value);
|
|
|
if (optionIndex === -1) {
|
|
|
newValue.push(option.value);
|
|
|
} else {
|
|
|
newValue.splice(optionIndex, 1);
|
|
|
}
|
|
|
if (!('value' in restProps)) {
|
|
|
setValue(newValue);
|
|
|
}
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
|
|
|
const indexA = memoOptions.findIndex(opt => opt.value === a);
|
|
|
const indexB = memoOptions.findIndex(opt => opt.value === b);
|
|
|
return indexA - indexB;
|
|
|
}));
|
|
|
};
|
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
|
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
|
|
|
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_Checkbox, {
|
|
|
prefixCls: prefixCls,
|
|
|
key: option.value.toString(),
|
|
|
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
|
|
|
value: option.value,
|
|
|
checked: value.includes(option.value),
|
|
|
onChange: option.onChange,
|
|
|
className: `${groupPrefixCls}-item`,
|
|
|
style: option.style,
|
|
|
title: option.title
|
|
|
}, option.label)) : children;
|
|
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
|
const context = {
|
|
|
toggleOption,
|
|
|
value,
|
|
|
disabled: restProps.disabled,
|
|
|
name: restProps.name,
|
|
|
// https://github.com/ant-design/ant-design/issues/16376
|
|
|
registerValue,
|
|
|
cancelValue
|
|
|
};
|
|
|
const classString = _classnames_2_5_1_classnames_default()(groupPrefixCls, {
|
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, className, rootClassName, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
className: classString,
|
|
|
style: style
|
|
|
}, domProps, {
|
|
|
ref: ref
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_GroupContext.Provider, {
|
|
|
value: context
|
|
|
}, childrenNode)));
|
|
|
};
|
|
|
|
|
|
const CheckboxGroup = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalGroup);
|
|
|
/* harmony default export */ var Group = (/*#__PURE__*/_react_17_0_2_react.memo(CheckboxGroup));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const es_checkbox_Checkbox = checkbox_Checkbox;
|
|
|
es_checkbox_Checkbox.Group = Group;
|
|
|
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1710:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules ***!
|
|
|
\**********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ table; }
|
|
|
});
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/constant.js
|
|
|
var EXPAND_COLUMN = {};
|
|
|
var INTERNAL_HOOKS = 'rc-table-internal-hook';
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__(50298);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/hooks/useEvent.js
|
|
|
var useEvent = __webpack_require__(6089);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/hooks/useLayoutEffect.js
|
|
|
var useLayoutEffect = __webpack_require__(34280);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/isEqual.js
|
|
|
var isEqual = __webpack_require__(13697);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-dom@17.0.2@react-dom/index.js
|
|
|
var _react_dom_17_0_2_react_dom = __webpack_require__(4676);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@rc-component_context@1.4.0@@rc-component/context/es/context.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createContext(defaultValue) {
|
|
|
var Context = /*#__PURE__*/_react_17_0_2_react.createContext(undefined);
|
|
|
var Provider = function Provider(_ref) {
|
|
|
var value = _ref.value,
|
|
|
children = _ref.children;
|
|
|
var valueRef = _react_17_0_2_react.useRef(value);
|
|
|
valueRef.current = value;
|
|
|
var _React$useState = _react_17_0_2_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 () {
|
|
|
(0,_react_dom_17_0_2_react_dom.unstable_batchedUpdates)(function () {
|
|
|
context.listeners.forEach(function (listener) {
|
|
|
listener(value);
|
|
|
});
|
|
|
});
|
|
|
}, [value]);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Context.Provider, {
|
|
|
value: context
|
|
|
}, children);
|
|
|
};
|
|
|
return {
|
|
|
Context: Context,
|
|
|
Provider: Provider,
|
|
|
defaultValue: defaultValue
|
|
|
};
|
|
|
}
|
|
|
|
|
|
/** e.g. useSelect(userContext) => user */
|
|
|
|
|
|
/** e.g. useSelect(userContext, user => user.name) => user.name */
|
|
|
|
|
|
/** e.g. useSelect(userContext, ['name', 'age']) => user { name, age } */
|
|
|
|
|
|
/** e.g. useSelect(userContext, 'name') => user.name */
|
|
|
|
|
|
function useContext(holder, selector) {
|
|
|
var eventSelector = (0,useEvent/* default */.Z)(typeof selector === 'function' ? selector : function (ctx) {
|
|
|
if (selector === undefined) {
|
|
|
return ctx;
|
|
|
}
|
|
|
if (!Array.isArray(selector)) {
|
|
|
return ctx[selector];
|
|
|
}
|
|
|
var obj = {};
|
|
|
selector.forEach(function (key) {
|
|
|
obj[key] = ctx[key];
|
|
|
});
|
|
|
return obj;
|
|
|
});
|
|
|
var context = _react_17_0_2_react.useContext(holder === null || holder === void 0 ? void 0 : holder.Context);
|
|
|
var _ref2 = context || {},
|
|
|
listeners = _ref2.listeners,
|
|
|
getValue = _ref2.getValue;
|
|
|
var valueRef = _react_17_0_2_react.useRef();
|
|
|
valueRef.current = eventSelector(context ? getValue() : holder === null || holder === void 0 ? void 0 : holder.defaultValue);
|
|
|
var _React$useState3 = _react_17_0_2_react.useState({}),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
forceUpdate = _React$useState4[1];
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
|
if (!context) {
|
|
|
return;
|
|
|
}
|
|
|
function trigger(nextValue) {
|
|
|
var nextSelectorValue = eventSelector(nextValue);
|
|
|
if (!(0,isEqual/* default */.Z)(valueRef.current, nextSelectorValue, true)) {
|
|
|
forceUpdate({});
|
|
|
}
|
|
|
}
|
|
|
listeners.add(trigger);
|
|
|
return function () {
|
|
|
listeners.delete(trigger);
|
|
|
};
|
|
|
}, [context]);
|
|
|
return valueRef.current;
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(14809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(8654);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@rc-component_context@1.4.0@@rc-component/context/es/Immutable.js
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Create Immutable pair for `makeImmutable` and `responseImmutable`.
|
|
|
*/
|
|
|
function createImmutable() {
|
|
|
var ImmutableContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
|
|
|
|
/**
|
|
|
* Get render update mark by `makeImmutable` root.
|
|
|
* Do not deps on the return value as render times
|
|
|
* but only use for `useMemo` or `useCallback` deps.
|
|
|
*/
|
|
|
function useImmutableMark() {
|
|
|
return _react_17_0_2_react.useContext(ImmutableContext);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Wrapped Component will be marked as Immutable.
|
|
|
* When Component parent trigger render,
|
|
|
* it will notice children component (use with `responseImmutable`) node that parent has updated.
|
|
|
* @param Component Passed Component
|
|
|
* @param triggerRender Customize trigger `responseImmutable` children re-render logic. Default will always trigger re-render when this component re-render.
|
|
|
*/
|
|
|
function makeImmutable(Component, shouldTriggerRender) {
|
|
|
var refAble = (0,es_ref/* supportRef */.Yr)(Component);
|
|
|
var ImmutableComponent = function ImmutableComponent(props, ref) {
|
|
|
var refProps = refAble ? {
|
|
|
ref: ref
|
|
|
} : {};
|
|
|
var renderTimesRef = _react_17_0_2_react.useRef(0);
|
|
|
var prevProps = _react_17_0_2_react.useRef(props);
|
|
|
|
|
|
// If parent has the context, we do not wrap it
|
|
|
var mark = useImmutableMark();
|
|
|
if (mark !== null) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Component, (0,esm_extends/* default */.Z)({}, props, refProps));
|
|
|
}
|
|
|
if (
|
|
|
// Always trigger re-render if not provide `notTriggerRender`
|
|
|
!shouldTriggerRender || shouldTriggerRender(prevProps.current, props)) {
|
|
|
renderTimesRef.current += 1;
|
|
|
}
|
|
|
prevProps.current = props;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(ImmutableContext.Provider, {
|
|
|
value: renderTimesRef.current
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(Component, (0,esm_extends/* default */.Z)({}, props, refProps)));
|
|
|
};
|
|
|
if (false) {}
|
|
|
return refAble ? /*#__PURE__*/_react_17_0_2_react.forwardRef(ImmutableComponent) : ImmutableComponent;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Wrapped Component with `React.memo`.
|
|
|
* But will rerender when parent with `makeImmutable` rerender.
|
|
|
*/
|
|
|
function responseImmutable(Component, propsAreEqual) {
|
|
|
var refAble = (0,es_ref/* supportRef */.Yr)(Component);
|
|
|
var ImmutableComponent = function ImmutableComponent(props, ref) {
|
|
|
var refProps = refAble ? {
|
|
|
ref: ref
|
|
|
} : {};
|
|
|
useImmutableMark();
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Component, (0,esm_extends/* default */.Z)({}, props, refProps));
|
|
|
};
|
|
|
if (false) {}
|
|
|
return refAble ? /*#__PURE__*/_react_17_0_2_react.memo( /*#__PURE__*/_react_17_0_2_react.forwardRef(ImmutableComponent), propsAreEqual) : /*#__PURE__*/_react_17_0_2_react.memo(ImmutableComponent, propsAreEqual);
|
|
|
}
|
|
|
return {
|
|
|
makeImmutable: makeImmutable,
|
|
|
responseImmutable: responseImmutable,
|
|
|
useImmutableMark: useImmutableMark
|
|
|
};
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@rc-component_context@1.4.0@@rc-component/context/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
// For legacy usage, we export it directly
|
|
|
var _createImmutable = createImmutable(),
|
|
|
makeImmutable = _createImmutable.makeImmutable,
|
|
|
responseImmutable = _createImmutable.responseImmutable,
|
|
|
useImmutableMark = _createImmutable.useImmutableMark;
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/context/TableContext.js
|
|
|
|
|
|
var TableContext_createImmutable = createImmutable(),
|
|
|
TableContext_makeImmutable = TableContext_createImmutable.makeImmutable,
|
|
|
TableContext_responseImmutable = TableContext_createImmutable.responseImmutable,
|
|
|
TableContext_useImmutableMark = TableContext_createImmutable.useImmutableMark;
|
|
|
|
|
|
var TableContext = createContext();
|
|
|
/* harmony default export */ var context_TableContext = (TableContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useRenderTimes.js
|
|
|
/* istanbul ignore file */
|
|
|
|
|
|
function useRenderTimes(props, debug) {
|
|
|
// Render times
|
|
|
var timesRef = _react_17_0_2_react.useRef(0);
|
|
|
timesRef.current += 1;
|
|
|
|
|
|
// Props changed
|
|
|
var propsRef = _react_17_0_2_react.useRef(props);
|
|
|
var keys = [];
|
|
|
Object.keys(props || {}).map(function (key) {
|
|
|
var _propsRef$current;
|
|
|
if ((props === null || props === void 0 ? void 0 : props[key]) !== ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current[key])) {
|
|
|
keys.push(key);
|
|
|
}
|
|
|
});
|
|
|
propsRef.current = props;
|
|
|
|
|
|
// Cache keys since React rerender may cause it lost
|
|
|
var keysRef = _react_17_0_2_react.useRef([]);
|
|
|
if (keys.length) {
|
|
|
keysRef.current = keys;
|
|
|
}
|
|
|
_react_17_0_2_react.useDebugValue(timesRef.current);
|
|
|
_react_17_0_2_react.useDebugValue(keysRef.current.join(', '));
|
|
|
if (debug) {
|
|
|
console.log("".concat(debug, ":"), timesRef.current, keysRef.current);
|
|
|
}
|
|
|
return timesRef.current;
|
|
|
}
|
|
|
/* harmony default export */ var hooks_useRenderTimes = ((/* unused pure expression or super */ null && ( false ? 0 : function () {})));
|
|
|
var RenderBlock = /*#__PURE__*/_react_17_0_2_react.memo(function () {
|
|
|
var times = useRenderTimes();
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("h1", null, "Render Times: ", times);
|
|
|
});
|
|
|
RenderBlock.displayName = 'RenderBlock';
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__(93664);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(20439);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(4635);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/hooks/useMemo.js
|
|
|
var useMemo = __webpack_require__(80547);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/utils/get.js
|
|
|
var get = __webpack_require__(97938);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/warning.js
|
|
|
var es_warning = __webpack_require__(48736);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/context/PerfContext.js
|
|
|
|
|
|
// TODO: Remove when use `responsiveImmutable`
|
|
|
var PerfContext = /*#__PURE__*/_react_17_0_2_react.createContext({
|
|
|
renderWithProps: false
|
|
|
});
|
|
|
/* harmony default export */ var context_PerfContext = (PerfContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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 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@7.33.4@rc-table/es/Cell/useCellRender.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isRenderCell(data) {
|
|
|
return data && (0,esm_typeof/* default */.Z)(data) === 'object' && !Array.isArray(data) && ! /*#__PURE__*/_react_17_0_2_react.isValidElement(data);
|
|
|
}
|
|
|
function useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate) {
|
|
|
// TODO: Remove this after next major version
|
|
|
var perfRecord = _react_17_0_2_react.useContext(context_PerfContext);
|
|
|
var mark = TableContext_useImmutableMark();
|
|
|
|
|
|
// ======================== Render ========================
|
|
|
var retData = (0,useMemo/* default */.Z)(function () {
|
|
|
if (validateValue(children)) {
|
|
|
return [children];
|
|
|
}
|
|
|
var path = dataIndex === null || dataIndex === undefined || dataIndex === '' ? [] : Array.isArray(dataIndex) ? dataIndex : [dataIndex];
|
|
|
var value = (0,get/* default */.Z)(record, path);
|
|
|
|
|
|
// 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];
|
|
|
}, [
|
|
|
// Force update deps
|
|
|
mark,
|
|
|
// Normal deps
|
|
|
record, children, dataIndex, render, renderIndex], function (prev, next) {
|
|
|
if (shouldCellUpdate) {
|
|
|
var _prev = (0,slicedToArray/* default */.Z)(prev, 2),
|
|
|
prevRecord = _prev[1];
|
|
|
var _next = (0,slicedToArray/* default */.Z)(next, 2),
|
|
|
nextRecord = _next[1];
|
|
|
return shouldCellUpdate(nextRecord, prevRecord);
|
|
|
}
|
|
|
|
|
|
// Legacy mode should always update
|
|
|
if (perfRecord.renderWithProps) {
|
|
|
return true;
|
|
|
}
|
|
|
return !(0,isEqual/* default */.Z)(prev, next, true);
|
|
|
});
|
|
|
return retData;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Cell/useHoverState.js
|
|
|
|
|
|
|
|
|
/** Check if cell is in hover range */
|
|
|
function inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {
|
|
|
var cellEndRow = cellStartRow + cellRowSpan - 1;
|
|
|
return cellStartRow <= endRow && cellEndRow >= startRow;
|
|
|
}
|
|
|
function useHoverState(rowIndex, rowSpan) {
|
|
|
return useContext(context_TableContext, function (ctx) {
|
|
|
var hovering = inHoverRange(rowIndex, rowSpan || 1, ctx.hoverStartRow, ctx.hoverEndRow);
|
|
|
return [hovering, ctx.onHover];
|
|
|
});
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Cell/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_17_0_2_react.isValidElement(children) && typeof children.props.children === 'string') {
|
|
|
title = children.props.children;
|
|
|
}
|
|
|
}
|
|
|
return title;
|
|
|
};
|
|
|
function Cell(props) {
|
|
|
var _ref2, _ref3, _legacyCellProps$colS, _ref4, _ref5, _legacyCellProps$rowS, _additionalProps$titl, _classNames;
|
|
|
if (false) {}
|
|
|
var Component = props.component,
|
|
|
children = props.children,
|
|
|
ellipsis = props.ellipsis,
|
|
|
scope = props.scope,
|
|
|
prefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
align = props.align,
|
|
|
record = props.record,
|
|
|
render = props.render,
|
|
|
dataIndex = props.dataIndex,
|
|
|
renderIndex = props.renderIndex,
|
|
|
shouldCellUpdate = props.shouldCellUpdate,
|
|
|
index = props.index,
|
|
|
rowType = props.rowType,
|
|
|
colSpan = props.colSpan,
|
|
|
rowSpan = props.rowSpan,
|
|
|
fixLeft = props.fixLeft,
|
|
|
fixRight = props.fixRight,
|
|
|
firstFixLeft = props.firstFixLeft,
|
|
|
lastFixLeft = props.lastFixLeft,
|
|
|
firstFixRight = props.firstFixRight,
|
|
|
lastFixRight = props.lastFixRight,
|
|
|
appendNode = props.appendNode,
|
|
|
_props$additionalProp = props.additionalProps,
|
|
|
additionalProps = _props$additionalProp === void 0 ? {} : _props$additionalProp,
|
|
|
isSticky = props.isSticky;
|
|
|
var cellPrefixCls = "".concat(prefixCls, "-cell");
|
|
|
var _useContext = useContext(context_TableContext, ['supportSticky', 'allColumnsFixedLeft']),
|
|
|
supportSticky = _useContext.supportSticky,
|
|
|
allColumnsFixedLeft = _useContext.allColumnsFixedLeft;
|
|
|
|
|
|
// ====================== Value =======================
|
|
|
var _useCellRender = useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate),
|
|
|
_useCellRender2 = (0,slicedToArray/* default */.Z)(_useCellRender, 2),
|
|
|
childNode = _useCellRender2[0],
|
|
|
legacyCellProps = _useCellRender2[1];
|
|
|
|
|
|
// ====================== 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;
|
|
|
}
|
|
|
|
|
|
// ================ RowSpan & ColSpan =================
|
|
|
var mergedColSpan = (_ref2 = (_ref3 = (_legacyCellProps$colS = legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.colSpan) !== null && _legacyCellProps$colS !== void 0 ? _legacyCellProps$colS : additionalProps.colSpan) !== null && _ref3 !== void 0 ? _ref3 : colSpan) !== null && _ref2 !== void 0 ? _ref2 : 1;
|
|
|
var mergedRowSpan = (_ref4 = (_ref5 = (_legacyCellProps$rowS = legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.rowSpan) !== null && _legacyCellProps$rowS !== void 0 ? _legacyCellProps$rowS : additionalProps.rowSpan) !== null && _ref5 !== void 0 ? _ref5 : rowSpan) !== null && _ref4 !== void 0 ? _ref4 : 1;
|
|
|
|
|
|
// ====================== Hover =======================
|
|
|
var _useHoverState = useHoverState(index, mergedRowSpan),
|
|
|
_useHoverState2 = (0,slicedToArray/* default */.Z)(_useHoverState, 2),
|
|
|
hovering = _useHoverState2[0],
|
|
|
onHover = _useHoverState2[1];
|
|
|
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 ======================
|
|
|
if (mergedColSpan === 0 || mergedRowSpan === 0) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
// >>>>> Title
|
|
|
var title = (_additionalProps$titl = additionalProps.title) !== null && _additionalProps$titl !== void 0 ? _additionalProps$titl : getTitleFromCellRenderChildren({
|
|
|
rowType: rowType,
|
|
|
ellipsis: ellipsis,
|
|
|
children: childNode
|
|
|
});
|
|
|
|
|
|
// >>>>> ClassName
|
|
|
var mergedClassName = _classnames_2_5_1_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, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className);
|
|
|
|
|
|
// >>>>> Style
|
|
|
var alignStyle = {};
|
|
|
if (align) {
|
|
|
alignStyle.textAlign = align;
|
|
|
}
|
|
|
var mergedStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, fixedStyle), additionalProps.style), alignStyle), legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.style);
|
|
|
|
|
|
// >>>>> Children Node
|
|
|
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_17_0_2_react.isValidElement(mergedChildNode)) {
|
|
|
mergedChildNode = null;
|
|
|
}
|
|
|
if (ellipsis && (lastFixLeft || firstFixRight)) {
|
|
|
mergedChildNode = /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: "".concat(cellPrefixCls, "-content")
|
|
|
}, mergedChildNode);
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Component, (0,esm_extends/* default */.Z)({}, legacyCellProps, additionalProps, {
|
|
|
className: mergedClassName,
|
|
|
style: mergedStyle
|
|
|
// A11y
|
|
|
,
|
|
|
title: title,
|
|
|
scope: scope
|
|
|
// Hover
|
|
|
,
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
//Span
|
|
|
,
|
|
|
colSpan: mergedColSpan !== 1 ? mergedColSpan : null,
|
|
|
rowSpan: mergedRowSpan !== 1 ? mergedRowSpan : null
|
|
|
}), appendNode, mergedChildNode);
|
|
|
}
|
|
|
/* harmony default export */ var es_Cell = (/*#__PURE__*/_react_17_0_2_react.memo(Cell));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/utils/fixUtil.js
|
|
|
function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction, curColumns) {
|
|
|
var startColumn = columns[colStart] || {};
|
|
|
var endColumn = columns[colEnd] || {};
|
|
|
var fixLeft;
|
|
|
var fixRight;
|
|
|
if (startColumn.fixed === 'left') {
|
|
|
fixLeft = stickyOffsets.left[direction === 'rtl' ? colEnd : colStart];
|
|
|
} else if (endColumn.fixed === 'right') {
|
|
|
fixRight = stickyOffsets.right[direction === 'rtl' ? colStart : colEnd];
|
|
|
}
|
|
|
var lastFixLeft = false;
|
|
|
var firstFixRight = false;
|
|
|
var lastFixRight = false;
|
|
|
var firstFixLeft = false;
|
|
|
var nextColumn = columns[colEnd + 1];
|
|
|
var prevColumn = columns[colStart - 1];
|
|
|
|
|
|
// no children only
|
|
|
var canLastFix = !(curColumns !== null && curColumns !== void 0 && curColumns.children);
|
|
|
if (direction === 'rtl') {
|
|
|
if (fixLeft !== undefined) {
|
|
|
var prevFixLeft = prevColumn && prevColumn.fixed === 'left';
|
|
|
firstFixLeft = !prevFixLeft && canLastFix;
|
|
|
} else if (fixRight !== undefined) {
|
|
|
var nextFixRight = nextColumn && nextColumn.fixed === 'right';
|
|
|
lastFixRight = !nextFixRight && canLastFix;
|
|
|
}
|
|
|
} else if (fixLeft !== undefined) {
|
|
|
var nextFixLeft = nextColumn && nextColumn.fixed === 'left';
|
|
|
lastFixLeft = !nextFixLeft && canLastFix;
|
|
|
} else if (fixRight !== undefined) {
|
|
|
var prevFixRight = prevColumn && prevColumn.fixed === 'right';
|
|
|
firstFixRight = !prevFixRight && canLastFix;
|
|
|
}
|
|
|
return {
|
|
|
fixLeft: fixLeft,
|
|
|
fixRight: fixRight,
|
|
|
lastFixLeft: lastFixLeft,
|
|
|
firstFixRight: firstFixRight,
|
|
|
lastFixRight: lastFixRight,
|
|
|
firstFixLeft: firstFixLeft,
|
|
|
isSticky: stickyOffsets.isSticky
|
|
|
};
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Footer/SummaryContext.js
|
|
|
|
|
|
var SummaryContext = /*#__PURE__*/_react_17_0_2_react.createContext({});
|
|
|
/* harmony default export */ var Footer_SummaryContext = (SummaryContext);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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 _useContext = useContext(context_TableContext, ['prefixCls', 'direction']),
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
direction = _useContext.direction;
|
|
|
var _React$useContext = _react_17_0_2_react.useContext(Footer_SummaryContext),
|
|
|
scrollColumnIndex = _React$useContext.scrollColumnIndex,
|
|
|
stickyOffsets = _React$useContext.stickyOffsets,
|
|
|
flattenColumns = _React$useContext.flattenColumns,
|
|
|
columns = _React$useContext.columns;
|
|
|
var lastIndex = index + colSpan - 1;
|
|
|
var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan;
|
|
|
var fixedInfo = getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[index]);
|
|
|
return /*#__PURE__*/_react_17_0_2_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));
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(62646);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Footer/Row.js
|
|
|
|
|
|
var _excluded = ["children"];
|
|
|
|
|
|
function FooterRow(_ref) {
|
|
|
var children = _ref.children,
|
|
|
props = (0,objectWithoutProperties/* default */.Z)(_ref, _excluded);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("tr", props, children);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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@7.33.4@rc-table/es/Footer/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Footer(props) {
|
|
|
if (false) {}
|
|
|
var children = props.children,
|
|
|
stickyOffsets = props.stickyOffsets,
|
|
|
flattenColumns = props.flattenColumns,
|
|
|
columns = props.columns;
|
|
|
var prefixCls = useContext(context_TableContext, 'prefixCls');
|
|
|
var lastColumnIndex = flattenColumns.length - 1;
|
|
|
var scrollColumn = flattenColumns[lastColumnIndex];
|
|
|
var summaryContext = _react_17_0_2_react.useMemo(function () {
|
|
|
return {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
flattenColumns: flattenColumns,
|
|
|
scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null,
|
|
|
columns: columns
|
|
|
};
|
|
|
}, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets, columns]);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Footer_SummaryContext.Provider, {
|
|
|
value: summaryContext
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("tfoot", {
|
|
|
className: "".concat(prefixCls, "-summary")
|
|
|
}, children));
|
|
|
}
|
|
|
/* harmony default export */ var es_Footer = (TableContext_responseImmutable(Footer));
|
|
|
var FooterComponents = Footer_Summary;
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/index.js
|
|
|
var es = __webpack_require__(70425);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-resize-observer@1.4.3@rc-resize-observer/es/index.js + 4 modules
|
|
|
var _rc_resize_observer_1_4_3_rc_resize_observer_es = __webpack_require__(29301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/isVisible.js
|
|
|
var isVisible = __webpack_require__(29194);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/styleChecker.js
|
|
|
var styleChecker = __webpack_require__(24514);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/getScrollBarSize.js
|
|
|
var getScrollBarSize = __webpack_require__(75152);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/pickAttrs.js
|
|
|
var pickAttrs = __webpack_require__(26112);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useFlattenRecords.js
|
|
|
|
|
|
// recursion (flat tree structure)
|
|
|
function fillRecords(list, record, indent, childrenColumnName, expandedKeys, getRowKey, index) {
|
|
|
list.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) {
|
|
|
fillRecords(list, record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
* 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_17_0_2_react.useMemo(function () {
|
|
|
if (expandedKeys !== null && expandedKeys !== void 0 && expandedKeys.size) {
|
|
|
var list = [];
|
|
|
|
|
|
// collect flattened record
|
|
|
for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {
|
|
|
var record = data[i];
|
|
|
|
|
|
// using array.push or spread operator may cause "Maximum call stack size exceeded" exception if array size is big enough.
|
|
|
fillRecords(list, record, 0, childrenColumnName, expandedKeys, getRowKey, i);
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
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@7.33.4@rc-table/es/Body/ExpandedRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ExpandedRow(props) {
|
|
|
if (false) {}
|
|
|
var prefixCls = props.prefixCls,
|
|
|
children = props.children,
|
|
|
Component = props.component,
|
|
|
cellComponent = props.cellComponent,
|
|
|
className = props.className,
|
|
|
expanded = props.expanded,
|
|
|
colSpan = props.colSpan,
|
|
|
isEmpty = props.isEmpty;
|
|
|
var _useContext = useContext(context_TableContext, ['scrollbarSize', 'fixHeader', 'fixColumn', 'componentWidth', 'horizonScroll']),
|
|
|
scrollbarSize = _useContext.scrollbarSize,
|
|
|
fixHeader = _useContext.fixHeader,
|
|
|
fixColumn = _useContext.fixColumn,
|
|
|
componentWidth = _useContext.componentWidth,
|
|
|
horizonScroll = _useContext.horizonScroll;
|
|
|
|
|
|
// Cache render node
|
|
|
var contentNode = children;
|
|
|
if (isEmpty ? horizonScroll && componentWidth : fixColumn) {
|
|
|
contentNode = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: {
|
|
|
width: componentWidth - (fixHeader ? scrollbarSize : 0),
|
|
|
position: 'sticky',
|
|
|
left: 0,
|
|
|
overflow: 'hidden'
|
|
|
},
|
|
|
className: "".concat(prefixCls, "-expanded-row-fixed")
|
|
|
}, contentNode);
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Component, {
|
|
|
className: className,
|
|
|
style: {
|
|
|
display: expanded ? null : 'none'
|
|
|
}
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es_Cell, {
|
|
|
component: cellComponent,
|
|
|
prefixCls: prefixCls,
|
|
|
colSpan: colSpan
|
|
|
}, contentNode));
|
|
|
}
|
|
|
/* harmony default export */ var Body_ExpandedRow = (ExpandedRow);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useRowInfo.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useRowInfo(record, rowKey, recordIndex, indent) {
|
|
|
var context = useContext(context_TableContext, ['prefixCls', 'fixedInfoList', 'flattenColumns', 'expandableType', 'expandRowByClick', 'onTriggerExpand', 'rowClassName', 'expandedRowClassName', 'indentSize', 'expandIcon', 'expandedRowRender', 'expandIconColumnIndex', 'expandedKeys', 'childrenColumnName', 'rowExpandable', 'onRow']);
|
|
|
var flattenColumns = context.flattenColumns,
|
|
|
expandableType = context.expandableType,
|
|
|
expandedKeys = context.expandedKeys,
|
|
|
childrenColumnName = context.childrenColumnName,
|
|
|
onTriggerExpand = context.onTriggerExpand,
|
|
|
rowExpandable = context.rowExpandable,
|
|
|
onRow = context.onRow,
|
|
|
expandRowByClick = context.expandRowByClick,
|
|
|
rowClassName = context.rowClassName;
|
|
|
|
|
|
// ======================= Expandable =======================
|
|
|
// Only when row is not expandable and `children` exist in record
|
|
|
var nestExpandable = expandableType === 'nest';
|
|
|
var rowSupportExpand = expandableType === 'row' && (!rowExpandable || rowExpandable(record));
|
|
|
var mergedExpandable = rowSupportExpand || nestExpandable;
|
|
|
var expanded = expandedKeys && expandedKeys.has(rowKey);
|
|
|
var hasNestChildren = childrenColumnName && record && record[childrenColumnName];
|
|
|
var onInternalTriggerExpand = (0,es.useEvent)(onTriggerExpand);
|
|
|
|
|
|
// ========================= onRow ==========================
|
|
|
var rowProps = onRow === null || onRow === void 0 ? void 0 : onRow(record, recordIndex);
|
|
|
var onRowClick = rowProps === null || rowProps === void 0 ? void 0 : rowProps.onClick;
|
|
|
var onClick = function onClick(event) {
|
|
|
if (expandRowByClick && mergedExpandable) {
|
|
|
onTriggerExpand(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];
|
|
|
}
|
|
|
onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.apply(void 0, [event].concat(args));
|
|
|
};
|
|
|
|
|
|
// ====================== RowClassName ======================
|
|
|
var computeRowClassName;
|
|
|
if (typeof rowClassName === 'string') {
|
|
|
computeRowClassName = rowClassName;
|
|
|
} else if (typeof rowClassName === 'function') {
|
|
|
computeRowClassName = rowClassName(record, recordIndex, indent);
|
|
|
}
|
|
|
|
|
|
// ========================= Column =========================
|
|
|
var columnsKey = getColumnsKey(flattenColumns);
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, context), {}, {
|
|
|
columnsKey: columnsKey,
|
|
|
nestExpandable: nestExpandable,
|
|
|
expanded: expanded,
|
|
|
hasNestChildren: hasNestChildren,
|
|
|
record: record,
|
|
|
onTriggerExpand: onInternalTriggerExpand,
|
|
|
rowSupportExpand: rowSupportExpand,
|
|
|
expandable: mergedExpandable,
|
|
|
rowProps: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, rowProps), {}, {
|
|
|
className: _classnames_2_5_1_classnames_default()(computeRowClassName, rowProps === null || rowProps === void 0 ? void 0 : rowProps.className),
|
|
|
onClick: onClick
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Body/BodyRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ==================================================================================
|
|
|
// == getCellProps ==
|
|
|
// ==================================================================================
|
|
|
function getCellProps(rowInfo, column, colIndex, indent, index) {
|
|
|
var record = rowInfo.record,
|
|
|
prefixCls = rowInfo.prefixCls,
|
|
|
columnsKey = rowInfo.columnsKey,
|
|
|
fixedInfoList = rowInfo.fixedInfoList,
|
|
|
expandIconColumnIndex = rowInfo.expandIconColumnIndex,
|
|
|
nestExpandable = rowInfo.nestExpandable,
|
|
|
indentSize = rowInfo.indentSize,
|
|
|
expandIcon = rowInfo.expandIcon,
|
|
|
expanded = rowInfo.expanded,
|
|
|
hasNestChildren = rowInfo.hasNestChildren,
|
|
|
onTriggerExpand = rowInfo.onTriggerExpand;
|
|
|
var key = columnsKey[colIndex];
|
|
|
var fixedInfo = fixedInfoList[colIndex];
|
|
|
|
|
|
// ============= Used for nest expandable =============
|
|
|
var appendCellNode;
|
|
|
if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {
|
|
|
appendCellNode = /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_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: onTriggerExpand
|
|
|
}));
|
|
|
}
|
|
|
var additionalCellProps;
|
|
|
if (column.onCell) {
|
|
|
additionalCellProps = column.onCell(record, index);
|
|
|
}
|
|
|
return {
|
|
|
key: key,
|
|
|
fixedInfo: fixedInfo,
|
|
|
appendCellNode: appendCellNode,
|
|
|
additionalCellProps: additionalCellProps || {}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// ==================================================================================
|
|
|
// == getCellProps ==
|
|
|
// ==================================================================================
|
|
|
function BodyRow(props) {
|
|
|
if (false) {}
|
|
|
var className = props.className,
|
|
|
style = props.style,
|
|
|
record = props.record,
|
|
|
index = props.index,
|
|
|
renderIndex = props.renderIndex,
|
|
|
rowKey = props.rowKey,
|
|
|
_props$indent = props.indent,
|
|
|
indent = _props$indent === void 0 ? 0 : _props$indent,
|
|
|
RowComponent = props.rowComponent,
|
|
|
cellComponent = props.cellComponent,
|
|
|
scopeCellComponent = props.scopeCellComponent;
|
|
|
var rowInfo = useRowInfo(record, rowKey, index, indent);
|
|
|
var prefixCls = rowInfo.prefixCls,
|
|
|
flattenColumns = rowInfo.flattenColumns,
|
|
|
expandedRowClassName = rowInfo.expandedRowClassName,
|
|
|
expandedRowRender = rowInfo.expandedRowRender,
|
|
|
rowProps = rowInfo.rowProps,
|
|
|
expanded = rowInfo.expanded,
|
|
|
rowSupportExpand = rowInfo.rowSupportExpand;
|
|
|
var _React$useState = _react_17_0_2_react.useState(false),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
expandRended = _React$useState2[0],
|
|
|
setExpandRended = _React$useState2[1];
|
|
|
if (false) {}
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
if (expanded) {
|
|
|
setExpandRended(true);
|
|
|
}
|
|
|
}, [expanded]);
|
|
|
|
|
|
// ======================== Base tr row ========================
|
|
|
var baseRowNode = /*#__PURE__*/_react_17_0_2_react.createElement(RowComponent, (0,esm_extends/* default */.Z)({}, rowProps, {
|
|
|
"data-row-key": rowKey,
|
|
|
className: _classnames_2_5_1_classnames_default()(className, "".concat(prefixCls, "-row"), "".concat(prefixCls, "-row-level-").concat(indent), rowProps === null || rowProps === void 0 ? void 0 : rowProps.className),
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, style), rowProps === null || rowProps === void 0 ? void 0 : rowProps.style)
|
|
|
}), flattenColumns.map(function (column, colIndex) {
|
|
|
var render = column.render,
|
|
|
dataIndex = column.dataIndex,
|
|
|
columnClassName = column.className;
|
|
|
var _getCellProps = getCellProps(rowInfo, column, colIndex, indent, index),
|
|
|
key = _getCellProps.key,
|
|
|
fixedInfo = _getCellProps.fixedInfo,
|
|
|
appendCellNode = _getCellProps.appendCellNode,
|
|
|
additionalCellProps = _getCellProps.additionalCellProps;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Cell, (0,esm_extends/* default */.Z)({
|
|
|
className: columnClassName,
|
|
|
ellipsis: column.ellipsis,
|
|
|
align: column.align,
|
|
|
scope: column.rowScope,
|
|
|
component: column.rowScope ? scopeCellComponent : cellComponent,
|
|
|
prefixCls: prefixCls,
|
|
|
key: key,
|
|
|
record: record,
|
|
|
index: index,
|
|
|
renderIndex: renderIndex,
|
|
|
dataIndex: dataIndex,
|
|
|
render: render,
|
|
|
shouldCellUpdate: column.shouldCellUpdate
|
|
|
}, 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_17_0_2_react.createElement(Body_ExpandedRow, {
|
|
|
expanded: expanded,
|
|
|
className: _classnames_2_5_1_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_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, baseRowNode, expandRowNode);
|
|
|
}
|
|
|
BodyRow.displayName = 'BodyRow';
|
|
|
/* harmony default export */ var Body_BodyRow = (TableContext_responseImmutable(BodyRow));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Body/MeasureCell.js
|
|
|
|
|
|
|
|
|
function MeasureCell(_ref) {
|
|
|
var columnKey = _ref.columnKey,
|
|
|
onColumnResize = _ref.onColumnResize;
|
|
|
var cellRef = _react_17_0_2_react.useRef();
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
if (cellRef.current) {
|
|
|
onColumnResize(columnKey, cellRef.current.offsetWidth);
|
|
|
}
|
|
|
}, []);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_rc_resize_observer_1_4_3_rc_resize_observer_es/* default */.Z, {
|
|
|
data: columnKey
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("td", {
|
|
|
ref: cellRef,
|
|
|
style: {
|
|
|
padding: 0,
|
|
|
border: 0,
|
|
|
height: 0
|
|
|
}
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: {
|
|
|
height: 0,
|
|
|
overflow: 'hidden'
|
|
|
}
|
|
|
}, "\xA0")));
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Body/MeasureRow.js
|
|
|
|
|
|
|
|
|
|
|
|
function MeasureRow(_ref) {
|
|
|
var prefixCls = _ref.prefixCls,
|
|
|
columnsKey = _ref.columnsKey,
|
|
|
onColumnResize = _ref.onColumnResize;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("tr", {
|
|
|
"aria-hidden": "true",
|
|
|
className: "".concat(prefixCls, "-measure-row"),
|
|
|
style: {
|
|
|
height: 0,
|
|
|
fontSize: 0
|
|
|
}
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(_rc_resize_observer_1_4_3_rc_resize_observer_es/* default */.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_17_0_2_react.createElement(MeasureCell, {
|
|
|
key: columnKey,
|
|
|
columnKey: columnKey,
|
|
|
onColumnResize: onColumnResize
|
|
|
});
|
|
|
})));
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/Body/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Body(props) {
|
|
|
if (false) {}
|
|
|
var data = props.data,
|
|
|
measureColumnWidth = props.measureColumnWidth;
|
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'getComponent', 'onColumnResize', 'flattenColumns', 'getRowKey', 'expandedKeys', 'childrenColumnName', 'emptyNode']),
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
getComponent = _useContext.getComponent,
|
|
|
onColumnResize = _useContext.onColumnResize,
|
|
|
flattenColumns = _useContext.flattenColumns,
|
|
|
getRowKey = _useContext.getRowKey,
|
|
|
expandedKeys = _useContext.expandedKeys,
|
|
|
childrenColumnName = _useContext.childrenColumnName,
|
|
|
emptyNode = _useContext.emptyNode;
|
|
|
var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
|
|
|
|
|
|
// =================== Performance ====================
|
|
|
var perfRef = _react_17_0_2_react.useRef({
|
|
|
renderWithProps: false
|
|
|
});
|
|
|
|
|
|
// ====================== Render ======================
|
|
|
var WrapperComponent = getComponent(['body', 'wrapper'], 'tbody');
|
|
|
var trComponent = getComponent(['body', 'row'], 'tr');
|
|
|
var tdComponent = getComponent(['body', 'cell'], 'td');
|
|
|
var thComponent = getComponent(['body', 'cell'], 'th');
|
|
|
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_17_0_2_react.createElement(Body_BodyRow, {
|
|
|
key: key,
|
|
|
rowKey: key,
|
|
|
record: record,
|
|
|
index: idx,
|
|
|
renderIndex: renderIndex,
|
|
|
rowComponent: trComponent,
|
|
|
cellComponent: tdComponent,
|
|
|
scopeCellComponent: thComponent,
|
|
|
getRowKey: getRowKey,
|
|
|
indent: indent
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
rows = /*#__PURE__*/_react_17_0_2_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_17_0_2_react.createElement(context_PerfContext.Provider, {
|
|
|
value: perfRef.current
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(WrapperComponent, {
|
|
|
className: "".concat(prefixCls, "-tbody")
|
|
|
}, measureColumnWidth && /*#__PURE__*/_react_17_0_2_react.createElement(MeasureRow, {
|
|
|
prefixCls: prefixCls,
|
|
|
columnsKey: columnsKey,
|
|
|
onColumnResize: onColumnResize
|
|
|
}), rows));
|
|
|
}
|
|
|
Body.displayName = 'Body';
|
|
|
/* harmony default export */ var es_Body = (TableContext_responseImmutable(Body));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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@7.33.4@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_17_0_2_react.createElement("col", (0,esm_extends/* default */.Z)({
|
|
|
key: i,
|
|
|
style: {
|
|
|
width: width
|
|
|
}
|
|
|
}, restAdditionalProps)));
|
|
|
mustInsert = true;
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("colgroup", null, cols);
|
|
|
}
|
|
|
/* harmony default export */ var es_ColGroup = (ColGroup);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(95190);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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_17_0_2_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_17_0_2_react.forwardRef(function (props, ref) {
|
|
|
if (false) {}
|
|
|
var className = props.className,
|
|
|
noData = props.noData,
|
|
|
columns = props.columns,
|
|
|
flattenColumns = props.flattenColumns,
|
|
|
colWidths = props.colWidths,
|
|
|
columCount = props.columCount,
|
|
|
stickyOffsets = props.stickyOffsets,
|
|
|
direction = props.direction,
|
|
|
fixHeader = props.fixHeader,
|
|
|
stickyTopOffset = props.stickyTopOffset,
|
|
|
stickyBottomOffset = props.stickyBottomOffset,
|
|
|
stickyClassName = props.stickyClassName,
|
|
|
onScroll = props.onScroll,
|
|
|
maxContentScroll = props.maxContentScroll,
|
|
|
children = props.children,
|
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, FixedHolder_excluded);
|
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'scrollbarSize', 'isSticky']),
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
scrollbarSize = _useContext.scrollbarSize,
|
|
|
isSticky = _useContext.isSticky;
|
|
|
var combinationScrollBarSize = isSticky && !fixHeader ? 0 : scrollbarSize;
|
|
|
|
|
|
// Pass wheel to scroll event
|
|
|
var scrollRef = _react_17_0_2_react.useRef(null);
|
|
|
var setScrollRef = _react_17_0_2_react.useCallback(function (element) {
|
|
|
(0,es_ref/* fillRef */.mH)(ref, element);
|
|
|
(0,es_ref/* fillRef */.mH)(scrollRef, element);
|
|
|
}, []);
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
var _scrollRef$current;
|
|
|
function onWheel(e) {
|
|
|
var _ref = e,
|
|
|
currentTarget = _ref.currentTarget,
|
|
|
deltaX = _ref.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_17_0_2_react.useMemo(function () {
|
|
|
return flattenColumns.every(function (column) {
|
|
|
return column.width;
|
|
|
});
|
|
|
}, [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_17_0_2_react.useMemo)(function () {
|
|
|
return combinationScrollBarSize ? [].concat((0,toConsumableArray/* default */.Z)(columns), [ScrollBarColumn]) : columns;
|
|
|
}, [combinationScrollBarSize, columns]);
|
|
|
var flattenColumnsWithScrollbar = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
return combinationScrollBarSize ? [].concat((0,toConsumableArray/* default */.Z)(flattenColumns), [ScrollBarColumn]) : flattenColumns;
|
|
|
}, [combinationScrollBarSize, flattenColumns]);
|
|
|
|
|
|
// Calculate the sticky offsets
|
|
|
var headerStickyOffsets = (0,_react_17_0_2_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_17_0_2_react.createElement("div", {
|
|
|
style: (0,objectSpread2/* default */.Z)({
|
|
|
overflow: 'hidden'
|
|
|
}, isSticky ? {
|
|
|
top: stickyTopOffset,
|
|
|
bottom: stickyBottomOffset
|
|
|
} : {}),
|
|
|
ref: setScrollRef,
|
|
|
className: _classnames_2_5_1_classnames_default()(className, (0,defineProperty/* default */.Z)({}, stickyClassName, !!stickyClassName))
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("table", {
|
|
|
style: {
|
|
|
tableLayout: 'fixed',
|
|
|
visibility: noData || mergedColumnWidth ? null : 'hidden'
|
|
|
}
|
|
|
}, (!noData || !maxContentScroll || allFlattenColumnsWithWidth) && /*#__PURE__*/_react_17_0_2_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)({}, restProps), {}, {
|
|
|
stickyOffsets: headerStickyOffsets,
|
|
|
columns: columnsWithScrollbar,
|
|
|
flattenColumns: flattenColumnsWithScrollbar
|
|
|
}))));
|
|
|
});
|
|
|
FixedHolder.displayName = 'FixedHolder';
|
|
|
|
|
|
/** Return a table in div as fixed element which contains sticky info */
|
|
|
// export default responseImmutable(FixedHolder);
|
|
|
/* harmony default export */ var es_FixedHolder = (/*#__PURE__*/_react_17_0_2_react.memo(FixedHolder));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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,
|
|
|
tdCellComponent = _ref.tdCellComponent,
|
|
|
onHeaderRow = _ref.onHeaderRow,
|
|
|
index = _ref.index;
|
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'direction']),
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
direction = _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_17_0_2_react.createElement(RowComponent, rowProps, cells.map(function (cell, cellIndex) {
|
|
|
var column = cell.column;
|
|
|
var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction, column);
|
|
|
var additionalProps;
|
|
|
if (column && column.onHeaderCell) {
|
|
|
additionalProps = cell.column.onHeaderCell(column);
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Cell, (0,esm_extends/* default */.Z)({}, cell, {
|
|
|
scope: column.title ? cell.colSpan > 1 ? 'colgroup' : 'col' : null,
|
|
|
ellipsis: column.ellipsis,
|
|
|
align: column.align,
|
|
|
component: column.title ? CellComponent : tdCellComponent,
|
|
|
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@7.33.4@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(props) {
|
|
|
if (false) {}
|
|
|
var stickyOffsets = props.stickyOffsets,
|
|
|
columns = props.columns,
|
|
|
flattenColumns = props.flattenColumns,
|
|
|
onHeaderRow = props.onHeaderRow;
|
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'getComponent']),
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
getComponent = _useContext.getComponent;
|
|
|
var rows = _react_17_0_2_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');
|
|
|
var tdComponent = getComponent(['header', 'cell'], 'td');
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(WrapperComponent, {
|
|
|
className: "".concat(prefixCls, "-thead")
|
|
|
}, rows.map(function (row, rowIndex) {
|
|
|
var rowNode = /*#__PURE__*/_react_17_0_2_react.createElement(Header_HeaderRow, {
|
|
|
key: rowIndex,
|
|
|
flattenColumns: flattenColumns,
|
|
|
cells: row,
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
rowComponent: trComponent,
|
|
|
cellComponent: thComponent,
|
|
|
tdCellComponent: tdComponent,
|
|
|
onHeaderRow: onHeaderRow,
|
|
|
index: rowIndex
|
|
|
});
|
|
|
return rowNode;
|
|
|
}));
|
|
|
}
|
|
|
/* harmony default export */ var Header_Header = (TableContext_responseImmutable(Header));
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/Children/toArray.js
|
|
|
var Children_toArray = __webpack_require__(11592);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useColumns/useWidthColumns.js
|
|
|
|
|
|
|
|
|
function parseColWidth(totalWidth) {
|
|
|
var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
|
if (typeof width === 'number') {
|
|
|
return width;
|
|
|
}
|
|
|
if (width.endsWith('%')) {
|
|
|
return totalWidth * parseFloat(width) / 100;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Fill all column with width
|
|
|
*/
|
|
|
function useWidthColumns(flattenColumns, scrollWidth) {
|
|
|
return _react_17_0_2_react.useMemo(function () {
|
|
|
// Fill width if needed
|
|
|
if (scrollWidth && scrollWidth > 0) {
|
|
|
var totalWidth = 0;
|
|
|
var missWidthCount = 0;
|
|
|
|
|
|
// collect not given width column
|
|
|
flattenColumns.forEach(function (col) {
|
|
|
var colWidth = parseColWidth(scrollWidth, col.width);
|
|
|
if (colWidth) {
|
|
|
totalWidth += colWidth;
|
|
|
} else {
|
|
|
missWidthCount += 1;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// Fill width
|
|
|
var restWidth = scrollWidth - totalWidth;
|
|
|
var restCount = missWidthCount;
|
|
|
var avgWidth = restWidth / missWidthCount;
|
|
|
var realTotal = 0;
|
|
|
var filledColumns = flattenColumns.map(function (col) {
|
|
|
var clone = (0,objectSpread2/* default */.Z)({}, col);
|
|
|
var colWidth = parseColWidth(scrollWidth, clone.width);
|
|
|
if (colWidth) {
|
|
|
clone.width = colWidth;
|
|
|
} else {
|
|
|
var colAvgWidth = Math.floor(avgWidth);
|
|
|
clone.width = restCount === 1 ? restWidth : colAvgWidth;
|
|
|
restWidth -= colAvgWidth;
|
|
|
restCount -= 1;
|
|
|
}
|
|
|
realTotal += clone.width;
|
|
|
return clone;
|
|
|
});
|
|
|
return [filledColumns, realTotal];
|
|
|
}
|
|
|
return [flattenColumns, scrollWidth];
|
|
|
}, [flattenColumns, scrollWidth]);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useColumns/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var useColumns_excluded = ["children"],
|
|
|
_excluded2 = ["fixed"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function convertChildrenToColumns(children) {
|
|
|
return (0,Children_toArray/* default */.Z)(children).filter(function (node) {
|
|
|
return /*#__PURE__*/_react_17_0_2_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) {
|
|
|
var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key';
|
|
|
return columns.filter(function (column) {
|
|
|
return column && (0,esm_typeof/* default */.Z)(column) === 'object';
|
|
|
}).reduce(function (list, column, index) {
|
|
|
var fixed = column.fixed;
|
|
|
// Convert `fixed='true'` to `fixed='left'` instead
|
|
|
var parsedFixed = fixed === true ? 'left' : fixed;
|
|
|
var mergedKey = "".concat(parentKey, "-").concat(index);
|
|
|
var subColumns = column.children;
|
|
|
if (subColumns && subColumns.length > 0) {
|
|
|
return [].concat((0,toConsumableArray/* default */.Z)(list), (0,toConsumableArray/* default */.Z)(flatColumns(subColumns, mergedKey).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)({
|
|
|
key: mergedKey
|
|
|
}, 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,
|
|
|
scrollWidth = _ref2.scrollWidth;
|
|
|
var baseColumns = _react_17_0_2_react.useMemo(function () {
|
|
|
return columns || convertChildrenToColumns(children);
|
|
|
}, [columns, children]);
|
|
|
|
|
|
// ========================== Expand ==========================
|
|
|
var withExpandColumns = _react_17_0_2_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_17_0_2_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_17_0_2_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_17_0_2_react.useMemo(function () {
|
|
|
if (direction === 'rtl') {
|
|
|
return revertForRtl(flatColumns(mergedColumns));
|
|
|
}
|
|
|
return flatColumns(mergedColumns);
|
|
|
}, [mergedColumns, direction, scrollWidth]);
|
|
|
|
|
|
// Only check out of production since it's waste for each render
|
|
|
if (false) {}
|
|
|
|
|
|
// ========================= FillWidth ========================
|
|
|
var _useWidthColumns = useWidthColumns(flattenColumns, scrollWidth),
|
|
|
_useWidthColumns2 = (0,slicedToArray/* default */.Z)(_useWidthColumns, 2),
|
|
|
filledColumns = _useWidthColumns2[0],
|
|
|
realScrollWidth = _useWidthColumns2[1];
|
|
|
return [mergedColumns, filledColumns, realScrollWidth];
|
|
|
}
|
|
|
/* harmony default export */ var hooks_useColumns = (useColumns);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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_17_0_2_react.createElement("span", {
|
|
|
className: _classnames_2_5_1_classnames_default()(expandClassName, "".concat(prefixCls, "-row-spaced"))
|
|
|
});
|
|
|
}
|
|
|
var onClick = function onClick(event) {
|
|
|
onExpand(record, event);
|
|
|
event.stopPropagation();
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: _classnames_2_5_1_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;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useExpand.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useExpand(props, mergedData, getRowKey) {
|
|
|
var expandableConfig = getExpandableProps(props);
|
|
|
var expandIcon = expandableConfig.expandIcon,
|
|
|
expandedRowKeys = expandableConfig.expandedRowKeys,
|
|
|
defaultExpandedRowKeys = expandableConfig.defaultExpandedRowKeys,
|
|
|
defaultExpandAllRows = expandableConfig.defaultExpandAllRows,
|
|
|
expandedRowRender = expandableConfig.expandedRowRender,
|
|
|
onExpand = expandableConfig.onExpand,
|
|
|
onExpandedRowsChange = expandableConfig.onExpandedRowsChange,
|
|
|
childrenColumnName = expandableConfig.childrenColumnName;
|
|
|
var mergedExpandIcon = expandIcon || renderExpandIcon;
|
|
|
var mergedChildrenColumnName = childrenColumnName || 'children';
|
|
|
var expandableType = _react_17_0_2_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 && props.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_17_0_2_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_17_0_2_react.useMemo(function () {
|
|
|
return new Set(expandedRowKeys || innerExpandedKeys || []);
|
|
|
}, [expandedRowKeys, innerExpandedKeys]);
|
|
|
var onTriggerExpand = _react_17_0_2_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) {}
|
|
|
return [expandableConfig, expandableType, mergedExpandedKeys, mergedExpandIcon, mergedChildrenColumnName, onTriggerExpand];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useFixedInfo.js
|
|
|
|
|
|
|
|
|
|
|
|
function useFixedInfo(flattenColumns, stickyOffsets, direction, columns) {
|
|
|
var fixedInfoList = flattenColumns.map(function (_, colIndex) {
|
|
|
return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[colIndex]);
|
|
|
});
|
|
|
return (0,useMemo/* default */.Z)(function () {
|
|
|
return fixedInfoList;
|
|
|
}, [fixedInfoList], function (prev, next) {
|
|
|
return !(0,isEqual/* default */.Z)(prev, next);
|
|
|
});
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useFrame.js
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Execute code before next frame but async
|
|
|
*/
|
|
|
function useLayoutState(defaultState) {
|
|
|
var stateRef = (0,_react_17_0_2_react.useRef)(defaultState);
|
|
|
var _useState = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
|
forceUpdate = _useState2[1];
|
|
|
var lastPromiseRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var updateBatchRef = (0,_react_17_0_2_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_17_0_2_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_17_0_2_react.useRef)(defaultState || null);
|
|
|
var timeoutRef = (0,_react_17_0_2_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_17_0_2_react.useEffect)(function () {
|
|
|
return cleanUp;
|
|
|
}, []);
|
|
|
return [setState, getState];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/hooks/useHover.js
|
|
|
|
|
|
|
|
|
function useHover() {
|
|
|
var _React$useState = _react_17_0_2_react.useState(-1),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
startRow = _React$useState2[0],
|
|
|
setStartRow = _React$useState2[1];
|
|
|
var _React$useState3 = _react_17_0_2_react.useState(-1),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
endRow = _React$useState4[0],
|
|
|
setEndRow = _React$useState4[1];
|
|
|
var onHover = _react_17_0_2_react.useCallback(function (start, end) {
|
|
|
setStartRow(start);
|
|
|
setEndRow(end);
|
|
|
}, []);
|
|
|
return [startRow, endRow, onHover];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/canUseDom.js
|
|
|
var canUseDom = __webpack_require__(47273);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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_17_0_2_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@7.33.4@rc-table/es/hooks/useStickyOffsets.js
|
|
|
|
|
|
/**
|
|
|
* Get sticky column offset width
|
|
|
*/
|
|
|
function useStickyOffsets(colWidths, columnCount, direction) {
|
|
|
var stickyOffsets = (0,_react_17_0_2_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@7.33.4@rc-table/es/Panel/index.js
|
|
|
|
|
|
function Panel(_ref) {
|
|
|
var className = _ref.className,
|
|
|
children = _ref.children;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: className
|
|
|
}, children);
|
|
|
}
|
|
|
/* harmony default export */ var es_Panel = (Panel);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/addEventListener.js
|
|
|
var addEventListener = __webpack_require__(8224);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/css.js
|
|
|
var css = __webpack_require__(55468);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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 prefixCls = useContext(context_TableContext, '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_17_0_2_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_17_0_2_react.useRef({
|
|
|
delta: 0,
|
|
|
x: 0
|
|
|
});
|
|
|
var _React$useState = _react_17_0_2_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_17_0_2_react.useImperativeHandle(ref, function () {
|
|
|
return {
|
|
|
setScrollLeft: setScrollLeft
|
|
|
};
|
|
|
});
|
|
|
_react_17_0_2_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_17_0_2_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_17_0_2_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_17_0_2_react.createElement("div", {
|
|
|
style: {
|
|
|
height: (0,getScrollBarSize/* default */.Z)(),
|
|
|
width: bodyWidth,
|
|
|
bottom: offsetScroll
|
|
|
},
|
|
|
className: "".concat(prefixCls, "-sticky-scroll")
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
onMouseDown: onMouseDown,
|
|
|
ref: scrollBarRef,
|
|
|
className: _classnames_2_5_1_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_17_0_2_react.forwardRef(StickyScrollBar));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@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@7.33.4@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
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DEFAULT_PREFIX = 'rc-table';
|
|
|
|
|
|
// Used for conditions cache
|
|
|
var EMPTY_DATA = [];
|
|
|
|
|
|
// Used for customize scroll
|
|
|
var EMPTY_SCROLL_TARGET = {};
|
|
|
function defaultEmpty() {
|
|
|
return 'No Data';
|
|
|
}
|
|
|
function Table_Table(tableProps) {
|
|
|
var _classNames;
|
|
|
var props = (0,objectSpread2/* default */.Z)({
|
|
|
rowKey: 'key',
|
|
|
prefixCls: DEFAULT_PREFIX,
|
|
|
emptyText: defaultEmpty
|
|
|
}, tableProps);
|
|
|
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,
|
|
|
caption = props.caption,
|
|
|
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,
|
|
|
tailor = props.tailor,
|
|
|
sticky = props.sticky;
|
|
|
var mergedData = data || EMPTY_DATA;
|
|
|
var hasData = !!mergedData.length;
|
|
|
var useInternalHooks = internalHooks === INTERNAL_HOOKS;
|
|
|
|
|
|
// ===================== Warning ======================
|
|
|
if (false) {}
|
|
|
|
|
|
// ==================== Customize =====================
|
|
|
var getComponent = _react_17_0_2_react.useCallback(function (path, defaultComponent) {
|
|
|
return (0,get/* default */.Z)(components, path) || defaultComponent;
|
|
|
}, [components]);
|
|
|
var getRowKey = _react_17_0_2_react.useMemo(function () {
|
|
|
if (typeof rowKey === 'function') {
|
|
|
return rowKey;
|
|
|
}
|
|
|
return function (record) {
|
|
|
var key = record && record[rowKey];
|
|
|
if (false) {}
|
|
|
return key;
|
|
|
};
|
|
|
}, [rowKey]);
|
|
|
var customizeScrollBody = getComponent(['body']);
|
|
|
|
|
|
// ====================== Hover =======================
|
|
|
var _useHover = useHover(),
|
|
|
_useHover2 = (0,slicedToArray/* default */.Z)(_useHover, 3),
|
|
|
startRow = _useHover2[0],
|
|
|
endRow = _useHover2[1],
|
|
|
onHover = _useHover2[2];
|
|
|
|
|
|
// ====================== Expand ======================
|
|
|
var _useExpand = useExpand(props, mergedData, getRowKey),
|
|
|
_useExpand2 = (0,slicedToArray/* default */.Z)(_useExpand, 6),
|
|
|
expandableConfig = _useExpand2[0],
|
|
|
expandableType = _useExpand2[1],
|
|
|
mergedExpandedKeys = _useExpand2[2],
|
|
|
mergedExpandIcon = _useExpand2[3],
|
|
|
mergedChildrenColumnName = _useExpand2[4],
|
|
|
onTriggerExpand = _useExpand2[5];
|
|
|
|
|
|
// ====================== Column ======================
|
|
|
var scrollX = scroll === null || scroll === void 0 ? void 0 : scroll.x;
|
|
|
var _React$useState = _react_17_0_2_react.useState(0),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
componentWidth = _React$useState2[0],
|
|
|
setComponentWidth = _React$useState2[1];
|
|
|
var _useColumns = hooks_useColumns((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), expandableConfig), {}, {
|
|
|
expandable: !!expandableConfig.expandedRowRender,
|
|
|
columnTitle: expandableConfig.columnTitle,
|
|
|
expandedKeys: mergedExpandedKeys,
|
|
|
getRowKey: getRowKey,
|
|
|
// https://github.com/ant-design/ant-design/issues/23894
|
|
|
onTriggerExpand: onTriggerExpand,
|
|
|
expandIcon: mergedExpandIcon,
|
|
|
expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
|
|
|
direction: direction,
|
|
|
scrollWidth: useInternalHooks && tailor && typeof scrollX === 'number' ? scrollX : null
|
|
|
}), useInternalHooks ? transformColumns : null),
|
|
|
_useColumns2 = (0,slicedToArray/* default */.Z)(_useColumns, 3),
|
|
|
columns = _useColumns2[0],
|
|
|
flattenColumns = _useColumns2[1],
|
|
|
flattenScrollX = _useColumns2[2];
|
|
|
var mergedScrollX = flattenScrollX !== null && flattenScrollX !== void 0 ? flattenScrollX : scrollX;
|
|
|
var columnContext = _react_17_0_2_react.useMemo(function () {
|
|
|
return {
|
|
|
columns: columns,
|
|
|
flattenColumns: flattenColumns
|
|
|
};
|
|
|
}, [columns, flattenColumns]);
|
|
|
|
|
|
// ====================== Scroll ======================
|
|
|
var fullTableRef = _react_17_0_2_react.useRef();
|
|
|
var scrollHeaderRef = _react_17_0_2_react.useRef();
|
|
|
var scrollBodyRef = _react_17_0_2_react.useRef();
|
|
|
var scrollBodyContainerRef = _react_17_0_2_react.useRef();
|
|
|
var scrollSummaryRef = _react_17_0_2_react.useRef();
|
|
|
var _React$useState3 = _react_17_0_2_react.useState(false),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
pingedLeft = _React$useState4[0],
|
|
|
setPingedLeft = _React$useState4[1];
|
|
|
var _React$useState5 = _react_17_0_2_react.useState(false),
|
|
|
_React$useState6 = (0,slicedToArray/* default */.Z)(_React$useState5, 2),
|
|
|
pingedRight = _React$useState6[0],
|
|
|
setPingedRight = _React$useState6[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_17_0_2_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(mergedScrollX) || Boolean(expandableConfig.fixed);
|
|
|
var fixColumn = horizonScroll && flattenColumns.some(function (_ref) {
|
|
|
var fixed = _ref.fixed;
|
|
|
return fixed;
|
|
|
});
|
|
|
|
|
|
// Sticky
|
|
|
var stickyRef = _react_17_0_2_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 = _react_17_0_2_react.useMemo(function () {
|
|
|
return summary === null || summary === void 0 ? void 0 : summary(mergedData);
|
|
|
}, [summary, mergedData]);
|
|
|
var fixFooter = (fixHeader || isSticky) && /*#__PURE__*/_react_17_0_2_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: mergedScrollX === true ? 'auto' : mergedScrollX,
|
|
|
minWidth: '100%'
|
|
|
};
|
|
|
}
|
|
|
var onColumnResize = _react_17_0_2_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) {
|
|
|
target.scrollLeft = scrollLeft;
|
|
|
|
|
|
// Delay to force scroll position if not sync
|
|
|
// ref: https://github.com/ant-design/ant-design/issues/37179
|
|
|
if (target.scrollLeft !== scrollLeft) {
|
|
|
setTimeout(function () {
|
|
|
target.scrollLeft = scrollLeft;
|
|
|
}, 0);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
var onScroll = (0,useEvent/* default */.Z)(function (_ref2) {
|
|
|
var currentTarget = _ref2.currentTarget,
|
|
|
scrollLeft = _ref2.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);
|
|
|
}
|
|
|
var measureTarget = currentTarget || scrollHeaderRef.current;
|
|
|
if (measureTarget) {
|
|
|
var scrollWidth = measureTarget.scrollWidth,
|
|
|
clientWidth = measureTarget.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(_ref3) {
|
|
|
var width = _ref3.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_17_0_2_react.useRef(false);
|
|
|
_react_17_0_2_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_17_0_2_react.useEffect(function () {
|
|
|
mounted.current = true;
|
|
|
}, []);
|
|
|
|
|
|
// ===================== Effects ======================
|
|
|
var _React$useState7 = _react_17_0_2_react.useState(0),
|
|
|
_React$useState8 = (0,slicedToArray/* default */.Z)(_React$useState7, 2),
|
|
|
scrollbarSize = _React$useState8[0],
|
|
|
setScrollbarSize = _React$useState8[1];
|
|
|
var _React$useState9 = _react_17_0_2_react.useState(true),
|
|
|
_React$useState10 = (0,slicedToArray/* default */.Z)(_React$useState9, 2),
|
|
|
supportSticky = _React$useState10[0],
|
|
|
setSupportSticky = _React$useState10[1]; // Only IE not support, we mark as support first
|
|
|
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
if (!tailor || !useInternalHooks) {
|
|
|
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_17_0_2_react.useEffect(function () {
|
|
|
if (useInternalHooks && internalRefs) {
|
|
|
internalRefs.body.current = scrollBodyRef.current;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// ========================================================================
|
|
|
// == Render ==
|
|
|
// ========================================================================
|
|
|
// =================== Render: Func ===================
|
|
|
var renderFixedHeaderTable = _react_17_0_2_react.useCallback(function (fixedHolderPassProps) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement(Header_Header, fixedHolderPassProps), fixFooter === 'top' && /*#__PURE__*/_react_17_0_2_react.createElement(es_Footer, fixedHolderPassProps, summaryNode));
|
|
|
}, [fixFooter, summaryNode]);
|
|
|
var renderFixedFooterTable = _react_17_0_2_react.useCallback(function (fixedHolderPassProps) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Footer, fixedHolderPassProps, summaryNode);
|
|
|
}, [summaryNode]);
|
|
|
|
|
|
// =================== Render: Node ===================
|
|
|
var TableComponent = getComponent(['table'], 'table');
|
|
|
|
|
|
// Table layout
|
|
|
var mergedTableLayout = _react_17_0_2_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 mergedScrollX === 'max-content' ? 'auto' : 'fixed';
|
|
|
}
|
|
|
if (fixHeader || isSticky || flattenColumns.some(function (_ref4) {
|
|
|
var ellipsis = _ref4.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_17_0_2_react.useMemo(function () {
|
|
|
if (hasData) {
|
|
|
return null;
|
|
|
}
|
|
|
if (typeof emptyText === 'function') {
|
|
|
return emptyText();
|
|
|
}
|
|
|
return emptyText;
|
|
|
}, [hasData, emptyText]);
|
|
|
|
|
|
// Body
|
|
|
var bodyTable = /*#__PURE__*/_react_17_0_2_react.createElement(es_Body, {
|
|
|
data: mergedData,
|
|
|
measureColumnWidth: fixHeader || horizonScroll || isSticky
|
|
|
});
|
|
|
var bodyColGroup = /*#__PURE__*/_react_17_0_2_react.createElement(es_ColGroup, {
|
|
|
colWidths: flattenColumns.map(function (_ref5) {
|
|
|
var width = _ref5.width;
|
|
|
return width;
|
|
|
}),
|
|
|
columns: flattenColumns
|
|
|
});
|
|
|
var captionElement = caption !== null && caption !== undefined ? /*#__PURE__*/_react_17_0_2_react.createElement("caption", {
|
|
|
className: "".concat(prefixCls, "-caption")
|
|
|
}, caption) : undefined;
|
|
|
var dataProps = (0,pickAttrs/* default */.Z)(props, {
|
|
|
data: true
|
|
|
});
|
|
|
var ariaProps = (0,pickAttrs/* default */.Z)(props, {
|
|
|
aria: true
|
|
|
});
|
|
|
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 (_ref6, index) {
|
|
|
var width = _ref6.width;
|
|
|
var colWidth = index === flattenColumns.length - 1 ? width - scrollbarSize : width;
|
|
|
if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {
|
|
|
return colWidth;
|
|
|
}
|
|
|
if (false) {}
|
|
|
return 0;
|
|
|
});
|
|
|
} else {
|
|
|
bodyContent = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollXStyle), scrollYStyle),
|
|
|
onScroll: onScroll,
|
|
|
ref: scrollBodyRef,
|
|
|
className: _classnames_2_5_1_classnames_default()("".concat(prefixCls, "-body"))
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(TableComponent, (0,esm_extends/* default */.Z)({
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollTableStyle), {}, {
|
|
|
tableLayout: mergedTableLayout
|
|
|
})
|
|
|
}, ariaProps), captionElement, bodyColGroup, bodyTable, !fixFooter && summaryNode && /*#__PURE__*/_react_17_0_2_react.createElement(es_Footer, {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
flattenColumns: flattenColumns,
|
|
|
columns: columns
|
|
|
}, 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 && mergedScrollX === 'max-content'
|
|
|
}, headerProps), columnContext), {}, {
|
|
|
direction: direction,
|
|
|
stickyClassName: stickyClassName,
|
|
|
onScroll: onScroll
|
|
|
});
|
|
|
groupTableNode = /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, showHeader !== false && /*#__PURE__*/_react_17_0_2_react.createElement(es_FixedHolder, (0,esm_extends/* default */.Z)({}, fixedHolderProps, {
|
|
|
stickyTopOffset: offsetHeader,
|
|
|
className: "".concat(prefixCls, "-header"),
|
|
|
ref: scrollHeaderRef
|
|
|
}), renderFixedHeaderTable), bodyContent, fixFooter && fixFooter !== 'top' && /*#__PURE__*/_react_17_0_2_react.createElement(es_FixedHolder, (0,esm_extends/* default */.Z)({}, fixedHolderProps, {
|
|
|
stickyBottomOffset: offsetSummary,
|
|
|
className: "".concat(prefixCls, "-summary"),
|
|
|
ref: scrollSummaryRef
|
|
|
}), renderFixedFooterTable), isSticky && /*#__PURE__*/_react_17_0_2_react.createElement(stickyScrollBar, {
|
|
|
ref: stickyRef,
|
|
|
offsetScroll: offsetScroll,
|
|
|
scrollBodyRef: scrollBodyRef,
|
|
|
onScroll: onScroll,
|
|
|
container: container
|
|
|
}));
|
|
|
} else {
|
|
|
// >>>>>> Unique table
|
|
|
groupTableNode = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollXStyle), scrollYStyle),
|
|
|
className: _classnames_2_5_1_classnames_default()("".concat(prefixCls, "-content")),
|
|
|
onScroll: onScroll,
|
|
|
ref: scrollBodyRef
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(TableComponent, (0,esm_extends/* default */.Z)({
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollTableStyle), {}, {
|
|
|
tableLayout: mergedTableLayout
|
|
|
})
|
|
|
}, ariaProps), captionElement, bodyColGroup, showHeader !== false && /*#__PURE__*/_react_17_0_2_react.createElement(Header_Header, (0,esm_extends/* default */.Z)({}, headerProps, columnContext)), bodyTable, summaryNode && /*#__PURE__*/_react_17_0_2_react.createElement(es_Footer, {
|
|
|
stickyOffsets: stickyOffsets,
|
|
|
flattenColumns: flattenColumns,
|
|
|
columns: columns
|
|
|
}, summaryNode)));
|
|
|
}
|
|
|
var fullTable = /*#__PURE__*/_react_17_0_2_react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
|
className: _classnames_2_5_1_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
|
|
|
}, dataProps), title && /*#__PURE__*/_react_17_0_2_react.createElement(es_Panel, {
|
|
|
className: "".concat(prefixCls, "-title")
|
|
|
}, title(mergedData)), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
ref: scrollBodyContainerRef,
|
|
|
className: "".concat(prefixCls, "-container")
|
|
|
}, groupTableNode), footer && /*#__PURE__*/_react_17_0_2_react.createElement(es_Panel, {
|
|
|
className: "".concat(prefixCls, "-footer")
|
|
|
}, footer(mergedData)));
|
|
|
if (horizonScroll) {
|
|
|
fullTable = /*#__PURE__*/_react_17_0_2_react.createElement(_rc_resize_observer_1_4_3_rc_resize_observer_es/* default */.Z, {
|
|
|
onResize: onFullTableResize
|
|
|
}, fullTable);
|
|
|
}
|
|
|
var fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction, columns);
|
|
|
var TableContextValue = _react_17_0_2_react.useMemo(function () {
|
|
|
return {
|
|
|
// Scroll
|
|
|
scrollX: mergedScrollX,
|
|
|
// Table
|
|
|
prefixCls: prefixCls,
|
|
|
getComponent: getComponent,
|
|
|
scrollbarSize: scrollbarSize,
|
|
|
direction: direction,
|
|
|
fixedInfoList: fixedInfoList,
|
|
|
isSticky: isSticky,
|
|
|
supportSticky: supportSticky,
|
|
|
componentWidth: componentWidth,
|
|
|
fixHeader: fixHeader,
|
|
|
fixColumn: fixColumn,
|
|
|
horizonScroll: horizonScroll,
|
|
|
// Body
|
|
|
tableLayout: mergedTableLayout,
|
|
|
rowClassName: rowClassName,
|
|
|
expandedRowClassName: expandableConfig.expandedRowClassName,
|
|
|
expandIcon: mergedExpandIcon,
|
|
|
expandableType: expandableType,
|
|
|
expandRowByClick: expandableConfig.expandRowByClick,
|
|
|
expandedRowRender: expandableConfig.expandedRowRender,
|
|
|
onTriggerExpand: onTriggerExpand,
|
|
|
expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
|
|
|
indentSize: expandableConfig.indentSize,
|
|
|
allColumnsFixedLeft: flattenColumns.every(function (col) {
|
|
|
return col.fixed === 'left';
|
|
|
}),
|
|
|
emptyNode: emptyNode,
|
|
|
// Column
|
|
|
columns: columns,
|
|
|
flattenColumns: flattenColumns,
|
|
|
onColumnResize: onColumnResize,
|
|
|
// Row
|
|
|
hoverStartRow: startRow,
|
|
|
hoverEndRow: endRow,
|
|
|
onHover: onHover,
|
|
|
rowExpandable: expandableConfig.rowExpandable,
|
|
|
onRow: onRow,
|
|
|
getRowKey: getRowKey,
|
|
|
expandedKeys: mergedExpandedKeys,
|
|
|
childrenColumnName: mergedChildrenColumnName
|
|
|
};
|
|
|
}, [
|
|
|
// Scroll
|
|
|
mergedScrollX,
|
|
|
// Table
|
|
|
prefixCls, getComponent, scrollbarSize, direction, fixedInfoList, isSticky, supportSticky, componentWidth, fixHeader, fixColumn, horizonScroll,
|
|
|
// Body
|
|
|
mergedTableLayout, rowClassName, expandableConfig.expandedRowClassName, mergedExpandIcon, expandableType, expandableConfig.expandRowByClick, expandableConfig.expandedRowRender, onTriggerExpand, expandableConfig.expandIconColumnIndex, expandableConfig.indentSize, emptyNode,
|
|
|
// Column
|
|
|
columns, flattenColumns, onColumnResize,
|
|
|
// Row
|
|
|
startRow, endRow, onHover, expandableConfig.rowExpandable, onRow, getRowKey, mergedExpandedKeys, mergedChildrenColumnName]);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(context_TableContext.Provider, {
|
|
|
value: TableContextValue
|
|
|
}, fullTable);
|
|
|
}
|
|
|
function genTable(shouldTriggerRender) {
|
|
|
return TableContext_makeImmutable(Table_Table, shouldTriggerRender);
|
|
|
}
|
|
|
var ImmutableTable = genTable();
|
|
|
ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
|
|
|
ImmutableTable.INTERNAL_HOOKS = INTERNAL_HOOKS;
|
|
|
ImmutableTable.Column = sugar_Column;
|
|
|
ImmutableTable.ColumnGroup = sugar_ColumnGroup;
|
|
|
ImmutableTable.Summary = FooterComponents;
|
|
|
/* harmony default export */ var es_Table = (ImmutableTable);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-virtual-list@3.19.1@rc-virtual-list/es/index.js + 17 modules
|
|
|
var _rc_virtual_list_3_19_1_rc_virtual_list_es = __webpack_require__(6790);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/VirtualTable/context.js
|
|
|
|
|
|
var StaticContext = createContext(null);
|
|
|
var GridContext = createContext(null);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/VirtualTable/VirtualCell.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Return the width of the column by `colSpan`.
|
|
|
* When `colSpan` is `0` will be trade as `1`.
|
|
|
*/
|
|
|
function getColumnWidth(colIndex, colSpan, columnsOffset) {
|
|
|
var mergedColSpan = colSpan || 1;
|
|
|
return columnsOffset[colIndex + mergedColSpan] - (columnsOffset[colIndex] || 0);
|
|
|
}
|
|
|
function VirtualCell(props) {
|
|
|
var rowInfo = props.rowInfo,
|
|
|
column = props.column,
|
|
|
colIndex = props.colIndex,
|
|
|
indent = props.indent,
|
|
|
index = props.index,
|
|
|
renderIndex = props.renderIndex,
|
|
|
record = props.record,
|
|
|
style = props.style,
|
|
|
className = props.className,
|
|
|
inverse = props.inverse,
|
|
|
getHeight = props.getHeight;
|
|
|
var render = column.render,
|
|
|
dataIndex = column.dataIndex,
|
|
|
columnClassName = column.className,
|
|
|
colWidth = column.width;
|
|
|
var _useContext = useContext(GridContext, ['columnsOffset']),
|
|
|
columnsOffset = _useContext.columnsOffset;
|
|
|
var _getCellProps = getCellProps(rowInfo, column, colIndex, indent, index),
|
|
|
key = _getCellProps.key,
|
|
|
fixedInfo = _getCellProps.fixedInfo,
|
|
|
appendCellNode = _getCellProps.appendCellNode,
|
|
|
additionalCellProps = _getCellProps.additionalCellProps;
|
|
|
var cellStyle = additionalCellProps.style,
|
|
|
_additionalCellProps$ = additionalCellProps.colSpan,
|
|
|
colSpan = _additionalCellProps$ === void 0 ? 1 : _additionalCellProps$,
|
|
|
_additionalCellProps$2 = additionalCellProps.rowSpan,
|
|
|
rowSpan = _additionalCellProps$2 === void 0 ? 1 : _additionalCellProps$2;
|
|
|
|
|
|
// ========================= ColWidth =========================
|
|
|
// column width
|
|
|
var startColIndex = colIndex - 1;
|
|
|
var concatColWidth = getColumnWidth(startColIndex, colSpan, columnsOffset);
|
|
|
|
|
|
// margin offset
|
|
|
var marginOffset = colSpan > 1 ? colWidth - concatColWidth : 0;
|
|
|
|
|
|
// ========================== Style ===========================
|
|
|
var mergedStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, cellStyle), style), {}, {
|
|
|
flex: "0 0 ".concat(concatColWidth, "px"),
|
|
|
width: "".concat(concatColWidth, "px"),
|
|
|
marginRight: marginOffset,
|
|
|
pointerEvents: 'auto'
|
|
|
});
|
|
|
|
|
|
// When `colSpan` or `rowSpan` is `0`, should skip render.
|
|
|
var needHide = _react_17_0_2_react.useMemo(function () {
|
|
|
if (inverse) {
|
|
|
return rowSpan <= 1;
|
|
|
} else {
|
|
|
return colSpan === 0 || rowSpan === 0 || rowSpan > 1;
|
|
|
}
|
|
|
}, [rowSpan, colSpan, inverse]);
|
|
|
|
|
|
// 0 rowSpan or colSpan should not render
|
|
|
if (needHide) {
|
|
|
mergedStyle.visibility = 'hidden';
|
|
|
} else if (inverse) {
|
|
|
mergedStyle.height = getHeight === null || getHeight === void 0 ? void 0 : getHeight(rowSpan);
|
|
|
}
|
|
|
var mergedRender = needHide ? function () {
|
|
|
return null;
|
|
|
} : render;
|
|
|
|
|
|
// ========================== Render ==========================
|
|
|
var cellSpan = {};
|
|
|
|
|
|
// Virtual should reset `colSpan` & `rowSpan`
|
|
|
if (rowSpan === 0 || colSpan === 0) {
|
|
|
cellSpan.rowSpan = 1;
|
|
|
cellSpan.colSpan = 1;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Cell, (0,esm_extends/* default */.Z)({
|
|
|
className: _classnames_2_5_1_classnames_default()(columnClassName, className),
|
|
|
ellipsis: column.ellipsis,
|
|
|
align: column.align,
|
|
|
scope: column.rowScope,
|
|
|
component: "div",
|
|
|
prefixCls: rowInfo.prefixCls,
|
|
|
key: key,
|
|
|
record: record,
|
|
|
index: index,
|
|
|
renderIndex: renderIndex,
|
|
|
dataIndex: dataIndex,
|
|
|
render: mergedRender,
|
|
|
shouldCellUpdate: column.shouldCellUpdate
|
|
|
}, fixedInfo, {
|
|
|
appendNode: appendCellNode,
|
|
|
additionalProps: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, additionalCellProps), {}, {
|
|
|
style: mergedStyle
|
|
|
}, cellSpan)
|
|
|
}));
|
|
|
}
|
|
|
/* harmony default export */ var VirtualTable_VirtualCell = (VirtualCell);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/VirtualTable/BodyLine.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BodyLine_excluded = ["data", "index", "className", "rowKey", "style", "extra", "getHeight"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BodyLine = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref) {
|
|
|
var data = props.data,
|
|
|
index = props.index,
|
|
|
className = props.className,
|
|
|
rowKey = props.rowKey,
|
|
|
style = props.style,
|
|
|
extra = props.extra,
|
|
|
getHeight = props.getHeight,
|
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, BodyLine_excluded);
|
|
|
var record = data.record,
|
|
|
indent = data.indent,
|
|
|
renderIndex = data.index;
|
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX']),
|
|
|
scrollX = _useContext.scrollX,
|
|
|
flattenColumns = _useContext.flattenColumns,
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
fixColumn = _useContext.fixColumn,
|
|
|
componentWidth = _useContext.componentWidth;
|
|
|
var rowInfo = useRowInfo(record, rowKey, index, indent);
|
|
|
|
|
|
// ========================== Expand ==========================
|
|
|
var rowSupportExpand = rowInfo.rowSupportExpand,
|
|
|
expanded = rowInfo.expanded,
|
|
|
rowProps = rowInfo.rowProps,
|
|
|
expandedRowRender = rowInfo.expandedRowRender,
|
|
|
expandedRowClassName = rowInfo.expandedRowClassName;
|
|
|
var expandRowNode;
|
|
|
if (rowSupportExpand && expanded) {
|
|
|
var expandContent = expandedRowRender(record, index, indent + 1, expanded);
|
|
|
var computedExpandedRowClassName = expandedRowClassName === null || expandedRowClassName === void 0 ? void 0 : expandedRowClassName(record, index, indent);
|
|
|
var additionalProps = {};
|
|
|
if (fixColumn) {
|
|
|
additionalProps = {
|
|
|
style: (0,defineProperty/* default */.Z)({}, '--virtual-width', "".concat(componentWidth, "px"))
|
|
|
};
|
|
|
}
|
|
|
var rowCellCls = "".concat(prefixCls, "-expanded-row-cell");
|
|
|
expandRowNode = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: _classnames_2_5_1_classnames_default()("".concat(prefixCls, "-expanded-row"), "".concat(prefixCls, "-expanded-row-level-").concat(indent + 1), computedExpandedRowClassName)
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es_Cell, {
|
|
|
component: "div",
|
|
|
prefixCls: prefixCls,
|
|
|
className: _classnames_2_5_1_classnames_default()(rowCellCls, (0,defineProperty/* default */.Z)({}, "".concat(rowCellCls, "-fixed"), fixColumn)),
|
|
|
additionalProps: additionalProps
|
|
|
}, expandContent));
|
|
|
}
|
|
|
|
|
|
// ========================== Render ==========================
|
|
|
|
|
|
var rowStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, style), {}, {
|
|
|
width: scrollX
|
|
|
});
|
|
|
if (extra) {
|
|
|
rowStyle.position = 'absolute';
|
|
|
rowStyle.pointerEvents = 'none';
|
|
|
}
|
|
|
var rowNode = /*#__PURE__*/_react_17_0_2_react.createElement("div", (0,esm_extends/* default */.Z)({}, rowProps, restProps, {
|
|
|
ref: rowSupportExpand ? null : ref,
|
|
|
className: _classnames_2_5_1_classnames_default()(className, "".concat(prefixCls, "-row"), rowProps === null || rowProps === void 0 ? void 0 : rowProps.className, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-row-extra"), extra)),
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, rowStyle), rowProps === null || rowProps === void 0 ? void 0 : rowProps.style)
|
|
|
}), flattenColumns.map(function (column, colIndex) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(VirtualTable_VirtualCell, {
|
|
|
key: colIndex,
|
|
|
rowInfo: rowInfo,
|
|
|
column: column,
|
|
|
colIndex: colIndex,
|
|
|
indent: indent,
|
|
|
index: index,
|
|
|
renderIndex: renderIndex,
|
|
|
record: record,
|
|
|
inverse: extra,
|
|
|
getHeight: getHeight
|
|
|
});
|
|
|
}));
|
|
|
if (rowSupportExpand) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
ref: ref
|
|
|
}, rowNode, expandRowNode);
|
|
|
}
|
|
|
return rowNode;
|
|
|
});
|
|
|
var ResponseBodyLine = TableContext_responseImmutable(BodyLine);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var VirtualTable_BodyLine = (ResponseBodyLine);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/VirtualTable/BodyGrid.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Grid = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref) {
|
|
|
var data = props.data,
|
|
|
onScroll = props.onScroll;
|
|
|
var _useContext = useContext(context_TableContext, ['flattenColumns', 'onColumnResize', 'getRowKey', 'prefixCls', 'expandedKeys', 'childrenColumnName', 'emptyNode', 'scrollX']),
|
|
|
flattenColumns = _useContext.flattenColumns,
|
|
|
onColumnResize = _useContext.onColumnResize,
|
|
|
getRowKey = _useContext.getRowKey,
|
|
|
expandedKeys = _useContext.expandedKeys,
|
|
|
prefixCls = _useContext.prefixCls,
|
|
|
childrenColumnName = _useContext.childrenColumnName,
|
|
|
emptyNode = _useContext.emptyNode,
|
|
|
scrollX = _useContext.scrollX;
|
|
|
var _useContext2 = useContext(StaticContext),
|
|
|
scrollY = _useContext2.scrollY,
|
|
|
listItemHeight = _useContext2.listItemHeight;
|
|
|
|
|
|
// =========================== Ref ============================
|
|
|
var listRef = _react_17_0_2_react.useRef();
|
|
|
|
|
|
// =========================== Data ===========================
|
|
|
var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
|
|
|
|
|
|
// ========================== Column ==========================
|
|
|
var columnsWidth = _react_17_0_2_react.useMemo(function () {
|
|
|
var total = 0;
|
|
|
return flattenColumns.map(function (_ref) {
|
|
|
var width = _ref.width,
|
|
|
key = _ref.key;
|
|
|
total += width;
|
|
|
return [key, width, total];
|
|
|
});
|
|
|
}, [flattenColumns]);
|
|
|
var columnsOffset = _react_17_0_2_react.useMemo(function () {
|
|
|
return columnsWidth.map(function (colWidth) {
|
|
|
return colWidth[2];
|
|
|
});
|
|
|
}, [columnsWidth]);
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
columnsWidth.forEach(function (_ref2) {
|
|
|
var _ref3 = (0,slicedToArray/* default */.Z)(_ref2, 2),
|
|
|
key = _ref3[0],
|
|
|
width = _ref3[1];
|
|
|
onColumnResize(key, width);
|
|
|
});
|
|
|
}, [columnsWidth]);
|
|
|
|
|
|
// =========================== Ref ============================
|
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
|
var obj = {};
|
|
|
Object.defineProperty(obj, 'scrollLeft', {
|
|
|
get: function get() {
|
|
|
var _listRef$current;
|
|
|
return ((_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.getScrollInfo().x) || 0;
|
|
|
},
|
|
|
set: function set(value) {
|
|
|
var _listRef$current2;
|
|
|
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.scrollTo({
|
|
|
left: value
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
return obj;
|
|
|
});
|
|
|
|
|
|
// ======================= Col/Row Span =======================
|
|
|
var getRowSpan = function getRowSpan(column, index) {
|
|
|
var _flattenData$index;
|
|
|
var record = (_flattenData$index = flattenData[index]) === null || _flattenData$index === void 0 ? void 0 : _flattenData$index.record;
|
|
|
var onCell = column.onCell;
|
|
|
if (onCell) {
|
|
|
var _cellProps$rowSpan;
|
|
|
var cellProps = onCell(record, index);
|
|
|
return (_cellProps$rowSpan = cellProps === null || cellProps === void 0 ? void 0 : cellProps.rowSpan) !== null && _cellProps$rowSpan !== void 0 ? _cellProps$rowSpan : 1;
|
|
|
}
|
|
|
return 1;
|
|
|
};
|
|
|
var extraRender = function extraRender(info) {
|
|
|
var start = info.start,
|
|
|
end = info.end,
|
|
|
getSize = info.getSize,
|
|
|
offsetY = info.offsetY;
|
|
|
|
|
|
// Do nothing if no data
|
|
|
if (end < 0) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
// Find first rowSpan column
|
|
|
var firstRowSpanColumns = flattenColumns.filter(
|
|
|
// rowSpan is 0
|
|
|
function (column) {
|
|
|
return getRowSpan(column, start) === 0;
|
|
|
});
|
|
|
var startIndex = start;
|
|
|
var _loop = function _loop(i) {
|
|
|
firstRowSpanColumns = firstRowSpanColumns.filter(function (column) {
|
|
|
return getRowSpan(column, i) === 0;
|
|
|
});
|
|
|
if (!firstRowSpanColumns.length) {
|
|
|
startIndex = i;
|
|
|
return "break";
|
|
|
}
|
|
|
};
|
|
|
for (var i = start; i >= 0; i -= 1) {
|
|
|
var _ret = _loop(i);
|
|
|
if (_ret === "break") break;
|
|
|
}
|
|
|
|
|
|
// Find last rowSpan column
|
|
|
var lastRowSpanColumns = flattenColumns.filter(
|
|
|
// rowSpan is not 1
|
|
|
function (column) {
|
|
|
return getRowSpan(column, end) !== 1;
|
|
|
});
|
|
|
var endIndex = end;
|
|
|
var _loop2 = function _loop2(_i) {
|
|
|
lastRowSpanColumns = lastRowSpanColumns.filter(function (column) {
|
|
|
return getRowSpan(column, _i) !== 1;
|
|
|
});
|
|
|
if (!lastRowSpanColumns.length) {
|
|
|
endIndex = Math.max(_i - 1, end);
|
|
|
return "break";
|
|
|
}
|
|
|
};
|
|
|
for (var _i = end; _i < flattenData.length; _i += 1) {
|
|
|
var _ret2 = _loop2(_i);
|
|
|
if (_ret2 === "break") break;
|
|
|
}
|
|
|
|
|
|
// Collect the line who has rowSpan
|
|
|
var spanLines = [];
|
|
|
var _loop3 = function _loop3(_i2) {
|
|
|
var item = flattenData[_i2];
|
|
|
|
|
|
// This code will never reach, just incase
|
|
|
if (!item) {
|
|
|
return "continue";
|
|
|
}
|
|
|
if (flattenColumns.some(function (column) {
|
|
|
return getRowSpan(column, _i2) > 1;
|
|
|
})) {
|
|
|
spanLines.push(_i2);
|
|
|
}
|
|
|
};
|
|
|
for (var _i2 = startIndex; _i2 <= endIndex; _i2 += 1) {
|
|
|
var _ret3 = _loop3(_i2);
|
|
|
if (_ret3 === "continue") continue;
|
|
|
}
|
|
|
|
|
|
// Patch extra line on the page
|
|
|
var nodes = spanLines.map(function (index) {
|
|
|
var item = flattenData[index];
|
|
|
var rowKey = getRowKey(item.record, index);
|
|
|
var getHeight = function getHeight(rowSpan) {
|
|
|
var endItemIndex = index + rowSpan - 1;
|
|
|
var endItemKey = getRowKey(flattenData[endItemIndex].record, endItemIndex);
|
|
|
var sizeInfo = getSize(rowKey, endItemKey);
|
|
|
return sizeInfo.bottom - sizeInfo.top;
|
|
|
};
|
|
|
var sizeInfo = getSize(rowKey);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(VirtualTable_BodyLine, {
|
|
|
key: index,
|
|
|
data: item,
|
|
|
rowKey: rowKey,
|
|
|
index: index,
|
|
|
style: {
|
|
|
top: -offsetY + sizeInfo.top
|
|
|
},
|
|
|
extra: true,
|
|
|
getHeight: getHeight
|
|
|
});
|
|
|
});
|
|
|
return nodes;
|
|
|
};
|
|
|
|
|
|
// ========================= Context ==========================
|
|
|
var gridContext = _react_17_0_2_react.useMemo(function () {
|
|
|
return {
|
|
|
columnsOffset: columnsOffset
|
|
|
};
|
|
|
}, [columnsOffset]);
|
|
|
|
|
|
// ========================== Render ==========================
|
|
|
var tblPrefixCls = "".concat(prefixCls, "-tbody");
|
|
|
var bodyContent;
|
|
|
if (flattenData.length) {
|
|
|
bodyContent = /*#__PURE__*/_react_17_0_2_react.createElement(_rc_virtual_list_3_19_1_rc_virtual_list_es/* default */.Z, {
|
|
|
fullHeight: false,
|
|
|
ref: listRef,
|
|
|
className: _classnames_2_5_1_classnames_default()(tblPrefixCls, "".concat(tblPrefixCls, "-virtual")),
|
|
|
height: scrollY,
|
|
|
itemHeight: listItemHeight || 24,
|
|
|
data: flattenData,
|
|
|
itemKey: function itemKey(item) {
|
|
|
return getRowKey(item.record);
|
|
|
},
|
|
|
scrollWidth: scrollX,
|
|
|
onVirtualScroll: function onVirtualScroll(_ref4) {
|
|
|
var x = _ref4.x;
|
|
|
onScroll({
|
|
|
scrollLeft: x
|
|
|
});
|
|
|
},
|
|
|
extraRender: extraRender
|
|
|
}, function (item, index, itemProps) {
|
|
|
var rowKey = getRowKey(item.record, index);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(VirtualTable_BodyLine, (0,esm_extends/* default */.Z)({
|
|
|
data: item,
|
|
|
rowKey: rowKey,
|
|
|
index: index
|
|
|
}, itemProps));
|
|
|
});
|
|
|
} else {
|
|
|
bodyContent = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: _classnames_2_5_1_classnames_default()("".concat(prefixCls, "-placeholder"))
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es_Cell, {
|
|
|
component: "div",
|
|
|
prefixCls: prefixCls
|
|
|
}, emptyNode));
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(GridContext.Provider, {
|
|
|
value: gridContext
|
|
|
}, bodyContent);
|
|
|
});
|
|
|
var ResponseGrid = TableContext_responseImmutable(Grid);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var BodyGrid = (ResponseGrid);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/VirtualTable/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var renderBody = function renderBody(rawData, props) {
|
|
|
var ref = props.ref,
|
|
|
onScroll = props.onScroll;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(BodyGrid, {
|
|
|
ref: ref,
|
|
|
data: rawData,
|
|
|
onScroll: onScroll
|
|
|
});
|
|
|
};
|
|
|
var PRESET_COLUMN_WIDTH = 100;
|
|
|
function VirtualTable(props) {
|
|
|
var columns = props.columns,
|
|
|
scroll = props.scroll,
|
|
|
_props$prefixCls = props.prefixCls,
|
|
|
prefixCls = _props$prefixCls === void 0 ? DEFAULT_PREFIX : _props$prefixCls,
|
|
|
className = props.className,
|
|
|
listItemHeight = props.listItemHeight;
|
|
|
var _ref = scroll || {},
|
|
|
scrollX = _ref.x,
|
|
|
scrollY = _ref.y;
|
|
|
|
|
|
// Fill scrollX
|
|
|
if (typeof scrollX !== 'number') {
|
|
|
scrollX = ((columns || []).length + 1) * PRESET_COLUMN_WIDTH;
|
|
|
if (false) {}
|
|
|
}
|
|
|
|
|
|
// Fill scrollY
|
|
|
if (typeof scrollY !== 'number') {
|
|
|
scrollY = 500;
|
|
|
if (false) {}
|
|
|
}
|
|
|
|
|
|
// ========================= Context ==========================
|
|
|
var context = _react_17_0_2_react.useMemo(function () {
|
|
|
return {
|
|
|
scrollY: scrollY,
|
|
|
listItemHeight: listItemHeight
|
|
|
};
|
|
|
}, [scrollY, listItemHeight]);
|
|
|
|
|
|
// ========================== Render ==========================
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(StaticContext.Provider, {
|
|
|
value: context
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es_Table, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
className: _classnames_2_5_1_classnames_default()(className, "".concat(prefixCls, "-virtual")),
|
|
|
scroll: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scroll), {}, {
|
|
|
x: scrollX
|
|
|
}),
|
|
|
components: {
|
|
|
body: renderBody
|
|
|
},
|
|
|
columns: columns,
|
|
|
internalHooks: INTERNAL_HOOKS,
|
|
|
tailor: true
|
|
|
})));
|
|
|
}
|
|
|
function genVirtualTable(shouldTriggerRender) {
|
|
|
return TableContext_makeImmutable(VirtualTable, shouldTriggerRender);
|
|
|
}
|
|
|
/* harmony default export */ var es_VirtualTable = (genVirtualTable());
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-table@7.33.4@rc-table/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var _rc_table_7_33_4_rc_table_es = ((/* unused pure expression or super */ null && (Table)));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@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@5.9.0@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);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(2738);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/scrollTo.js + 1 modules
|
|
|
var scrollTo = __webpack_require__(68031);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/defaultRenderEmpty.js
|
|
|
var defaultRenderEmpty = __webpack_require__(93891);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
|
var useSize = __webpack_require__(19716);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/grid/hooks/useBreakpoint.js
|
|
|
var useBreakpoint = __webpack_require__(8628);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/locale/en_US.js + 1 modules
|
|
|
var en_US = __webpack_require__(31724);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var es_pagination = __webpack_require__(58421);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/useToken.js + 4 modules
|
|
|
var useToken = __webpack_require__(88088);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/ExpandIcon.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
function ExpandIcon_renderExpandIcon(locale) {
|
|
|
return function expandIcon(_ref) {
|
|
|
let {
|
|
|
prefixCls,
|
|
|
onExpand,
|
|
|
record,
|
|
|
expanded,
|
|
|
expandable
|
|
|
} = _ref;
|
|
|
const iconPrefix = `${prefixCls}-row-expand-icon`;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("button", {
|
|
|
type: "button",
|
|
|
onClick: e => {
|
|
|
onExpand(record, e);
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
className: _classnames_2_5_1_classnames_default()(iconPrefix, {
|
|
|
[`${iconPrefix}-spaced`]: !expandable,
|
|
|
[`${iconPrefix}-expanded`]: expandable && expanded,
|
|
|
[`${iconPrefix}-collapsed`]: expandable && !expanded
|
|
|
}),
|
|
|
"aria-label": expanded ? locale.collapse : locale.expand,
|
|
|
"aria-expanded": expanded
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
/* harmony default export */ var ExpandIcon = (ExpandIcon_renderExpandIcon);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@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 ? `${pos}-${index}` : `${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) {
|
|
|
const res = renderColumnTitle(title, props);
|
|
|
if (Object.prototype.toString.call(res) === '[object Object]') return '';
|
|
|
return res;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@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/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(7657);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@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_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_FilterFilled
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(FilterFilled_FilterFilled);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_FilterFilled = (RefIcon);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useForceUpdate.js
|
|
|
var useForceUpdate = __webpack_require__(56762);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useSyncState.js
|
|
|
|
|
|
|
|
|
function useSyncState(initialValue) {
|
|
|
const ref = _react_17_0_2_react.useRef(initialValue);
|
|
|
const forceUpdate = (0,useForceUpdate/* default */.Z)();
|
|
|
return [() => ref.current, newValue => {
|
|
|
ref.current = newValue;
|
|
|
// re-render
|
|
|
forceUpdate();
|
|
|
}];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/empty/index.js + 3 modules
|
|
|
var empty = __webpack_require__(64165);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var es_menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/OverrideContext.js
|
|
|
var OverrideContext = __webpack_require__(40875);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(5112);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules
|
|
|
var tree = __webpack_require__(41416);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/SearchOutlined.js + 1 modules
|
|
|
var SearchOutlined = __webpack_require__(47472);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(10249);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useFilter/FilterSearch.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function FilterSearch(_ref) {
|
|
|
let {
|
|
|
value,
|
|
|
onChange,
|
|
|
filterSearch,
|
|
|
tablePrefixCls,
|
|
|
locale
|
|
|
} = _ref;
|
|
|
if (!filterSearch) {
|
|
|
return null;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${tablePrefixCls}-filter-dropdown-search`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(input/* default */.Z, {
|
|
|
prefix: /*#__PURE__*/_react_17_0_2_react.createElement(SearchOutlined/* default */.Z, null),
|
|
|
placeholder: locale.filterSearchPlaceholder,
|
|
|
onChange: onChange,
|
|
|
value: value,
|
|
|
// for skip min-width of input
|
|
|
htmlSize: 1,
|
|
|
className: `${tablePrefixCls}-filter-dropdown-search-input`
|
|
|
}));
|
|
|
}
|
|
|
/* harmony default export */ var useFilter_FilterSearch = (FilterSearch);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/KeyCode.js
|
|
|
var KeyCode = __webpack_require__(10228);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useFilter/FilterWrapper.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const onKeyDown = event => {
|
|
|
const {
|
|
|
keyCode
|
|
|
} = event;
|
|
|
if (keyCode === KeyCode/* default */.Z.ENTER) {
|
|
|
event.stopPropagation();
|
|
|
}
|
|
|
};
|
|
|
const FilterDropdownMenuWrapper = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: props.className,
|
|
|
onClick: e => e.stopPropagation(),
|
|
|
onKeyDown: onKeyDown,
|
|
|
ref: ref
|
|
|
}, props.children));
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var FilterWrapper = (FilterDropdownMenuWrapper);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useFilter/FilterDropdown.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function flattenKeys(filters) {
|
|
|
let keys = [];
|
|
|
(filters || []).forEach(_ref => {
|
|
|
let {
|
|
|
value,
|
|
|
children
|
|
|
} = _ref;
|
|
|
keys.push(value);
|
|
|
if (children) {
|
|
|
keys = [].concat((0,toConsumableArray/* default */.Z)(keys), (0,toConsumableArray/* default */.Z)(flattenKeys(children)));
|
|
|
}
|
|
|
});
|
|
|
return keys;
|
|
|
}
|
|
|
function hasSubMenu(filters) {
|
|
|
return filters.some(_ref2 => {
|
|
|
let {
|
|
|
children
|
|
|
} = _ref2;
|
|
|
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(_ref3) {
|
|
|
let {
|
|
|
filters,
|
|
|
prefixCls,
|
|
|
filteredKeys,
|
|
|
filterMultiple,
|
|
|
searchValue,
|
|
|
filterSearch
|
|
|
} = _ref3;
|
|
|
return filters.map((filter, index) => {
|
|
|
const key = String(filter.value);
|
|
|
if (filter.children) {
|
|
|
return {
|
|
|
key: key || index,
|
|
|
label: filter.text,
|
|
|
popupClassName: `${prefixCls}-dropdown-submenu`,
|
|
|
children: renderFilterItems({
|
|
|
filters: filter.children,
|
|
|
prefixCls,
|
|
|
filteredKeys,
|
|
|
filterMultiple,
|
|
|
searchValue,
|
|
|
filterSearch
|
|
|
})
|
|
|
};
|
|
|
}
|
|
|
const Component = filterMultiple ? es_checkbox/* default */.Z : es_radio/* default */.ZP;
|
|
|
const item = {
|
|
|
key: filter.value !== undefined ? key : index,
|
|
|
label: /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement(Component, {
|
|
|
checked: filteredKeys.includes(key)
|
|
|
}), /*#__PURE__*/_react_17_0_2_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, _b;
|
|
|
const {
|
|
|
tablePrefixCls,
|
|
|
prefixCls,
|
|
|
column,
|
|
|
dropdownPrefixCls,
|
|
|
columnKey,
|
|
|
filterMultiple,
|
|
|
filterMode = 'menu',
|
|
|
filterSearch = false,
|
|
|
filterState,
|
|
|
triggerFilter,
|
|
|
locale,
|
|
|
children,
|
|
|
getPopupContainer
|
|
|
} = props;
|
|
|
const {
|
|
|
filterDropdownOpen,
|
|
|
onFilterDropdownOpenChange,
|
|
|
filterResetToDefaultFilteredValue,
|
|
|
defaultFilteredValue,
|
|
|
// Deprecated
|
|
|
filterDropdownVisible,
|
|
|
onFilterDropdownVisibleChange
|
|
|
} = column;
|
|
|
const [visible, setVisible] = _react_17_0_2_react.useState(false);
|
|
|
const filtered = !!(filterState && (((_a = filterState.filteredKeys) === null || _a === void 0 ? void 0 : _a.length) || filterState.forceFiltered));
|
|
|
const triggerVisible = newVisible => {
|
|
|
setVisible(newVisible);
|
|
|
onFilterDropdownOpenChange === null || onFilterDropdownOpenChange === void 0 ? void 0 : onFilterDropdownOpenChange(newVisible);
|
|
|
onFilterDropdownVisibleChange === null || onFilterDropdownVisibleChange === void 0 ? void 0 : onFilterDropdownVisibleChange(newVisible);
|
|
|
};
|
|
|
if (false) {}
|
|
|
const mergedVisible = (_b = filterDropdownOpen !== null && filterDropdownOpen !== void 0 ? filterDropdownOpen : filterDropdownVisible) !== null && _b !== void 0 ? _b : visible;
|
|
|
// ===================== Select Keys =====================
|
|
|
const propFilteredKeys = filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys;
|
|
|
const [getFilteredKeysSync, setFilteredKeysSync] = useSyncState(propFilteredKeys || []);
|
|
|
const onSelectKeys = _ref5 => {
|
|
|
let {
|
|
|
selectedKeys
|
|
|
} = _ref5;
|
|
|
setFilteredKeysSync(selectedKeys);
|
|
|
};
|
|
|
const onCheck = (keys, _ref6) => {
|
|
|
let {
|
|
|
node,
|
|
|
checked
|
|
|
} = _ref6;
|
|
|
if (!filterMultiple) {
|
|
|
onSelectKeys({
|
|
|
selectedKeys: checked && node.key ? [node.key] : []
|
|
|
});
|
|
|
} else {
|
|
|
onSelectKeys({
|
|
|
selectedKeys: keys
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (!visible) {
|
|
|
return;
|
|
|
}
|
|
|
onSelectKeys({
|
|
|
selectedKeys: propFilteredKeys || []
|
|
|
});
|
|
|
}, [propFilteredKeys]);
|
|
|
// ====================== Open Keys ======================
|
|
|
const [openKeys, setOpenKeys] = _react_17_0_2_react.useState([]);
|
|
|
const onOpenChange = keys => {
|
|
|
setOpenKeys(keys);
|
|
|
};
|
|
|
// search in tree mode column filter
|
|
|
const [searchValue, setSearchValue] = _react_17_0_2_react.useState('');
|
|
|
const onSearch = e => {
|
|
|
const {
|
|
|
value
|
|
|
} = e.target;
|
|
|
setSearchValue(value);
|
|
|
};
|
|
|
// clear search value after close filter dropdown
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (!visible) {
|
|
|
setSearchValue('');
|
|
|
}
|
|
|
}, [visible]);
|
|
|
// ======================= Submit ========================
|
|
|
const internalTriggerFilter = keys => {
|
|
|
const mergedKeys = keys && keys.length ? keys : null;
|
|
|
if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) {
|
|
|
return null;
|
|
|
}
|
|
|
if ((0,isEqual/* default */.Z)(mergedKeys, filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys, true)) {
|
|
|
return null;
|
|
|
}
|
|
|
triggerFilter({
|
|
|
column,
|
|
|
key: columnKey,
|
|
|
filteredKeys: mergedKeys
|
|
|
});
|
|
|
};
|
|
|
const onConfirm = () => {
|
|
|
triggerVisible(false);
|
|
|
internalTriggerFilter(getFilteredKeysSync());
|
|
|
};
|
|
|
const onReset = function () {
|
|
|
let {
|
|
|
confirm,
|
|
|
closeDropdown
|
|
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
|
confirm: false,
|
|
|
closeDropdown: false
|
|
|
};
|
|
|
if (confirm) {
|
|
|
internalTriggerFilter([]);
|
|
|
}
|
|
|
if (closeDropdown) {
|
|
|
triggerVisible(false);
|
|
|
}
|
|
|
setSearchValue('');
|
|
|
if (filterResetToDefaultFilteredValue) {
|
|
|
setFilteredKeysSync((defaultFilteredValue || []).map(key => String(key)));
|
|
|
} else {
|
|
|
setFilteredKeysSync([]);
|
|
|
}
|
|
|
};
|
|
|
const doFilter = function () {
|
|
|
let {
|
|
|
closeDropdown
|
|
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
|
closeDropdown: true
|
|
|
};
|
|
|
if (closeDropdown) {
|
|
|
triggerVisible(false);
|
|
|
}
|
|
|
internalTriggerFilter(getFilteredKeysSync());
|
|
|
};
|
|
|
const onVisibleChange = newVisible => {
|
|
|
if (newVisible && propFilteredKeys !== undefined) {
|
|
|
// Sync filteredKeys on appear in controlled mode (propFilteredKeys !== undefined)
|
|
|
setFilteredKeysSync(propFilteredKeys || []);
|
|
|
}
|
|
|
triggerVisible(newVisible);
|
|
|
// Default will filter when closed
|
|
|
if (!newVisible && !column.filterDropdown) {
|
|
|
onConfirm();
|
|
|
}
|
|
|
};
|
|
|
// ======================== Style ========================
|
|
|
const dropdownMenuClass = _classnames_2_5_1_classnames_default()({
|
|
|
[`${dropdownPrefixCls}-menu-without-submenu`]: !hasSubMenu(column.filters || [])
|
|
|
});
|
|
|
const onCheckAll = e => {
|
|
|
if (e.target.checked) {
|
|
|
const allFilterKeys = flattenKeys(column === null || column === void 0 ? void 0 : column.filters).map(key => String(key));
|
|
|
setFilteredKeysSync(allFilterKeys);
|
|
|
} else {
|
|
|
setFilteredKeysSync([]);
|
|
|
}
|
|
|
};
|
|
|
const getTreeData = _ref7 => {
|
|
|
let {
|
|
|
filters
|
|
|
} = _ref7;
|
|
|
return (filters || []).map((filter, index) => {
|
|
|
const key = String(filter.value);
|
|
|
const item = {
|
|
|
title: filter.text,
|
|
|
key: filter.value !== undefined ? key : index
|
|
|
};
|
|
|
if (filter.children) {
|
|
|
item.children = getTreeData({
|
|
|
filters: filter.children
|
|
|
});
|
|
|
}
|
|
|
return item;
|
|
|
});
|
|
|
};
|
|
|
const getFilterData = node => {
|
|
|
var _a;
|
|
|
return Object.assign(Object.assign({}, node), {
|
|
|
text: node.title,
|
|
|
value: node.key,
|
|
|
children: ((_a = node.children) === null || _a === void 0 ? void 0 : _a.map(item => getFilterData(item))) || []
|
|
|
});
|
|
|
};
|
|
|
let dropdownContent;
|
|
|
if (typeof column.filterDropdown === 'function') {
|
|
|
dropdownContent = column.filterDropdown({
|
|
|
prefixCls: `${dropdownPrefixCls}-custom`,
|
|
|
setSelectedKeys: selectedKeys => onSelectKeys({
|
|
|
selectedKeys
|
|
|
}),
|
|
|
selectedKeys: getFilteredKeysSync(),
|
|
|
confirm: doFilter,
|
|
|
clearFilters: onReset,
|
|
|
filters: column.filters,
|
|
|
visible: mergedVisible,
|
|
|
close: () => {
|
|
|
triggerVisible(false);
|
|
|
}
|
|
|
});
|
|
|
} else if (column.filterDropdown) {
|
|
|
dropdownContent = column.filterDropdown;
|
|
|
} else {
|
|
|
const selectedKeys = getFilteredKeysSync() || [];
|
|
|
const getFilterComponent = () => {
|
|
|
if ((column.filters || []).length === 0) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(empty/* default */.Z, {
|
|
|
image: empty/* default */.Z.PRESENTED_IMAGE_SIMPLE,
|
|
|
description: locale.filterEmptyText,
|
|
|
imageStyle: {
|
|
|
height: 24
|
|
|
},
|
|
|
style: {
|
|
|
margin: 0,
|
|
|
padding: '16px 0'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
if (filterMode === 'tree') {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement(useFilter_FilterSearch, {
|
|
|
filterSearch: filterSearch,
|
|
|
value: searchValue,
|
|
|
onChange: onSearch,
|
|
|
tablePrefixCls: tablePrefixCls,
|
|
|
locale: locale
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${tablePrefixCls}-filter-dropdown-tree`
|
|
|
}, filterMultiple ? /*#__PURE__*/_react_17_0_2_react.createElement(es_checkbox/* default */.Z, {
|
|
|
checked: selectedKeys.length === flattenKeys(column.filters).length,
|
|
|
indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column.filters).length,
|
|
|
className: `${tablePrefixCls}-filter-dropdown-checkall`,
|
|
|
onChange: onCheckAll
|
|
|
}, locale.filterCheckall) : null, /*#__PURE__*/_react_17_0_2_react.createElement(tree/* default */.Z, {
|
|
|
checkable: true,
|
|
|
selectable: false,
|
|
|
blockNode: true,
|
|
|
multiple: filterMultiple,
|
|
|
checkStrictly: !filterMultiple,
|
|
|
className: `${dropdownPrefixCls}-menu`,
|
|
|
onCheck: onCheck,
|
|
|
checkedKeys: selectedKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
showIcon: false,
|
|
|
treeData: getTreeData({
|
|
|
filters: column.filters
|
|
|
}),
|
|
|
autoExpandParent: true,
|
|
|
defaultExpandAll: true,
|
|
|
filterTreeNode: searchValue.trim() ? node => {
|
|
|
if (typeof filterSearch === 'function') {
|
|
|
return filterSearch(searchValue, getFilterData(node));
|
|
|
}
|
|
|
return searchValueMatched(searchValue, node.title);
|
|
|
} : undefined
|
|
|
})));
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement(useFilter_FilterSearch, {
|
|
|
filterSearch: filterSearch,
|
|
|
value: searchValue,
|
|
|
onChange: onSearch,
|
|
|
tablePrefixCls: tablePrefixCls,
|
|
|
locale: locale
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(es_menu/* default */.Z, {
|
|
|
selectable: true,
|
|
|
multiple: filterMultiple,
|
|
|
prefixCls: `${dropdownPrefixCls}-menu`,
|
|
|
className: dropdownMenuClass,
|
|
|
onSelect: onSelectKeys,
|
|
|
onDeselect: onSelectKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
getPopupContainer: getPopupContainer,
|
|
|
openKeys: openKeys,
|
|
|
onOpenChange: onOpenChange,
|
|
|
items: renderFilterItems({
|
|
|
filters: column.filters || [],
|
|
|
filterSearch,
|
|
|
prefixCls,
|
|
|
filteredKeys: getFilteredKeysSync(),
|
|
|
filterMultiple,
|
|
|
searchValue
|
|
|
})
|
|
|
}));
|
|
|
};
|
|
|
const getResetDisabled = () => {
|
|
|
if (filterResetToDefaultFilteredValue) {
|
|
|
return (0,isEqual/* default */.Z)((defaultFilteredValue || []).map(key => String(key)), selectedKeys, true);
|
|
|
}
|
|
|
return selectedKeys.length === 0;
|
|
|
};
|
|
|
dropdownContent = /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, getFilterComponent(), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-dropdown-btns`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
size: "small",
|
|
|
disabled: getResetDisabled(),
|
|
|
onClick: () => onReset()
|
|
|
}, locale.filterReset), /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
size: "small",
|
|
|
onClick: onConfirm
|
|
|
}, locale.filterConfirm)));
|
|
|
}
|
|
|
// We should not block customize Menu with additional props
|
|
|
if (column.filterDropdown) {
|
|
|
dropdownContent = /*#__PURE__*/_react_17_0_2_react.createElement(OverrideContext/* OverrideProvider */.J, {
|
|
|
selectable: undefined
|
|
|
}, dropdownContent);
|
|
|
}
|
|
|
const menu = () => /*#__PURE__*/_react_17_0_2_react.createElement(FilterWrapper, {
|
|
|
className: `${prefixCls}-dropdown`
|
|
|
}, dropdownContent);
|
|
|
let filterIcon;
|
|
|
if (typeof column.filterIcon === 'function') {
|
|
|
filterIcon = column.filterIcon(filtered);
|
|
|
} else if (column.filterIcon) {
|
|
|
filterIcon = column.filterIcon;
|
|
|
} else {
|
|
|
filterIcon = /*#__PURE__*/_react_17_0_2_react.createElement(icons_FilterFilled, null);
|
|
|
}
|
|
|
const {
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-column`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${tablePrefixCls}-column-title`
|
|
|
}, children), /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, {
|
|
|
dropdownRender: menu,
|
|
|
trigger: ['click'],
|
|
|
open: mergedVisible,
|
|
|
onOpenChange: onVisibleChange,
|
|
|
getPopupContainer: getPopupContainer,
|
|
|
placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight'
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
role: "button",
|
|
|
tabIndex: -1,
|
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-trigger`, {
|
|
|
active: filtered
|
|
|
}),
|
|
|
onClick: e => {
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
}, filterIcon)));
|
|
|
}
|
|
|
/* harmony default export */ var useFilter_FilterDropdown = (FilterDropdown);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useFilter/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function collectFilterStates(columns, init, pos) {
|
|
|
let filterStates = [];
|
|
|
(columns || []).forEach((column, index) => {
|
|
|
var _a;
|
|
|
const columnPos = getColumnPos(index, pos);
|
|
|
if (column.filters || 'filterDropdown' in column || 'onFilter' in column) {
|
|
|
if ('filteredValue' in column) {
|
|
|
// Controlled
|
|
|
let 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,
|
|
|
key: getColumnKey(column, columnPos),
|
|
|
filteredKeys: filteredValues,
|
|
|
forceFiltered: column.filtered
|
|
|
});
|
|
|
} else {
|
|
|
// Uncontrolled
|
|
|
filterStates.push({
|
|
|
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, locale, triggerFilter, getPopupContainer, pos) {
|
|
|
return columns.map((column, index) => {
|
|
|
const columnPos = getColumnPos(index, pos);
|
|
|
const {
|
|
|
filterMultiple = true,
|
|
|
filterMode,
|
|
|
filterSearch
|
|
|
} = column;
|
|
|
let newColumn = column;
|
|
|
if (newColumn.filters || newColumn.filterDropdown) {
|
|
|
const columnKey = getColumnKey(newColumn, columnPos);
|
|
|
const filterState = filterStates.find(_ref => {
|
|
|
let {
|
|
|
key
|
|
|
} = _ref;
|
|
|
return columnKey === key;
|
|
|
});
|
|
|
newColumn = Object.assign(Object.assign({}, newColumn), {
|
|
|
title: renderProps => /*#__PURE__*/_react_17_0_2_react.createElement(useFilter_FilterDropdown, {
|
|
|
tablePrefixCls: prefixCls,
|
|
|
prefixCls: `${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 = Object.assign(Object.assign({}, newColumn), {
|
|
|
children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, locale, triggerFilter, getPopupContainer, columnPos)
|
|
|
});
|
|
|
}
|
|
|
return newColumn;
|
|
|
});
|
|
|
}
|
|
|
function generateFilterInfo(filterStates) {
|
|
|
const currentFilters = {};
|
|
|
filterStates.forEach(_ref2 => {
|
|
|
let {
|
|
|
key,
|
|
|
filteredKeys,
|
|
|
column
|
|
|
} = _ref2;
|
|
|
const {
|
|
|
filters,
|
|
|
filterDropdown
|
|
|
} = column;
|
|
|
if (filterDropdown) {
|
|
|
currentFilters[key] = filteredKeys || null;
|
|
|
} else if (Array.isArray(filteredKeys)) {
|
|
|
const keys = flattenKeys(filters);
|
|
|
currentFilters[key] = keys.filter(originKey => filteredKeys.includes(String(originKey)));
|
|
|
} else {
|
|
|
currentFilters[key] = null;
|
|
|
}
|
|
|
});
|
|
|
return currentFilters;
|
|
|
}
|
|
|
function getFilterData(data, filterStates) {
|
|
|
return filterStates.reduce((currentData, filterState) => {
|
|
|
const {
|
|
|
column: {
|
|
|
onFilter,
|
|
|
filters
|
|
|
},
|
|
|
filteredKeys
|
|
|
} = filterState;
|
|
|
if (onFilter && filteredKeys && filteredKeys.length) {
|
|
|
return currentData.filter(record => filteredKeys.some(key => {
|
|
|
const keys = flattenKeys(filters);
|
|
|
const keyIndex = keys.findIndex(k => String(k) === String(key));
|
|
|
const realKey = keyIndex !== -1 ? keys[keyIndex] : key;
|
|
|
return onFilter(realKey, record);
|
|
|
}));
|
|
|
}
|
|
|
return currentData;
|
|
|
}, data);
|
|
|
}
|
|
|
const getMergedColumns = rawMergedColumns => rawMergedColumns.flatMap(column => {
|
|
|
if ('children' in column) {
|
|
|
return [column].concat((0,toConsumableArray/* default */.Z)(getMergedColumns(column.children || [])));
|
|
|
}
|
|
|
return [column];
|
|
|
});
|
|
|
function useFilter(_ref3) {
|
|
|
let {
|
|
|
prefixCls,
|
|
|
dropdownPrefixCls,
|
|
|
mergedColumns: rawMergedColumns,
|
|
|
onFilterChange,
|
|
|
getPopupContainer,
|
|
|
locale: tableLocale
|
|
|
} = _ref3;
|
|
|
const mergedColumns = _react_17_0_2_react.useMemo(() => getMergedColumns(rawMergedColumns || []), [rawMergedColumns]);
|
|
|
const [filterStates, setFilterStates] = _react_17_0_2_react.useState(() => collectFilterStates(mergedColumns, true));
|
|
|
const mergedFilterStates = _react_17_0_2_react.useMemo(() => {
|
|
|
const collectedStates = collectFilterStates(mergedColumns, false);
|
|
|
if (collectedStates.length === 0) {
|
|
|
return collectedStates;
|
|
|
}
|
|
|
let filteredKeysIsAllNotControlled = true;
|
|
|
let filteredKeysIsAllControlled = true;
|
|
|
collectedStates.forEach(_ref4 => {
|
|
|
let {
|
|
|
filteredKeys
|
|
|
} = _ref4;
|
|
|
if (filteredKeys !== undefined) {
|
|
|
filteredKeysIsAllNotControlled = false;
|
|
|
} else {
|
|
|
filteredKeysIsAllControlled = false;
|
|
|
}
|
|
|
});
|
|
|
// Return if not controlled
|
|
|
if (filteredKeysIsAllNotControlled) {
|
|
|
// Filter column may have been removed
|
|
|
const keyList = (mergedColumns || []).map((column, index) => getColumnKey(column, getColumnPos(index)));
|
|
|
return filterStates.filter(_ref5 => {
|
|
|
let {
|
|
|
key
|
|
|
} = _ref5;
|
|
|
return keyList.includes(key);
|
|
|
}).map(item => {
|
|
|
const col = mergedColumns[keyList.findIndex(key => key === item.key)];
|
|
|
return Object.assign(Object.assign({}, item), {
|
|
|
column: Object.assign(Object.assign({}, item.column), col),
|
|
|
forceFiltered: col.filtered
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
false ? 0 : void 0;
|
|
|
return collectedStates;
|
|
|
}, [mergedColumns, filterStates]);
|
|
|
const filters = _react_17_0_2_react.useMemo(() => generateFilterInfo(mergedFilterStates), [mergedFilterStates]);
|
|
|
const triggerFilter = filterState => {
|
|
|
const newFilterStates = mergedFilterStates.filter(_ref6 => {
|
|
|
let {
|
|
|
key
|
|
|
} = _ref6;
|
|
|
return key !== filterState.key;
|
|
|
});
|
|
|
newFilterStates.push(filterState);
|
|
|
setFilterStates(newFilterStates);
|
|
|
onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);
|
|
|
};
|
|
|
const transformColumns = innerColumns => injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, tableLocale, triggerFilter, getPopupContainer);
|
|
|
return [transformColumns, mergedFilterStates, filters];
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var hooks_useFilter = (useFilter);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useLazyKVMap.js
|
|
|
|
|
|
function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
|
const mapCacheRef = _react_17_0_2_react.useRef({});
|
|
|
function getRecordByKey(key) {
|
|
|
if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
|
|
|
const kvMap = new Map();
|
|
|
/* eslint-disable no-inner-declarations */
|
|
|
function dig(records) {
|
|
|
records.forEach((record, index) => {
|
|
|
const rowKey = getRowKey(record, index);
|
|
|
kvMap.set(rowKey, record);
|
|
|
if (record && typeof record === 'object' && childrenColumnName in record) {
|
|
|
dig(record[childrenColumnName] || []);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
/* eslint-enable */
|
|
|
dig(data);
|
|
|
mapCacheRef.current = {
|
|
|
data,
|
|
|
childrenColumnName,
|
|
|
kvMap,
|
|
|
getRowKey
|
|
|
};
|
|
|
}
|
|
|
return mapCacheRef.current.kvMap.get(key);
|
|
|
}
|
|
|
return [getRecordByKey];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/extendsObject.js
|
|
|
var extendsObject = __webpack_require__(50371);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@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;
|
|
|
};
|
|
|
|
|
|
|
|
|
const DEFAULT_PAGE_SIZE = 10;
|
|
|
function getPaginationParam(mergedPagination, pagination) {
|
|
|
const param = {
|
|
|
current: mergedPagination.current,
|
|
|
pageSize: mergedPagination.pageSize
|
|
|
};
|
|
|
const paginationObj = pagination && typeof pagination === 'object' ? pagination : {};
|
|
|
Object.keys(paginationObj).forEach(pageProp => {
|
|
|
const value = mergedPagination[pageProp];
|
|
|
if (typeof value !== 'function') {
|
|
|
param[pageProp] = value;
|
|
|
}
|
|
|
});
|
|
|
return param;
|
|
|
}
|
|
|
function usePagination(total, onChange, pagination) {
|
|
|
const _a = pagination && typeof pagination === 'object' ? pagination : {},
|
|
|
{
|
|
|
total: paginationTotal = 0
|
|
|
} = _a,
|
|
|
paginationObj = __rest(_a, ["total"]);
|
|
|
const [innerPagination, setInnerPagination] = (0,_react_17_0_2_react.useState)(() => ({
|
|
|
current: 'defaultCurrent' in paginationObj ? paginationObj.defaultCurrent : 1,
|
|
|
pageSize: 'defaultPageSize' in paginationObj ? paginationObj.defaultPageSize : DEFAULT_PAGE_SIZE
|
|
|
}));
|
|
|
// ============ Basic Pagination Config ============
|
|
|
const mergedPagination = (0,extendsObject/* default */.Z)(innerPagination, paginationObj, {
|
|
|
total: paginationTotal > 0 ? paginationTotal : total
|
|
|
});
|
|
|
// Reset `current` if data length or pageSize changed
|
|
|
const maxPage = Math.ceil((paginationTotal || total) / mergedPagination.pageSize);
|
|
|
if (mergedPagination.current > maxPage) {
|
|
|
// Prevent a maximum page count of 0
|
|
|
mergedPagination.current = maxPage || 1;
|
|
|
}
|
|
|
const refreshPagination = (current, pageSize) => {
|
|
|
setInnerPagination({
|
|
|
current: current !== null && current !== void 0 ? current : 1,
|
|
|
pageSize: pageSize || mergedPagination.pageSize
|
|
|
});
|
|
|
};
|
|
|
const 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 [{}, () => {}];
|
|
|
}
|
|
|
return [Object.assign(Object.assign({}, mergedPagination), {
|
|
|
onChange: onInternalChange
|
|
|
}), refreshPagination];
|
|
|
}
|
|
|
/* harmony default export */ var hooks_usePagination = (usePagination);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(84105);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/util.js
|
|
|
var util = __webpack_require__(35654);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/utils/conductUtil.js
|
|
|
var conductUtil = __webpack_require__(90782);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/utils/treeUtil.js
|
|
|
var treeUtil = __webpack_require__(71430);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/hooks/useMergedState.js
|
|
|
var useMergedState = __webpack_require__(18929);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useSelection.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: warning if use ajax!!!
|
|
|
const SELECTION_COLUMN = {};
|
|
|
const SELECTION_ALL = 'SELECT_ALL';
|
|
|
const SELECTION_INVERT = 'SELECT_INVERT';
|
|
|
const SELECTION_NONE = 'SELECT_NONE';
|
|
|
const EMPTY_LIST = [];
|
|
|
const flattenData = (childrenColumnName, data) => {
|
|
|
let list = [];
|
|
|
(data || []).forEach(record => {
|
|
|
list.push(record);
|
|
|
if (record && typeof record === 'object' && childrenColumnName in record) {
|
|
|
list = [].concat((0,toConsumableArray/* default */.Z)(list), (0,toConsumableArray/* default */.Z)(flattenData(childrenColumnName, record[childrenColumnName])));
|
|
|
}
|
|
|
});
|
|
|
return list;
|
|
|
};
|
|
|
const useSelection = (config, rowSelection) => {
|
|
|
const {
|
|
|
preserveSelectedRowKeys,
|
|
|
selectedRowKeys,
|
|
|
defaultSelectedRowKeys,
|
|
|
getCheckboxProps,
|
|
|
onChange: onSelectionChange,
|
|
|
onSelect,
|
|
|
onSelectAll,
|
|
|
onSelectInvert,
|
|
|
onSelectNone,
|
|
|
onSelectMultiple,
|
|
|
columnWidth: selectionColWidth,
|
|
|
type: selectionType,
|
|
|
selections,
|
|
|
fixed,
|
|
|
renderCell: customizeRenderCell,
|
|
|
hideSelectAll,
|
|
|
checkStrictly = true
|
|
|
} = rowSelection || {};
|
|
|
const {
|
|
|
prefixCls,
|
|
|
data,
|
|
|
pageData,
|
|
|
getRecordByKey,
|
|
|
getRowKey,
|
|
|
expandType,
|
|
|
childrenColumnName,
|
|
|
locale: tableLocale,
|
|
|
getPopupContainer
|
|
|
} = config;
|
|
|
// ========================= Keys =========================
|
|
|
const [mergedSelectedKeys, setMergedSelectedKeys] = (0,useMergedState/* default */.Z)(selectedRowKeys || defaultSelectedRowKeys || EMPTY_LIST, {
|
|
|
value: selectedRowKeys
|
|
|
});
|
|
|
// ======================== Caches ========================
|
|
|
const preserveRecordsRef = _react_17_0_2_react.useRef(new Map());
|
|
|
const updatePreserveRecordsCache = (0,_react_17_0_2_react.useCallback)(keys => {
|
|
|
if (preserveSelectedRowKeys) {
|
|
|
const newCache = new Map();
|
|
|
// Keep key if mark as preserveSelectedRowKeys
|
|
|
keys.forEach(key => {
|
|
|
let 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_17_0_2_react.useEffect(() => {
|
|
|
updatePreserveRecordsCache(mergedSelectedKeys);
|
|
|
}, [mergedSelectedKeys]);
|
|
|
const {
|
|
|
keyEntities
|
|
|
} = (0,_react_17_0_2_react.useMemo)(() => {
|
|
|
if (checkStrictly) {
|
|
|
return {
|
|
|
keyEntities: null
|
|
|
};
|
|
|
}
|
|
|
let convertData = data;
|
|
|
if (preserveSelectedRowKeys) {
|
|
|
const keysSet = new Set(data.map((record, index) => getRowKey(record, index)));
|
|
|
// remove preserveRecords that duplicate data
|
|
|
const preserveRecords = Array.from(preserveRecordsRef.current).reduce((total, _ref) => {
|
|
|
let [key, value] = _ref;
|
|
|
return keysSet.has(key) ? total : total.concat(value);
|
|
|
}, []);
|
|
|
convertData = [].concat((0,toConsumableArray/* default */.Z)(convertData), (0,toConsumableArray/* default */.Z)(preserveRecords));
|
|
|
}
|
|
|
return (0,treeUtil/* convertDataToEntities */.I8)(convertData, {
|
|
|
externalGetKey: getRowKey,
|
|
|
childrenPropName: childrenColumnName
|
|
|
});
|
|
|
}, [data, getRowKey, checkStrictly, childrenColumnName, preserveSelectedRowKeys]);
|
|
|
// Get flatten data
|
|
|
const flattedData = (0,_react_17_0_2_react.useMemo)(() => flattenData(childrenColumnName, pageData), [childrenColumnName, pageData]);
|
|
|
// Get all checkbox props
|
|
|
const checkboxPropsMap = (0,_react_17_0_2_react.useMemo)(() => {
|
|
|
const map = new Map();
|
|
|
flattedData.forEach((record, index) => {
|
|
|
const key = getRowKey(record, index);
|
|
|
const checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};
|
|
|
map.set(key, checkboxProps);
|
|
|
false ? 0 : void 0;
|
|
|
});
|
|
|
return map;
|
|
|
}, [flattedData, getRowKey, getCheckboxProps]);
|
|
|
const isCheckboxDisabled = (0,_react_17_0_2_react.useCallback)(r => {
|
|
|
var _a;
|
|
|
return !!((_a = checkboxPropsMap.get(getRowKey(r))) === null || _a === void 0 ? void 0 : _a.disabled);
|
|
|
}, [checkboxPropsMap, getRowKey]);
|
|
|
const [derivedSelectedKeys, derivedHalfSelectedKeys] = (0,_react_17_0_2_react.useMemo)(() => {
|
|
|
if (checkStrictly) {
|
|
|
return [mergedSelectedKeys || [], []];
|
|
|
}
|
|
|
const {
|
|
|
checkedKeys,
|
|
|
halfCheckedKeys
|
|
|
} = (0,conductUtil/* conductCheck */.S)(mergedSelectedKeys, true, keyEntities, isCheckboxDisabled);
|
|
|
return [checkedKeys || [], halfCheckedKeys];
|
|
|
}, [mergedSelectedKeys, checkStrictly, keyEntities, isCheckboxDisabled]);
|
|
|
const derivedSelectedKeySet = (0,_react_17_0_2_react.useMemo)(() => {
|
|
|
const keys = selectionType === 'radio' ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;
|
|
|
return new Set(keys);
|
|
|
}, [derivedSelectedKeys, selectionType]);
|
|
|
const derivedHalfSelectedKeySet = (0,_react_17_0_2_react.useMemo)(() => selectionType === 'radio' ? new Set() : new Set(derivedHalfSelectedKeys), [derivedHalfSelectedKeys, selectionType]);
|
|
|
// Save last selected key to enable range selection
|
|
|
const [lastSelectedKey, setLastSelectedKey] = (0,_react_17_0_2_react.useState)(null);
|
|
|
// Reset if rowSelection reset
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (!rowSelection) {
|
|
|
setMergedSelectedKeys(EMPTY_LIST);
|
|
|
}
|
|
|
}, [!!rowSelection]);
|
|
|
const setSelectedKeys = (0,_react_17_0_2_react.useCallback)((keys, method) => {
|
|
|
let availableKeys;
|
|
|
let records;
|
|
|
updatePreserveRecordsCache(keys);
|
|
|
if (preserveSelectedRowKeys) {
|
|
|
availableKeys = keys;
|
|
|
records = keys.map(key => preserveRecordsRef.current.get(key));
|
|
|
} else {
|
|
|
// Filter key which not exist in the `dataSource`
|
|
|
availableKeys = [];
|
|
|
records = [];
|
|
|
keys.forEach(key => {
|
|
|
const 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
|
|
|
const triggerSingleSelection = (0,_react_17_0_2_react.useCallback)((key, selected, keys, event) => {
|
|
|
if (onSelect) {
|
|
|
const rows = keys.map(k => getRecordByKey(k));
|
|
|
onSelect(getRecordByKey(key), selected, rows, event);
|
|
|
}
|
|
|
setSelectedKeys(keys, 'single');
|
|
|
}, [onSelect, getRecordByKey, setSelectedKeys]);
|
|
|
const mergedSelections = (0,_react_17_0_2_react.useMemo)(() => {
|
|
|
if (!selections || hideSelectAll) {
|
|
|
return null;
|
|
|
}
|
|
|
const selectionList = selections === true ? [SELECTION_ALL, SELECTION_INVERT, SELECTION_NONE] : selections;
|
|
|
return selectionList.map(selection => {
|
|
|
if (selection === SELECTION_ALL) {
|
|
|
return {
|
|
|
key: 'all',
|
|
|
text: tableLocale.selectionAll,
|
|
|
onSelect() {
|
|
|
setSelectedKeys(data.map((record, index) => getRowKey(record, index)).filter(key => {
|
|
|
const 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() {
|
|
|
const keySet = new Set(derivedSelectedKeySet);
|
|
|
pageData.forEach((record, index) => {
|
|
|
const key = getRowKey(record, index);
|
|
|
const 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);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
const 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() {
|
|
|
onSelectNone === null || onSelectNone === void 0 ? void 0 : onSelectNone();
|
|
|
setSelectedKeys(Array.from(derivedSelectedKeySet).filter(key => {
|
|
|
const checkProps = checkboxPropsMap.get(key);
|
|
|
return checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled;
|
|
|
}), 'none');
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
return selection;
|
|
|
}).map(selection => Object.assign(Object.assign({}, selection), {
|
|
|
onSelect: function () {
|
|
|
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 ========================
|
|
|
const transformColumns = (0,_react_17_0_2_react.useCallback)(columns => {
|
|
|
var _a;
|
|
|
// >>>>>>>>>>> Skip if not exists `rowSelection`
|
|
|
if (!rowSelection) {
|
|
|
false ? 0 : void 0;
|
|
|
return columns.filter(col => col !== SELECTION_COLUMN);
|
|
|
}
|
|
|
// >>>>>>>>>>> Support selection
|
|
|
let cloneColumns = (0,toConsumableArray/* default */.Z)(columns);
|
|
|
const keySet = new Set(derivedSelectedKeySet);
|
|
|
// Record key only need check with enabled
|
|
|
const recordKeys = flattedData.map(getRowKey).filter(key => !checkboxPropsMap.get(key).disabled);
|
|
|
const checkedCurrentAll = recordKeys.every(key => keySet.has(key));
|
|
|
const checkedCurrentSome = recordKeys.some(key => keySet.has(key));
|
|
|
const onSelectAllChange = () => {
|
|
|
const changeKeys = [];
|
|
|
if (checkedCurrentAll) {
|
|
|
recordKeys.forEach(key => {
|
|
|
keySet.delete(key);
|
|
|
changeKeys.push(key);
|
|
|
});
|
|
|
} else {
|
|
|
recordKeys.forEach(key => {
|
|
|
if (!keySet.has(key)) {
|
|
|
keySet.add(key);
|
|
|
changeKeys.push(key);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
const keys = Array.from(keySet);
|
|
|
onSelectAll === null || onSelectAll === void 0 ? void 0 : onSelectAll(!checkedCurrentAll, keys.map(k => getRecordByKey(k)), changeKeys.map(k => getRecordByKey(k)));
|
|
|
setSelectedKeys(keys, 'all');
|
|
|
setLastSelectedKey(null);
|
|
|
};
|
|
|
// ===================== Render =====================
|
|
|
// Title Cell
|
|
|
let title;
|
|
|
if (selectionType !== 'radio') {
|
|
|
let customizeSelections;
|
|
|
if (mergedSelections) {
|
|
|
const menu = {
|
|
|
getPopupContainer,
|
|
|
items: mergedSelections.map((selection, index) => {
|
|
|
const {
|
|
|
key,
|
|
|
text,
|
|
|
onSelect: onSelectionClick
|
|
|
} = selection;
|
|
|
return {
|
|
|
key: key !== null && key !== void 0 ? key : index,
|
|
|
onClick: () => {
|
|
|
onSelectionClick === null || onSelectionClick === void 0 ? void 0 : onSelectionClick(recordKeys);
|
|
|
},
|
|
|
label: text
|
|
|
};
|
|
|
})
|
|
|
};
|
|
|
customizeSelections = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-selection-extra`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, {
|
|
|
menu: menu,
|
|
|
getPopupContainer: getPopupContainer
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", null, /*#__PURE__*/_react_17_0_2_react.createElement(DownOutlined/* default */.Z, null))));
|
|
|
}
|
|
|
const allDisabledData = flattedData.map((record, index) => {
|
|
|
const key = getRowKey(record, index);
|
|
|
const checkboxProps = checkboxPropsMap.get(key) || {};
|
|
|
return Object.assign({
|
|
|
checked: keySet.has(key)
|
|
|
}, checkboxProps);
|
|
|
}).filter(_ref2 => {
|
|
|
let {
|
|
|
disabled
|
|
|
} = _ref2;
|
|
|
return disabled;
|
|
|
});
|
|
|
const allDisabled = !!allDisabledData.length && allDisabledData.length === flattedData.length;
|
|
|
const allDisabledAndChecked = allDisabled && allDisabledData.every(_ref3 => {
|
|
|
let {
|
|
|
checked
|
|
|
} = _ref3;
|
|
|
return checked;
|
|
|
});
|
|
|
const allDisabledSomeChecked = allDisabled && allDisabledData.some(_ref4 => {
|
|
|
let {
|
|
|
checked
|
|
|
} = _ref4;
|
|
|
return checked;
|
|
|
});
|
|
|
title = !hideSelectAll && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-selection`
|
|
|
}, /*#__PURE__*/_react_17_0_2_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
|
|
|
let renderCell;
|
|
|
if (selectionType === 'radio') {
|
|
|
renderCell = (_, record, index) => {
|
|
|
const key = getRowKey(record, index);
|
|
|
const checked = keySet.has(key);
|
|
|
return {
|
|
|
node: /*#__PURE__*/_react_17_0_2_react.createElement(es_radio/* default */.ZP, Object.assign({}, checkboxPropsMap.get(key), {
|
|
|
checked: checked,
|
|
|
onClick: e => e.stopPropagation(),
|
|
|
onChange: event => {
|
|
|
if (!keySet.has(key)) {
|
|
|
triggerSingleSelection(key, true, [key], event.nativeEvent);
|
|
|
}
|
|
|
}
|
|
|
})),
|
|
|
checked
|
|
|
};
|
|
|
};
|
|
|
} else {
|
|
|
renderCell = (_, record, index) => {
|
|
|
var _a;
|
|
|
const key = getRowKey(record, index);
|
|
|
const checked = keySet.has(key);
|
|
|
const indeterminate = derivedHalfSelectedKeySet.has(key);
|
|
|
const checkboxProps = checkboxPropsMap.get(key);
|
|
|
let 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_17_0_2_react.createElement(es_checkbox/* default */.Z, Object.assign({}, checkboxProps, {
|
|
|
indeterminate: mergedIndeterminate,
|
|
|
checked: checked,
|
|
|
skipGroup: true,
|
|
|
onClick: e => e.stopPropagation(),
|
|
|
onChange: _ref5 => {
|
|
|
let {
|
|
|
nativeEvent
|
|
|
} = _ref5;
|
|
|
const {
|
|
|
shiftKey
|
|
|
} = nativeEvent;
|
|
|
let startIndex = -1;
|
|
|
let endIndex = -1;
|
|
|
// Get range of this
|
|
|
if (shiftKey && checkStrictly) {
|
|
|
const pointKeys = new Set([lastSelectedKey, key]);
|
|
|
recordKeys.some((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
|
|
|
const rangeKeys = recordKeys.slice(startIndex, endIndex + 1);
|
|
|
const changedKeys = [];
|
|
|
if (checked) {
|
|
|
rangeKeys.forEach(recordKey => {
|
|
|
if (keySet.has(recordKey)) {
|
|
|
changedKeys.push(recordKey);
|
|
|
keySet.delete(recordKey);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
rangeKeys.forEach(recordKey => {
|
|
|
if (!keySet.has(recordKey)) {
|
|
|
changedKeys.push(recordKey);
|
|
|
keySet.add(recordKey);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
const keys = Array.from(keySet);
|
|
|
onSelectMultiple === null || onSelectMultiple === void 0 ? void 0 : onSelectMultiple(!checked, keys.map(recordKey => getRecordByKey(recordKey)), changedKeys.map(recordKey => getRecordByKey(recordKey)));
|
|
|
setSelectedKeys(keys, 'multiple');
|
|
|
} else {
|
|
|
// Single record selected
|
|
|
const originCheckedKeys = derivedSelectedKeys;
|
|
|
if (checkStrictly) {
|
|
|
const checkedKeys = checked ? (0,util/* arrDel */._5)(originCheckedKeys, key) : (0,util/* arrAdd */.L0)(originCheckedKeys, key);
|
|
|
triggerSingleSelection(key, !checked, checkedKeys, nativeEvent);
|
|
|
} else {
|
|
|
// Always fill first
|
|
|
const result = (0,conductUtil/* conductCheck */.S)([].concat((0,toConsumableArray/* default */.Z)(originCheckedKeys), [key]), true, keyEntities, isCheckboxDisabled);
|
|
|
const {
|
|
|
checkedKeys,
|
|
|
halfCheckedKeys
|
|
|
} = result;
|
|
|
let nextCheckedKeys = checkedKeys;
|
|
|
// If remove, we do it again to correction
|
|
|
if (checked) {
|
|
|
const tempKeySet = new Set(checkedKeys);
|
|
|
tempKeySet.delete(key);
|
|
|
nextCheckedKeys = (0,conductUtil/* conductCheck */.S)(Array.from(tempKeySet), {
|
|
|
checked: false,
|
|
|
halfCheckedKeys
|
|
|
}, keyEntities, isCheckboxDisabled).checkedKeys;
|
|
|
}
|
|
|
triggerSingleSelection(key, !checked, nextCheckedKeys, nativeEvent);
|
|
|
}
|
|
|
}
|
|
|
if (checked) {
|
|
|
setLastSelectedKey(null);
|
|
|
} else {
|
|
|
setLastSelectedKey(key);
|
|
|
}
|
|
|
}
|
|
|
})),
|
|
|
checked
|
|
|
};
|
|
|
};
|
|
|
}
|
|
|
const renderSelectionCell = (_, record, index) => {
|
|
|
const {
|
|
|
node,
|
|
|
checked
|
|
|
} = renderCell(_, record, index);
|
|
|
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(col => {
|
|
|
var _a;
|
|
|
return ((_a = col[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN';
|
|
|
}) === 0) {
|
|
|
const [expandColumn, ...restColumns] = cloneColumns;
|
|
|
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
|
|
|
const selectionColumnIndex = cloneColumns.indexOf(SELECTION_COLUMN);
|
|
|
false ? 0 : void 0;
|
|
|
cloneColumns = cloneColumns.filter((column, index) => column !== SELECTION_COLUMN || index === selectionColumnIndex);
|
|
|
// Fixed column logic
|
|
|
const prevCol = cloneColumns[selectionColumnIndex - 1];
|
|
|
const nextCol = cloneColumns[selectionColumnIndex + 1];
|
|
|
let 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;
|
|
|
}
|
|
|
const columnCls = _classnames_2_5_1_classnames_default()(`${prefixCls}-selection-col`, {
|
|
|
[`${prefixCls}-selection-col-with-dropdown`]: selections && selectionType === 'checkbox'
|
|
|
});
|
|
|
// Replace with real selection column
|
|
|
const selectionColumn = {
|
|
|
fixed: mergedFixed,
|
|
|
width: selectionColWidth,
|
|
|
className: `${prefixCls}-selection-column`,
|
|
|
title: rowSelection.columnTitle || title,
|
|
|
render: renderSelectionCell,
|
|
|
onCell: rowSelection.onCell,
|
|
|
[INTERNAL_COL_DEFINE]: {
|
|
|
className: columnCls
|
|
|
}
|
|
|
};
|
|
|
return cloneColumns.map(col => col === SELECTION_COLUMN ? selectionColumn : col);
|
|
|
}, [getRowKey, flattedData, rowSelection, derivedSelectedKeys, derivedSelectedKeySet, derivedHalfSelectedKeySet, selectionColWidth, mergedSelections, expandType, lastSelectedKey, checkboxPropsMap, onSelectMultiple, triggerSingleSelection, isCheckboxDisabled]);
|
|
|
return [transformColumns, derivedSelectedKeySet];
|
|
|
};
|
|
|
/* harmony default export */ var hooks_useSelection = (useSelection);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CaretDownOutlined.js + 1 modules
|
|
|
var CaretDownOutlined = __webpack_require__(89489);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CaretUpOutlined.js + 1 modules
|
|
|
var CaretUpOutlined = __webpack_require__(59477);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useSorter.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ASCEND = 'ascend';
|
|
|
const DESCEND = 'descend';
|
|
|
function getMultiplePriority(column) {
|
|
|
if (typeof 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 && typeof 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) {
|
|
|
let sortStates = [];
|
|
|
function pushState(column, columnPos) {
|
|
|
sortStates.push({
|
|
|
column,
|
|
|
key: getColumnKey(column, columnPos),
|
|
|
multiplePriority: getMultiplePriority(column),
|
|
|
sortOrder: column.sortOrder
|
|
|
});
|
|
|
}
|
|
|
(columns || []).forEach((column, index) => {
|
|
|
const 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,
|
|
|
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((column, index) => {
|
|
|
const columnPos = getColumnPos(index, pos);
|
|
|
let newColumn = column;
|
|
|
if (newColumn.sorter) {
|
|
|
const sortDirections = newColumn.sortDirections || defaultSortDirections;
|
|
|
const showSorterTooltip = newColumn.showSorterTooltip === undefined ? tableShowSorterTooltip : newColumn.showSorterTooltip;
|
|
|
const columnKey = getColumnKey(newColumn, columnPos);
|
|
|
const sorterState = sorterStates.find(_ref => {
|
|
|
let {
|
|
|
key
|
|
|
} = _ref;
|
|
|
return key === columnKey;
|
|
|
});
|
|
|
const sortOrder = sorterState ? sorterState.sortOrder : null;
|
|
|
const nextSortOrder = nextSortDirection(sortDirections, sortOrder);
|
|
|
let sorter;
|
|
|
if (column.sortIcon) {
|
|
|
sorter = column.sortIcon({
|
|
|
sortOrder
|
|
|
});
|
|
|
} else {
|
|
|
const upNode = sortDirections.includes(ASCEND) && /*#__PURE__*/_react_17_0_2_react.createElement(CaretUpOutlined/* default */.Z, {
|
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-column-sorter-up`, {
|
|
|
active: sortOrder === ASCEND
|
|
|
})
|
|
|
});
|
|
|
const downNode = sortDirections.includes(DESCEND) && /*#__PURE__*/_react_17_0_2_react.createElement(CaretDownOutlined/* default */.Z, {
|
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-column-sorter-down`, {
|
|
|
active: sortOrder === DESCEND
|
|
|
})
|
|
|
});
|
|
|
sorter = /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-column-sorter`, {
|
|
|
[`${prefixCls}-column-sorter-full`]: !!(upNode && downNode)
|
|
|
})
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-column-sorter-inner`,
|
|
|
"aria-hidden": "true"
|
|
|
}, upNode, downNode));
|
|
|
}
|
|
|
const {
|
|
|
cancelSort,
|
|
|
triggerAsc,
|
|
|
triggerDesc
|
|
|
} = tableLocale || {};
|
|
|
let sortTip = cancelSort;
|
|
|
if (nextSortOrder === DESCEND) {
|
|
|
sortTip = triggerDesc;
|
|
|
} else if (nextSortOrder === ASCEND) {
|
|
|
sortTip = triggerAsc;
|
|
|
}
|
|
|
const tooltipProps = typeof showSorterTooltip === 'object' ? showSorterTooltip : {
|
|
|
title: sortTip
|
|
|
};
|
|
|
newColumn = Object.assign(Object.assign({}, newColumn), {
|
|
|
className: _classnames_2_5_1_classnames_default()(newColumn.className, {
|
|
|
[`${prefixCls}-column-sort`]: sortOrder
|
|
|
}),
|
|
|
title: renderProps => {
|
|
|
const renderSortTitle = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-column-sorters`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-column-title`
|
|
|
}, renderColumnTitle(column.title, renderProps)), sorter);
|
|
|
return showSorterTooltip ? /*#__PURE__*/_react_17_0_2_react.createElement(tooltip/* default */.Z, Object.assign({}, tooltipProps), renderSortTitle) : renderSortTitle;
|
|
|
},
|
|
|
onHeaderCell: col => {
|
|
|
const cell = column.onHeaderCell && column.onHeaderCell(col) || {};
|
|
|
const originOnClick = cell.onClick;
|
|
|
const originOKeyDown = cell.onKeyDown;
|
|
|
cell.onClick = event => {
|
|
|
triggerSorter({
|
|
|
column,
|
|
|
key: columnKey,
|
|
|
sortOrder: nextSortOrder,
|
|
|
multiplePriority: getMultiplePriority(column)
|
|
|
});
|
|
|
originOnClick === null || originOnClick === void 0 ? void 0 : originOnClick(event);
|
|
|
};
|
|
|
cell.onKeyDown = event => {
|
|
|
if (event.keyCode === KeyCode/* default */.Z.ENTER) {
|
|
|
triggerSorter({
|
|
|
column,
|
|
|
key: columnKey,
|
|
|
sortOrder: nextSortOrder,
|
|
|
multiplePriority: getMultiplePriority(column)
|
|
|
});
|
|
|
originOKeyDown === null || originOKeyDown === void 0 ? void 0 : originOKeyDown(event);
|
|
|
}
|
|
|
};
|
|
|
const renderTitle = safeColumnTitle(column.title, {});
|
|
|
const 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 (sortOrder) {
|
|
|
cell['aria-sort'] = sortOrder === 'ascend' ? 'ascending' : 'descending';
|
|
|
} else {
|
|
|
cell['aria-label'] = displayTitle || '';
|
|
|
}
|
|
|
cell.className = _classnames_2_5_1_classnames_default()(cell.className, `${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 = Object.assign(Object.assign({}, newColumn), {
|
|
|
children: injectSorter(prefixCls, newColumn.children, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, columnPos)
|
|
|
});
|
|
|
}
|
|
|
return newColumn;
|
|
|
});
|
|
|
}
|
|
|
function stateToInfo(sorterStates) {
|
|
|
const {
|
|
|
column,
|
|
|
sortOrder
|
|
|
} = sorterStates;
|
|
|
return {
|
|
|
column,
|
|
|
order: sortOrder,
|
|
|
field: column.dataIndex,
|
|
|
columnKey: column.key
|
|
|
};
|
|
|
}
|
|
|
function generateSorterInfo(sorterStates) {
|
|
|
const list = sorterStates.filter(_ref2 => {
|
|
|
let {
|
|
|
sortOrder
|
|
|
} = _ref2;
|
|
|
return sortOrder;
|
|
|
}).map(stateToInfo);
|
|
|
// =========== Legacy compatible support ===========
|
|
|
// https://github.com/ant-design/ant-design/pull/19226
|
|
|
if (list.length === 0 && sorterStates.length) {
|
|
|
return Object.assign(Object.assign({}, stateToInfo(sorterStates[sorterStates.length - 1])), {
|
|
|
column: undefined
|
|
|
});
|
|
|
}
|
|
|
if (list.length <= 1) {
|
|
|
return list[0] || {};
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
function getSortData(data, sortStates, childrenColumnName) {
|
|
|
const innerSorterStates = sortStates.slice().sort((a, b) => b.multiplePriority - a.multiplePriority);
|
|
|
const cloneData = data.slice();
|
|
|
const runningSorters = innerSorterStates.filter(_ref3 => {
|
|
|
let {
|
|
|
column: {
|
|
|
sorter
|
|
|
},
|
|
|
sortOrder
|
|
|
} = _ref3;
|
|
|
return getSortFunction(sorter) && sortOrder;
|
|
|
});
|
|
|
// Skip if no sorter needed
|
|
|
if (!runningSorters.length) {
|
|
|
return cloneData;
|
|
|
}
|
|
|
return cloneData.sort((record1, record2) => {
|
|
|
for (let i = 0; i < runningSorters.length; i += 1) {
|
|
|
const sorterState = runningSorters[i];
|
|
|
const {
|
|
|
column: {
|
|
|
sorter
|
|
|
},
|
|
|
sortOrder
|
|
|
} = sorterState;
|
|
|
const compareFn = getSortFunction(sorter);
|
|
|
if (compareFn && sortOrder) {
|
|
|
const compareResult = compareFn(record1, record2, sortOrder);
|
|
|
if (compareResult !== 0) {
|
|
|
return sortOrder === ASCEND ? compareResult : -compareResult;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return 0;
|
|
|
}).map(record => {
|
|
|
const subRecords = record[childrenColumnName];
|
|
|
if (subRecords) {
|
|
|
return Object.assign(Object.assign({}, record), {
|
|
|
[childrenColumnName]: getSortData(subRecords, sortStates, childrenColumnName)
|
|
|
});
|
|
|
}
|
|
|
return record;
|
|
|
});
|
|
|
}
|
|
|
function useFilterSorter(_ref4) {
|
|
|
let {
|
|
|
prefixCls,
|
|
|
mergedColumns,
|
|
|
onSorterChange,
|
|
|
sortDirections,
|
|
|
tableLocale,
|
|
|
showSorterTooltip
|
|
|
} = _ref4;
|
|
|
const [sortStates, setSortStates] = _react_17_0_2_react.useState(collectSortStates(mergedColumns, true));
|
|
|
const mergedSorterStates = _react_17_0_2_react.useMemo(() => {
|
|
|
let validate = true;
|
|
|
const collectedStates = collectSortStates(mergedColumns, false);
|
|
|
// Return if not controlled
|
|
|
if (!collectedStates.length) {
|
|
|
return sortStates;
|
|
|
}
|
|
|
const validateStates = [];
|
|
|
function patchStates(state) {
|
|
|
if (validate) {
|
|
|
validateStates.push(state);
|
|
|
} else {
|
|
|
validateStates.push(Object.assign(Object.assign({}, state), {
|
|
|
sortOrder: null
|
|
|
}));
|
|
|
}
|
|
|
}
|
|
|
let multipleMode = null;
|
|
|
collectedStates.forEach(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
|
|
|
const columnTitleSorterProps = _react_17_0_2_react.useMemo(() => {
|
|
|
const sortColumns = mergedSorterStates.map(_ref5 => {
|
|
|
let {
|
|
|
column,
|
|
|
sortOrder
|
|
|
} = _ref5;
|
|
|
return {
|
|
|
column,
|
|
|
order: sortOrder
|
|
|
};
|
|
|
});
|
|
|
return {
|
|
|
sortColumns,
|
|
|
// Legacy
|
|
|
sortColumn: sortColumns[0] && sortColumns[0].column,
|
|
|
sortOrder: sortColumns[0] && sortColumns[0].order
|
|
|
};
|
|
|
}, [mergedSorterStates]);
|
|
|
function triggerSorter(sortState) {
|
|
|
let newSorterStates;
|
|
|
if (sortState.multiplePriority === false || !mergedSorterStates.length || mergedSorterStates[0].multiplePriority === false) {
|
|
|
newSorterStates = [sortState];
|
|
|
} else {
|
|
|
newSorterStates = [].concat((0,toConsumableArray/* default */.Z)(mergedSorterStates.filter(_ref6 => {
|
|
|
let {
|
|
|
key
|
|
|
} = _ref6;
|
|
|
return key !== sortState.key;
|
|
|
})), [sortState]);
|
|
|
}
|
|
|
setSortStates(newSorterStates);
|
|
|
onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);
|
|
|
}
|
|
|
const transformColumns = innerColumns => injectSorter(prefixCls, innerColumns, mergedSorterStates, triggerSorter, sortDirections, tableLocale, showSorterTooltip);
|
|
|
const getSorters = () => generateSorterInfo(mergedSorterStates);
|
|
|
return [transformColumns, mergedSorterStates, columnTitleSorterProps, getSorters];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/hooks/useTitleColumns.js
|
|
|
|
|
|
|
|
|
function fillTitle(columns, columnTitleProps) {
|
|
|
return columns.map(column => {
|
|
|
const cloneColumn = Object.assign({}, column);
|
|
|
cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);
|
|
|
if ('children' in cloneColumn) {
|
|
|
cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
|
|
|
}
|
|
|
return cloneColumn;
|
|
|
});
|
|
|
}
|
|
|
function useTitleColumns(columnTitleProps) {
|
|
|
const filledColumns = _react_17_0_2_react.useCallback(columns => fillTitle(columns, columnTitleProps), [columnTitleProps]);
|
|
|
return [filledColumns];
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/RcTable/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Same as `rc-table` but we modify trigger children update logic instead.
|
|
|
*/
|
|
|
/* harmony default export */ var RcTable = (genTable((prev, next) => {
|
|
|
const {
|
|
|
_renderTimes: prevRenderTimes
|
|
|
} = prev;
|
|
|
const {
|
|
|
_renderTimes: nextRenderTimes
|
|
|
} = next;
|
|
|
return prevRenderTimes !== nextRenderTimes;
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/RcTable/VirtualTable.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Same as `rc-table` but we modify trigger children update logic instead.
|
|
|
*/
|
|
|
/* harmony default export */ var RcTable_VirtualTable = (genVirtualTable((prev, next) => {
|
|
|
const {
|
|
|
_renderTimes: prevRenderTimes
|
|
|
} = prev;
|
|
|
const {
|
|
|
_renderTimes: nextRenderTimes
|
|
|
} = next;
|
|
|
return prevRenderTimes !== nextRenderTimes;
|
|
|
}));
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ctrl_tinycolor@3.6.1@@ctrl/tinycolor/dist/module/index.js
|
|
|
var dist_module = __webpack_require__(64993);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
var style = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/bordered.js
|
|
|
const genBorderedStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
const tableBorder = `${token.lineWidth}px ${token.lineType} ${token.tableBorderColor}`;
|
|
|
const getSizeBorderStyle = (size, paddingVertical, paddingHorizontal) => ({
|
|
|
[`&${componentCls}-${size}`]: {
|
|
|
[`> ${componentCls}-container`]: {
|
|
|
[`> ${componentCls}-content, > ${componentCls}-body`]: {
|
|
|
[`
|
|
|
> table > tbody > tr > th,
|
|
|
> table > tbody > tr > td
|
|
|
`]: {
|
|
|
[`> ${componentCls}-expanded-row-fixed`]: {
|
|
|
margin: `-${paddingVertical}px -${paddingHorizontal + token.lineWidth}px`
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}${componentCls}-bordered`]: Object.assign(Object.assign(Object.assign({
|
|
|
// ============================ Title =============================
|
|
|
[`> ${componentCls}-title`]: {
|
|
|
border: tableBorder,
|
|
|
borderBottom: 0
|
|
|
},
|
|
|
// ============================ Content ============================
|
|
|
[`> ${componentCls}-container`]: {
|
|
|
borderInlineStart: tableBorder,
|
|
|
borderTop: tableBorder,
|
|
|
[`
|
|
|
> ${componentCls}-content,
|
|
|
> ${componentCls}-header,
|
|
|
> ${componentCls}-body,
|
|
|
> ${componentCls}-summary
|
|
|
`]: {
|
|
|
'> table': {
|
|
|
// ============================= Cell =============================
|
|
|
[`
|
|
|
> thead > tr > th,
|
|
|
> thead > tr > td,
|
|
|
> tbody > tr > th,
|
|
|
> tbody > tr > td,
|
|
|
> tfoot > tr > th,
|
|
|
> tfoot > tr > td
|
|
|
`]: {
|
|
|
borderInlineEnd: tableBorder
|
|
|
},
|
|
|
// ============================ Header ============================
|
|
|
'> thead': {
|
|
|
'> tr:not(:last-child) > th': {
|
|
|
borderBottom: tableBorder
|
|
|
},
|
|
|
'> tr > th::before': {
|
|
|
backgroundColor: 'transparent !important'
|
|
|
}
|
|
|
},
|
|
|
// Fixed right should provides additional border
|
|
|
[`
|
|
|
> thead > tr,
|
|
|
> tbody > tr,
|
|
|
> tfoot > tr
|
|
|
`]: {
|
|
|
[`> ${componentCls}-cell-fix-right-first::after`]: {
|
|
|
borderInlineEnd: tableBorder
|
|
|
}
|
|
|
},
|
|
|
// ========================== Expandable ==========================
|
|
|
[`
|
|
|
> tbody > tr > th,
|
|
|
> tbody > tr > td
|
|
|
`]: {
|
|
|
[`> ${componentCls}-expanded-row-fixed`]: {
|
|
|
margin: `-${token.tablePaddingVertical}px -${token.tablePaddingHorizontal + token.lineWidth}px`,
|
|
|
'&::after': {
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
insetInlineEnd: token.lineWidth,
|
|
|
bottom: 0,
|
|
|
borderInlineEnd: tableBorder,
|
|
|
content: '""'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ============================ Scroll ============================
|
|
|
[`&${componentCls}-scroll-horizontal`]: {
|
|
|
[`> ${componentCls}-container > ${componentCls}-body`]: {
|
|
|
'> table > tbody': {
|
|
|
[`
|
|
|
> tr${componentCls}-expanded-row,
|
|
|
> tr${componentCls}-placeholder
|
|
|
`]: {
|
|
|
[`> th, > td`]: {
|
|
|
borderInlineEnd: 0
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, getSizeBorderStyle('middle', token.tablePaddingVerticalMiddle, token.tablePaddingHorizontalMiddle)), getSizeBorderStyle('small', token.tablePaddingVerticalSmall, token.tablePaddingHorizontalSmall)), {
|
|
|
// ============================ Footer ============================
|
|
|
[`> ${componentCls}-footer`]: {
|
|
|
border: tableBorder,
|
|
|
borderTop: 0
|
|
|
}
|
|
|
}),
|
|
|
// ============================ Nested ============================
|
|
|
[`${componentCls}-cell`]: {
|
|
|
[`${componentCls}-container:first-child`]: {
|
|
|
// :first-child to avoid the case when bordered and title is set
|
|
|
borderTop: 0
|
|
|
},
|
|
|
// https://github.com/ant-design/ant-design/issues/35577
|
|
|
'&-scrollbar:not([rowspan])': {
|
|
|
boxShadow: `0 ${token.lineWidth}px 0 ${token.lineWidth}px ${token.tableHeaderBg}`
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-bordered ${componentCls}-cell-scrollbar`]: {
|
|
|
borderInlineEnd: tableBorder
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var bordered = (genBorderedStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/ellipsis.js
|
|
|
|
|
|
const genEllipsisStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-cell-ellipsis`]: Object.assign(Object.assign({}, style/* textEllipsis */.vS), {
|
|
|
wordBreak: 'keep-all',
|
|
|
// Fixed first or last should special process
|
|
|
[`
|
|
|
&${componentCls}-cell-fix-left-last,
|
|
|
&${componentCls}-cell-fix-right-first
|
|
|
`]: {
|
|
|
overflow: 'visible',
|
|
|
[`${componentCls}-cell-content`]: {
|
|
|
display: 'block',
|
|
|
overflow: 'hidden',
|
|
|
textOverflow: 'ellipsis'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-column-title`]: {
|
|
|
overflow: 'hidden',
|
|
|
textOverflow: 'ellipsis',
|
|
|
wordBreak: 'keep-all'
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var ellipsis = (genEllipsisStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/empty.js
|
|
|
// ========================= Placeholder ==========================
|
|
|
const genEmptyStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-tbody > tr${componentCls}-placeholder`]: {
|
|
|
textAlign: 'center',
|
|
|
color: token.colorTextDisabled,
|
|
|
[`
|
|
|
&:hover > th,
|
|
|
&:hover > td,
|
|
|
`]: {
|
|
|
background: token.colorBgContainer
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var style_empty = (genEmptyStyle);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/operationUnit.js
|
|
|
var operationUnit = __webpack_require__(15969);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/expand.js
|
|
|
|
|
|
const genExpandStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
antCls,
|
|
|
controlInteractiveSize: checkboxSize,
|
|
|
motionDurationSlow,
|
|
|
lineWidth,
|
|
|
paddingXS,
|
|
|
lineType,
|
|
|
tableBorderColor,
|
|
|
tableExpandIconBg,
|
|
|
tableExpandColumnWidth,
|
|
|
borderRadius,
|
|
|
fontSize,
|
|
|
fontSizeSM,
|
|
|
lineHeight,
|
|
|
tablePaddingVertical,
|
|
|
tablePaddingHorizontal,
|
|
|
tableExpandedRowBg,
|
|
|
paddingXXS
|
|
|
} = token;
|
|
|
const halfInnerSize = checkboxSize / 2 - lineWidth;
|
|
|
// must be odd number, unless it cannot align center
|
|
|
const expandIconSize = halfInnerSize * 2 + lineWidth * 3;
|
|
|
const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
|
|
|
const expandIconLineOffset = paddingXXS - lineWidth;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-expand-icon-col`]: {
|
|
|
width: tableExpandColumnWidth
|
|
|
},
|
|
|
[`${componentCls}-row-expand-icon-cell`]: {
|
|
|
textAlign: 'center',
|
|
|
[`${componentCls}-row-expand-icon`]: {
|
|
|
display: 'inline-flex',
|
|
|
float: 'none',
|
|
|
verticalAlign: 'sub'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-row-indent`]: {
|
|
|
height: 1,
|
|
|
float: 'left'
|
|
|
},
|
|
|
[`${componentCls}-row-expand-icon`]: Object.assign(Object.assign({}, (0,operationUnit/* operationUnit */.N)(token)), {
|
|
|
position: 'relative',
|
|
|
float: 'left',
|
|
|
boxSizing: 'border-box',
|
|
|
width: expandIconSize,
|
|
|
height: expandIconSize,
|
|
|
padding: 0,
|
|
|
color: 'inherit',
|
|
|
lineHeight: `${expandIconSize}px`,
|
|
|
background: tableExpandIconBg,
|
|
|
border: tableBorder,
|
|
|
borderRadius,
|
|
|
transform: `scale(${checkboxSize / expandIconSize})`,
|
|
|
transition: `all ${motionDurationSlow}`,
|
|
|
userSelect: 'none',
|
|
|
[`&:focus, &:hover, &:active`]: {
|
|
|
borderColor: 'currentcolor'
|
|
|
},
|
|
|
[`&::before, &::after`]: {
|
|
|
position: 'absolute',
|
|
|
background: 'currentcolor',
|
|
|
transition: `transform ${motionDurationSlow} ease-out`,
|
|
|
content: '""'
|
|
|
},
|
|
|
'&::before': {
|
|
|
top: halfInnerSize,
|
|
|
insetInlineEnd: expandIconLineOffset,
|
|
|
insetInlineStart: expandIconLineOffset,
|
|
|
height: lineWidth
|
|
|
},
|
|
|
'&::after': {
|
|
|
top: expandIconLineOffset,
|
|
|
bottom: expandIconLineOffset,
|
|
|
insetInlineStart: halfInnerSize,
|
|
|
width: lineWidth,
|
|
|
transform: 'rotate(90deg)'
|
|
|
},
|
|
|
// Motion effect
|
|
|
'&-collapsed::before': {
|
|
|
transform: 'rotate(-180deg)'
|
|
|
},
|
|
|
'&-collapsed::after': {
|
|
|
transform: 'rotate(0deg)'
|
|
|
},
|
|
|
'&-spaced': {
|
|
|
'&::before, &::after': {
|
|
|
display: 'none',
|
|
|
content: 'none'
|
|
|
},
|
|
|
background: 'transparent',
|
|
|
border: 0,
|
|
|
visibility: 'hidden'
|
|
|
}
|
|
|
}),
|
|
|
[`${componentCls}-row-indent + ${componentCls}-row-expand-icon`]: {
|
|
|
marginTop: (fontSize * lineHeight - lineWidth * 3) / 2 - Math.ceil((fontSizeSM * 1.4 - lineWidth * 3) / 2),
|
|
|
marginInlineEnd: paddingXS
|
|
|
},
|
|
|
[`tr${componentCls}-expanded-row`]: {
|
|
|
'&, &:hover': {
|
|
|
[`> th, > td`]: {
|
|
|
background: tableExpandedRowBg
|
|
|
}
|
|
|
},
|
|
|
// https://github.com/ant-design/ant-design/issues/25573
|
|
|
[`${antCls}-descriptions-view`]: {
|
|
|
display: 'flex',
|
|
|
table: {
|
|
|
flex: 'auto',
|
|
|
width: 'auto'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// With fixed
|
|
|
[`${componentCls}-expanded-row-fixed`]: {
|
|
|
position: 'relative',
|
|
|
margin: `-${tablePaddingVertical}px -${tablePaddingHorizontal}px`,
|
|
|
padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var expand = (genExpandStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/filter.js
|
|
|
|
|
|
const genFilterStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
antCls,
|
|
|
iconCls,
|
|
|
tableFilterDropdownWidth,
|
|
|
tableFilterDropdownSearchWidth,
|
|
|
paddingXXS,
|
|
|
paddingXS,
|
|
|
colorText,
|
|
|
lineWidth,
|
|
|
lineType,
|
|
|
tableBorderColor,
|
|
|
tableHeaderIconColor,
|
|
|
fontSizeSM,
|
|
|
tablePaddingHorizontal,
|
|
|
borderRadius,
|
|
|
motionDurationSlow,
|
|
|
colorTextDescription,
|
|
|
colorPrimary,
|
|
|
tableHeaderFilterActiveBg,
|
|
|
colorTextDisabled,
|
|
|
tableFilterDropdownBg,
|
|
|
tableFilterDropdownHeight,
|
|
|
controlItemBgHover,
|
|
|
controlItemBgActive,
|
|
|
boxShadowSecondary,
|
|
|
filterDropdownMenuBg
|
|
|
} = token;
|
|
|
const dropdownPrefixCls = `${antCls}-dropdown`;
|
|
|
const tableFilterDropdownPrefixCls = `${componentCls}-filter-dropdown`;
|
|
|
const treePrefixCls = `${antCls}-tree`;
|
|
|
const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
|
|
|
return [{
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-filter-column`]: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
[`${componentCls}-filter-trigger`]: {
|
|
|
position: 'relative',
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
marginBlock: -paddingXXS,
|
|
|
marginInline: `${paddingXXS}px ${-tablePaddingHorizontal / 2}px`,
|
|
|
padding: `0 ${paddingXXS}px`,
|
|
|
color: tableHeaderIconColor,
|
|
|
fontSize: fontSizeSM,
|
|
|
borderRadius,
|
|
|
cursor: 'pointer',
|
|
|
transition: `all ${motionDurationSlow}`,
|
|
|
'&:hover': {
|
|
|
color: colorTextDescription,
|
|
|
background: tableHeaderFilterActiveBg
|
|
|
},
|
|
|
'&.active': {
|
|
|
color: colorPrimary
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
// Dropdown
|
|
|
[`${antCls}-dropdown`]: {
|
|
|
[tableFilterDropdownPrefixCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
minWidth: tableFilterDropdownWidth,
|
|
|
backgroundColor: tableFilterDropdownBg,
|
|
|
borderRadius,
|
|
|
boxShadow: boxShadowSecondary,
|
|
|
overflow: 'hidden',
|
|
|
// Reset menu
|
|
|
[`${dropdownPrefixCls}-menu`]: {
|
|
|
// https://github.com/ant-design/ant-design/issues/4916
|
|
|
// https://github.com/ant-design/ant-design/issues/19542
|
|
|
maxHeight: tableFilterDropdownHeight,
|
|
|
overflowX: 'hidden',
|
|
|
border: 0,
|
|
|
boxShadow: 'none',
|
|
|
borderRadius: 'unset',
|
|
|
backgroundColor: filterDropdownMenuBg,
|
|
|
'&:empty::after': {
|
|
|
display: 'block',
|
|
|
padding: `${paddingXS}px 0`,
|
|
|
color: colorTextDisabled,
|
|
|
fontSize: fontSizeSM,
|
|
|
textAlign: 'center',
|
|
|
content: '"Not Found"'
|
|
|
}
|
|
|
},
|
|
|
[`${tableFilterDropdownPrefixCls}-tree`]: {
|
|
|
paddingBlock: `${paddingXS}px 0`,
|
|
|
paddingInline: paddingXS,
|
|
|
[treePrefixCls]: {
|
|
|
padding: 0
|
|
|
},
|
|
|
[`${treePrefixCls}-treenode ${treePrefixCls}-node-content-wrapper:hover`]: {
|
|
|
backgroundColor: controlItemBgHover
|
|
|
},
|
|
|
[`${treePrefixCls}-treenode-checkbox-checked ${treePrefixCls}-node-content-wrapper`]: {
|
|
|
'&, &:hover': {
|
|
|
backgroundColor: controlItemBgActive
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[`${tableFilterDropdownPrefixCls}-search`]: {
|
|
|
padding: paddingXS,
|
|
|
borderBottom: tableBorder,
|
|
|
'&-input': {
|
|
|
input: {
|
|
|
minWidth: tableFilterDropdownSearchWidth
|
|
|
},
|
|
|
[iconCls]: {
|
|
|
color: colorTextDisabled
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[`${tableFilterDropdownPrefixCls}-checkall`]: {
|
|
|
width: '100%',
|
|
|
marginBottom: paddingXXS,
|
|
|
marginInlineStart: paddingXXS
|
|
|
},
|
|
|
// Operation
|
|
|
[`${tableFilterDropdownPrefixCls}-btns`]: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between',
|
|
|
padding: `${paddingXS - lineWidth}px ${paddingXS}px`,
|
|
|
overflow: 'hidden',
|
|
|
borderTop: tableBorder
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
// Dropdown Menu & SubMenu
|
|
|
{
|
|
|
// submenu of table filter dropdown
|
|
|
[`${antCls}-dropdown ${tableFilterDropdownPrefixCls}, ${tableFilterDropdownPrefixCls}-submenu`]: {
|
|
|
// Checkbox
|
|
|
[`${antCls}-checkbox-wrapper + span`]: {
|
|
|
paddingInlineStart: paddingXS,
|
|
|
color: colorText
|
|
|
},
|
|
|
[`> ul`]: {
|
|
|
maxHeight: 'calc(100vh - 130px)',
|
|
|
overflowX: 'hidden',
|
|
|
overflowY: 'auto'
|
|
|
}
|
|
|
}
|
|
|
}];
|
|
|
};
|
|
|
/* harmony default export */ var filter = (genFilterStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/fixed.js
|
|
|
const genFixedStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
lineWidth,
|
|
|
colorSplit,
|
|
|
motionDurationSlow,
|
|
|
zIndexTableFixed,
|
|
|
tableBg,
|
|
|
zIndexTableSticky
|
|
|
} = token;
|
|
|
const shadowColor = colorSplit;
|
|
|
// Follow style is magic of shadow which should not follow token:
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`
|
|
|
${componentCls}-cell-fix-left,
|
|
|
${componentCls}-cell-fix-right
|
|
|
`]: {
|
|
|
position: 'sticky !important',
|
|
|
zIndex: zIndexTableFixed,
|
|
|
background: tableBg
|
|
|
},
|
|
|
[`
|
|
|
${componentCls}-cell-fix-left-first::after,
|
|
|
${componentCls}-cell-fix-left-last::after
|
|
|
`]: {
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
right: {
|
|
|
_skip_check_: true,
|
|
|
value: 0
|
|
|
},
|
|
|
bottom: -lineWidth,
|
|
|
width: 30,
|
|
|
transform: 'translateX(100%)',
|
|
|
transition: `box-shadow ${motionDurationSlow}`,
|
|
|
content: '""',
|
|
|
pointerEvents: 'none'
|
|
|
},
|
|
|
[`${componentCls}-cell-fix-left-all::after`]: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
[`
|
|
|
${componentCls}-cell-fix-right-first::after,
|
|
|
${componentCls}-cell-fix-right-last::after
|
|
|
`]: {
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
bottom: -lineWidth,
|
|
|
left: {
|
|
|
_skip_check_: true,
|
|
|
value: 0
|
|
|
},
|
|
|
width: 30,
|
|
|
transform: 'translateX(-100%)',
|
|
|
transition: `box-shadow ${motionDurationSlow}`,
|
|
|
content: '""',
|
|
|
pointerEvents: 'none'
|
|
|
},
|
|
|
[`${componentCls}-container`]: {
|
|
|
'&::before, &::after': {
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
zIndex: zIndexTableSticky + 1,
|
|
|
width: 30,
|
|
|
transition: `box-shadow ${motionDurationSlow}`,
|
|
|
content: '""',
|
|
|
pointerEvents: 'none'
|
|
|
},
|
|
|
'&::before': {
|
|
|
insetInlineStart: 0
|
|
|
},
|
|
|
'&::after': {
|
|
|
insetInlineEnd: 0
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-ping-left`]: {
|
|
|
[`&:not(${componentCls}-has-fix-left) ${componentCls}-container`]: {
|
|
|
position: 'relative',
|
|
|
'&::before': {
|
|
|
boxShadow: `inset 10px 0 8px -8px ${shadowColor}`
|
|
|
}
|
|
|
},
|
|
|
[`
|
|
|
${componentCls}-cell-fix-left-first::after,
|
|
|
${componentCls}-cell-fix-left-last::after
|
|
|
`]: {
|
|
|
boxShadow: `inset 10px 0 8px -8px ${shadowColor}`
|
|
|
},
|
|
|
[`${componentCls}-cell-fix-left-last::before`]: {
|
|
|
backgroundColor: 'transparent !important'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-ping-right`]: {
|
|
|
[`&:not(${componentCls}-has-fix-right) ${componentCls}-container`]: {
|
|
|
position: 'relative',
|
|
|
'&::after': {
|
|
|
boxShadow: `inset -10px 0 8px -8px ${shadowColor}`
|
|
|
}
|
|
|
},
|
|
|
[`
|
|
|
${componentCls}-cell-fix-right-first::after,
|
|
|
${componentCls}-cell-fix-right-last::after
|
|
|
`]: {
|
|
|
boxShadow: `inset -10px 0 8px -8px ${shadowColor}`
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var fixed = (genFixedStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/pagination.js
|
|
|
const genPaginationStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
antCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
// ========================== Pagination ==========================
|
|
|
[`${componentCls}-pagination${antCls}-pagination`]: {
|
|
|
margin: `${token.margin}px 0`
|
|
|
},
|
|
|
[`${componentCls}-pagination`]: {
|
|
|
display: 'flex',
|
|
|
flexWrap: 'wrap',
|
|
|
rowGap: token.paddingXS,
|
|
|
'> *': {
|
|
|
flex: 'none'
|
|
|
},
|
|
|
'&-left': {
|
|
|
justifyContent: 'flex-start'
|
|
|
},
|
|
|
'&-center': {
|
|
|
justifyContent: 'center'
|
|
|
},
|
|
|
'&-right': {
|
|
|
justifyContent: 'flex-end'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var pagination = (genPaginationStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/radius.js
|
|
|
const genRadiusStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
tableRadius
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[componentCls]: {
|
|
|
// https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
|
|
|
[`${componentCls}-title, ${componentCls}-header`]: {
|
|
|
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`
|
|
|
},
|
|
|
[`${componentCls}-title + ${componentCls}-container`]: {
|
|
|
borderStartStartRadius: 0,
|
|
|
borderStartEndRadius: 0,
|
|
|
// https://github.com/ant-design/ant-design/issues/41975
|
|
|
[`${componentCls}-header, table`]: {
|
|
|
borderRadius: 0
|
|
|
},
|
|
|
'table > thead > tr:first-child': {
|
|
|
'th:first-child, th:last-child, td:first-child, td:last-child': {
|
|
|
borderRadius: 0
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
'&-container': {
|
|
|
borderStartStartRadius: tableRadius,
|
|
|
borderStartEndRadius: tableRadius,
|
|
|
'table > thead > tr:first-child': {
|
|
|
'> *:first-child': {
|
|
|
borderStartStartRadius: tableRadius
|
|
|
},
|
|
|
'> *:last-child': {
|
|
|
borderStartEndRadius: tableRadius
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
'&-footer': {
|
|
|
borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var radius = (genRadiusStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/rtl.js
|
|
|
const genStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper-rtl`]: {
|
|
|
direction: 'rtl',
|
|
|
table: {
|
|
|
direction: 'rtl'
|
|
|
},
|
|
|
[`${componentCls}-pagination-left`]: {
|
|
|
justifyContent: 'flex-end'
|
|
|
},
|
|
|
[`${componentCls}-pagination-right`]: {
|
|
|
justifyContent: 'flex-start'
|
|
|
},
|
|
|
[`${componentCls}-row-expand-icon`]: {
|
|
|
float: 'right',
|
|
|
'&::after': {
|
|
|
transform: 'rotate(-90deg)'
|
|
|
},
|
|
|
'&-collapsed::before': {
|
|
|
transform: 'rotate(180deg)'
|
|
|
},
|
|
|
'&-collapsed::after': {
|
|
|
transform: 'rotate(0deg)'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-container`]: {
|
|
|
'&::before': {
|
|
|
insetInlineStart: 'unset',
|
|
|
insetInlineEnd: 0
|
|
|
},
|
|
|
'&::after': {
|
|
|
insetInlineStart: 0,
|
|
|
insetInlineEnd: 'unset'
|
|
|
},
|
|
|
[`${componentCls}-row-indent`]: {
|
|
|
float: 'right'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var rtl = (genStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/selection.js
|
|
|
const genSelectionStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
antCls,
|
|
|
iconCls,
|
|
|
fontSizeIcon,
|
|
|
padding,
|
|
|
paddingXS,
|
|
|
tableHeaderIconColor,
|
|
|
tableHeaderIconColorHover,
|
|
|
tableSelectionColumnWidth
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
// ========================== Selections ==========================
|
|
|
[`${componentCls}-selection-col`]: {
|
|
|
width: tableSelectionColumnWidth,
|
|
|
[`&${componentCls}-selection-col-with-dropdown`]: {
|
|
|
width: tableSelectionColumnWidth + fontSizeIcon + padding / 4
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-bordered ${componentCls}-selection-col`]: {
|
|
|
width: tableSelectionColumnWidth + paddingXS * 2,
|
|
|
[`&${componentCls}-selection-col-with-dropdown`]: {
|
|
|
width: tableSelectionColumnWidth + fontSizeIcon + padding / 4 + paddingXS * 2
|
|
|
}
|
|
|
},
|
|
|
[`
|
|
|
table tr th${componentCls}-selection-column,
|
|
|
table tr td${componentCls}-selection-column
|
|
|
`]: {
|
|
|
paddingInlineEnd: token.paddingXS,
|
|
|
paddingInlineStart: token.paddingXS,
|
|
|
textAlign: 'center',
|
|
|
[`${antCls}-radio-wrapper`]: {
|
|
|
marginInlineEnd: 0
|
|
|
}
|
|
|
},
|
|
|
[`table tr th${componentCls}-selection-column${componentCls}-cell-fix-left`]: {
|
|
|
zIndex: token.zIndexTableFixed + 1
|
|
|
},
|
|
|
[`table tr th${componentCls}-selection-column::after`]: {
|
|
|
backgroundColor: 'transparent !important'
|
|
|
},
|
|
|
[`${componentCls}-selection`]: {
|
|
|
position: 'relative',
|
|
|
display: 'inline-flex',
|
|
|
flexDirection: 'column'
|
|
|
},
|
|
|
[`${componentCls}-selection-extra`]: {
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
zIndex: 1,
|
|
|
cursor: 'pointer',
|
|
|
transition: `all ${token.motionDurationSlow}`,
|
|
|
marginInlineStart: '100%',
|
|
|
paddingInlineStart: `${token.tablePaddingHorizontal / 4}px`,
|
|
|
[iconCls]: {
|
|
|
color: tableHeaderIconColor,
|
|
|
fontSize: fontSizeIcon,
|
|
|
verticalAlign: 'baseline',
|
|
|
'&:hover': {
|
|
|
color: tableHeaderIconColorHover
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var selection = (genSelectionStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/size.js
|
|
|
const genSizeStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
const getSizeStyle = (size, paddingVertical, paddingHorizontal, fontSize) => ({
|
|
|
[`${componentCls}${componentCls}-${size}`]: {
|
|
|
fontSize,
|
|
|
[`
|
|
|
${componentCls}-title,
|
|
|
${componentCls}-footer,
|
|
|
${componentCls}-cell,
|
|
|
${componentCls}-thead > tr > th,
|
|
|
${componentCls}-tbody > tr > th,
|
|
|
${componentCls}-tbody > tr > td,
|
|
|
tfoot > tr > th,
|
|
|
tfoot > tr > td
|
|
|
`]: {
|
|
|
padding: `${paddingVertical}px ${paddingHorizontal}px`
|
|
|
},
|
|
|
[`${componentCls}-filter-trigger`]: {
|
|
|
marginInlineEnd: `-${paddingHorizontal / 2}px`
|
|
|
},
|
|
|
[`${componentCls}-expanded-row-fixed`]: {
|
|
|
margin: `-${paddingVertical}px -${paddingHorizontal}px`
|
|
|
},
|
|
|
[`${componentCls}-tbody`]: {
|
|
|
// ========================= Nest Table ===========================
|
|
|
[`${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
|
marginBlock: `-${paddingVertical}px`,
|
|
|
marginInline: `${token.tableExpandColumnWidth - paddingHorizontal}px -${paddingHorizontal}px`
|
|
|
}
|
|
|
},
|
|
|
// https://github.com/ant-design/ant-design/issues/35167
|
|
|
[`${componentCls}-selection-column`]: {
|
|
|
paddingInlineStart: `${paddingHorizontal / 4}px`
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: Object.assign(Object.assign({}, getSizeStyle('middle', token.tablePaddingVerticalMiddle, token.tablePaddingHorizontalMiddle, token.tableFontSizeMiddle)), getSizeStyle('small', token.tablePaddingVerticalSmall, token.tablePaddingHorizontalSmall, token.tableFontSizeSmall))
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var size = (genSizeStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/sorter.js
|
|
|
const genSorterStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
marginXXS,
|
|
|
fontSizeIcon,
|
|
|
tableHeaderIconColor,
|
|
|
tableHeaderIconColorHover
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-thead th${componentCls}-column-has-sorters`]: {
|
|
|
outline: 'none',
|
|
|
cursor: 'pointer',
|
|
|
transition: `all ${token.motionDurationSlow}`,
|
|
|
'&:hover': {
|
|
|
background: token.tableHeaderSortHoverBg,
|
|
|
'&::before': {
|
|
|
backgroundColor: 'transparent !important'
|
|
|
}
|
|
|
},
|
|
|
'&:focus-visible': {
|
|
|
color: token.colorPrimary
|
|
|
},
|
|
|
// https://github.com/ant-design/ant-design/issues/30969
|
|
|
[`
|
|
|
&${componentCls}-cell-fix-left:hover,
|
|
|
&${componentCls}-cell-fix-right:hover
|
|
|
`]: {
|
|
|
background: token.tableFixedHeaderSortActiveBg
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-thead th${componentCls}-column-sort`]: {
|
|
|
background: token.tableHeaderSortBg,
|
|
|
'&::before': {
|
|
|
backgroundColor: 'transparent !important'
|
|
|
}
|
|
|
},
|
|
|
[`td${componentCls}-column-sort`]: {
|
|
|
background: token.tableBodySortBg
|
|
|
},
|
|
|
[`${componentCls}-column-title`]: {
|
|
|
position: 'relative',
|
|
|
zIndex: 1,
|
|
|
flex: 1
|
|
|
},
|
|
|
[`${componentCls}-column-sorters`]: {
|
|
|
display: 'flex',
|
|
|
flex: 'auto',
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'space-between',
|
|
|
'&::after': {
|
|
|
position: 'absolute',
|
|
|
inset: 0,
|
|
|
width: '100%',
|
|
|
height: '100%',
|
|
|
content: '""'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-column-sorter`]: {
|
|
|
marginInlineStart: marginXXS,
|
|
|
color: tableHeaderIconColor,
|
|
|
fontSize: 0,
|
|
|
transition: `color ${token.motionDurationSlow}`,
|
|
|
'&-inner': {
|
|
|
display: 'inline-flex',
|
|
|
flexDirection: 'column',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
'&-up, &-down': {
|
|
|
fontSize: fontSizeIcon,
|
|
|
'&.active': {
|
|
|
color: token.colorPrimary
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-column-sorter-up + ${componentCls}-column-sorter-down`]: {
|
|
|
marginTop: '-0.3em'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-column-sorters:hover ${componentCls}-column-sorter`]: {
|
|
|
color: tableHeaderIconColorHover
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var sorter = (genSorterStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/sticky.js
|
|
|
const genStickyStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
opacityLoading,
|
|
|
tableScrollThumbBg,
|
|
|
tableScrollThumbBgHover,
|
|
|
tableScrollThumbSize,
|
|
|
tableScrollBg,
|
|
|
zIndexTableSticky,
|
|
|
stickyScrollBarBorderRadius
|
|
|
} = token;
|
|
|
const tableBorder = `${token.lineWidth}px ${token.lineType} ${token.tableBorderColor}`;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-sticky`]: {
|
|
|
'&-holder': {
|
|
|
position: 'sticky',
|
|
|
zIndex: zIndexTableSticky,
|
|
|
background: token.colorBgContainer
|
|
|
},
|
|
|
'&-scroll': {
|
|
|
position: 'sticky',
|
|
|
bottom: 0,
|
|
|
height: `${tableScrollThumbSize}px !important`,
|
|
|
zIndex: zIndexTableSticky,
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
background: tableScrollBg,
|
|
|
borderTop: tableBorder,
|
|
|
opacity: opacityLoading,
|
|
|
'&:hover': {
|
|
|
transformOrigin: 'center bottom'
|
|
|
},
|
|
|
// fake scrollbar style of sticky
|
|
|
'&-bar': {
|
|
|
height: tableScrollThumbSize,
|
|
|
backgroundColor: tableScrollThumbBg,
|
|
|
borderRadius: stickyScrollBarBorderRadius,
|
|
|
transition: `all ${token.motionDurationSlow}, transform none`,
|
|
|
position: 'absolute',
|
|
|
bottom: 0,
|
|
|
'&:hover, &-active': {
|
|
|
backgroundColor: tableScrollThumbBgHover
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var sticky = (genStickyStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/summary.js
|
|
|
const genSummaryStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
lineWidth,
|
|
|
tableBorderColor
|
|
|
} = token;
|
|
|
const tableBorder = `${lineWidth}px ${token.lineType} ${tableBorderColor}`;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
[`${componentCls}-summary`]: {
|
|
|
position: 'relative',
|
|
|
zIndex: token.zIndexTableFixed,
|
|
|
background: token.tableBg,
|
|
|
'> tr': {
|
|
|
'> th, > td': {
|
|
|
borderBottom: tableBorder
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[`div${componentCls}-summary`]: {
|
|
|
boxShadow: `0 -${lineWidth}px 0 ${tableBorderColor}`
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var summary = (genSummaryStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/virtual.js
|
|
|
const genVirtualStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
const tableBorder = `${token.lineWidth}px ${token.lineType} ${token.tableBorderColor}`;
|
|
|
const rowCellCls = `${componentCls}-expanded-row-cell`;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
// ========================== Row ==========================
|
|
|
[`${componentCls}-tbody-virtual`]: {
|
|
|
[`${componentCls}-row`]: {
|
|
|
display: 'flex',
|
|
|
boxSizing: 'border-box',
|
|
|
width: '100%'
|
|
|
},
|
|
|
[`${componentCls}-cell`]: {
|
|
|
borderBottom: tableBorder
|
|
|
},
|
|
|
[`${componentCls}-expanded-row`]: {
|
|
|
[`${rowCellCls}${rowCellCls}-fixed`]: {
|
|
|
position: 'sticky',
|
|
|
insetInlineStart: 0,
|
|
|
overflow: 'hidden',
|
|
|
width: `calc(var(--virtual-width) - ${token.lineWidth}px)`,
|
|
|
borderInlineEnd: 'none'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ======================== Border =========================
|
|
|
[`${componentCls}-bordered`]: {
|
|
|
[`${componentCls}-tbody-virtual`]: {
|
|
|
'&:after': {
|
|
|
content: '""',
|
|
|
insetInline: 0,
|
|
|
bottom: 0,
|
|
|
borderBottom: tableBorder,
|
|
|
position: 'absolute'
|
|
|
},
|
|
|
[`${componentCls}-cell`]: {
|
|
|
borderInlineEnd: tableBorder,
|
|
|
[`&${componentCls}-cell-fix-right-first:before`]: {
|
|
|
content: '""',
|
|
|
position: 'absolute',
|
|
|
insetBlock: 0,
|
|
|
insetInlineStart: -token.lineWidth,
|
|
|
borderInlineStart: tableBorder
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var virtual = (genVirtualStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/style/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const genTableStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
fontWeightStrong,
|
|
|
tablePaddingVertical,
|
|
|
tablePaddingHorizontal,
|
|
|
lineWidth,
|
|
|
lineType,
|
|
|
tableBorderColor,
|
|
|
tableFontSize,
|
|
|
tableBg,
|
|
|
tableRadius,
|
|
|
tableHeaderTextColor,
|
|
|
motionDurationMid,
|
|
|
tableHeaderBg,
|
|
|
tableHeaderCellSplitColor,
|
|
|
tableRowHoverBg,
|
|
|
tableSelectedRowBg,
|
|
|
tableSelectedRowHoverBg,
|
|
|
tableFooterTextColor,
|
|
|
tableFooterBg,
|
|
|
paddingContentVerticalLG
|
|
|
} = token;
|
|
|
const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
|
|
|
return {
|
|
|
[`${componentCls}-wrapper`]: Object.assign(Object.assign({
|
|
|
clear: 'both',
|
|
|
maxWidth: '100%'
|
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
fontSize: tableFontSize,
|
|
|
background: tableBg,
|
|
|
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`
|
|
|
}),
|
|
|
// https://github.com/ant-design/ant-design/issues/17611
|
|
|
table: {
|
|
|
width: '100%',
|
|
|
textAlign: 'start',
|
|
|
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`,
|
|
|
borderCollapse: 'separate',
|
|
|
borderSpacing: 0
|
|
|
},
|
|
|
// ============================= Cell =============================
|
|
|
[`
|
|
|
${componentCls}-cell,
|
|
|
${componentCls}-thead > tr > th,
|
|
|
${componentCls}-tbody > tr > th,
|
|
|
${componentCls}-tbody > tr > td,
|
|
|
tfoot > tr > th,
|
|
|
tfoot > tr > td
|
|
|
`]: {
|
|
|
position: 'relative',
|
|
|
padding: `${paddingContentVerticalLG}px ${tablePaddingHorizontal}px`,
|
|
|
overflowWrap: 'break-word'
|
|
|
},
|
|
|
// ============================ Title =============================
|
|
|
[`${componentCls}-title`]: {
|
|
|
padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`
|
|
|
},
|
|
|
// ============================ Header ============================
|
|
|
[`${componentCls}-thead`]: {
|
|
|
[`
|
|
|
> tr > th,
|
|
|
> tr > td
|
|
|
`]: {
|
|
|
position: 'relative',
|
|
|
color: tableHeaderTextColor,
|
|
|
fontWeight: fontWeightStrong,
|
|
|
textAlign: 'start',
|
|
|
background: tableHeaderBg,
|
|
|
borderBottom: tableBorder,
|
|
|
transition: `background ${motionDurationMid} ease`,
|
|
|
"&[colspan]:not([colspan='1'])": {
|
|
|
textAlign: 'center'
|
|
|
},
|
|
|
[`&:not(:last-child):not(${componentCls}-selection-column):not(${componentCls}-row-expand-icon-cell):not([colspan])::before`]: {
|
|
|
position: 'absolute',
|
|
|
top: '50%',
|
|
|
insetInlineEnd: 0,
|
|
|
width: 1,
|
|
|
height: '1.6em',
|
|
|
backgroundColor: tableHeaderCellSplitColor,
|
|
|
transform: 'translateY(-50%)',
|
|
|
transition: `background-color ${motionDurationMid}`,
|
|
|
content: '""'
|
|
|
}
|
|
|
},
|
|
|
'> tr:not(:last-child) > th[colspan]': {
|
|
|
borderBottom: 0
|
|
|
}
|
|
|
},
|
|
|
// ============================ Body ============================
|
|
|
[`${componentCls}-tbody`]: {
|
|
|
'> tr': {
|
|
|
[`> th, > td`]: {
|
|
|
transition: `background ${motionDurationMid}, border-color ${motionDurationMid}`,
|
|
|
borderBottom: tableBorder,
|
|
|
// ========================= Nest Table ===========================
|
|
|
[`
|
|
|
> ${componentCls}-wrapper:only-child,
|
|
|
> ${componentCls}-expanded-row-fixed > ${componentCls}-wrapper:only-child
|
|
|
`]: {
|
|
|
[componentCls]: {
|
|
|
marginBlock: `-${tablePaddingVertical}px`,
|
|
|
marginInline: `${token.tableExpandColumnWidth - tablePaddingHorizontal}px -${tablePaddingHorizontal}px`,
|
|
|
[`${componentCls}-tbody > tr:last-child > td`]: {
|
|
|
borderBottom: 0,
|
|
|
'&:first-child, &:last-child': {
|
|
|
borderRadius: 0
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
'> th': {
|
|
|
position: 'relative',
|
|
|
color: tableHeaderTextColor,
|
|
|
fontWeight: fontWeightStrong,
|
|
|
textAlign: 'start',
|
|
|
background: tableHeaderBg,
|
|
|
borderBottom: tableBorder,
|
|
|
transition: `background ${motionDurationMid} ease`
|
|
|
},
|
|
|
[`
|
|
|
&${componentCls}-row:hover > th,
|
|
|
&${componentCls}-row:hover > td,
|
|
|
> th${componentCls}-cell-row-hover,
|
|
|
> td${componentCls}-cell-row-hover
|
|
|
`]: {
|
|
|
background: tableRowHoverBg
|
|
|
},
|
|
|
[`&${componentCls}-row-selected`]: {
|
|
|
[`> th, > td`]: {
|
|
|
background: tableSelectedRowBg
|
|
|
},
|
|
|
[`&:hover > th, &:hover > td`]: {
|
|
|
background: tableSelectedRowHoverBg
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ============================ Footer ============================
|
|
|
[`${componentCls}-footer`]: {
|
|
|
padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`,
|
|
|
color: tableFooterTextColor,
|
|
|
background: tableFooterBg
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var table_style = ((0,genComponentStyleHook/* default */.Z)('Table', token => {
|
|
|
const {
|
|
|
colorTextHeading,
|
|
|
colorSplit,
|
|
|
colorIcon,
|
|
|
colorIconHover,
|
|
|
opacityLoading,
|
|
|
colorBgContainer,
|
|
|
controlInteractiveSize: checkboxSize,
|
|
|
headerBg,
|
|
|
headerColor,
|
|
|
headerSortActiveBg,
|
|
|
headerSortHoverBg,
|
|
|
bodySortBg,
|
|
|
rowHoverBg,
|
|
|
rowSelectedBg,
|
|
|
rowSelectedHoverBg,
|
|
|
rowExpandedBg,
|
|
|
cellPaddingBlock,
|
|
|
cellPaddingInline,
|
|
|
cellPaddingBlockMD,
|
|
|
cellPaddingInlineMD,
|
|
|
cellPaddingBlockSM,
|
|
|
cellPaddingInlineSM,
|
|
|
borderColor,
|
|
|
footerBg,
|
|
|
footerColor,
|
|
|
headerBorderRadius,
|
|
|
cellFontSize,
|
|
|
cellFontSizeMD,
|
|
|
cellFontSizeSM,
|
|
|
headerSplitColor,
|
|
|
fixedHeaderSortActiveBg,
|
|
|
headerFilterHoverBg,
|
|
|
filterDropdownBg,
|
|
|
expandIconBg,
|
|
|
selectionColumnWidth,
|
|
|
stickyScrollBarBg
|
|
|
} = token;
|
|
|
const baseColorAction = new dist_module/* TinyColor */.C(colorIcon);
|
|
|
const baseColorActionHover = new dist_module/* TinyColor */.C(colorIconHover);
|
|
|
const zIndexTableFixed = 2;
|
|
|
const tableToken = (0,statistic/* merge */.TS)(token, {
|
|
|
tableFontSize: cellFontSize,
|
|
|
tableBg: colorBgContainer,
|
|
|
tableRadius: headerBorderRadius,
|
|
|
tablePaddingVertical: cellPaddingBlock,
|
|
|
tablePaddingHorizontal: cellPaddingInline,
|
|
|
tablePaddingVerticalMiddle: cellPaddingBlockMD,
|
|
|
tablePaddingHorizontalMiddle: cellPaddingInlineMD,
|
|
|
tablePaddingVerticalSmall: cellPaddingBlockSM,
|
|
|
tablePaddingHorizontalSmall: cellPaddingInlineSM,
|
|
|
tableBorderColor: borderColor,
|
|
|
tableHeaderTextColor: headerColor,
|
|
|
tableHeaderBg: headerBg,
|
|
|
tableFooterTextColor: footerColor,
|
|
|
tableFooterBg: footerBg,
|
|
|
tableHeaderCellSplitColor: headerSplitColor,
|
|
|
tableHeaderSortBg: headerSortActiveBg,
|
|
|
tableHeaderSortHoverBg: headerSortHoverBg,
|
|
|
tableHeaderIconColor: baseColorAction.clone().setAlpha(baseColorAction.getAlpha() * opacityLoading).toRgbString(),
|
|
|
tableHeaderIconColorHover: baseColorActionHover.clone().setAlpha(baseColorActionHover.getAlpha() * opacityLoading).toRgbString(),
|
|
|
tableBodySortBg: bodySortBg,
|
|
|
tableFixedHeaderSortActiveBg: fixedHeaderSortActiveBg,
|
|
|
tableHeaderFilterActiveBg: headerFilterHoverBg,
|
|
|
tableFilterDropdownBg: filterDropdownBg,
|
|
|
tableRowHoverBg: rowHoverBg,
|
|
|
tableSelectedRowBg: rowSelectedBg,
|
|
|
tableSelectedRowHoverBg: rowSelectedHoverBg,
|
|
|
zIndexTableFixed,
|
|
|
zIndexTableSticky: zIndexTableFixed + 1,
|
|
|
tableFontSizeMiddle: cellFontSizeMD,
|
|
|
tableFontSizeSmall: cellFontSizeSM,
|
|
|
tableSelectionColumnWidth: selectionColumnWidth,
|
|
|
tableExpandIconBg: expandIconBg,
|
|
|
tableExpandColumnWidth: checkboxSize + 2 * token.padding,
|
|
|
tableExpandedRowBg: rowExpandedBg,
|
|
|
// Dropdown
|
|
|
tableFilterDropdownWidth: 120,
|
|
|
tableFilterDropdownHeight: 264,
|
|
|
tableFilterDropdownSearchWidth: 140,
|
|
|
// Virtual Scroll Bar
|
|
|
tableScrollThumbSize: 8,
|
|
|
tableScrollThumbBg: stickyScrollBarBg,
|
|
|
tableScrollThumbBgHover: colorTextHeading,
|
|
|
tableScrollBg: colorSplit
|
|
|
});
|
|
|
return [genTableStyle(tableToken), pagination(tableToken), summary(tableToken), sorter(tableToken), filter(tableToken), bordered(tableToken), radius(tableToken), expand(tableToken), summary(tableToken), style_empty(tableToken), selection(tableToken), fixed(tableToken), sticky(tableToken), ellipsis(tableToken), size(tableToken), rtl(tableToken), virtual(tableToken)];
|
|
|
}, token => {
|
|
|
const {
|
|
|
colorFillAlter,
|
|
|
colorBgContainer,
|
|
|
colorTextHeading,
|
|
|
colorFillSecondary,
|
|
|
colorFillContent,
|
|
|
controlItemBgActive,
|
|
|
controlItemBgActiveHover,
|
|
|
padding,
|
|
|
paddingSM,
|
|
|
paddingXS,
|
|
|
colorBorderSecondary,
|
|
|
borderRadiusLG,
|
|
|
fontSize,
|
|
|
controlHeight,
|
|
|
colorTextPlaceholder
|
|
|
} = token;
|
|
|
const colorFillSecondarySolid = new dist_module/* TinyColor */.C(colorFillSecondary).onBackground(colorBgContainer).toHexShortString();
|
|
|
const colorFillContentSolid = new dist_module/* TinyColor */.C(colorFillContent).onBackground(colorBgContainer).toHexShortString();
|
|
|
const colorFillAlterSolid = new dist_module/* TinyColor */.C(colorFillAlter).onBackground(colorBgContainer).toHexShortString();
|
|
|
return {
|
|
|
headerBg: colorFillAlterSolid,
|
|
|
headerColor: colorTextHeading,
|
|
|
headerSortActiveBg: colorFillSecondarySolid,
|
|
|
headerSortHoverBg: colorFillContentSolid,
|
|
|
bodySortBg: colorFillAlterSolid,
|
|
|
rowHoverBg: colorFillAlterSolid,
|
|
|
rowSelectedBg: controlItemBgActive,
|
|
|
rowSelectedHoverBg: controlItemBgActiveHover,
|
|
|
rowExpandedBg: colorFillAlter,
|
|
|
cellPaddingBlock: padding,
|
|
|
cellPaddingInline: padding,
|
|
|
cellPaddingBlockMD: paddingSM,
|
|
|
cellPaddingInlineMD: paddingXS,
|
|
|
cellPaddingBlockSM: paddingXS,
|
|
|
cellPaddingInlineSM: paddingXS,
|
|
|
borderColor: colorBorderSecondary,
|
|
|
headerBorderRadius: borderRadiusLG,
|
|
|
footerBg: colorFillAlterSolid,
|
|
|
footerColor: colorTextHeading,
|
|
|
cellFontSize: fontSize,
|
|
|
cellFontSizeMD: fontSize,
|
|
|
cellFontSizeSM: fontSize,
|
|
|
headerSplitColor: colorBorderSecondary,
|
|
|
fixedHeaderSortActiveBg: colorFillSecondarySolid,
|
|
|
headerFilterHoverBg: colorFillContent,
|
|
|
filterDropdownMenuBg: colorBgContainer,
|
|
|
filterDropdownBg: colorBgContainer,
|
|
|
expandIconBg: colorBgContainer,
|
|
|
selectionColumnWidth: controlHeight,
|
|
|
stickyScrollBarBg: colorTextPlaceholder,
|
|
|
stickyScrollBarBorderRadius: 100
|
|
|
};
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/InternalTable.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalTable_EMPTY_LIST = [];
|
|
|
const InternalTable = (props, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
size: customizeSize,
|
|
|
bordered,
|
|
|
dropdownPrefixCls: customizeDropdownPrefixCls,
|
|
|
dataSource,
|
|
|
pagination,
|
|
|
rowSelection,
|
|
|
rowKey = 'key',
|
|
|
rowClassName,
|
|
|
columns,
|
|
|
children,
|
|
|
childrenColumnName: legacyChildrenColumnName,
|
|
|
onChange,
|
|
|
getPopupContainer,
|
|
|
loading,
|
|
|
expandIcon,
|
|
|
expandable,
|
|
|
expandedRowRender,
|
|
|
expandIconColumnIndex,
|
|
|
indentSize,
|
|
|
scroll,
|
|
|
sortDirections,
|
|
|
locale,
|
|
|
showSorterTooltip = true,
|
|
|
virtual
|
|
|
} = props;
|
|
|
if (false) {}
|
|
|
const baseColumns = _react_17_0_2_react.useMemo(() => columns || convertChildrenToColumns(children), [columns, children]);
|
|
|
const needResponsive = _react_17_0_2_react.useMemo(() => baseColumns.some(col => col.responsive), [baseColumns]);
|
|
|
const screens = (0,useBreakpoint/* default */.Z)(needResponsive);
|
|
|
const mergedColumns = _react_17_0_2_react.useMemo(() => {
|
|
|
const matched = new Set(Object.keys(screens).filter(m => screens[m]));
|
|
|
return baseColumns.filter(c => !c.responsive || c.responsive.some(r => matched.has(r)));
|
|
|
}, [baseColumns, screens]);
|
|
|
const tableProps = (0,omit/* default */.Z)(props, ['className', 'style', 'columns']);
|
|
|
const {
|
|
|
locale: contextLocale = en_US/* default */.Z,
|
|
|
direction,
|
|
|
table,
|
|
|
renderEmpty,
|
|
|
getPrefixCls,
|
|
|
getPopupContainer: getContextPopupContainer
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
|
const tableLocale = Object.assign(Object.assign({}, contextLocale.Table), locale);
|
|
|
const rawData = dataSource || InternalTable_EMPTY_LIST;
|
|
|
const prefixCls = getPrefixCls('table', customizePrefixCls);
|
|
|
const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);
|
|
|
const mergedExpandable = Object.assign({
|
|
|
childrenColumnName: legacyChildrenColumnName,
|
|
|
expandIconColumnIndex
|
|
|
}, expandable);
|
|
|
const {
|
|
|
childrenColumnName = 'children'
|
|
|
} = mergedExpandable;
|
|
|
const expandType = _react_17_0_2_react.useMemo(() => {
|
|
|
if (rawData.some(item => item === null || item === void 0 ? void 0 : item[childrenColumnName])) {
|
|
|
return 'nest';
|
|
|
}
|
|
|
if (expandedRowRender || expandable && expandable.expandedRowRender) {
|
|
|
return 'row';
|
|
|
}
|
|
|
return null;
|
|
|
}, [rawData]);
|
|
|
const internalRefs = {
|
|
|
body: _react_17_0_2_react.useRef()
|
|
|
};
|
|
|
// ============================ RowKey ============================
|
|
|
const getRowKey = _react_17_0_2_react.useMemo(() => {
|
|
|
if (typeof rowKey === 'function') {
|
|
|
return rowKey;
|
|
|
}
|
|
|
return record => record === null || record === void 0 ? void 0 : record[rowKey];
|
|
|
}, [rowKey]);
|
|
|
const [getRecordByKey] = useLazyKVMap(rawData, childrenColumnName, getRowKey);
|
|
|
// ============================ Events =============================
|
|
|
const changeEventInfo = {};
|
|
|
const triggerOnChange = function (info, action) {
|
|
|
let reset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
|
var _a, _b, _c;
|
|
|
const changeInfo = Object.assign(Object.assign({}, changeEventInfo), info);
|
|
|
if (reset) {
|
|
|
(_a = changeEventInfo.resetPagination) === null || _a === void 0 ? void 0 : _a.call(changeEventInfo);
|
|
|
// Reset event param
|
|
|
if ((_b = changeInfo.pagination) === null || _b === void 0 ? void 0 : _b.current) {
|
|
|
changeInfo.pagination.current = 1;
|
|
|
}
|
|
|
// Trigger pagination events
|
|
|
if (pagination && pagination.onChange) {
|
|
|
pagination.onChange(1, (_c = changeInfo.pagination) === null || _c === void 0 ? void 0 : _c.pageSize);
|
|
|
}
|
|
|
}
|
|
|
if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {
|
|
|
(0,scrollTo/* default */.Z)(0, {
|
|
|
getContainer: () => 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
|
|
|
});
|
|
|
};
|
|
|
/**
|
|
|
* 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 =============================
|
|
|
const onSorterChange = (sorter, sorterStates) => {
|
|
|
triggerOnChange({
|
|
|
sorter,
|
|
|
sorterStates
|
|
|
}, 'sort', false);
|
|
|
};
|
|
|
const [transformSorterColumns, sortStates, sorterTitleProps, getSorters] = useFilterSorter({
|
|
|
prefixCls,
|
|
|
mergedColumns,
|
|
|
onSorterChange,
|
|
|
sortDirections: sortDirections || ['ascend', 'descend'],
|
|
|
tableLocale,
|
|
|
showSorterTooltip
|
|
|
});
|
|
|
const sortedData = _react_17_0_2_react.useMemo(() => getSortData(rawData, sortStates, childrenColumnName), [rawData, sortStates]);
|
|
|
changeEventInfo.sorter = getSorters();
|
|
|
changeEventInfo.sorterStates = sortStates;
|
|
|
// ============================ Filter ============================
|
|
|
const onFilterChange = (filters, filterStates) => {
|
|
|
triggerOnChange({
|
|
|
filters,
|
|
|
filterStates
|
|
|
}, 'filter', true);
|
|
|
};
|
|
|
const [transformFilterColumns, filterStates, filters] = hooks_useFilter({
|
|
|
prefixCls,
|
|
|
locale: tableLocale,
|
|
|
dropdownPrefixCls,
|
|
|
mergedColumns,
|
|
|
onFilterChange,
|
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer
|
|
|
});
|
|
|
const mergedData = getFilterData(sortedData, filterStates);
|
|
|
changeEventInfo.filters = filters;
|
|
|
changeEventInfo.filterStates = filterStates;
|
|
|
// ============================ Column ============================
|
|
|
const columnTitleProps = _react_17_0_2_react.useMemo(() => {
|
|
|
const mergedFilters = {};
|
|
|
Object.keys(filters).forEach(filterKey => {
|
|
|
if (filters[filterKey] !== null) {
|
|
|
mergedFilters[filterKey] = filters[filterKey];
|
|
|
}
|
|
|
});
|
|
|
return Object.assign(Object.assign({}, sorterTitleProps), {
|
|
|
filters: mergedFilters
|
|
|
});
|
|
|
}, [sorterTitleProps, filters]);
|
|
|
const [transformTitleColumns] = useTitleColumns(columnTitleProps);
|
|
|
// ========================== Pagination ==========================
|
|
|
const onPaginationChange = (current, pageSize) => {
|
|
|
triggerOnChange({
|
|
|
pagination: Object.assign(Object.assign({}, changeEventInfo.pagination), {
|
|
|
current,
|
|
|
pageSize
|
|
|
})
|
|
|
}, 'paginate');
|
|
|
};
|
|
|
const [mergedPagination, resetPagination] = hooks_usePagination(mergedData.length, onPaginationChange, pagination);
|
|
|
changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(mergedPagination, pagination);
|
|
|
changeEventInfo.resetPagination = resetPagination;
|
|
|
// ============================= Data =============================
|
|
|
const pageData = _react_17_0_2_react.useMemo(() => {
|
|
|
if (pagination === false || !mergedPagination.pageSize) {
|
|
|
return mergedData;
|
|
|
}
|
|
|
const {
|
|
|
current = 1,
|
|
|
total,
|
|
|
pageSize = DEFAULT_PAGE_SIZE
|
|
|
} = mergedPagination;
|
|
|
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 ==========================
|
|
|
const [transformSelectionColumns, selectedKeySet] = hooks_useSelection({
|
|
|
prefixCls,
|
|
|
data: mergedData,
|
|
|
pageData,
|
|
|
getRowKey,
|
|
|
getRecordByKey,
|
|
|
expandType,
|
|
|
childrenColumnName,
|
|
|
locale: tableLocale,
|
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer
|
|
|
}, rowSelection);
|
|
|
const internalRowClassName = (record, index, indent) => {
|
|
|
let mergedRowClassName;
|
|
|
if (typeof rowClassName === 'function') {
|
|
|
mergedRowClassName = _classnames_2_5_1_classnames_default()(rowClassName(record, index, indent));
|
|
|
} else {
|
|
|
mergedRowClassName = _classnames_2_5_1_classnames_default()(rowClassName);
|
|
|
}
|
|
|
return _classnames_2_5_1_classnames_default()({
|
|
|
[`${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 ============================
|
|
|
const transformColumns = _react_17_0_2_react.useCallback(innerColumns => transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns)))), [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);
|
|
|
let topPaginationNode;
|
|
|
let bottomPaginationNode;
|
|
|
if (pagination !== false && (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.total)) {
|
|
|
let paginationSize;
|
|
|
if (mergedPagination.size) {
|
|
|
paginationSize = mergedPagination.size;
|
|
|
} else {
|
|
|
paginationSize = mergedSize === 'small' || mergedSize === 'middle' ? 'small' : undefined;
|
|
|
}
|
|
|
const renderPagination = position => /*#__PURE__*/_react_17_0_2_react.createElement(es_pagination/* default */.Z, Object.assign({}, mergedPagination, {
|
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-pagination ${prefixCls}-pagination-${position}`, mergedPagination.className),
|
|
|
size: paginationSize
|
|
|
}));
|
|
|
const defaultPosition = direction === 'rtl' ? 'left' : 'right';
|
|
|
const {
|
|
|
position
|
|
|
} = mergedPagination;
|
|
|
if (position !== null && Array.isArray(position)) {
|
|
|
const topPos = position.find(p => p.includes('top'));
|
|
|
const bottomPos = position.find(p => p.includes('bottom'));
|
|
|
const isDisable = position.every(p => `${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
|
|
|
let spinProps;
|
|
|
if (typeof loading === 'boolean') {
|
|
|
spinProps = {
|
|
|
spinning: loading
|
|
|
};
|
|
|
} else if (typeof loading === 'object') {
|
|
|
spinProps = Object.assign({
|
|
|
spinning: true
|
|
|
}, loading);
|
|
|
}
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = table_style(prefixCls);
|
|
|
const [, token] = (0,useToken/* default */.Z)();
|
|
|
const wrapperClassNames = _classnames_2_5_1_classnames_default()(`${prefixCls}-wrapper`, table === null || table === void 0 ? void 0 : table.className, {
|
|
|
[`${prefixCls}-wrapper-rtl`]: direction === 'rtl'
|
|
|
}, className, rootClassName, hashId);
|
|
|
const mergedStyle = Object.assign(Object.assign({}, table === null || table === void 0 ? void 0 : table.style), style);
|
|
|
const emptyText = locale && locale.emptyText || (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Table')) || /*#__PURE__*/_react_17_0_2_react.createElement(defaultRenderEmpty/* default */.Z, {
|
|
|
componentName: "Table"
|
|
|
});
|
|
|
// ========================== Render ==========================
|
|
|
const TableComponent = virtual ? RcTable_VirtualTable : RcTable;
|
|
|
// >>> Virtual Table props. We set height here since it will affect height collection
|
|
|
const virtualProps = {};
|
|
|
const listItemHeight = _react_17_0_2_react.useMemo(() => {
|
|
|
const {
|
|
|
fontSize,
|
|
|
lineHeight,
|
|
|
padding,
|
|
|
paddingXS,
|
|
|
paddingSM
|
|
|
} = token;
|
|
|
const fontHeight = Math.floor(fontSize * lineHeight);
|
|
|
switch (mergedSize) {
|
|
|
case 'large':
|
|
|
return padding * 2 + fontHeight;
|
|
|
case 'small':
|
|
|
return paddingXS * 2 + fontHeight;
|
|
|
default:
|
|
|
return paddingSM * 2 + fontHeight;
|
|
|
}
|
|
|
}, [token, mergedSize]);
|
|
|
if (virtual) {
|
|
|
virtualProps.listItemHeight = listItemHeight;
|
|
|
}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
ref: ref,
|
|
|
className: wrapperClassNames,
|
|
|
style: mergedStyle
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(spin/* default */.Z, Object.assign({
|
|
|
spinning: false
|
|
|
}, spinProps), topPaginationNode, /*#__PURE__*/_react_17_0_2_react.createElement(TableComponent, Object.assign({}, virtualProps, tableProps, {
|
|
|
columns: mergedColumns,
|
|
|
direction: direction,
|
|
|
expandable: mergedExpandable,
|
|
|
prefixCls: prefixCls,
|
|
|
className: _classnames_2_5_1_classnames_default()({
|
|
|
[`${prefixCls}-middle`]: mergedSize === 'middle',
|
|
|
[`${prefixCls}-small`]: mergedSize === 'small',
|
|
|
[`${prefixCls}-bordered`]: bordered,
|
|
|
[`${prefixCls}-empty`]: rawData.length === 0
|
|
|
}),
|
|
|
data: pageData,
|
|
|
rowKey: getRowKey,
|
|
|
rowClassName: internalRowClassName,
|
|
|
emptyText: emptyText,
|
|
|
// Internal
|
|
|
internalHooks: INTERNAL_HOOKS,
|
|
|
internalRefs: internalRefs,
|
|
|
transformColumns: transformColumns
|
|
|
})), bottomPaginationNode)));
|
|
|
};
|
|
|
/* harmony default export */ var table_InternalTable = (/*#__PURE__*/_react_17_0_2_react.forwardRef(InternalTable));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/Table.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const table_Table_Table = (props, ref) => {
|
|
|
const renderTimesRef = _react_17_0_2_react.useRef(0);
|
|
|
renderTimesRef.current += 1;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(table_InternalTable, Object.assign({}, props, {
|
|
|
ref: ref,
|
|
|
_renderTimes: renderTimesRef.current
|
|
|
}));
|
|
|
};
|
|
|
const ForwardTable = /*#__PURE__*/_react_17_0_2_react.forwardRef(table_Table_Table);
|
|
|
ForwardTable.SELECTION_COLUMN = SELECTION_COLUMN;
|
|
|
ForwardTable.EXPAND_COLUMN = EXPAND_COLUMN;
|
|
|
ForwardTable.SELECTION_ALL = SELECTION_ALL;
|
|
|
ForwardTable.SELECTION_INVERT = SELECTION_INVERT;
|
|
|
ForwardTable.SELECTION_NONE = SELECTION_NONE;
|
|
|
ForwardTable.Column = table_Column;
|
|
|
ForwardTable.ColumnGroup = table_ColumnGroup;
|
|
|
ForwardTable.Summary = FooterComponents;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var table_Table = (ForwardTable);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
/* harmony default export */ var table = (table_Table);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 41416:
|
|
|
/*!********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules ***!
|
|
|
\********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ tree; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/index.js + 7 modules
|
|
|
var es = __webpack_require__(79556);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(95190);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/FileOutlined.js + 1 modules
|
|
|
var FileOutlined = __webpack_require__(52671);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/FolderOpenOutlined.js + 1 modules
|
|
|
var FolderOpenOutlined = __webpack_require__(8657);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(14809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@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);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(7657);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@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_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_FolderOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(FolderOutlined_FolderOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_FolderOutlined = (RefIcon);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/util.js
|
|
|
var util = __webpack_require__(35654);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/utils/treeUtil.js
|
|
|
var treeUtil = __webpack_require__(71430);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@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);
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@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_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_HolderOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var HolderOutlined_RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(HolderOutlined_HolderOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_HolderOutlined = (HolderOutlined_RefIcon);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/motion.js
|
|
|
var _util_motion = __webpack_require__(62892);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/style/index.js
|
|
|
var tree_style = __webpack_require__(20648);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/utils/dropIndicator.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
const offset = 4;
|
|
|
function dropIndicatorRender(props) {
|
|
|
const {
|
|
|
dropPosition,
|
|
|
dropLevelOffset,
|
|
|
prefixCls,
|
|
|
indent,
|
|
|
direction = 'ltr'
|
|
|
} = props;
|
|
|
const startPosition = direction === 'ltr' ? 'left' : 'right';
|
|
|
const endPosition = direction === 'ltr' ? 'right' : 'left';
|
|
|
const style = {
|
|
|
[startPosition]: -dropLevelOffset * indent + offset,
|
|
|
[endPosition]: 0
|
|
|
};
|
|
|
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_17_0_2_react.createElement("div", {
|
|
|
style: style,
|
|
|
className: `${prefixCls}-drop-indicator`
|
|
|
});
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/utils/iconUtil.js + 2 modules
|
|
|
var iconUtil = __webpack_require__(71997);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/Tree.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Tree = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
virtual,
|
|
|
tree
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
showIcon = false,
|
|
|
showLine,
|
|
|
switcherIcon,
|
|
|
blockNode = false,
|
|
|
children,
|
|
|
checkable = false,
|
|
|
selectable = true,
|
|
|
draggable,
|
|
|
motion: customMotion,
|
|
|
style
|
|
|
} = props;
|
|
|
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
|
const rootPrefixCls = getPrefixCls();
|
|
|
const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, (0,_util_motion/* default */.Z)(rootPrefixCls)), {
|
|
|
motionAppear: false
|
|
|
});
|
|
|
const newProps = Object.assign(Object.assign({}, props), {
|
|
|
checkable,
|
|
|
selectable,
|
|
|
showIcon,
|
|
|
motion,
|
|
|
blockNode,
|
|
|
showLine: Boolean(showLine),
|
|
|
dropIndicatorRender: dropIndicatorRender
|
|
|
});
|
|
|
const [wrapSSR, hashId] = (0,tree_style/* default */.ZP)(prefixCls);
|
|
|
const draggableConfig = _react_17_0_2_react.useMemo(() => {
|
|
|
if (!draggable) {
|
|
|
return false;
|
|
|
}
|
|
|
let mergedDraggable = {};
|
|
|
switch (typeof draggable) {
|
|
|
case 'function':
|
|
|
mergedDraggable.nodeDraggable = draggable;
|
|
|
break;
|
|
|
case 'object':
|
|
|
mergedDraggable = Object.assign({}, draggable);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
// Do nothing
|
|
|
}
|
|
|
|
|
|
if (mergedDraggable.icon !== false) {
|
|
|
mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/_react_17_0_2_react.createElement(icons_HolderOutlined, null);
|
|
|
}
|
|
|
return mergedDraggable;
|
|
|
}, [draggable]);
|
|
|
const renderSwitcherIcon = nodeProps => /*#__PURE__*/_react_17_0_2_react.createElement(iconUtil/* default */.Z, {
|
|
|
prefixCls: prefixCls,
|
|
|
switcherIcon: switcherIcon,
|
|
|
treeNodeProps: nodeProps,
|
|
|
showLine: showLine
|
|
|
});
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
|
|
|
itemHeight: 20,
|
|
|
ref: ref,
|
|
|
virtual: virtual
|
|
|
}, newProps, {
|
|
|
// newProps may contain style so declare style below it
|
|
|
style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),
|
|
|
prefixCls: prefixCls,
|
|
|
className: _classnames_2_5_1_classnames_default()({
|
|
|
[`${prefixCls}-icon-hide`]: !showIcon,
|
|
|
[`${prefixCls}-block-node`]: blockNode,
|
|
|
[`${prefixCls}-unselectable`]: !selectable,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId),
|
|
|
direction: direction,
|
|
|
checkable: checkable ? /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-checkbox-inner`
|
|
|
}) : checkable,
|
|
|
selectable: selectable,
|
|
|
switcherIcon: renderSwitcherIcon,
|
|
|
draggable: draggableConfig
|
|
|
}), children));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var tree_Tree = (Tree);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@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) {
|
|
|
const {
|
|
|
key,
|
|
|
children
|
|
|
} = dataNode;
|
|
|
if (callback(key, dataNode) !== false) {
|
|
|
traverseNodesKey(children || [], callback);
|
|
|
}
|
|
|
}
|
|
|
treeData.forEach(processNode);
|
|
|
}
|
|
|
/** 计算选中范围,只考虑expanded情况以优化性能 */
|
|
|
function calcRangeKeys(_ref) {
|
|
|
let {
|
|
|
treeData,
|
|
|
expandedKeys,
|
|
|
startKey,
|
|
|
endKey
|
|
|
} = _ref;
|
|
|
const keys = [];
|
|
|
let record = Record.None;
|
|
|
if (startKey && startKey === endKey) {
|
|
|
return [startKey];
|
|
|
}
|
|
|
if (!startKey || !endKey) {
|
|
|
return [];
|
|
|
}
|
|
|
function matchKey(key) {
|
|
|
return key === startKey || key === endKey;
|
|
|
}
|
|
|
traverseNodesKey(treeData, 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) {
|
|
|
const restKeys = (0,toConsumableArray/* default */.Z)(keys);
|
|
|
const nodes = [];
|
|
|
traverseNodesKey(treeData, (key, node) => {
|
|
|
const index = restKeys.indexOf(key);
|
|
|
if (index !== -1) {
|
|
|
nodes.push(node);
|
|
|
restKeys.splice(index, 1);
|
|
|
}
|
|
|
return !!restKeys.length;
|
|
|
});
|
|
|
return nodes;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/DirectoryTree.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getIcon(props) {
|
|
|
const {
|
|
|
isLeaf,
|
|
|
expanded
|
|
|
} = props;
|
|
|
if (isLeaf) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(FileOutlined/* default */.Z, null);
|
|
|
}
|
|
|
return expanded ? /*#__PURE__*/_react_17_0_2_react.createElement(FolderOpenOutlined/* default */.Z, null) : /*#__PURE__*/_react_17_0_2_react.createElement(icons_FolderOutlined, null);
|
|
|
}
|
|
|
function getTreeData(_ref) {
|
|
|
let {
|
|
|
treeData,
|
|
|
children
|
|
|
} = _ref;
|
|
|
return treeData || (0,treeUtil/* convertTreeToData */.zn)(children);
|
|
|
}
|
|
|
const DirectoryTree = (_a, ref) => {
|
|
|
var {
|
|
|
defaultExpandAll,
|
|
|
defaultExpandParent,
|
|
|
defaultExpandedKeys
|
|
|
} = _a,
|
|
|
props = __rest(_a, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]);
|
|
|
// Shift click usage
|
|
|
const lastSelectedKey = _react_17_0_2_react.useRef();
|
|
|
const cachedSelectedKeys = _react_17_0_2_react.useRef();
|
|
|
const getInitExpandedKeys = () => {
|
|
|
const {
|
|
|
keyEntities
|
|
|
} = (0,treeUtil/* convertDataToEntities */.I8)(getTreeData(props));
|
|
|
let 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;
|
|
|
};
|
|
|
const [selectedKeys, setSelectedKeys] = _react_17_0_2_react.useState(props.selectedKeys || props.defaultSelectedKeys || []);
|
|
|
const [expandedKeys, setExpandedKeys] = _react_17_0_2_react.useState(() => getInitExpandedKeys());
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('selectedKeys' in props) {
|
|
|
setSelectedKeys(props.selectedKeys);
|
|
|
}
|
|
|
}, [props.selectedKeys]);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('expandedKeys' in props) {
|
|
|
setExpandedKeys(props.expandedKeys);
|
|
|
}
|
|
|
}, [props.expandedKeys]);
|
|
|
const 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);
|
|
|
};
|
|
|
const onSelect = (keys, event) => {
|
|
|
var _a;
|
|
|
const {
|
|
|
multiple
|
|
|
} = props;
|
|
|
const {
|
|
|
node,
|
|
|
nativeEvent
|
|
|
} = event;
|
|
|
const {
|
|
|
key = ''
|
|
|
} = node;
|
|
|
const treeData = getTreeData(props);
|
|
|
// const newState: DirectoryTreeState = {};
|
|
|
// We need wrap this event since some value is not same
|
|
|
const newEvent = Object.assign(Object.assign({}, event), {
|
|
|
selected: true
|
|
|
});
|
|
|
// Windows / Mac single pick
|
|
|
const ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
|
const shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
|
// Generate new selected keys
|
|
|
let 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,
|
|
|
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);
|
|
|
}
|
|
|
};
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
showIcon = true,
|
|
|
expandAction = 'click'
|
|
|
} = props,
|
|
|
otherProps = __rest(props, ["prefixCls", "className", "showIcon", "expandAction"]);
|
|
|
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
|
const connectClassName = _classnames_2_5_1_classnames_default()(`${prefixCls}-directory`, {
|
|
|
[`${prefixCls}-directory-rtl`]: direction === 'rtl'
|
|
|
}, className);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(tree_Tree, Object.assign({
|
|
|
icon: getIcon,
|
|
|
ref: ref,
|
|
|
blockNode: true
|
|
|
}, otherProps, {
|
|
|
showIcon: showIcon,
|
|
|
expandAction: expandAction,
|
|
|
prefixCls: prefixCls,
|
|
|
className: connectClassName,
|
|
|
expandedKeys: expandedKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
onSelect: onSelect,
|
|
|
onExpand: onExpand
|
|
|
}));
|
|
|
};
|
|
|
const ForwardDirectoryTree = /*#__PURE__*/_react_17_0_2_react.forwardRef(DirectoryTree);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var tree_DirectoryTree = (ForwardDirectoryTree);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const 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);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8224:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/addEventListener.js ***!
|
|
|
\*************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Z: function() { return /* binding */ addEventListenerWrap; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ 4676);
|
|
|
|
|
|
function addEventListenerWrap(target, eventType, cb, option) {
|
|
|
/* eslint camelcase: 2 */
|
|
|
var callback = react_dom__WEBPACK_IMPORTED_MODULE_0__.unstable_batchedUpdates ? function run(e) {
|
|
|
react_dom__WEBPACK_IMPORTED_MODULE_0__.unstable_batchedUpdates(cb, e);
|
|
|
} : cb;
|
|
|
if (target !== null && target !== void 0 && target.addEventListener) {
|
|
|
target.addEventListener(eventType, callback, option);
|
|
|
}
|
|
|
return {
|
|
|
remove: function remove() {
|
|
|
if (target !== null && target !== void 0 && target.removeEventListener) {
|
|
|
target.removeEventListener(eventType, callback, option);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 55468:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/_rc-util@5.44.4@rc-util/es/Dom/css.js ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* 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)
|
|
|
};
|
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |