You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7907 lines
266 KiB
7907 lines
266 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[63889],{
|
|
|
|
/***/ 39398:
|
|
/*!**********************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js + 1 modules ***!
|
|
\**********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_CaretDownOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/CaretDownOutlined.js
|
|
// This icon file is generated automatically.
|
|
var CaretDownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "outlined" };
|
|
/* harmony default export */ var asn_CaretDownOutlined = (CaretDownOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var CaretDownOutlined_CaretDownOutlined = function CaretDownOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_CaretDownOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_CaretDownOutlined = (/*#__PURE__*/react.forwardRef(CaretDownOutlined_CaretDownOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 10010:
|
|
/*!********************************************************************************!*\
|
|
!*** ./node_modules/@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/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/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/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@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.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_CaretUpOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_CaretUpOutlined = (/*#__PURE__*/react.forwardRef(CaretUpOutlined_CaretUpOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 38780:
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/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);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 66367:
|
|
/*!*************************************************!*\
|
|
!*** ./node_modules/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;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 58375:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/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/antd/node_modules/rc-util/es/raf.js
|
|
var raf = __webpack_require__(96523);
|
|
;// CONCATENATED MODULE: ./node_modules/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/es/_util/getScroll.js
|
|
var getScroll = __webpack_require__(66367);
|
|
;// CONCATENATED MODULE: ./node_modules/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);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 84567:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/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/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/rc-checkbox/es/index.js + 5 modules
|
|
var es = __webpack_require__(95860);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var config_provider_context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(98866);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
var context = __webpack_require__(65223);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/GroupContext.js
|
|
|
|
const GroupContext = /*#__PURE__*/react.createContext(null);
|
|
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js
|
|
var checkbox_style = __webpack_require__(63185);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Checkbox.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 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.useContext(config_provider_context/* ConfigContext */.E_);
|
|
const checkboxGroup = react.useContext(checkbox_GroupContext);
|
|
const {
|
|
isFormItemInput
|
|
} = react.useContext(context/* FormItemInputContext */.aM);
|
|
const contextDisabled = 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.useRef(restProps.value);
|
|
react.useEffect(() => {
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
false ? 0 : void 0;
|
|
}, []);
|
|
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_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_default()({
|
|
[`${prefixCls}-indeterminate`]: indeterminate
|
|
}, hashId);
|
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
return wrapSSR(
|
|
/*#__PURE__*/
|
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
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.createElement(es/* default */.Z, Object.assign({
|
|
"aria-checked": ariaChecked
|
|
}, checkboxProps, {
|
|
prefixCls: prefixCls,
|
|
className: checkboxClass,
|
|
disabled: mergedDisabled,
|
|
ref: ref
|
|
})), children !== undefined && /*#__PURE__*/react.createElement("span", null, children)));
|
|
};
|
|
const Checkbox = /*#__PURE__*/react.forwardRef(InternalCheckbox);
|
|
if (false) {}
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Group.js
|
|
|
|
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.useContext(config_provider_context/* ConfigContext */.E_);
|
|
const [value, setValue] = react.useState(restProps.value || defaultValue || []);
|
|
const [registeredValues, setRegisteredValues] = react.useState([]);
|
|
react.useEffect(() => {
|
|
if ('value' in restProps) {
|
|
setValue(restProps.value || []);
|
|
}
|
|
}, [restProps.value]);
|
|
const memoOptions = 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.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_default()(groupPrefixCls, {
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", Object.assign({
|
|
className: classString,
|
|
style: style
|
|
}, domProps, {
|
|
ref: ref
|
|
}), /*#__PURE__*/react.createElement(checkbox_GroupContext.Provider, {
|
|
value: context
|
|
}, childrenNode)));
|
|
};
|
|
|
|
const CheckboxGroup = /*#__PURE__*/react.forwardRef(InternalGroup);
|
|
/* harmony default export */ var Group = (/*#__PURE__*/react.memo(CheckboxGroup));
|
|
;// CONCATENATED MODULE: ./node_modules/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);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 85418:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/antd/es/dropdown/index.js + 1 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_dropdown; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/dropdown.js + 9 modules
|
|
var dropdown = __webpack_require__(35874);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/EllipsisOutlined.js + 1 modules
|
|
var EllipsisOutlined = __webpack_require__(89705);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/space/index.js + 2 modules
|
|
var space = __webpack_require__(42075);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/space/Compact.js
|
|
var Compact = __webpack_require__(4173);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/style/index.js + 1 modules
|
|
var style = __webpack_require__(66748);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/dropdown/dropdown-button.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 DropdownButton = props => {
|
|
const {
|
|
getPopupContainer: getContextPopupContainer,
|
|
getPrefixCls,
|
|
direction
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
type = 'default',
|
|
danger,
|
|
disabled,
|
|
loading,
|
|
onClick,
|
|
htmlType,
|
|
children,
|
|
className,
|
|
menu,
|
|
arrow,
|
|
autoFocus,
|
|
overlay,
|
|
trigger,
|
|
align,
|
|
open,
|
|
onOpenChange,
|
|
placement,
|
|
getPopupContainer,
|
|
href,
|
|
icon = /*#__PURE__*/react.createElement(EllipsisOutlined/* default */.Z, null),
|
|
title,
|
|
buttonsRender = buttons => buttons,
|
|
mouseEnterDelay,
|
|
mouseLeaveDelay,
|
|
overlayClassName,
|
|
overlayStyle,
|
|
destroyPopupOnHide,
|
|
dropdownRender
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
|
|
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
|
const buttonPrefixCls = `${prefixCls}-button`;
|
|
const [wrapSSR, hashId] = (0,style/* default */.Z)(prefixCls);
|
|
const dropdownProps = {
|
|
menu,
|
|
arrow,
|
|
autoFocus,
|
|
align,
|
|
disabled,
|
|
trigger: disabled ? [] : trigger,
|
|
onOpenChange,
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
mouseEnterDelay,
|
|
mouseLeaveDelay,
|
|
overlayClassName,
|
|
overlayStyle,
|
|
destroyPopupOnHide,
|
|
dropdownRender
|
|
};
|
|
const {
|
|
compactSize,
|
|
compactItemClassnames
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
const classes = classnames_default()(buttonPrefixCls, compactItemClassnames, className, hashId);
|
|
if ('overlay' in props) {
|
|
dropdownProps.overlay = overlay;
|
|
}
|
|
if ('open' in props) {
|
|
dropdownProps.open = open;
|
|
}
|
|
if ('placement' in props) {
|
|
dropdownProps.placement = placement;
|
|
} else {
|
|
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
|
}
|
|
const leftButton = /*#__PURE__*/react.createElement(es_button/* default */.ZP, {
|
|
type: type,
|
|
danger: danger,
|
|
disabled: disabled,
|
|
loading: loading,
|
|
onClick: onClick,
|
|
htmlType: htmlType,
|
|
href: href,
|
|
title: title
|
|
}, children);
|
|
const rightButton = /*#__PURE__*/react.createElement(es_button/* default */.ZP, {
|
|
type: type,
|
|
danger: danger,
|
|
icon: icon
|
|
});
|
|
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
|
|
return wrapSSR( /*#__PURE__*/react.createElement(space/* default.Compact */.Z.Compact, Object.assign({
|
|
className: classes,
|
|
size: compactSize,
|
|
block: true
|
|
}, restProps), leftButtonToRender, /*#__PURE__*/react.createElement(dropdown/* default */.Z, Object.assign({}, dropdownProps), rightButtonToRender)));
|
|
};
|
|
DropdownButton.__ANT_BUTTON = true;
|
|
/* harmony default export */ var dropdown_button = (DropdownButton);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/dropdown/index.js
|
|
'use client';
|
|
|
|
|
|
|
|
const Dropdown = dropdown/* default */.Z;
|
|
Dropdown.Button = dropdown_button;
|
|
/* harmony default export */ var es_dropdown = (Dropdown);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 49867:
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/antd/es/style/operationUnit.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "N": function() { return /* binding */ operationUnit; }
|
|
/* harmony export */ });
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
const operationUnit = token => ({
|
|
// FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
|
|
// And Typography use this to generate link style which should not do this.
|
|
color: token.colorLink,
|
|
textDecoration: 'none',
|
|
outline: 'none',
|
|
cursor: 'pointer',
|
|
transition: `color ${token.motionDurationSlow}`,
|
|
'&:focus, &:hover': {
|
|
color: token.colorLinkHover
|
|
},
|
|
'&:active': {
|
|
color: token.colorLinkActive
|
|
}
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 63889:
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/antd/es/table/index.js + 90 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/es/constant.js
|
|
var EXPAND_COLUMN = {};
|
|
var INTERNAL_HOOKS = 'rc-table-internal-hook';
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(97685);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useEvent.js
|
|
var useEvent = __webpack_require__(66680);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
var useLayoutEffect = __webpack_require__(8410);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/isEqual.js
|
|
var isEqual = __webpack_require__(91881);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/react-dom/index.js
|
|
var react_dom = __webpack_require__(73935);
|
|
;// CONCATENATED MODULE: ./node_modules/@rc-component/context/es/context.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createContext(defaultValue) {
|
|
var Context = /*#__PURE__*/react.createContext(undefined);
|
|
|
|
var Provider = function Provider(_ref) {
|
|
var value = _ref.value,
|
|
children = _ref.children;
|
|
var valueRef = react.useRef(value);
|
|
valueRef.current = value;
|
|
|
|
var _React$useState = react.useState(function () {
|
|
return {
|
|
getValue: function getValue() {
|
|
return valueRef.current;
|
|
},
|
|
listeners: new Set()
|
|
};
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 1),
|
|
context = _React$useState2[0];
|
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
(0,react_dom.unstable_batchedUpdates)(function () {
|
|
context.listeners.forEach(function (listener) {
|
|
listener(value);
|
|
});
|
|
});
|
|
}, [value]);
|
|
return /*#__PURE__*/react.createElement(Context.Provider, {
|
|
value: context
|
|
}, children);
|
|
};
|
|
|
|
return {
|
|
Context: Context,
|
|
Provider: Provider,
|
|
defaultValue: defaultValue
|
|
};
|
|
}
|
|
/** e.g. useSelect(userContext) => user */
|
|
|
|
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.useContext(holder === null || holder === void 0 ? void 0 : holder.Context);
|
|
|
|
var _ref2 = context || {},
|
|
listeners = _ref2.listeners,
|
|
getValue = _ref2.getValue;
|
|
|
|
var valueRef = react.useRef();
|
|
valueRef.current = eventSelector(context ? getValue() : holder === null || holder === void 0 ? void 0 : holder.defaultValue);
|
|
|
|
var _React$useState3 = 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/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
var ref = __webpack_require__(42550);
|
|
;// CONCATENATED MODULE: ./node_modules/@rc-component/context/es/Immutable.js
|
|
|
|
|
|
|
|
var ImmutableContext = /*#__PURE__*/react.createContext(0);
|
|
|
|
/**
|
|
* 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.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,ref/* supportRef */.Yr)(Component);
|
|
|
|
var ImmutableComponent = function ImmutableComponent(props, ref) {
|
|
var refProps = refAble ? {
|
|
ref: ref
|
|
} : {};
|
|
var renderTimesRef = react.useRef(0);
|
|
var prevProps = react.useRef(props);
|
|
|
|
if ( // Always trigger re-render if not provide `notTriggerRender`
|
|
!shouldTriggerRender || shouldTriggerRender(prevProps.current, props)) {
|
|
renderTimesRef.current += 1;
|
|
}
|
|
|
|
prevProps.current = props;
|
|
return /*#__PURE__*/react.createElement(ImmutableContext.Provider, {
|
|
value: renderTimesRef.current
|
|
}, /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({}, props, refProps)));
|
|
};
|
|
|
|
if (false) {}
|
|
|
|
return refAble ? /*#__PURE__*/react.forwardRef(ImmutableComponent) : ImmutableComponent;
|
|
}
|
|
/**
|
|
* Wrapped Component with `React.memo`.
|
|
* But will rerender when parent with `makeImmutable` rerender.
|
|
*/
|
|
|
|
function responseImmutable(Component, propsAreEqual) {
|
|
var refAble = (0,ref/* supportRef */.Yr)(Component);
|
|
|
|
var ImmutableComponent = function ImmutableComponent(props, ref) {
|
|
var refProps = refAble ? {
|
|
ref: ref
|
|
} : {};
|
|
useImmutableMark();
|
|
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({}, props, refProps));
|
|
};
|
|
|
|
if (false) {}
|
|
|
|
return refAble ? /*#__PURE__*/react.memo( /*#__PURE__*/react.forwardRef(ImmutableComponent), propsAreEqual) : /*#__PURE__*/react.memo(ImmutableComponent, propsAreEqual);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/@rc-component/context/es/index.js
|
|
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/TableContext.js
|
|
|
|
var TableContext = createContext();
|
|
/* harmony default export */ var context_TableContext = (TableContext);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useRenderTimes.js
|
|
/* istanbul ignore file */
|
|
|
|
function useRenderTimes(props, debug) {
|
|
// Render times
|
|
var timesRef = react.useRef(0);
|
|
timesRef.current += 1;
|
|
|
|
// Props changed
|
|
var propsRef = 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.useRef([]);
|
|
if (keys.length) {
|
|
keysRef.current = keys;
|
|
}
|
|
react.useDebugValue(timesRef.current);
|
|
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.memo(function () {
|
|
var times = useRenderTimes();
|
|
return /*#__PURE__*/react.createElement("h1", null, "Render Times: ", times);
|
|
});
|
|
RenderBlock.displayName = 'RenderBlock';
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__(71002);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/hooks/useMemo.js
|
|
|
|
function useMemo_useMemo(getValue, condition, shouldUpdate) {
|
|
var cacheRef = react.useRef({});
|
|
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
|
|
cacheRef.current.value = getValue();
|
|
cacheRef.current.condition = condition;
|
|
}
|
|
return cacheRef.current.value;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/warning.js
|
|
/* eslint-disable no-console */
|
|
var warned = {};
|
|
var preWarningFns = [];
|
|
|
|
/**
|
|
* Pre warning enable you to parse content before console.error.
|
|
* Modify to null will prevent warning.
|
|
*/
|
|
var preMessage = function preMessage(fn) {
|
|
preWarningFns.push(fn);
|
|
};
|
|
function warning_warning(valid, message) {
|
|
// Support uglify
|
|
if (false) { var finalMessage; }
|
|
}
|
|
function note(valid, message) {
|
|
// Support uglify
|
|
if (false) { var finalMessage; }
|
|
}
|
|
function resetWarned() {
|
|
warned = {};
|
|
}
|
|
function call(method, valid, message) {
|
|
if (!valid && !warned[message]) {
|
|
method(false, message);
|
|
warned[message] = true;
|
|
}
|
|
}
|
|
function warningOnce(valid, message) {
|
|
call(warning_warning, valid, message);
|
|
}
|
|
function noteOnce(valid, message) {
|
|
call(note, valid, message);
|
|
}
|
|
warningOnce.preMessage = preMessage;
|
|
warningOnce.resetWarned = resetWarned;
|
|
warningOnce.noteOnce = noteOnce;
|
|
/* harmony default export */ var es_warning = (warningOnce);
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/isEqual.js
|
|
|
|
|
|
|
|
/**
|
|
* Deeply compares two object literals.
|
|
* @param obj1 object 1
|
|
* @param obj2 object 2
|
|
* @param shallow shallow compare
|
|
* @returns
|
|
*/
|
|
function isEqual_isEqual(obj1, obj2) {
|
|
var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
// https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
|
|
var refSet = new Set();
|
|
function deepEqual(a, b) {
|
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
var circular = refSet.has(a);
|
|
es_warning(!circular, 'Warning: There may be circular references');
|
|
if (circular) {
|
|
return false;
|
|
}
|
|
if (a === b) {
|
|
return true;
|
|
}
|
|
if (shallow && level > 1) {
|
|
return false;
|
|
}
|
|
refSet.add(a);
|
|
var newLevel = level + 1;
|
|
if (Array.isArray(a)) {
|
|
if (!Array.isArray(b) || a.length !== b.length) {
|
|
return false;
|
|
}
|
|
for (var i = 0; i < a.length; i++) {
|
|
if (!deepEqual(a[i], b[i], newLevel)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
if (a && b && (0,esm_typeof/* default */.Z)(a) === 'object' && (0,esm_typeof/* default */.Z)(b) === 'object') {
|
|
var keys = Object.keys(a);
|
|
if (keys.length !== Object.keys(b).length) {
|
|
return false;
|
|
}
|
|
return keys.every(function (key) {
|
|
return deepEqual(a[key], b[key], newLevel);
|
|
});
|
|
}
|
|
// other
|
|
return false;
|
|
}
|
|
return deepEqual(obj1, obj2);
|
|
}
|
|
/* harmony default export */ var es_isEqual = (isEqual_isEqual);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/utils/get.js
|
|
function get(entity, path) {
|
|
var current = entity;
|
|
for (var i = 0; i < path.length; i += 1) {
|
|
if (current === null || current === undefined) {
|
|
return undefined;
|
|
}
|
|
current = current[path[i]];
|
|
}
|
|
return current;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/context/PerfContext.js
|
|
|
|
// TODO: Remove when use `responsiveImmutable`
|
|
var PerfContext = /*#__PURE__*/react.createContext({
|
|
renderWithProps: false
|
|
});
|
|
/* harmony default export */ var context_PerfContext = (PerfContext);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/valueUtil.js
|
|
var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY';
|
|
function toArray(arr) {
|
|
if (arr === undefined || arr === null) {
|
|
return [];
|
|
}
|
|
return Array.isArray(arr) ? arr : [arr];
|
|
}
|
|
function getColumnsKey(columns) {
|
|
var columnKeys = [];
|
|
var keys = {};
|
|
columns.forEach(function (column) {
|
|
var _ref = column || {},
|
|
key = _ref.key,
|
|
dataIndex = _ref.dataIndex;
|
|
var mergedKey = key || toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX;
|
|
while (keys[mergedKey]) {
|
|
mergedKey = "".concat(mergedKey, "_next");
|
|
}
|
|
keys[mergedKey] = true;
|
|
columnKeys.push(mergedKey);
|
|
});
|
|
return columnKeys;
|
|
}
|
|
function validateValue(val) {
|
|
return val !== null && val !== undefined;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Cell/useCellRender.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isRenderCell(data) {
|
|
return data && (0,esm_typeof/* default */.Z)(data) === 'object' && !Array.isArray(data) && ! /*#__PURE__*/react.isValidElement(data);
|
|
}
|
|
function useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate) {
|
|
// TODO: Remove this after next major version
|
|
var perfRecord = react.useContext(context_PerfContext);
|
|
var mark = useImmutableMark();
|
|
|
|
// ======================== Render ========================
|
|
var retData = useMemo_useMemo(function () {
|
|
if (validateValue(children)) {
|
|
return [children];
|
|
}
|
|
var path = dataIndex === null || dataIndex === undefined || dataIndex === '' ? [] : Array.isArray(dataIndex) ? dataIndex : [dataIndex];
|
|
var value = get(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 !es_isEqual(prev, next, true);
|
|
});
|
|
return retData;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/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/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.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_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)({}, additionalProps.style), alignStyle), fixedStyle), 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.isValidElement(mergedChildNode)) {
|
|
mergedChildNode = null;
|
|
}
|
|
if (ellipsis && (lastFixLeft || firstFixRight)) {
|
|
mergedChildNode = /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(cellPrefixCls, "-content")
|
|
}, mergedChildNode);
|
|
}
|
|
return /*#__PURE__*/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.memo(Cell));
|
|
;// CONCATENATED MODULE: ./node_modules/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/es/Footer/SummaryContext.js
|
|
|
|
var SummaryContext = /*#__PURE__*/react.createContext({});
|
|
/* harmony default export */ var Footer_SummaryContext = (SummaryContext);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/Cell.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SummaryCell(_ref) {
|
|
var className = _ref.className,
|
|
index = _ref.index,
|
|
children = _ref.children,
|
|
_ref$colSpan = _ref.colSpan,
|
|
colSpan = _ref$colSpan === void 0 ? 1 : _ref$colSpan,
|
|
rowSpan = _ref.rowSpan,
|
|
align = _ref.align;
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'direction']),
|
|
prefixCls = _useContext.prefixCls,
|
|
direction = _useContext.direction;
|
|
var _React$useContext = 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.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/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
;// CONCATENATED MODULE: ./node_modules/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.createElement("tr", props, children);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/Summary.js
|
|
|
|
|
|
/**
|
|
* Syntactic sugar. Do not support HOC.
|
|
*/
|
|
function Summary(_ref) {
|
|
var children = _ref.children;
|
|
return children;
|
|
}
|
|
Summary.Row = FooterRow;
|
|
Summary.Cell = SummaryCell;
|
|
/* harmony default export */ var Footer_Summary = (Summary);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Footer/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Footer(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.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.createElement(Footer_SummaryContext.Provider, {
|
|
value: summaryContext
|
|
}, /*#__PURE__*/react.createElement("tfoot", {
|
|
className: "".concat(prefixCls, "-summary")
|
|
}, children));
|
|
}
|
|
/* harmony default export */ var es_Footer = (responseImmutable(Footer));
|
|
var FooterComponents = Footer_Summary;
|
|
// EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js + 4 modules
|
|
var es = __webpack_require__(48555);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/Dom/isVisible.js
|
|
/* harmony default export */ var isVisible = (function (element) {
|
|
if (!element) {
|
|
return false;
|
|
}
|
|
if (element instanceof Element) {
|
|
if (element.offsetParent) {
|
|
return true;
|
|
}
|
|
if (element.getBBox) {
|
|
var _getBBox = element.getBBox(),
|
|
width = _getBBox.width,
|
|
height = _getBBox.height;
|
|
if (width || height) {
|
|
return true;
|
|
}
|
|
}
|
|
if (element.getBoundingClientRect) {
|
|
var _element$getBoundingC = element.getBoundingClientRect(),
|
|
_width = _element$getBoundingC.width,
|
|
_height = _element$getBoundingC.height;
|
|
if (_width || _height) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/Dom/styleChecker.js
|
|
|
|
var isStyleNameSupport = function isStyleNameSupport(styleName) {
|
|
if (canUseDom() && window.document.documentElement) {
|
|
var styleNameList = Array.isArray(styleName) ? styleName : [styleName];
|
|
var documentElement = window.document.documentElement;
|
|
return styleNameList.some(function (name) {
|
|
return name in documentElement.style;
|
|
});
|
|
}
|
|
return false;
|
|
};
|
|
var isStyleValueSupport = function isStyleValueSupport(styleName, value) {
|
|
if (!isStyleNameSupport(styleName)) {
|
|
return false;
|
|
}
|
|
var ele = document.createElement('div');
|
|
var origin = ele.style[styleName];
|
|
ele.style[styleName] = value;
|
|
return ele.style[styleName] !== origin;
|
|
};
|
|
function isStyleSupport(styleName, styleValue) {
|
|
if (!Array.isArray(styleName) && styleValue !== undefined) {
|
|
return isStyleValueSupport(styleName, styleValue);
|
|
}
|
|
return isStyleNameSupport(styleName);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/getScrollBarSize.js
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
var cached;
|
|
function getScrollBarSize(fresh) {
|
|
if (typeof document === 'undefined') {
|
|
return 0;
|
|
}
|
|
if (fresh || cached === undefined) {
|
|
var inner = document.createElement('div');
|
|
inner.style.width = '100%';
|
|
inner.style.height = '200px';
|
|
var outer = document.createElement('div');
|
|
var outerStyle = outer.style;
|
|
outerStyle.position = 'absolute';
|
|
outerStyle.top = '0';
|
|
outerStyle.left = '0';
|
|
outerStyle.pointerEvents = 'none';
|
|
outerStyle.visibility = 'hidden';
|
|
outerStyle.width = '200px';
|
|
outerStyle.height = '150px';
|
|
outerStyle.overflow = 'hidden';
|
|
outer.appendChild(inner);
|
|
document.body.appendChild(outer);
|
|
var widthContained = inner.offsetWidth;
|
|
outer.style.overflow = 'scroll';
|
|
var widthScroll = inner.offsetWidth;
|
|
if (widthContained === widthScroll) {
|
|
widthScroll = outer.clientWidth;
|
|
}
|
|
document.body.removeChild(outer);
|
|
cached = widthContained - widthScroll;
|
|
}
|
|
return cached;
|
|
}
|
|
function ensureSize(str) {
|
|
var match = str.match(/^(.*)px$/);
|
|
var value = Number(match === null || match === void 0 ? void 0 : match[1]);
|
|
return Number.isNaN(value) ? getScrollBarSize() : value;
|
|
}
|
|
function getTargetScrollBarSize(target) {
|
|
if (typeof document === 'undefined' || !target || !(target instanceof Element)) {
|
|
return {
|
|
width: 0,
|
|
height: 0
|
|
};
|
|
}
|
|
var _getComputedStyle = getComputedStyle(target, '::-webkit-scrollbar'),
|
|
width = _getComputedStyle.width,
|
|
height = _getComputedStyle.height;
|
|
return {
|
|
width: ensureSize(width),
|
|
height: ensureSize(height)
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function useEvent_useEvent(callback) {
|
|
var fnRef = react.useRef();
|
|
fnRef.current = callback;
|
|
var memoFn = react.useCallback(function () {
|
|
var _fnRef$current;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
}, []);
|
|
return memoFn;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/pickAttrs.js
|
|
|
|
var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
|
|
var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
|
|
var propList = "".concat(attributes, " ").concat(eventsName).split(/[\s\n]+/);
|
|
|
|
/* eslint-enable max-len */
|
|
var ariaPrefix = 'aria-';
|
|
var dataPrefix = 'data-';
|
|
function match(key, prefix) {
|
|
return key.indexOf(prefix) === 0;
|
|
}
|
|
/**
|
|
* Picker props from exist props with filter
|
|
* @param props Passed props
|
|
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
|
|
*/
|
|
function pickAttrs(props) {
|
|
var ariaOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
var mergedConfig;
|
|
if (ariaOnly === false) {
|
|
mergedConfig = {
|
|
aria: true,
|
|
data: true,
|
|
attr: true
|
|
};
|
|
} else if (ariaOnly === true) {
|
|
mergedConfig = {
|
|
aria: true
|
|
};
|
|
} else {
|
|
mergedConfig = (0,objectSpread2/* default */.Z)({}, ariaOnly);
|
|
}
|
|
var attrs = {};
|
|
Object.keys(props).forEach(function (key) {
|
|
if (
|
|
// Aria
|
|
mergedConfig.aria && (key === 'role' || match(key, ariaPrefix)) ||
|
|
// Data
|
|
mergedConfig.data && match(key, dataPrefix) ||
|
|
// Attr
|
|
mergedConfig.attr && propList.includes(key)) {
|
|
attrs[key] = props[key];
|
|
}
|
|
});
|
|
return attrs;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useFlattenRecords.js
|
|
|
|
|
|
// recursion (flat tree structure)
|
|
function flatRecord(record, indent, childrenColumnName, expandedKeys, getRowKey, index) {
|
|
var arr = [];
|
|
arr.push({
|
|
record: record,
|
|
indent: indent,
|
|
index: index
|
|
});
|
|
var key = getRowKey(record);
|
|
var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key);
|
|
if (record && Array.isArray(record[childrenColumnName]) && expanded) {
|
|
// expanded state, flat record
|
|
for (var i = 0; i < record[childrenColumnName].length; i += 1) {
|
|
var tempArr = flatRecord(record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);
|
|
arr.push.apply(arr, (0,toConsumableArray/* default */.Z)(tempArr));
|
|
}
|
|
}
|
|
return arr;
|
|
}
|
|
|
|
/**
|
|
* flat tree data on expanded state
|
|
*
|
|
* @export
|
|
* @template T
|
|
* @param {*} data : table data
|
|
* @param {string} childrenColumnName : 指定树形结构的列名
|
|
* @param {Set<Key>} expandedKeys : 展开的行对应的keys
|
|
* @param {GetRowKey<T>} getRowKey : 获取当前rowKey的方法
|
|
* @returns flattened data
|
|
*/
|
|
function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
|
|
var arr = react.useMemo(function () {
|
|
if (expandedKeys !== null && expandedKeys !== void 0 && expandedKeys.size) {
|
|
var temp = [];
|
|
|
|
// collect flattened record
|
|
for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {
|
|
var record = data[i];
|
|
temp.push.apply(temp, (0,toConsumableArray/* default */.Z)(flatRecord(record, 0, childrenColumnName, expandedKeys, getRowKey, i)));
|
|
}
|
|
return temp;
|
|
}
|
|
return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
|
|
return {
|
|
record: item,
|
|
indent: 0,
|
|
index: index
|
|
};
|
|
});
|
|
}, [data, childrenColumnName, expandedKeys, getRowKey]);
|
|
return arr;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/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 : fixColumn) {
|
|
contentNode = /*#__PURE__*/react.createElement("div", {
|
|
style: {
|
|
width: componentWidth - (fixHeader ? scrollbarSize : 0),
|
|
position: 'sticky',
|
|
left: 0,
|
|
overflow: 'hidden'
|
|
},
|
|
className: "".concat(prefixCls, "-expanded-row-fixed")
|
|
}, componentWidth !== 0 && contentNode);
|
|
}
|
|
return /*#__PURE__*/react.createElement(Component, {
|
|
className: className,
|
|
style: {
|
|
display: expanded ? null : 'none'
|
|
}
|
|
}, /*#__PURE__*/react.createElement(es_Cell, {
|
|
component: cellComponent,
|
|
prefixCls: prefixCls,
|
|
colSpan: colSpan
|
|
}, contentNode));
|
|
}
|
|
/* harmony default export */ var Body_ExpandedRow = (ExpandedRow);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/BodyRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function BodyRow(props) {
|
|
if (false) {}
|
|
var className = props.className,
|
|
style = props.style,
|
|
record = props.record,
|
|
index = props.index,
|
|
renderIndex = props.renderIndex,
|
|
rowKey = props.rowKey,
|
|
rowExpandable = props.rowExpandable,
|
|
expandedKeys = props.expandedKeys,
|
|
onRow = props.onRow,
|
|
_props$indent = props.indent,
|
|
indent = _props$indent === void 0 ? 0 : _props$indent,
|
|
RowComponent = props.rowComponent,
|
|
cellComponent = props.cellComponent,
|
|
scopeCellComponent = props.scopeCellComponent,
|
|
childrenColumnName = props.childrenColumnName;
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'fixedInfoList', 'flattenColumns', 'expandableType', 'expandRowByClick', 'onTriggerExpand', 'rowClassName', 'expandedRowClassName', 'indentSize', 'expandIcon', 'expandedRowRender', 'expandIconColumnIndex']),
|
|
prefixCls = _useContext.prefixCls,
|
|
fixedInfoList = _useContext.fixedInfoList,
|
|
flattenColumns = _useContext.flattenColumns,
|
|
expandableType = _useContext.expandableType,
|
|
expandRowByClick = _useContext.expandRowByClick,
|
|
onTriggerExpand = _useContext.onTriggerExpand,
|
|
rowClassName = _useContext.rowClassName,
|
|
expandedRowClassName = _useContext.expandedRowClassName,
|
|
indentSize = _useContext.indentSize,
|
|
expandIcon = _useContext.expandIcon,
|
|
expandedRowRender = _useContext.expandedRowRender,
|
|
expandIconColumnIndex = _useContext.expandIconColumnIndex;
|
|
var _React$useState = react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
expandRended = _React$useState2[0],
|
|
setExpandRended = _React$useState2[1];
|
|
if (false) {}
|
|
var expanded = expandedKeys && expandedKeys.has(rowKey);
|
|
react.useEffect(function () {
|
|
if (expanded) {
|
|
setExpandRended(true);
|
|
}
|
|
}, [expanded]);
|
|
var rowSupportExpand = expandableType === 'row' && (!rowExpandable || rowExpandable(record));
|
|
// Only when row is not expandable and `children` exist in record
|
|
var nestExpandable = expandableType === 'nest';
|
|
var hasNestChildren = childrenColumnName && record && record[childrenColumnName];
|
|
var mergedExpandable = rowSupportExpand || nestExpandable;
|
|
|
|
// ======================== Expandable =========================
|
|
var onExpandRef = react.useRef(onTriggerExpand);
|
|
onExpandRef.current = onTriggerExpand;
|
|
var onInternalTriggerExpand = function onInternalTriggerExpand() {
|
|
onExpandRef.current.apply(onExpandRef, arguments);
|
|
};
|
|
|
|
// =========================== onRow ===========================
|
|
var additionalProps = onRow === null || onRow === void 0 ? void 0 : onRow(record, index);
|
|
var onClick = function onClick(event) {
|
|
var _additionalProps$onCl;
|
|
if (expandRowByClick && mergedExpandable) {
|
|
onInternalTriggerExpand(record, event);
|
|
}
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onCl = additionalProps.onClick) === null || _additionalProps$onCl === void 0 ? void 0 : _additionalProps$onCl.call.apply(_additionalProps$onCl, [additionalProps, event].concat(args));
|
|
};
|
|
|
|
// ======================== Base tr row ========================
|
|
var computeRowClassName;
|
|
if (typeof rowClassName === 'string') {
|
|
computeRowClassName = rowClassName;
|
|
} else if (typeof rowClassName === 'function') {
|
|
computeRowClassName = rowClassName(record, index, indent);
|
|
}
|
|
var columnsKey = getColumnsKey(flattenColumns);
|
|
var baseRowNode = /*#__PURE__*/react.createElement(RowComponent, (0,esm_extends/* default */.Z)({}, additionalProps, {
|
|
"data-row-key": rowKey,
|
|
className: classnames_default()(className, "".concat(prefixCls, "-row"), "".concat(prefixCls, "-row-level-").concat(indent), computeRowClassName, additionalProps && additionalProps.className),
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, style), additionalProps ? additionalProps.style : null),
|
|
onClick: onClick
|
|
}), flattenColumns.map(function (column, colIndex) {
|
|
var render = column.render,
|
|
dataIndex = column.dataIndex,
|
|
columnClassName = column.className;
|
|
var key = columnsKey[colIndex];
|
|
var fixedInfo = fixedInfoList[colIndex];
|
|
|
|
// ============= Used for nest expandable =============
|
|
var appendCellNode;
|
|
if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {
|
|
appendCellNode = /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("span", {
|
|
style: {
|
|
paddingLeft: "".concat(indentSize * indent, "px")
|
|
},
|
|
className: "".concat(prefixCls, "-row-indent indent-level-").concat(indent)
|
|
}), expandIcon({
|
|
prefixCls: prefixCls,
|
|
expanded: expanded,
|
|
expandable: hasNestChildren,
|
|
record: record,
|
|
onExpand: onInternalTriggerExpand
|
|
}));
|
|
}
|
|
var additionalCellProps;
|
|
if (column.onCell) {
|
|
additionalCellProps = column.onCell(record, index);
|
|
}
|
|
return /*#__PURE__*/react.createElement(es_Cell, (0,esm_extends/* default */.Z)({
|
|
className: columnClassName,
|
|
ellipsis: column.ellipsis,
|
|
align: column.align,
|
|
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,
|
|
expanded: appendCellNode && expanded
|
|
}, fixedInfo, {
|
|
appendNode: appendCellNode,
|
|
additionalProps: additionalCellProps
|
|
}));
|
|
}));
|
|
|
|
// ======================== Expand Row =========================
|
|
var expandRowNode;
|
|
if (rowSupportExpand && (expandRended || expanded)) {
|
|
var expandContent = expandedRowRender(record, index, indent + 1, expanded);
|
|
var computedExpandedRowClassName = expandedRowClassName && expandedRowClassName(record, index, indent);
|
|
expandRowNode = /*#__PURE__*/react.createElement(Body_ExpandedRow, {
|
|
expanded: expanded,
|
|
className: classnames_default()("".concat(prefixCls, "-expanded-row"), "".concat(prefixCls, "-expanded-row-level-").concat(indent + 1), computedExpandedRowClassName),
|
|
prefixCls: prefixCls,
|
|
component: RowComponent,
|
|
cellComponent: cellComponent,
|
|
colSpan: flattenColumns.length,
|
|
isEmpty: false
|
|
}, expandContent);
|
|
}
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, baseRowNode, expandRowNode);
|
|
}
|
|
BodyRow.displayName = 'BodyRow';
|
|
/* harmony default export */ var Body_BodyRow = (responseImmutable(BodyRow));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/MeasureCell.js
|
|
|
|
|
|
function MeasureCell(_ref) {
|
|
var columnKey = _ref.columnKey,
|
|
onColumnResize = _ref.onColumnResize;
|
|
var cellRef = react.useRef();
|
|
react.useEffect(function () {
|
|
if (cellRef.current) {
|
|
onColumnResize(columnKey, cellRef.current.offsetWidth);
|
|
}
|
|
}, []);
|
|
return /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
data: columnKey
|
|
}, /*#__PURE__*/react.createElement("td", {
|
|
ref: cellRef,
|
|
style: {
|
|
padding: 0,
|
|
border: 0,
|
|
height: 0
|
|
}
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
style: {
|
|
height: 0,
|
|
overflow: 'hidden'
|
|
}
|
|
}, "\xA0")));
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/MeasureRow.js
|
|
|
|
|
|
|
|
function MeasureRow(_ref) {
|
|
var prefixCls = _ref.prefixCls,
|
|
columnsKey = _ref.columnsKey,
|
|
onColumnResize = _ref.onColumnResize;
|
|
return /*#__PURE__*/react.createElement("tr", {
|
|
"aria-hidden": "true",
|
|
className: "".concat(prefixCls, "-measure-row"),
|
|
style: {
|
|
height: 0,
|
|
fontSize: 0
|
|
}
|
|
}, /*#__PURE__*/react.createElement(es/* default.Collection */.Z.Collection, {
|
|
onBatchResize: function onBatchResize(infoList) {
|
|
infoList.forEach(function (_ref2) {
|
|
var columnKey = _ref2.data,
|
|
size = _ref2.size;
|
|
onColumnResize(columnKey, size.offsetWidth);
|
|
});
|
|
}
|
|
}, columnsKey.map(function (columnKey) {
|
|
return /*#__PURE__*/react.createElement(MeasureCell, {
|
|
key: columnKey,
|
|
columnKey: columnKey,
|
|
onColumnResize: onColumnResize
|
|
});
|
|
})));
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Body/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Body(props) {
|
|
if (false) {}
|
|
var data = props.data,
|
|
getRowKey = props.getRowKey,
|
|
measureColumnWidth = props.measureColumnWidth,
|
|
expandedKeys = props.expandedKeys,
|
|
onRow = props.onRow,
|
|
rowExpandable = props.rowExpandable,
|
|
emptyNode = props.emptyNode,
|
|
childrenColumnName = props.childrenColumnName;
|
|
var _useContext = useContext(context_TableContext, ['prefixCls', 'getComponent', 'onColumnResize', 'flattenColumns']),
|
|
prefixCls = _useContext.prefixCls,
|
|
getComponent = _useContext.getComponent,
|
|
onColumnResize = _useContext.onColumnResize,
|
|
flattenColumns = _useContext.flattenColumns;
|
|
var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
|
|
|
|
// =================== Performance ====================
|
|
var perfRef = 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.createElement(Body_BodyRow, {
|
|
key: key,
|
|
rowKey: key,
|
|
record: record,
|
|
index: idx,
|
|
renderIndex: renderIndex,
|
|
rowComponent: trComponent,
|
|
cellComponent: tdComponent,
|
|
scopeCellComponent: thComponent,
|
|
expandedKeys: expandedKeys,
|
|
onRow: onRow,
|
|
getRowKey: getRowKey,
|
|
rowExpandable: rowExpandable,
|
|
childrenColumnName: childrenColumnName,
|
|
indent: indent
|
|
});
|
|
});
|
|
} else {
|
|
rows = /*#__PURE__*/react.createElement(Body_ExpandedRow, {
|
|
expanded: true,
|
|
className: "".concat(prefixCls, "-placeholder"),
|
|
prefixCls: prefixCls,
|
|
component: trComponent,
|
|
cellComponent: tdComponent,
|
|
colSpan: flattenColumns.length,
|
|
isEmpty: true
|
|
}, emptyNode);
|
|
}
|
|
var columnsKey = getColumnsKey(flattenColumns);
|
|
return /*#__PURE__*/react.createElement(context_PerfContext.Provider, {
|
|
value: perfRef.current
|
|
}, /*#__PURE__*/react.createElement(WrapperComponent, {
|
|
className: "".concat(prefixCls, "-tbody")
|
|
}, measureColumnWidth && /*#__PURE__*/react.createElement(MeasureRow, {
|
|
prefixCls: prefixCls,
|
|
columnsKey: columnsKey,
|
|
onColumnResize: onColumnResize
|
|
}), rows));
|
|
}
|
|
Body.displayName = 'Body';
|
|
/* harmony default export */ var es_Body = (responseImmutable(Body));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/legacyUtil.js
|
|
|
|
|
|
var legacyUtil_excluded = ["expandable"];
|
|
|
|
var INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE';
|
|
function getExpandableProps(props) {
|
|
var expandable = props.expandable,
|
|
legacyExpandableConfig = (0,objectWithoutProperties/* default */.Z)(props, legacyUtil_excluded);
|
|
var config;
|
|
if ('expandable' in props) {
|
|
config = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, legacyExpandableConfig), expandable);
|
|
} else {
|
|
if (false) {}
|
|
config = legacyExpandableConfig;
|
|
}
|
|
if (config.showExpandColumn === false) {
|
|
config.expandIconColumnIndex = -1;
|
|
}
|
|
return config;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/ColGroup.js
|
|
|
|
|
|
var ColGroup_excluded = ["columnType"];
|
|
|
|
|
|
function ColGroup(_ref) {
|
|
var colWidths = _ref.colWidths,
|
|
columns = _ref.columns,
|
|
columCount = _ref.columCount;
|
|
var cols = [];
|
|
var len = columCount || columns.length;
|
|
|
|
// Only insert col with width & additional props
|
|
// Skip if rest col do not have any useful info
|
|
var mustInsert = false;
|
|
for (var i = len - 1; i >= 0; i -= 1) {
|
|
var width = colWidths[i];
|
|
var column = columns && columns[i];
|
|
var additionalProps = column && column[INTERNAL_COL_DEFINE];
|
|
if (width || additionalProps || mustInsert) {
|
|
var _ref2 = additionalProps || {},
|
|
columnType = _ref2.columnType,
|
|
restAdditionalProps = (0,objectWithoutProperties/* default */.Z)(_ref2, ColGroup_excluded);
|
|
cols.unshift( /*#__PURE__*/react.createElement("col", (0,esm_extends/* default */.Z)({
|
|
key: i,
|
|
style: {
|
|
width: width
|
|
}
|
|
}, restAdditionalProps)));
|
|
mustInsert = true;
|
|
}
|
|
}
|
|
return /*#__PURE__*/react.createElement("colgroup", null, cols);
|
|
}
|
|
/* harmony default export */ var es_ColGroup = (ColGroup);
|
|
// EXTERNAL MODULE: ./node_modules/react-is/index.js
|
|
var react_is = __webpack_require__(59864);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/ref.js
|
|
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
|
|
|
|
function fillRef(ref, node) {
|
|
if (typeof ref === 'function') {
|
|
ref(node);
|
|
} else if ((0,esm_typeof/* default */.Z)(ref) === 'object' && ref && 'current' in ref) {
|
|
ref.current = node;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Merge refs into one ref function to support ref passing.
|
|
*/
|
|
function composeRef() {
|
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
refs[_key] = arguments[_key];
|
|
}
|
|
var refList = refs.filter(function (ref) {
|
|
return ref;
|
|
});
|
|
if (refList.length <= 1) {
|
|
return refList[0];
|
|
}
|
|
return function (node) {
|
|
refs.forEach(function (ref) {
|
|
fillRef(ref, node);
|
|
});
|
|
};
|
|
}
|
|
function useComposeRef() {
|
|
for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
refs[_key2] = arguments[_key2];
|
|
}
|
|
return useMemo(function () {
|
|
return composeRef.apply(void 0, refs);
|
|
}, refs, function (prev, next) {
|
|
return prev.length === next.length && prev.every(function (ref, i) {
|
|
return ref === next[i];
|
|
});
|
|
});
|
|
}
|
|
function supportRef(nodeOrComponent) {
|
|
var _type$prototype, _nodeOrComponent$prot;
|
|
var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
|
|
|
|
// Function component node
|
|
if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
|
|
return false;
|
|
}
|
|
|
|
// Class component
|
|
if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/FixedHolder/index.js
|
|
|
|
|
|
|
|
|
|
var FixedHolder_excluded = ["className", "noData", "columns", "flattenColumns", "colWidths", "columCount", "stickyOffsets", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName", "onScroll", "maxContentScroll", "children"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useColumnWidth(colWidths, columCount) {
|
|
return (0,react.useMemo)(function () {
|
|
var cloneColumns = [];
|
|
for (var i = 0; i < columCount; i += 1) {
|
|
var val = colWidths[i];
|
|
if (val !== undefined) {
|
|
cloneColumns[i] = val;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
return cloneColumns;
|
|
}, [colWidths.join('_'), columCount]);
|
|
}
|
|
var FixedHolder = /*#__PURE__*/react.forwardRef(function (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.useRef(null);
|
|
var setScrollRef = react.useCallback(function (element) {
|
|
fillRef(ref, element);
|
|
fillRef(scrollRef, element);
|
|
}, []);
|
|
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.useMemo(function () {
|
|
return flattenColumns.every(function (column) {
|
|
return column.width >= 0;
|
|
});
|
|
}, [flattenColumns]);
|
|
|
|
// Add scrollbar column
|
|
var lastColumn = flattenColumns[flattenColumns.length - 1];
|
|
var ScrollBarColumn = {
|
|
fixed: lastColumn ? lastColumn.fixed : null,
|
|
scrollbar: true,
|
|
onHeaderCell: function onHeaderCell() {
|
|
return {
|
|
className: "".concat(prefixCls, "-cell-scrollbar")
|
|
};
|
|
}
|
|
};
|
|
var columnsWithScrollbar = (0,react.useMemo)(function () {
|
|
return combinationScrollBarSize ? [].concat((0,toConsumableArray/* default */.Z)(columns), [ScrollBarColumn]) : columns;
|
|
}, [combinationScrollBarSize, columns]);
|
|
var flattenColumnsWithScrollbar = (0,react.useMemo)(function () {
|
|
return combinationScrollBarSize ? [].concat((0,toConsumableArray/* default */.Z)(flattenColumns), [ScrollBarColumn]) : flattenColumns;
|
|
}, [combinationScrollBarSize, flattenColumns]);
|
|
|
|
// Calculate the sticky offsets
|
|
var headerStickyOffsets = (0,react.useMemo)(function () {
|
|
var right = stickyOffsets.right,
|
|
left = stickyOffsets.left;
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, stickyOffsets), {}, {
|
|
left: direction === 'rtl' ? [].concat((0,toConsumableArray/* default */.Z)(left.map(function (width) {
|
|
return width + combinationScrollBarSize;
|
|
})), [0]) : left,
|
|
right: direction === 'rtl' ? right : [].concat((0,toConsumableArray/* default */.Z)(right.map(function (width) {
|
|
return width + combinationScrollBarSize;
|
|
})), [0]),
|
|
isSticky: isSticky
|
|
});
|
|
}, [combinationScrollBarSize, stickyOffsets, isSticky]);
|
|
var mergedColumnWidth = useColumnWidth(colWidths, columCount);
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
style: (0,objectSpread2/* default */.Z)({
|
|
overflow: 'hidden'
|
|
}, isSticky ? {
|
|
top: stickyTopOffset,
|
|
bottom: stickyBottomOffset
|
|
} : {}),
|
|
ref: setScrollRef,
|
|
className: classnames_default()(className, (0,defineProperty/* default */.Z)({}, stickyClassName, !!stickyClassName))
|
|
}, /*#__PURE__*/react.createElement("table", {
|
|
style: {
|
|
tableLayout: 'fixed',
|
|
visibility: noData || mergedColumnWidth ? null : 'hidden'
|
|
}
|
|
}, (!noData || !maxContentScroll || allFlattenColumnsWithWidth) && /*#__PURE__*/react.createElement(es_ColGroup, {
|
|
colWidths: mergedColumnWidth ? [].concat((0,toConsumableArray/* default */.Z)(mergedColumnWidth), [combinationScrollBarSize]) : [],
|
|
columCount: columCount + 1,
|
|
columns: flattenColumnsWithScrollbar
|
|
}), children((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, 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.memo(FixedHolder));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Header/HeaderRow.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function HeaderRow(_ref) {
|
|
var cells = _ref.cells,
|
|
stickyOffsets = _ref.stickyOffsets,
|
|
flattenColumns = _ref.flattenColumns,
|
|
RowComponent = _ref.rowComponent,
|
|
CellComponent = _ref.cellComponent,
|
|
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.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.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/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.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.createElement(WrapperComponent, {
|
|
className: "".concat(prefixCls, "-thead")
|
|
}, rows.map(function (row, rowIndex) {
|
|
var rowNode = /*#__PURE__*/react.createElement(Header_HeaderRow, {
|
|
key: rowIndex,
|
|
flattenColumns: flattenColumns,
|
|
cells: row,
|
|
stickyOffsets: stickyOffsets,
|
|
rowComponent: trComponent,
|
|
cellComponent: thComponent,
|
|
tdCellComponent: tdComponent,
|
|
onHeaderRow: onHeaderRow,
|
|
index: rowIndex
|
|
});
|
|
return rowNode;
|
|
}));
|
|
}
|
|
/* harmony default export */ var Header_Header = (responseImmutable(Header));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/Children/toArray.js
|
|
|
|
|
|
function toArray_toArray(children) {
|
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
var ret = [];
|
|
react.Children.forEach(children, function (child) {
|
|
if ((child === undefined || child === null) && !option.keepEmpty) {
|
|
return;
|
|
}
|
|
if (Array.isArray(child)) {
|
|
ret = ret.concat(toArray_toArray(child));
|
|
} else if ((0,react_is.isFragment)(child) && child.props) {
|
|
ret = ret.concat(toArray_toArray(child.props.children, option));
|
|
} else {
|
|
ret.push(child);
|
|
}
|
|
});
|
|
return ret;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useColumns.js
|
|
|
|
|
|
|
|
|
|
|
|
var useColumns_excluded = ["children"],
|
|
_excluded2 = ["fixed"];
|
|
|
|
|
|
|
|
|
|
|
|
function convertChildrenToColumns(children) {
|
|
return toArray_toArray(children).filter(function (node) {
|
|
return /*#__PURE__*/react.isValidElement(node);
|
|
}).map(function (_ref) {
|
|
var key = _ref.key,
|
|
props = _ref.props;
|
|
var nodeChildren = props.children,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, useColumns_excluded);
|
|
var column = (0,objectSpread2/* default */.Z)({
|
|
key: key
|
|
}, restProps);
|
|
if (nodeChildren) {
|
|
column.children = convertChildrenToColumns(nodeChildren);
|
|
}
|
|
return column;
|
|
});
|
|
}
|
|
function flatColumns(columns) {
|
|
return columns.filter(function (column) {
|
|
return column && (0,esm_typeof/* default */.Z)(column) === 'object';
|
|
}).reduce(function (list, column) {
|
|
var fixed = column.fixed;
|
|
// Convert `fixed='true'` to `fixed='left'` instead
|
|
var parsedFixed = fixed === true ? 'left' : fixed;
|
|
var subColumns = column.children;
|
|
if (subColumns && subColumns.length > 0) {
|
|
return [].concat((0,toConsumableArray/* default */.Z)(list), (0,toConsumableArray/* default */.Z)(flatColumns(subColumns).map(function (subColum) {
|
|
return (0,objectSpread2/* default */.Z)({
|
|
fixed: parsedFixed
|
|
}, subColum);
|
|
})));
|
|
}
|
|
return [].concat((0,toConsumableArray/* default */.Z)(list), [(0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, column), {}, {
|
|
fixed: parsedFixed
|
|
})]);
|
|
}, []);
|
|
}
|
|
function warningFixed(flattenColumns) {
|
|
var allFixLeft = true;
|
|
for (var i = 0; i < flattenColumns.length; i += 1) {
|
|
var col = flattenColumns[i];
|
|
if (allFixLeft && col.fixed !== 'left') {
|
|
allFixLeft = false;
|
|
} else if (!allFixLeft && col.fixed === 'left') {
|
|
warning(false, "Index ".concat(i - 1, " of `columns` missing `fixed='left'` prop."));
|
|
break;
|
|
}
|
|
}
|
|
var allFixRight = true;
|
|
for (var _i = flattenColumns.length - 1; _i >= 0; _i -= 1) {
|
|
var _col = flattenColumns[_i];
|
|
if (allFixRight && _col.fixed !== 'right') {
|
|
allFixRight = false;
|
|
} else if (!allFixRight && _col.fixed === 'right') {
|
|
warning(false, "Index ".concat(_i + 1, " of `columns` missing `fixed='right'` prop."));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function revertForRtl(columns) {
|
|
return columns.map(function (column) {
|
|
var fixed = column.fixed,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(column, _excluded2);
|
|
|
|
// Convert `fixed='left'` to `fixed='right'` instead
|
|
var parsedFixed = fixed;
|
|
if (fixed === 'left') {
|
|
parsedFixed = 'right';
|
|
} else if (fixed === 'right') {
|
|
parsedFixed = 'left';
|
|
}
|
|
return (0,objectSpread2/* default */.Z)({
|
|
fixed: parsedFixed
|
|
}, restProps);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Parse `columns` & `children` into `columns`.
|
|
*/
|
|
function useColumns(_ref2, transformColumns) {
|
|
var prefixCls = _ref2.prefixCls,
|
|
columns = _ref2.columns,
|
|
children = _ref2.children,
|
|
expandable = _ref2.expandable,
|
|
expandedKeys = _ref2.expandedKeys,
|
|
columnTitle = _ref2.columnTitle,
|
|
getRowKey = _ref2.getRowKey,
|
|
onTriggerExpand = _ref2.onTriggerExpand,
|
|
expandIcon = _ref2.expandIcon,
|
|
rowExpandable = _ref2.rowExpandable,
|
|
expandIconColumnIndex = _ref2.expandIconColumnIndex,
|
|
direction = _ref2.direction,
|
|
expandRowByClick = _ref2.expandRowByClick,
|
|
columnWidth = _ref2.columnWidth,
|
|
fixed = _ref2.fixed;
|
|
var baseColumns = react.useMemo(function () {
|
|
return columns || convertChildrenToColumns(children);
|
|
}, [columns, children]);
|
|
|
|
// ========================== Expand ==========================
|
|
var withExpandColumns = react.useMemo(function () {
|
|
if (expandable) {
|
|
var _expandColumn;
|
|
var cloneColumns = baseColumns.slice();
|
|
|
|
// >>> Warning if use `expandIconColumnIndex`
|
|
if (false) {}
|
|
|
|
// >>> Insert expand column if not exist
|
|
if (!cloneColumns.includes(EXPAND_COLUMN)) {
|
|
var expandColIndex = expandIconColumnIndex || 0;
|
|
if (expandColIndex >= 0) {
|
|
cloneColumns.splice(expandColIndex, 0, EXPAND_COLUMN);
|
|
}
|
|
}
|
|
|
|
// >>> Deduplicate additional expand column
|
|
if (false) {}
|
|
var expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);
|
|
cloneColumns = cloneColumns.filter(function (column, index) {
|
|
return column !== EXPAND_COLUMN || index === expandColumnIndex;
|
|
});
|
|
|
|
// >>> Check if expand column need to fixed
|
|
var prevColumn = baseColumns[expandColumnIndex];
|
|
var fixedColumn;
|
|
if ((fixed === 'left' || fixed) && !expandIconColumnIndex) {
|
|
fixedColumn = 'left';
|
|
} else if ((fixed === 'right' || fixed) && expandIconColumnIndex === baseColumns.length) {
|
|
fixedColumn = 'right';
|
|
} else {
|
|
fixedColumn = prevColumn ? prevColumn.fixed : null;
|
|
}
|
|
|
|
// >>> Create expandable column
|
|
var expandColumn = (_expandColumn = {}, (0,defineProperty/* default */.Z)(_expandColumn, INTERNAL_COL_DEFINE, {
|
|
className: "".concat(prefixCls, "-expand-icon-col"),
|
|
columnType: 'EXPAND_COLUMN'
|
|
}), (0,defineProperty/* default */.Z)(_expandColumn, "title", columnTitle), (0,defineProperty/* default */.Z)(_expandColumn, "fixed", fixedColumn), (0,defineProperty/* default */.Z)(_expandColumn, "className", "".concat(prefixCls, "-row-expand-icon-cell")), (0,defineProperty/* default */.Z)(_expandColumn, "width", columnWidth), (0,defineProperty/* default */.Z)(_expandColumn, "render", function render(_, record, index) {
|
|
var rowKey = getRowKey(record, index);
|
|
var expanded = expandedKeys.has(rowKey);
|
|
var recordExpandable = rowExpandable ? rowExpandable(record) : true;
|
|
var icon = expandIcon({
|
|
prefixCls: prefixCls,
|
|
expanded: expanded,
|
|
expandable: recordExpandable,
|
|
record: record,
|
|
onExpand: onTriggerExpand
|
|
});
|
|
if (expandRowByClick) {
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
onClick: function onClick(e) {
|
|
return e.stopPropagation();
|
|
}
|
|
}, icon);
|
|
}
|
|
return icon;
|
|
}), _expandColumn);
|
|
return cloneColumns.map(function (col) {
|
|
return col === EXPAND_COLUMN ? expandColumn : col;
|
|
});
|
|
}
|
|
if (false) {}
|
|
return baseColumns.filter(function (col) {
|
|
return col !== EXPAND_COLUMN;
|
|
});
|
|
}, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]);
|
|
|
|
// ========================= Transform ========================
|
|
var mergedColumns = react.useMemo(function () {
|
|
var finalColumns = withExpandColumns;
|
|
if (transformColumns) {
|
|
finalColumns = transformColumns(finalColumns);
|
|
}
|
|
|
|
// Always provides at least one column for table display
|
|
if (!finalColumns.length) {
|
|
finalColumns = [{
|
|
render: function render() {
|
|
return null;
|
|
}
|
|
}];
|
|
}
|
|
return finalColumns;
|
|
}, [transformColumns, withExpandColumns, direction]);
|
|
|
|
// ========================== Flatten =========================
|
|
var flattenColumns = react.useMemo(function () {
|
|
if (direction === 'rtl') {
|
|
return revertForRtl(flatColumns(mergedColumns));
|
|
}
|
|
return flatColumns(mergedColumns);
|
|
}, [mergedColumns, direction]);
|
|
// Only check out of production since it's waste for each render
|
|
if (false) {}
|
|
return [mergedColumns, flattenColumns];
|
|
}
|
|
/* harmony default export */ var hooks_useColumns = (useColumns);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/utils/expandUtil.js
|
|
|
|
|
|
|
|
function renderExpandIcon(_ref) {
|
|
var _classNames;
|
|
var prefixCls = _ref.prefixCls,
|
|
record = _ref.record,
|
|
onExpand = _ref.onExpand,
|
|
expanded = _ref.expanded,
|
|
expandable = _ref.expandable;
|
|
var expandClassName = "".concat(prefixCls, "-row-expand-icon");
|
|
if (!expandable) {
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()(expandClassName, "".concat(prefixCls, "-row-spaced"))
|
|
});
|
|
}
|
|
var onClick = function onClick(event) {
|
|
onExpand(record, event);
|
|
event.stopPropagation();
|
|
};
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()(expandClassName, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-row-expanded"), expanded), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-row-collapsed"), !expanded), _classNames)),
|
|
onClick: onClick
|
|
});
|
|
}
|
|
function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
|
|
var keys = [];
|
|
function dig(list) {
|
|
(list || []).forEach(function (item, index) {
|
|
keys.push(getRowKey(item, index));
|
|
dig(item[childrenColumnName]);
|
|
});
|
|
}
|
|
dig(data);
|
|
return keys;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/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.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.useState(function () {
|
|
if (defaultExpandedRowKeys) {
|
|
return defaultExpandedRowKeys;
|
|
}
|
|
if (defaultExpandAllRows) {
|
|
return findAllChildrenKeys(mergedData, getRowKey, mergedChildrenColumnName);
|
|
}
|
|
return [];
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
innerExpandedKeys = _React$useState2[0],
|
|
setInnerExpandedKeys = _React$useState2[1];
|
|
var mergedExpandedKeys = react.useMemo(function () {
|
|
return new Set(expandedRowKeys || innerExpandedKeys || []);
|
|
}, [expandedRowKeys, innerExpandedKeys]);
|
|
var onTriggerExpand = react.useCallback(function (record) {
|
|
var key = getRowKey(record, mergedData.indexOf(record));
|
|
var newExpandedKeys;
|
|
var hasKey = mergedExpandedKeys.has(key);
|
|
if (hasKey) {
|
|
mergedExpandedKeys.delete(key);
|
|
newExpandedKeys = (0,toConsumableArray/* default */.Z)(mergedExpandedKeys);
|
|
} else {
|
|
newExpandedKeys = [].concat((0,toConsumableArray/* default */.Z)(mergedExpandedKeys), [key]);
|
|
}
|
|
setInnerExpandedKeys(newExpandedKeys);
|
|
if (onExpand) {
|
|
onExpand(!hasKey, record);
|
|
}
|
|
if (onExpandedRowsChange) {
|
|
onExpandedRowsChange(newExpandedKeys);
|
|
}
|
|
}, [getRowKey, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange]);
|
|
|
|
// Warning if use `expandedRowRender` and nest children in the same time
|
|
if (false) {}
|
|
return [expandableConfig, expandableType, mergedExpandedKeys, mergedExpandIcon, mergedChildrenColumnName, onTriggerExpand];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/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 useMemo_useMemo(function () {
|
|
return fixedInfoList;
|
|
}, [fixedInfoList], function (prev, next) {
|
|
return !es_isEqual(prev, next);
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useFrame.js
|
|
|
|
|
|
/**
|
|
* Execute code before next frame but async
|
|
*/
|
|
function useLayoutState(defaultState) {
|
|
var stateRef = (0,react.useRef)(defaultState);
|
|
var _useState = (0,react.useState)({}),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
forceUpdate = _useState2[1];
|
|
var lastPromiseRef = (0,react.useRef)(null);
|
|
var updateBatchRef = (0,react.useRef)([]);
|
|
function setFrameState(updater) {
|
|
updateBatchRef.current.push(updater);
|
|
var promise = Promise.resolve();
|
|
lastPromiseRef.current = promise;
|
|
promise.then(function () {
|
|
if (lastPromiseRef.current === promise) {
|
|
var prevBatch = updateBatchRef.current;
|
|
var prevState = stateRef.current;
|
|
updateBatchRef.current = [];
|
|
prevBatch.forEach(function (batchUpdater) {
|
|
stateRef.current = batchUpdater(stateRef.current);
|
|
});
|
|
lastPromiseRef.current = null;
|
|
if (prevState !== stateRef.current) {
|
|
forceUpdate({});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
(0,react.useEffect)(function () {
|
|
return function () {
|
|
lastPromiseRef.current = null;
|
|
};
|
|
}, []);
|
|
return [stateRef.current, setFrameState];
|
|
}
|
|
|
|
/** Lock frame, when frame pass reset the lock. */
|
|
function useTimeoutLock(defaultState) {
|
|
var frameRef = (0,react.useRef)(defaultState || null);
|
|
var timeoutRef = (0,react.useRef)();
|
|
function cleanUp() {
|
|
window.clearTimeout(timeoutRef.current);
|
|
}
|
|
function setState(newState) {
|
|
frameRef.current = newState;
|
|
cleanUp();
|
|
timeoutRef.current = window.setTimeout(function () {
|
|
frameRef.current = null;
|
|
timeoutRef.current = undefined;
|
|
}, 100);
|
|
}
|
|
function getState() {
|
|
return frameRef.current;
|
|
}
|
|
(0,react.useEffect)(function () {
|
|
return cleanUp;
|
|
}, []);
|
|
return [setState, getState];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useHover.js
|
|
|
|
|
|
function useHover() {
|
|
var _React$useState = react.useState(-1),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
startRow = _React$useState2[0],
|
|
setStartRow = _React$useState2[1];
|
|
var _React$useState3 = react.useState(-1),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
endRow = _React$useState4[0],
|
|
setEndRow = _React$useState4[1];
|
|
var onHover = react.useCallback(function (start, end) {
|
|
setStartRow(start);
|
|
setEndRow(end);
|
|
}, []);
|
|
return [startRow, endRow, onHover];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useSticky.js
|
|
|
|
|
|
|
|
// fix ssr render
|
|
var defaultContainer = canUseDom() ? window : null;
|
|
|
|
/** Sticky header hooks */
|
|
function useSticky(sticky, prefixCls) {
|
|
var _ref = (0,esm_typeof/* default */.Z)(sticky) === 'object' ? sticky : {},
|
|
_ref$offsetHeader = _ref.offsetHeader,
|
|
offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader,
|
|
_ref$offsetSummary = _ref.offsetSummary,
|
|
offsetSummary = _ref$offsetSummary === void 0 ? 0 : _ref$offsetSummary,
|
|
_ref$offsetScroll = _ref.offsetScroll,
|
|
offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll,
|
|
_ref$getContainer = _ref.getContainer,
|
|
getContainer = _ref$getContainer === void 0 ? function () {
|
|
return defaultContainer;
|
|
} : _ref$getContainer;
|
|
var container = getContainer() || defaultContainer;
|
|
return react.useMemo(function () {
|
|
var isSticky = !!sticky;
|
|
return {
|
|
isSticky: isSticky,
|
|
stickyClassName: isSticky ? "".concat(prefixCls, "-sticky-holder") : '',
|
|
offsetHeader: offsetHeader,
|
|
offsetSummary: offsetSummary,
|
|
offsetScroll: offsetScroll,
|
|
container: container
|
|
};
|
|
}, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/hooks/useStickyOffsets.js
|
|
|
|
/**
|
|
* Get sticky column offset width
|
|
*/
|
|
function useStickyOffsets(colWidths, columnCount, direction) {
|
|
var stickyOffsets = (0,react.useMemo)(function () {
|
|
var leftOffsets = [];
|
|
var rightOffsets = [];
|
|
var left = 0;
|
|
var right = 0;
|
|
for (var start = 0; start < columnCount; start += 1) {
|
|
if (direction === 'rtl') {
|
|
// Left offset
|
|
rightOffsets[start] = right;
|
|
right += colWidths[start] || 0;
|
|
|
|
// Right offset
|
|
var end = columnCount - start - 1;
|
|
leftOffsets[end] = left;
|
|
left += colWidths[end] || 0;
|
|
} else {
|
|
// Left offset
|
|
leftOffsets[start] = left;
|
|
left += colWidths[start] || 0;
|
|
|
|
// Right offset
|
|
var _end = columnCount - start - 1;
|
|
rightOffsets[_end] = right;
|
|
right += colWidths[_end] || 0;
|
|
}
|
|
}
|
|
return {
|
|
left: leftOffsets,
|
|
right: rightOffsets
|
|
};
|
|
}, [colWidths, columnCount, direction]);
|
|
return stickyOffsets;
|
|
}
|
|
/* harmony default export */ var hooks_useStickyOffsets = (useStickyOffsets);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Panel/index.js
|
|
|
|
function Panel(_ref) {
|
|
var className = _ref.className,
|
|
children = _ref.children;
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
className: className
|
|
}, children);
|
|
}
|
|
/* harmony default export */ var es_Panel = (Panel);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/Dom/addEventListener.js
|
|
|
|
function addEventListenerWrap(target, eventType, cb, option) {
|
|
/* eslint camelcase: 2 */
|
|
var callback = react_dom.unstable_batchedUpdates ? function run(e) {
|
|
react_dom.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);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/node_modules/rc-util/es/Dom/css.js
|
|
/* 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 css_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 css_get(node, name) {
|
|
var length = arguments.length;
|
|
var style = css_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 css_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)
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/stickyScrollBar.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var StickyScrollBar = function StickyScrollBar(_ref, ref) {
|
|
var _scrollBodyRef$curren, _scrollBodyRef$curren2;
|
|
var scrollBodyRef = _ref.scrollBodyRef,
|
|
onScroll = _ref.onScroll,
|
|
offsetScroll = _ref.offsetScroll,
|
|
container = _ref.container;
|
|
var 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.useRef();
|
|
var _useLayoutState = useLayoutState({
|
|
scrollLeft: 0,
|
|
isHiddenScrollBar: false
|
|
}),
|
|
_useLayoutState2 = (0,slicedToArray/* default */.Z)(_useLayoutState, 2),
|
|
scrollState = _useLayoutState2[0],
|
|
setScrollState = _useLayoutState2[1];
|
|
var refState = react.useRef({
|
|
delta: 0,
|
|
x: 0
|
|
});
|
|
var _React$useState = react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
isActive = _React$useState2[0],
|
|
setActive = _React$useState2[1];
|
|
var onMouseUp = function onMouseUp() {
|
|
setActive(false);
|
|
};
|
|
var onMouseDown = function onMouseDown(event) {
|
|
event.persist();
|
|
refState.current.delta = event.pageX - scrollState.scrollLeft;
|
|
refState.current.x = 0;
|
|
setActive(true);
|
|
event.preventDefault();
|
|
};
|
|
var onMouseMove = function onMouseMove(event) {
|
|
var _window;
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
|
|
var _ref2 = event || ((_window = window) === null || _window === void 0 ? void 0 : _window.event),
|
|
buttons = _ref2.buttons;
|
|
if (!isActive || buttons === 0) {
|
|
// If out body mouse up, we can set isActive false when mouse move
|
|
if (isActive) {
|
|
setActive(false);
|
|
}
|
|
return;
|
|
}
|
|
var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta;
|
|
if (left <= 0) {
|
|
left = 0;
|
|
}
|
|
if (left + scrollBarWidth >= bodyWidth) {
|
|
left = bodyWidth - scrollBarWidth;
|
|
}
|
|
onScroll({
|
|
scrollLeft: left / bodyWidth * (bodyScrollWidth + 2)
|
|
});
|
|
refState.current.x = event.pageX;
|
|
};
|
|
var onContainerScroll = function onContainerScroll() {
|
|
if (!scrollBodyRef.current) {
|
|
return;
|
|
}
|
|
var tableOffsetTop = getOffset(scrollBodyRef.current).top;
|
|
var tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight;
|
|
var currentClientOffset = container === window ? document.documentElement.scrollTop + window.innerHeight : getOffset(container).top + container.clientHeight;
|
|
if (tableBottomOffset - getScrollBarSize() <= currentClientOffset || tableOffsetTop >= currentClientOffset - offsetScroll) {
|
|
setScrollState(function (state) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
isHiddenScrollBar: true
|
|
});
|
|
});
|
|
} else {
|
|
setScrollState(function (state) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
isHiddenScrollBar: false
|
|
});
|
|
});
|
|
}
|
|
};
|
|
var setScrollLeft = function setScrollLeft(left) {
|
|
setScrollState(function (state) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
scrollLeft: left / bodyScrollWidth * bodyWidth || 0
|
|
});
|
|
});
|
|
};
|
|
react.useImperativeHandle(ref, function () {
|
|
return {
|
|
setScrollLeft: setScrollLeft
|
|
};
|
|
});
|
|
react.useEffect(function () {
|
|
var onMouseUpListener = addEventListenerWrap(document.body, 'mouseup', onMouseUp, false);
|
|
var onMouseMoveListener = addEventListenerWrap(document.body, 'mousemove', onMouseMove, false);
|
|
onContainerScroll();
|
|
return function () {
|
|
onMouseUpListener.remove();
|
|
onMouseMoveListener.remove();
|
|
};
|
|
}, [scrollBarWidth, isActive]);
|
|
react.useEffect(function () {
|
|
var onScrollListener = addEventListenerWrap(container, 'scroll', onContainerScroll, false);
|
|
var onResizeListener = addEventListenerWrap(window, 'resize', onContainerScroll, false);
|
|
return function () {
|
|
onScrollListener.remove();
|
|
onResizeListener.remove();
|
|
};
|
|
}, [container]);
|
|
react.useEffect(function () {
|
|
if (!scrollState.isHiddenScrollBar) {
|
|
setScrollState(function (state) {
|
|
var bodyNode = scrollBodyRef.current;
|
|
if (!bodyNode) {
|
|
return state;
|
|
}
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, state), {}, {
|
|
scrollLeft: bodyNode.scrollLeft / bodyNode.scrollWidth * bodyNode.clientWidth
|
|
});
|
|
});
|
|
}
|
|
}, [scrollState.isHiddenScrollBar]);
|
|
if (bodyScrollWidth <= bodyWidth || !scrollBarWidth || scrollState.isHiddenScrollBar) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
style: {
|
|
height: getScrollBarSize(),
|
|
width: bodyWidth,
|
|
bottom: offsetScroll
|
|
},
|
|
className: "".concat(prefixCls, "-sticky-scroll")
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
onMouseDown: onMouseDown,
|
|
ref: scrollBarRef,
|
|
className: classnames_default()("".concat(prefixCls, "-sticky-scroll-bar"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-sticky-scroll-bar-active"), isActive)),
|
|
style: {
|
|
width: "".concat(scrollBarWidth, "px"),
|
|
transform: "translate3d(".concat(scrollState.scrollLeft, "px, 0, 0)")
|
|
}
|
|
}));
|
|
};
|
|
/* harmony default export */ var stickyScrollBar = (/*#__PURE__*/react.forwardRef(StickyScrollBar));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/sugar/Column.js
|
|
/* istanbul ignore next */
|
|
/**
|
|
* This is a syntactic sugar for `columns` prop.
|
|
* So HOC will not work on this.
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
function Column(_) {
|
|
return null;
|
|
}
|
|
/* harmony default export */ var sugar_Column = (Column);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/sugar/ColumnGroup.js
|
|
/* istanbul ignore next */
|
|
/**
|
|
* This is a syntactic sugar for `columns` prop.
|
|
* So HOC will not work on this.
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
function ColumnGroup(_) {
|
|
return null;
|
|
}
|
|
/* harmony default export */ var sugar_ColumnGroup = (ColumnGroup);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/Table.js
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Feature:
|
|
* - fixed not need to set width
|
|
* - support `rowExpandable` to config row expand logic
|
|
* - add `summary` to support `() => ReactNode`
|
|
*
|
|
* Update:
|
|
* - `dataIndex` is `array[]` now
|
|
* - `expandable` wrap all the expand related props
|
|
*
|
|
* Removed:
|
|
* - expandIconAsCell
|
|
* - useFixedHeader
|
|
* - rowRef
|
|
* - columns[number].onCellClick
|
|
* - onRowClick
|
|
* - onRowDoubleClick
|
|
* - onRowMouseEnter
|
|
* - onRowMouseLeave
|
|
* - getBodyWrapper
|
|
* - bodyStyle
|
|
*
|
|
* Deprecated:
|
|
* - All expanded props, move into expandable
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Used for conditions cache
|
|
var EMPTY_DATA = [];
|
|
|
|
// Used for customize scroll
|
|
var EMPTY_SCROLL_TARGET = {};
|
|
function defaultEmpty() {
|
|
return 'No Data';
|
|
}
|
|
function Table_Table(tableProps) {
|
|
var _classNames;
|
|
var props = (0,objectSpread2/* default */.Z)({
|
|
rowKey: 'key',
|
|
prefixCls: 'rc-table',
|
|
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,
|
|
sticky = props.sticky;
|
|
var mergedData = data || EMPTY_DATA;
|
|
var hasData = !!mergedData.length;
|
|
|
|
// ===================== Warning ======================
|
|
if (false) {}
|
|
|
|
// ==================== Customize =====================
|
|
var getComponent = react.useCallback(function (path, defaultComponent) {
|
|
return get(components, path) || defaultComponent;
|
|
}, [components]);
|
|
var getRowKey = react.useMemo(function () {
|
|
if (typeof rowKey === 'function') {
|
|
return rowKey;
|
|
}
|
|
return function (record) {
|
|
var key = record && record[rowKey];
|
|
if (false) {}
|
|
return key;
|
|
};
|
|
}, [rowKey]);
|
|
|
|
// ====================== 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 _React$useState = 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
|
|
}), internalHooks === INTERNAL_HOOKS ? transformColumns : null),
|
|
_useColumns2 = (0,slicedToArray/* default */.Z)(_useColumns, 2),
|
|
columns = _useColumns2[0],
|
|
flattenColumns = _useColumns2[1];
|
|
var columnContext = react.useMemo(function () {
|
|
return {
|
|
columns: columns,
|
|
flattenColumns: flattenColumns
|
|
};
|
|
}, [columns, flattenColumns]);
|
|
|
|
// ====================== Scroll ======================
|
|
var fullTableRef = react.useRef();
|
|
var scrollHeaderRef = react.useRef();
|
|
var scrollBodyRef = react.useRef();
|
|
var scrollBodyContainerRef = react.useRef();
|
|
var scrollSummaryRef = react.useRef();
|
|
var _React$useState3 = react.useState(false),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
pingedLeft = _React$useState4[0],
|
|
setPingedLeft = _React$useState4[1];
|
|
var _React$useState5 = 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.useMemo(function () {
|
|
return pureColWidths;
|
|
}, [pureColWidths.join('_')]);
|
|
var stickyOffsets = hooks_useStickyOffsets(colWidths, flattenColumns.length, direction);
|
|
var fixHeader = scroll && validateValue(scroll.y);
|
|
var horizonScroll = scroll && validateValue(scroll.x) || Boolean(expandableConfig.fixed);
|
|
var fixColumn = horizonScroll && flattenColumns.some(function (_ref) {
|
|
var fixed = _ref.fixed;
|
|
return fixed;
|
|
});
|
|
|
|
// Sticky
|
|
var stickyRef = react.useRef();
|
|
var _useSticky = useSticky(sticky, prefixCls),
|
|
isSticky = _useSticky.isSticky,
|
|
offsetHeader = _useSticky.offsetHeader,
|
|
offsetSummary = _useSticky.offsetSummary,
|
|
offsetScroll = _useSticky.offsetScroll,
|
|
stickyClassName = _useSticky.stickyClassName,
|
|
container = _useSticky.container;
|
|
|
|
// Footer (Fix footer must fixed header)
|
|
var summaryNode = react.useMemo(function () {
|
|
return summary === null || summary === void 0 ? void 0 : summary(mergedData);
|
|
}, [summary, mergedData]);
|
|
var fixFooter = (fixHeader || isSticky) && /*#__PURE__*/react.isValidElement(summaryNode) && summaryNode.type === Footer_Summary && summaryNode.props.fixed;
|
|
|
|
// Scroll
|
|
var scrollXStyle;
|
|
var scrollYStyle;
|
|
var scrollTableStyle;
|
|
if (fixHeader) {
|
|
scrollYStyle = {
|
|
overflowY: 'scroll',
|
|
maxHeight: scroll.y
|
|
};
|
|
}
|
|
if (horizonScroll) {
|
|
scrollXStyle = {
|
|
overflowX: 'auto'
|
|
};
|
|
// When no vertical scrollbar, should hide it
|
|
// https://github.com/ant-design/ant-design/pull/20705
|
|
// https://github.com/ant-design/ant-design/issues/21879
|
|
if (!fixHeader) {
|
|
scrollYStyle = {
|
|
overflowY: 'hidden'
|
|
};
|
|
}
|
|
scrollTableStyle = {
|
|
width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) === true ? 'auto' : scroll === null || scroll === void 0 ? void 0 : scroll.x,
|
|
minWidth: '100%'
|
|
};
|
|
}
|
|
var onColumnResize = react.useCallback(function (columnKey, width) {
|
|
if (isVisible(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 = useEvent_useEvent(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);
|
|
}
|
|
if (currentTarget) {
|
|
var scrollWidth = currentTarget.scrollWidth,
|
|
clientWidth = currentTarget.clientWidth;
|
|
// There is no space to scroll
|
|
if (scrollWidth === clientWidth) {
|
|
setPingedLeft(false);
|
|
setPingedRight(false);
|
|
return;
|
|
}
|
|
if (isRTL) {
|
|
setPingedLeft(-mergedScrollLeft < scrollWidth - clientWidth);
|
|
setPingedRight(-mergedScrollLeft > 0);
|
|
} else {
|
|
setPingedLeft(mergedScrollLeft > 0);
|
|
setPingedRight(mergedScrollLeft < scrollWidth - clientWidth);
|
|
}
|
|
}
|
|
});
|
|
var triggerOnScroll = function triggerOnScroll() {
|
|
if (horizonScroll && scrollBodyRef.current) {
|
|
onScroll({
|
|
currentTarget: scrollBodyRef.current
|
|
});
|
|
} else {
|
|
setPingedLeft(false);
|
|
setPingedRight(false);
|
|
}
|
|
};
|
|
var onFullTableResize = function onFullTableResize(_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.useRef(false);
|
|
react.useEffect(function () {
|
|
// onFullTableResize will be trigger once when ResizeObserver is mounted
|
|
// This will reduce one duplicated triggerOnScroll time
|
|
if (mounted.current) {
|
|
triggerOnScroll();
|
|
}
|
|
}, [horizonScroll, data, columns.length]);
|
|
react.useEffect(function () {
|
|
mounted.current = true;
|
|
}, []);
|
|
|
|
// ===================== Effects ======================
|
|
var _React$useState7 = react.useState(0),
|
|
_React$useState8 = (0,slicedToArray/* default */.Z)(_React$useState7, 2),
|
|
scrollbarSize = _React$useState8[0],
|
|
setScrollbarSize = _React$useState8[1];
|
|
var _React$useState9 = 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.useEffect(function () {
|
|
if (scrollBodyRef.current instanceof Element) {
|
|
setScrollbarSize(getTargetScrollBarSize(scrollBodyRef.current).width);
|
|
} else {
|
|
setScrollbarSize(getTargetScrollBarSize(scrollBodyContainerRef.current).width);
|
|
}
|
|
setSupportSticky(isStyleSupport('position', 'sticky'));
|
|
}, []);
|
|
|
|
// ================== INTERNAL HOOKS ==================
|
|
react.useEffect(function () {
|
|
if (internalHooks === INTERNAL_HOOKS && internalRefs) {
|
|
internalRefs.body.current = scrollBodyRef.current;
|
|
}
|
|
});
|
|
|
|
// ========================================================================
|
|
// == Render ==
|
|
// ========================================================================
|
|
// =================== Render: Func ===================
|
|
var renderFixedHeaderTable = react.useCallback(function (fixedHolderPassProps) {
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Header_Header, fixedHolderPassProps), fixFooter === 'top' && /*#__PURE__*/react.createElement(es_Footer, fixedHolderPassProps, summaryNode));
|
|
}, [fixFooter, summaryNode]);
|
|
var renderFixedFooterTable = react.useCallback(function (fixedHolderPassProps) {
|
|
return /*#__PURE__*/react.createElement(es_Footer, fixedHolderPassProps, summaryNode);
|
|
}, [summaryNode]);
|
|
|
|
// =================== Render: Node ===================
|
|
var TableComponent = getComponent(['table'], 'table');
|
|
|
|
// Table layout
|
|
var mergedTableLayout = react.useMemo(function () {
|
|
if (tableLayout) {
|
|
return tableLayout;
|
|
}
|
|
// https://github.com/ant-design/ant-design/issues/25227
|
|
// When scroll.x is max-content, no need to fix table layout
|
|
// it's width should stretch out to fit content
|
|
if (fixColumn) {
|
|
return (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' ? 'auto' : 'fixed';
|
|
}
|
|
if (fixHeader || isSticky || flattenColumns.some(function (_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.useMemo(function () {
|
|
if (hasData) {
|
|
return null;
|
|
}
|
|
if (typeof emptyText === 'function') {
|
|
return emptyText();
|
|
}
|
|
return emptyText;
|
|
}, [hasData, emptyText]);
|
|
|
|
// Body
|
|
var bodyTable = /*#__PURE__*/react.createElement(es_Body, {
|
|
data: mergedData,
|
|
measureColumnWidth: fixHeader || horizonScroll || isSticky,
|
|
expandedKeys: mergedExpandedKeys,
|
|
rowExpandable: expandableConfig.rowExpandable,
|
|
getRowKey: getRowKey,
|
|
onRow: onRow,
|
|
emptyNode: emptyNode,
|
|
childrenColumnName: mergedChildrenColumnName
|
|
});
|
|
var bodyColGroup = /*#__PURE__*/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.createElement("caption", {
|
|
className: "".concat(prefixCls, "-caption")
|
|
}, caption) : undefined;
|
|
var customizeScrollBody = getComponent(['body']);
|
|
if (false) {}
|
|
var dataProps = pickAttrs(props, {
|
|
data: true
|
|
});
|
|
var ariaProps = pickAttrs(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 === columns.length - 1 ? width - scrollbarSize : width;
|
|
if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {
|
|
return colWidth;
|
|
}
|
|
if (false) {}
|
|
return 0;
|
|
});
|
|
} else {
|
|
bodyContent = /*#__PURE__*/react.createElement("div", {
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollXStyle), scrollYStyle),
|
|
onScroll: onScroll,
|
|
ref: scrollBodyRef,
|
|
className: classnames_default()("".concat(prefixCls, "-body"))
|
|
}, /*#__PURE__*/react.createElement(TableComponent, (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.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 && scroll.x === 'max-content'
|
|
}, headerProps), columnContext), {}, {
|
|
direction: direction,
|
|
stickyClassName: stickyClassName,
|
|
onScroll: onScroll
|
|
});
|
|
groupTableNode = /*#__PURE__*/react.createElement(react.Fragment, null, showHeader !== false && /*#__PURE__*/react.createElement(es_FixedHolder, (0,esm_extends/* default */.Z)({}, fixedHolderProps, {
|
|
stickyTopOffset: offsetHeader,
|
|
className: "".concat(prefixCls, "-header"),
|
|
ref: scrollHeaderRef
|
|
}), renderFixedHeaderTable), bodyContent, fixFooter && fixFooter !== 'top' && /*#__PURE__*/react.createElement(es_FixedHolder, (0,esm_extends/* default */.Z)({}, fixedHolderProps, {
|
|
stickyBottomOffset: offsetSummary,
|
|
className: "".concat(prefixCls, "-summary"),
|
|
ref: scrollSummaryRef
|
|
}), renderFixedFooterTable), isSticky && /*#__PURE__*/react.createElement(stickyScrollBar, {
|
|
ref: stickyRef,
|
|
offsetScroll: offsetScroll,
|
|
scrollBodyRef: scrollBodyRef,
|
|
onScroll: onScroll,
|
|
container: container
|
|
}));
|
|
} else {
|
|
// >>>>>> Unique table
|
|
groupTableNode = /*#__PURE__*/react.createElement("div", {
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollXStyle), scrollYStyle),
|
|
className: classnames_default()("".concat(prefixCls, "-content")),
|
|
onScroll: onScroll,
|
|
ref: scrollBodyRef
|
|
}, /*#__PURE__*/react.createElement(TableComponent, (0,esm_extends/* default */.Z)({
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, scrollTableStyle), {}, {
|
|
tableLayout: mergedTableLayout
|
|
})
|
|
}, ariaProps), captionElement, bodyColGroup, showHeader !== false && /*#__PURE__*/react.createElement(Header_Header, (0,esm_extends/* default */.Z)({}, headerProps, columnContext)), bodyTable, summaryNode && /*#__PURE__*/react.createElement(es_Footer, {
|
|
stickyOffsets: stickyOffsets,
|
|
flattenColumns: flattenColumns,
|
|
columns: columns
|
|
}, summaryNode)));
|
|
}
|
|
var fullTable = /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
className: classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-ping-left"), pingedLeft), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-ping-right"), pingedRight), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-fixed-header"), fixHeader), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-fixed-column"), fixColumn), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right'), _classNames)),
|
|
style: style,
|
|
id: id,
|
|
ref: fullTableRef
|
|
}, dataProps), title && /*#__PURE__*/react.createElement(es_Panel, {
|
|
className: "".concat(prefixCls, "-title")
|
|
}, title(mergedData)), /*#__PURE__*/react.createElement("div", {
|
|
ref: scrollBodyContainerRef,
|
|
className: "".concat(prefixCls, "-container")
|
|
}, groupTableNode), footer && /*#__PURE__*/react.createElement(es_Panel, {
|
|
className: "".concat(prefixCls, "-footer")
|
|
}, footer(mergedData)));
|
|
if (horizonScroll) {
|
|
fullTable = /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: onFullTableResize
|
|
}, fullTable);
|
|
}
|
|
var fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction, columns);
|
|
var TableContextValue = react.useMemo(function () {
|
|
return {
|
|
// 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';
|
|
}),
|
|
// Column
|
|
columns: columns,
|
|
flattenColumns: flattenColumns,
|
|
onColumnResize: onColumnResize,
|
|
// Row
|
|
hoverStartRow: startRow,
|
|
hoverEndRow: endRow,
|
|
onHover: onHover
|
|
};
|
|
}, [
|
|
// 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,
|
|
// Column
|
|
columns, flattenColumns, onColumnResize,
|
|
// Row
|
|
startRow, endRow, onHover]);
|
|
return /*#__PURE__*/react.createElement(context_TableContext.Provider, {
|
|
value: TableContextValue
|
|
}, fullTable);
|
|
}
|
|
function genTable(shouldTriggerRender) {
|
|
return makeImmutable(Table_Table, shouldTriggerRender);
|
|
}
|
|
var ImmutableTable = genTable();
|
|
ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
|
|
ImmutableTable.Column = sugar_Column;
|
|
ImmutableTable.ColumnGroup = sugar_ColumnGroup;
|
|
ImmutableTable.Summary = FooterComponents;
|
|
/* harmony default export */ var es_Table = ((/* unused pure expression or super */ null && (ImmutableTable)));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-table/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_table_es = ((/* unused pure expression or super */ null && (Table)));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/Column.js
|
|
/* istanbul ignore next */
|
|
/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
|
|
// eslint-disable-next-line no-unused-vars
|
|
function Column_Column(_) {
|
|
return null;
|
|
}
|
|
/* harmony default export */ var table_Column = (Column_Column);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/ColumnGroup.js
|
|
/* istanbul ignore next */
|
|
/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
|
|
// eslint-disable-next-line no-unused-vars
|
|
function ColumnGroup_ColumnGroup(_) {
|
|
return null;
|
|
}
|
|
/* harmony default export */ var table_ColumnGroup = (ColumnGroup_ColumnGroup);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/scrollTo.js + 1 modules
|
|
var scrollTo = __webpack_require__(58375);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/defaultRenderEmpty.js
|
|
var defaultRenderEmpty = __webpack_require__(88258);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(98675);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/grid/hooks/useBreakpoint.js
|
|
var useBreakpoint = __webpack_require__(25378);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/locale/en_US.js + 1 modules
|
|
var en_US = __webpack_require__(24457);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 11 modules
|
|
var es_pagination = __webpack_require__(83338);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js + 1 modules
|
|
var spin = __webpack_require__(57953);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/ExpandIcon.js
|
|
|
|
|
|
function ExpandIcon_renderExpandIcon(locale) {
|
|
return function expandIcon(_ref) {
|
|
let {
|
|
prefixCls,
|
|
onExpand,
|
|
record,
|
|
expanded,
|
|
expandable
|
|
} = _ref;
|
|
const iconPrefix = `${prefixCls}-row-expand-icon`;
|
|
return /*#__PURE__*/react.createElement("button", {
|
|
type: "button",
|
|
onClick: e => {
|
|
onExpand(record, e);
|
|
e.stopPropagation();
|
|
},
|
|
className: 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/es/table/RcTable.js
|
|
|
|
/**
|
|
* 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/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/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/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/FilterFilled.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var FilterFilled_FilterFilled = function FilterFilled(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_FilterFilled
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_FilterFilled = (/*#__PURE__*/react.forwardRef(FilterFilled_FilterFilled));
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/isEqual.js
|
|
var rc_util_es_isEqual = __webpack_require__(7699);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/hooks/useForceUpdate.js
|
|
var useForceUpdate = __webpack_require__(57838);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/_util/hooks/useSyncState.js
|
|
|
|
|
|
function useSyncState(initialValue) {
|
|
const ref = react.useRef(initialValue);
|
|
const forceUpdate = (0,useForceUpdate/* default */.Z)();
|
|
return [() => ref.current, newValue => {
|
|
ref.current = newValue;
|
|
// re-render
|
|
forceUpdate();
|
|
}];
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(84567);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/index.js + 1 modules
|
|
var dropdown = __webpack_require__(85418);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/empty/index.js + 3 modules
|
|
var empty = __webpack_require__(32983);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/menu/index.js + 11 modules
|
|
var es_menu = __webpack_require__(68508);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/menu/OverrideContext.js
|
|
var OverrideContext = __webpack_require__(76529);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(78045);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tree/index.js + 35 modules
|
|
var tree = __webpack_require__(282);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/SearchOutlined.js + 1 modules
|
|
var SearchOutlined = __webpack_require__(68795);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(79531);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/FilterSearch.js
|
|
|
|
|
|
|
|
function FilterSearch(_ref) {
|
|
let {
|
|
value,
|
|
onChange,
|
|
filterSearch,
|
|
tablePrefixCls,
|
|
locale
|
|
} = _ref;
|
|
if (!filterSearch) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
className: `${tablePrefixCls}-filter-dropdown-search`
|
|
}, /*#__PURE__*/react.createElement(input/* default */.Z, {
|
|
prefix: /*#__PURE__*/react.createElement(SearchOutlined/* default */.Z, null),
|
|
placeholder: locale.filterSearchPlaceholder,
|
|
onChange: onChange,
|
|
value: value,
|
|
// for skip min-width of input
|
|
htmlSize: 1,
|
|
className: `${tablePrefixCls}-filter-dropdown-search-input`
|
|
}));
|
|
}
|
|
/* harmony default export */ var useFilter_FilterSearch = (FilterSearch);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/KeyCode.js
|
|
var KeyCode = __webpack_require__(92389);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/FilterWrapper.js
|
|
|
|
|
|
const onKeyDown = event => {
|
|
const {
|
|
keyCode
|
|
} = event;
|
|
if (keyCode === KeyCode/* default.ENTER */.Z.ENTER) {
|
|
event.stopPropagation();
|
|
}
|
|
};
|
|
const FilterDropdownMenuWrapper = /*#__PURE__*/react.forwardRef((props, ref) => /*#__PURE__*/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/es/table/hooks/useFilter/FilterDropdown.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Component, {
|
|
checked: filteredKeys.includes(key)
|
|
}), /*#__PURE__*/react.createElement("span", null, filter.text))
|
|
};
|
|
if (searchValue.trim()) {
|
|
if (typeof filterSearch === 'function') {
|
|
return filterSearch(searchValue, filter) ? item : null;
|
|
}
|
|
return searchValueMatched(searchValue, filter.text) ? item : null;
|
|
}
|
|
return item;
|
|
});
|
|
}
|
|
function FilterDropdown(props) {
|
|
var _a, _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.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.useEffect(() => {
|
|
if (!visible) {
|
|
return;
|
|
}
|
|
onSelectKeys({
|
|
selectedKeys: propFilteredKeys || []
|
|
});
|
|
}, [propFilteredKeys]);
|
|
// ====================== Open Keys ======================
|
|
const [openKeys, setOpenKeys] = react.useState([]);
|
|
const onOpenChange = keys => {
|
|
setOpenKeys(keys);
|
|
};
|
|
// search in tree mode column filter
|
|
const [searchValue, setSearchValue] = react.useState('');
|
|
const onSearch = e => {
|
|
const {
|
|
value
|
|
} = e.target;
|
|
setSearchValue(value);
|
|
};
|
|
// clear search value after close filter dropdown
|
|
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,rc_util_es_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_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.createElement(empty/* default */.Z, {
|
|
image: empty/* default.PRESENTED_IMAGE_SIMPLE */.Z.PRESENTED_IMAGE_SIMPLE,
|
|
description: locale.filterEmptyText,
|
|
imageStyle: {
|
|
height: 24
|
|
},
|
|
style: {
|
|
margin: 0,
|
|
padding: '16px 0'
|
|
}
|
|
});
|
|
}
|
|
if (filterMode === 'tree') {
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(useFilter_FilterSearch, {
|
|
filterSearch: filterSearch,
|
|
value: searchValue,
|
|
onChange: onSearch,
|
|
tablePrefixCls: tablePrefixCls,
|
|
locale: locale
|
|
}), /*#__PURE__*/react.createElement("div", {
|
|
className: `${tablePrefixCls}-filter-dropdown-tree`
|
|
}, filterMultiple ? /*#__PURE__*/react.createElement(es_checkbox/* default */.Z, {
|
|
checked: selectedKeys.length === flattenKeys(column.filters).length,
|
|
indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column.filters).length,
|
|
className: `${tablePrefixCls}-filter-dropdown-checkall`,
|
|
onChange: onCheckAll
|
|
}, locale.filterCheckall) : null, /*#__PURE__*/react.createElement(tree/* default */.Z, {
|
|
checkable: true,
|
|
selectable: false,
|
|
blockNode: true,
|
|
multiple: filterMultiple,
|
|
checkStrictly: !filterMultiple,
|
|
className: `${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.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(useFilter_FilterSearch, {
|
|
filterSearch: filterSearch,
|
|
value: searchValue,
|
|
onChange: onSearch,
|
|
tablePrefixCls: tablePrefixCls,
|
|
locale: locale
|
|
}), /*#__PURE__*/react.createElement(es_menu/* default */.Z, {
|
|
selectable: true,
|
|
multiple: filterMultiple,
|
|
prefixCls: `${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,rc_util_es_isEqual/* default */.Z)((defaultFilteredValue || []).map(key => String(key)), selectedKeys, true);
|
|
}
|
|
return selectedKeys.length === 0;
|
|
};
|
|
dropdownContent = /*#__PURE__*/react.createElement(react.Fragment, null, getFilterComponent(), /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-dropdown-btns`
|
|
}, /*#__PURE__*/react.createElement(es_button/* default */.ZP, {
|
|
type: "link",
|
|
size: "small",
|
|
disabled: getResetDisabled(),
|
|
onClick: () => onReset()
|
|
}, locale.filterReset), /*#__PURE__*/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.createElement(OverrideContext/* OverrideProvider */.J, {
|
|
selectable: undefined
|
|
}, dropdownContent);
|
|
}
|
|
const menu = () => /*#__PURE__*/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.createElement(icons_FilterFilled, null);
|
|
}
|
|
const {
|
|
direction
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-column`
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
className: `${tablePrefixCls}-column-title`
|
|
}, children), /*#__PURE__*/react.createElement(dropdown/* default */.Z, {
|
|
dropdownRender: menu,
|
|
trigger: ['click'],
|
|
open: mergedVisible,
|
|
onOpenChange: onVisibleChange,
|
|
getPopupContainer: getPopupContainer,
|
|
placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight'
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
role: "button",
|
|
tabIndex: -1,
|
|
className: classnames_default()(`${prefixCls}-trigger`, {
|
|
active: filtered
|
|
}),
|
|
onClick: e => {
|
|
e.stopPropagation();
|
|
}
|
|
}, filterIcon)));
|
|
}
|
|
/* harmony default export */ var useFilter_FilterDropdown = (FilterDropdown);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useFilter/index.js
|
|
|
|
|
|
|
|
|
|
|
|
function collectFilterStates(columns, init, pos) {
|
|
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.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.useMemo(() => getMergedColumns(rawMergedColumns || []), [rawMergedColumns]);
|
|
const [filterStates, setFilterStates] = react.useState(() => collectFilterStates(mergedColumns, true));
|
|
const mergedFilterStates = 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.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/es/table/hooks/useLazyKVMap.js
|
|
|
|
function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
const mapCacheRef = 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/es/_util/extendsObject.js
|
|
var extendsObject = __webpack_require__(38780);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/usePagination.js
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
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.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/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(80882);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-tree/es/util.js
|
|
var util = __webpack_require__(29873);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-tree/es/utils/conductUtil.js
|
|
var conductUtil = __webpack_require__(97153);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-tree/es/utils/treeUtil.js + 2 modules
|
|
var treeUtil = __webpack_require__(83898);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/hooks/useMergedState.js
|
|
var useMergedState = __webpack_require__(5663);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useSelection.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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.useRef(new Map());
|
|
const updatePreserveRecordsCache = (0,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.useEffect(() => {
|
|
updatePreserveRecordsCache(mergedSelectedKeys);
|
|
}, [mergedSelectedKeys]);
|
|
const {
|
|
keyEntities
|
|
} = (0,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.useMemo)(() => flattenData(childrenColumnName, pageData), [childrenColumnName, pageData]);
|
|
// Get all checkbox props
|
|
const checkboxPropsMap = (0,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.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.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.useMemo)(() => {
|
|
const keys = selectionType === 'radio' ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;
|
|
return new Set(keys);
|
|
}, [derivedSelectedKeys, selectionType]);
|
|
const derivedHalfSelectedKeySet = (0,react.useMemo)(() => selectionType === 'radio' ? new Set() : new Set(derivedHalfSelectedKeys), [derivedHalfSelectedKeys, selectionType]);
|
|
// Save last selected key to enable range selection
|
|
const [lastSelectedKey, setLastSelectedKey] = (0,react.useState)(null);
|
|
// Reset if rowSelection reset
|
|
react.useEffect(() => {
|
|
if (!rowSelection) {
|
|
setMergedSelectedKeys(EMPTY_LIST);
|
|
}
|
|
}, [!!rowSelection]);
|
|
const setSelectedKeys = (0,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.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.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.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.createElement("div", {
|
|
className: `${prefixCls}-selection-extra`
|
|
}, /*#__PURE__*/react.createElement(dropdown/* default */.Z, {
|
|
menu: menu,
|
|
getPopupContainer: getPopupContainer
|
|
}, /*#__PURE__*/react.createElement("span", null, /*#__PURE__*/react.createElement(DownOutlined/* default */.Z, null))));
|
|
}
|
|
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.createElement("div", {
|
|
className: `${prefixCls}-selection`
|
|
}, /*#__PURE__*/react.createElement(es_checkbox/* default */.Z, {
|
|
checked: !allDisabled ? !!flattedData.length && checkedCurrentAll : allDisabledAndChecked,
|
|
indeterminate: !allDisabled ? !checkedCurrentAll && checkedCurrentSome : !allDisabledAndChecked && allDisabledSomeChecked,
|
|
onChange: onSelectAllChange,
|
|
disabled: flattedData.length === 0 || allDisabled,
|
|
"aria-label": customizeSelections ? 'Custom selection' : 'Select all',
|
|
skipGroup: true
|
|
}), customizeSelections);
|
|
}
|
|
// Body Cell
|
|
let renderCell;
|
|
if (selectionType === 'radio') {
|
|
renderCell = (_, record, index) => {
|
|
const key = getRowKey(record, index);
|
|
const checked = keySet.has(key);
|
|
return {
|
|
node: /*#__PURE__*/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.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_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/es/icons/CaretDownOutlined.js + 1 modules
|
|
var CaretDownOutlined = __webpack_require__(39398);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CaretUpOutlined.js + 1 modules
|
|
var CaretUpOutlined = __webpack_require__(10010);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(83062);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/hooks/useSorter.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.createElement(CaretUpOutlined/* default */.Z, {
|
|
className: classnames_default()(`${prefixCls}-column-sorter-up`, {
|
|
active: sortOrder === ASCEND
|
|
})
|
|
});
|
|
const downNode = sortDirections.includes(DESCEND) && /*#__PURE__*/react.createElement(CaretDownOutlined/* default */.Z, {
|
|
className: classnames_default()(`${prefixCls}-column-sorter-down`, {
|
|
active: sortOrder === DESCEND
|
|
})
|
|
});
|
|
sorter = /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()(`${prefixCls}-column-sorter`, {
|
|
[`${prefixCls}-column-sorter-full`]: !!(upNode && downNode)
|
|
})
|
|
}, /*#__PURE__*/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_default()(newColumn.className, {
|
|
[`${prefixCls}-column-sort`]: sortOrder
|
|
}),
|
|
title: renderProps => {
|
|
const renderSortTitle = /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-column-sorters`
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
className: `${prefixCls}-column-title`
|
|
}, renderColumnTitle(column.title, renderProps)), sorter);
|
|
return showSorterTooltip ? /*#__PURE__*/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.ENTER */.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_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.useState(collectSortStates(mergedColumns, true));
|
|
const mergedSorterStates = 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.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/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.useCallback(columns => fillTitle(columns, columnTitleProps), [columnTitleProps]);
|
|
return [filledColumns];
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
var dist_module = __webpack_require__(10274);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(45503);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/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/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/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/es/style/operationUnit.js
|
|
var operationUnit = __webpack_require__(49867);
|
|
;// CONCATENATED MODULE: ./node_modules/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/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
|
|
} = 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',
|
|
'&: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/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/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/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/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`]: {
|
|
'&::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'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/* harmony default export */ var rtl = (genStyle);
|
|
;// CONCATENATED MODULE: ./node_modules/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/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}-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/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/es/table/style/sticky.js
|
|
const genStickyStyle = token => {
|
|
const {
|
|
componentCls,
|
|
opacityLoading,
|
|
tableScrollThumbBg,
|
|
tableScrollThumbBgHover,
|
|
tableScrollThumbSize,
|
|
tableScrollBg,
|
|
zIndexTableSticky
|
|
} = 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: 100,
|
|
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/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/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}-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 {
|
|
controlItemBgActive,
|
|
controlItemBgActiveHover,
|
|
colorTextPlaceholder,
|
|
colorTextHeading,
|
|
colorSplit,
|
|
colorBorderSecondary,
|
|
fontSize,
|
|
padding,
|
|
paddingXS,
|
|
paddingSM,
|
|
controlHeight,
|
|
colorFillAlter,
|
|
colorIcon,
|
|
colorIconHover,
|
|
opacityLoading,
|
|
colorBgContainer,
|
|
borderRadiusLG,
|
|
colorFillContent,
|
|
colorFillSecondary,
|
|
controlInteractiveSize: checkboxSize
|
|
} = token;
|
|
const baseColorAction = new dist_module/* TinyColor */.C(colorIcon);
|
|
const baseColorActionHover = new dist_module/* TinyColor */.C(colorIconHover);
|
|
const tableSelectedRowBg = controlItemBgActive;
|
|
const zIndexTableFixed = 2;
|
|
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();
|
|
const tableToken = (0,statistic/* merge */.TS)(token, {
|
|
tableFontSize: fontSize,
|
|
tableBg: colorBgContainer,
|
|
tableRadius: borderRadiusLG,
|
|
tablePaddingVertical: padding,
|
|
tablePaddingHorizontal: padding,
|
|
tablePaddingVerticalMiddle: paddingSM,
|
|
tablePaddingHorizontalMiddle: paddingXS,
|
|
tablePaddingVerticalSmall: paddingXS,
|
|
tablePaddingHorizontalSmall: paddingXS,
|
|
tableBorderColor: colorBorderSecondary,
|
|
tableHeaderTextColor: colorTextHeading,
|
|
tableHeaderBg: colorFillAlterSolid,
|
|
tableFooterTextColor: colorTextHeading,
|
|
tableFooterBg: colorFillAlterSolid,
|
|
tableHeaderCellSplitColor: colorBorderSecondary,
|
|
tableHeaderSortBg: colorFillSecondarySolid,
|
|
tableHeaderSortHoverBg: colorFillContentSolid,
|
|
tableHeaderIconColor: baseColorAction.clone().setAlpha(baseColorAction.getAlpha() * opacityLoading).toRgbString(),
|
|
tableHeaderIconColorHover: baseColorActionHover.clone().setAlpha(baseColorActionHover.getAlpha() * opacityLoading).toRgbString(),
|
|
tableBodySortBg: colorFillAlterSolid,
|
|
tableFixedHeaderSortActiveBg: colorFillSecondarySolid,
|
|
tableHeaderFilterActiveBg: colorFillContent,
|
|
tableFilterDropdownBg: colorBgContainer,
|
|
tableRowHoverBg: colorFillAlterSolid,
|
|
tableSelectedRowBg,
|
|
tableSelectedRowHoverBg: controlItemBgActiveHover,
|
|
zIndexTableFixed,
|
|
zIndexTableSticky: zIndexTableFixed + 1,
|
|
tableFontSizeMiddle: fontSize,
|
|
tableFontSizeSmall: fontSize,
|
|
tableSelectionColumnWidth: controlHeight,
|
|
tableExpandIconBg: colorBgContainer,
|
|
tableExpandColumnWidth: checkboxSize + 2 * token.padding,
|
|
tableExpandedRowBg: colorFillAlter,
|
|
// Dropdown
|
|
tableFilterDropdownWidth: 120,
|
|
tableFilterDropdownHeight: 264,
|
|
tableFilterDropdownSearchWidth: 140,
|
|
// Virtual Scroll Bar
|
|
tableScrollThumbSize: 8,
|
|
tableScrollThumbBg: colorTextPlaceholder,
|
|
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)];
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/InternalTable.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
} = props;
|
|
if (false) {}
|
|
const baseColumns = react.useMemo(() => columns || convertChildrenToColumns(children), [columns, children]);
|
|
const needResponsive = react.useMemo(() => baseColumns.some(col => col.responsive), [baseColumns]);
|
|
const screens = (0,useBreakpoint/* default */.Z)(needResponsive);
|
|
const mergedColumns = 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.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.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.useRef()
|
|
};
|
|
// ============================ RowKey ============================
|
|
const getRowKey = 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.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.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.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_default()(rowClassName(record, index, indent));
|
|
} else {
|
|
mergedRowClassName = classnames_default()(rowClassName);
|
|
}
|
|
return 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.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.createElement(es_pagination/* default */.Z, Object.assign({}, mergedPagination, {
|
|
className: 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 wrapperClassNames = 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.createElement(defaultRenderEmpty/* default */.Z, {
|
|
componentName: "Table"
|
|
});
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", {
|
|
ref: ref,
|
|
className: wrapperClassNames,
|
|
style: mergedStyle
|
|
}, /*#__PURE__*/react.createElement(spin/* default */.Z, Object.assign({
|
|
spinning: false
|
|
}, spinProps), topPaginationNode, /*#__PURE__*/react.createElement(RcTable, Object.assign({}, tableProps, {
|
|
columns: mergedColumns,
|
|
direction: direction,
|
|
expandable: mergedExpandable,
|
|
prefixCls: prefixCls,
|
|
className: 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.forwardRef(InternalTable));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/table/Table.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const table_Table_Table = (props, ref) => {
|
|
const renderTimesRef = react.useRef(0);
|
|
renderTimesRef.current += 1;
|
|
return /*#__PURE__*/react.createElement(table_InternalTable, Object.assign({}, props, {
|
|
ref: ref,
|
|
_renderTimes: renderTimesRef.current
|
|
}));
|
|
};
|
|
const ForwardTable = /*#__PURE__*/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/es/table/index.js
|
|
'use client';
|
|
|
|
|
|
/* harmony default export */ var table = (table_Table);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 92389:
|
|
/*!**************************************************************!*\
|
|
!*** ./node_modules/antd/node_modules/rc-util/es/KeyCode.js ***!
|
|
\**************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
/**
|
|
* @ignore
|
|
* some key-codes definition and utils from closure-library
|
|
* @author yiminghe@gmail.com
|
|
*/
|
|
|
|
var KeyCode = {
|
|
/**
|
|
* MAC_ENTER
|
|
*/
|
|
MAC_ENTER: 3,
|
|
/**
|
|
* BACKSPACE
|
|
*/
|
|
BACKSPACE: 8,
|
|
/**
|
|
* TAB
|
|
*/
|
|
TAB: 9,
|
|
/**
|
|
* NUMLOCK on FF/Safari Mac
|
|
*/
|
|
NUM_CENTER: 12,
|
|
// NUMLOCK on FF/Safari Mac
|
|
/**
|
|
* ENTER
|
|
*/
|
|
ENTER: 13,
|
|
/**
|
|
* SHIFT
|
|
*/
|
|
SHIFT: 16,
|
|
/**
|
|
* CTRL
|
|
*/
|
|
CTRL: 17,
|
|
/**
|
|
* ALT
|
|
*/
|
|
ALT: 18,
|
|
/**
|
|
* PAUSE
|
|
*/
|
|
PAUSE: 19,
|
|
/**
|
|
* CAPS_LOCK
|
|
*/
|
|
CAPS_LOCK: 20,
|
|
/**
|
|
* ESC
|
|
*/
|
|
ESC: 27,
|
|
/**
|
|
* SPACE
|
|
*/
|
|
SPACE: 32,
|
|
/**
|
|
* PAGE_UP
|
|
*/
|
|
PAGE_UP: 33,
|
|
// also NUM_NORTH_EAST
|
|
/**
|
|
* PAGE_DOWN
|
|
*/
|
|
PAGE_DOWN: 34,
|
|
// also NUM_SOUTH_EAST
|
|
/**
|
|
* END
|
|
*/
|
|
END: 35,
|
|
// also NUM_SOUTH_WEST
|
|
/**
|
|
* HOME
|
|
*/
|
|
HOME: 36,
|
|
// also NUM_NORTH_WEST
|
|
/**
|
|
* LEFT
|
|
*/
|
|
LEFT: 37,
|
|
// also NUM_WEST
|
|
/**
|
|
* UP
|
|
*/
|
|
UP: 38,
|
|
// also NUM_NORTH
|
|
/**
|
|
* RIGHT
|
|
*/
|
|
RIGHT: 39,
|
|
// also NUM_EAST
|
|
/**
|
|
* DOWN
|
|
*/
|
|
DOWN: 40,
|
|
// also NUM_SOUTH
|
|
/**
|
|
* PRINT_SCREEN
|
|
*/
|
|
PRINT_SCREEN: 44,
|
|
/**
|
|
* INSERT
|
|
*/
|
|
INSERT: 45,
|
|
// also NUM_INSERT
|
|
/**
|
|
* DELETE
|
|
*/
|
|
DELETE: 46,
|
|
// also NUM_DELETE
|
|
/**
|
|
* ZERO
|
|
*/
|
|
ZERO: 48,
|
|
/**
|
|
* ONE
|
|
*/
|
|
ONE: 49,
|
|
/**
|
|
* TWO
|
|
*/
|
|
TWO: 50,
|
|
/**
|
|
* THREE
|
|
*/
|
|
THREE: 51,
|
|
/**
|
|
* FOUR
|
|
*/
|
|
FOUR: 52,
|
|
/**
|
|
* FIVE
|
|
*/
|
|
FIVE: 53,
|
|
/**
|
|
* SIX
|
|
*/
|
|
SIX: 54,
|
|
/**
|
|
* SEVEN
|
|
*/
|
|
SEVEN: 55,
|
|
/**
|
|
* EIGHT
|
|
*/
|
|
EIGHT: 56,
|
|
/**
|
|
* NINE
|
|
*/
|
|
NINE: 57,
|
|
/**
|
|
* QUESTION_MARK
|
|
*/
|
|
QUESTION_MARK: 63,
|
|
// needs localization
|
|
/**
|
|
* A
|
|
*/
|
|
A: 65,
|
|
/**
|
|
* B
|
|
*/
|
|
B: 66,
|
|
/**
|
|
* C
|
|
*/
|
|
C: 67,
|
|
/**
|
|
* D
|
|
*/
|
|
D: 68,
|
|
/**
|
|
* E
|
|
*/
|
|
E: 69,
|
|
/**
|
|
* F
|
|
*/
|
|
F: 70,
|
|
/**
|
|
* G
|
|
*/
|
|
G: 71,
|
|
/**
|
|
* H
|
|
*/
|
|
H: 72,
|
|
/**
|
|
* I
|
|
*/
|
|
I: 73,
|
|
/**
|
|
* J
|
|
*/
|
|
J: 74,
|
|
/**
|
|
* K
|
|
*/
|
|
K: 75,
|
|
/**
|
|
* L
|
|
*/
|
|
L: 76,
|
|
/**
|
|
* M
|
|
*/
|
|
M: 77,
|
|
/**
|
|
* N
|
|
*/
|
|
N: 78,
|
|
/**
|
|
* O
|
|
*/
|
|
O: 79,
|
|
/**
|
|
* P
|
|
*/
|
|
P: 80,
|
|
/**
|
|
* Q
|
|
*/
|
|
Q: 81,
|
|
/**
|
|
* R
|
|
*/
|
|
R: 82,
|
|
/**
|
|
* S
|
|
*/
|
|
S: 83,
|
|
/**
|
|
* T
|
|
*/
|
|
T: 84,
|
|
/**
|
|
* U
|
|
*/
|
|
U: 85,
|
|
/**
|
|
* V
|
|
*/
|
|
V: 86,
|
|
/**
|
|
* W
|
|
*/
|
|
W: 87,
|
|
/**
|
|
* X
|
|
*/
|
|
X: 88,
|
|
/**
|
|
* Y
|
|
*/
|
|
Y: 89,
|
|
/**
|
|
* Z
|
|
*/
|
|
Z: 90,
|
|
/**
|
|
* META
|
|
*/
|
|
META: 91,
|
|
// WIN_KEY_LEFT
|
|
/**
|
|
* WIN_KEY_RIGHT
|
|
*/
|
|
WIN_KEY_RIGHT: 92,
|
|
/**
|
|
* CONTEXT_MENU
|
|
*/
|
|
CONTEXT_MENU: 93,
|
|
/**
|
|
* NUM_ZERO
|
|
*/
|
|
NUM_ZERO: 96,
|
|
/**
|
|
* NUM_ONE
|
|
*/
|
|
NUM_ONE: 97,
|
|
/**
|
|
* NUM_TWO
|
|
*/
|
|
NUM_TWO: 98,
|
|
/**
|
|
* NUM_THREE
|
|
*/
|
|
NUM_THREE: 99,
|
|
/**
|
|
* NUM_FOUR
|
|
*/
|
|
NUM_FOUR: 100,
|
|
/**
|
|
* NUM_FIVE
|
|
*/
|
|
NUM_FIVE: 101,
|
|
/**
|
|
* NUM_SIX
|
|
*/
|
|
NUM_SIX: 102,
|
|
/**
|
|
* NUM_SEVEN
|
|
*/
|
|
NUM_SEVEN: 103,
|
|
/**
|
|
* NUM_EIGHT
|
|
*/
|
|
NUM_EIGHT: 104,
|
|
/**
|
|
* NUM_NINE
|
|
*/
|
|
NUM_NINE: 105,
|
|
/**
|
|
* NUM_MULTIPLY
|
|
*/
|
|
NUM_MULTIPLY: 106,
|
|
/**
|
|
* NUM_PLUS
|
|
*/
|
|
NUM_PLUS: 107,
|
|
/**
|
|
* NUM_MINUS
|
|
*/
|
|
NUM_MINUS: 109,
|
|
/**
|
|
* NUM_PERIOD
|
|
*/
|
|
NUM_PERIOD: 110,
|
|
/**
|
|
* NUM_DIVISION
|
|
*/
|
|
NUM_DIVISION: 111,
|
|
/**
|
|
* F1
|
|
*/
|
|
F1: 112,
|
|
/**
|
|
* F2
|
|
*/
|
|
F2: 113,
|
|
/**
|
|
* F3
|
|
*/
|
|
F3: 114,
|
|
/**
|
|
* F4
|
|
*/
|
|
F4: 115,
|
|
/**
|
|
* F5
|
|
*/
|
|
F5: 116,
|
|
/**
|
|
* F6
|
|
*/
|
|
F6: 117,
|
|
/**
|
|
* F7
|
|
*/
|
|
F7: 118,
|
|
/**
|
|
* F8
|
|
*/
|
|
F8: 119,
|
|
/**
|
|
* F9
|
|
*/
|
|
F9: 120,
|
|
/**
|
|
* F10
|
|
*/
|
|
F10: 121,
|
|
/**
|
|
* F11
|
|
*/
|
|
F11: 122,
|
|
/**
|
|
* F12
|
|
*/
|
|
F12: 123,
|
|
/**
|
|
* NUMLOCK
|
|
*/
|
|
NUMLOCK: 144,
|
|
/**
|
|
* SEMICOLON
|
|
*/
|
|
SEMICOLON: 186,
|
|
// needs localization
|
|
/**
|
|
* DASH
|
|
*/
|
|
DASH: 189,
|
|
// needs localization
|
|
/**
|
|
* EQUALS
|
|
*/
|
|
EQUALS: 187,
|
|
// needs localization
|
|
/**
|
|
* COMMA
|
|
*/
|
|
COMMA: 188,
|
|
// needs localization
|
|
/**
|
|
* PERIOD
|
|
*/
|
|
PERIOD: 190,
|
|
// needs localization
|
|
/**
|
|
* SLASH
|
|
*/
|
|
SLASH: 191,
|
|
// needs localization
|
|
/**
|
|
* APOSTROPHE
|
|
*/
|
|
APOSTROPHE: 192,
|
|
// needs localization
|
|
/**
|
|
* SINGLE_QUOTE
|
|
*/
|
|
SINGLE_QUOTE: 222,
|
|
// needs localization
|
|
/**
|
|
* OPEN_SQUARE_BRACKET
|
|
*/
|
|
OPEN_SQUARE_BRACKET: 219,
|
|
// needs localization
|
|
/**
|
|
* BACKSLASH
|
|
*/
|
|
BACKSLASH: 220,
|
|
// needs localization
|
|
/**
|
|
* CLOSE_SQUARE_BRACKET
|
|
*/
|
|
CLOSE_SQUARE_BRACKET: 221,
|
|
// needs localization
|
|
/**
|
|
* WIN_KEY
|
|
*/
|
|
WIN_KEY: 224,
|
|
/**
|
|
* MAC_FF_META
|
|
*/
|
|
MAC_FF_META: 224,
|
|
// Firefox (Gecko) fires this for the meta key instead of 91
|
|
/**
|
|
* WIN_IME
|
|
*/
|
|
WIN_IME: 229,
|
|
// ======================== Function ========================
|
|
/**
|
|
* whether text and modified key is entered at the same time.
|
|
*/
|
|
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
|
|
var keyCode = e.keyCode;
|
|
if (e.altKey && !e.ctrlKey || e.metaKey ||
|
|
// Function keys don't generate text
|
|
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
|
|
return false;
|
|
}
|
|
|
|
// The following keys are quite harmless, even in combination with
|
|
// CTRL, ALT or SHIFT.
|
|
switch (keyCode) {
|
|
case KeyCode.ALT:
|
|
case KeyCode.CAPS_LOCK:
|
|
case KeyCode.CONTEXT_MENU:
|
|
case KeyCode.CTRL:
|
|
case KeyCode.DOWN:
|
|
case KeyCode.END:
|
|
case KeyCode.ESC:
|
|
case KeyCode.HOME:
|
|
case KeyCode.INSERT:
|
|
case KeyCode.LEFT:
|
|
case KeyCode.MAC_FF_META:
|
|
case KeyCode.META:
|
|
case KeyCode.NUMLOCK:
|
|
case KeyCode.NUM_CENTER:
|
|
case KeyCode.PAGE_DOWN:
|
|
case KeyCode.PAGE_UP:
|
|
case KeyCode.PAUSE:
|
|
case KeyCode.PRINT_SCREEN:
|
|
case KeyCode.RIGHT:
|
|
case KeyCode.SHIFT:
|
|
case KeyCode.UP:
|
|
case KeyCode.WIN_KEY:
|
|
case KeyCode.WIN_KEY_RIGHT:
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
},
|
|
/**
|
|
* whether character is entered.
|
|
*/
|
|
isCharacterKey: function isCharacterKey(keyCode) {
|
|
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
|
|
return true;
|
|
}
|
|
|
|
// Safari sends zero key code for non-latin characters.
|
|
if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
|
|
return true;
|
|
}
|
|
switch (keyCode) {
|
|
case KeyCode.SPACE:
|
|
case KeyCode.QUESTION_MARK:
|
|
case KeyCode.NUM_PLUS:
|
|
case KeyCode.NUM_MINUS:
|
|
case KeyCode.NUM_PERIOD:
|
|
case KeyCode.NUM_DIVISION:
|
|
case KeyCode.SEMICOLON:
|
|
case KeyCode.DASH:
|
|
case KeyCode.EQUALS:
|
|
case KeyCode.COMMA:
|
|
case KeyCode.PERIOD:
|
|
case KeyCode.SLASH:
|
|
case KeyCode.APOSTROPHE:
|
|
case KeyCode.SINGLE_QUOTE:
|
|
case KeyCode.OPEN_SQUARE_BRACKET:
|
|
case KeyCode.BACKSLASH:
|
|
case KeyCode.CLOSE_SQUARE_BRACKET:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
/* harmony default export */ __webpack_exports__["Z"] = (KeyCode);
|
|
|
|
/***/ })
|
|
|
|
}]); |