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.
710 lines
25 KiB
710 lines
25 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[73755],{
|
|
|
|
/***/ 73755:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/list/index.js + 3 modules ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ list; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.27.0@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(80702);
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/extendsObject.js
|
|
var extendsObject = __webpack_require__(50371);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/responsiveObserver.js
|
|
var responsiveObserver = __webpack_require__(69507);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/defaultRenderEmpty.js
|
|
var defaultRenderEmpty = __webpack_require__(93891);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/grid/row.js
|
|
var row = __webpack_require__(27382);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/grid/hooks/useBreakpoint.js
|
|
var useBreakpoint = __webpack_require__(8628);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var es_pagination = __webpack_require__(58421);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
var spin = __webpack_require__(71418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(92343);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/grid/col.js
|
|
var col = __webpack_require__(37028);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/list/context.js
|
|
|
|
const ListContext = /*#__PURE__*/_react_17_0_2_react.createContext({});
|
|
const ListConsumer = ListContext.Consumer;
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/list/Item.js
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Meta = _a => {
|
|
var {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
avatar,
|
|
title,
|
|
description
|
|
} = _a,
|
|
others = __rest(_a, ["prefixCls", "className", "avatar", "title", "description"]);
|
|
const {
|
|
getPrefixCls
|
|
} = (0,_react_17_0_2_react.useContext)(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('list', customizePrefixCls);
|
|
const classString = _classnames_2_5_1_classnames_default()(`${prefixCls}-item-meta`, className);
|
|
const content = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-item-meta-content`
|
|
}, title && /*#__PURE__*/_react_17_0_2_react.createElement("h4", {
|
|
className: `${prefixCls}-item-meta-title`
|
|
}, title), description && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-item-meta-description`
|
|
}, description));
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({}, others, {
|
|
className: classString
|
|
}), avatar && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-item-meta-avatar`
|
|
}, avatar), (title || description) && content);
|
|
};
|
|
const InternalItem = (_a, ref) => {
|
|
var {
|
|
prefixCls: customizePrefixCls,
|
|
children,
|
|
actions,
|
|
extra,
|
|
className,
|
|
colStyle
|
|
} = _a,
|
|
others = __rest(_a, ["prefixCls", "children", "actions", "extra", "className", "colStyle"]);
|
|
const {
|
|
grid,
|
|
itemLayout
|
|
} = (0,_react_17_0_2_react.useContext)(ListContext);
|
|
const {
|
|
getPrefixCls
|
|
} = (0,_react_17_0_2_react.useContext)(context/* ConfigContext */.E_);
|
|
const isItemContainsTextNodeAndNotSingular = () => {
|
|
let result;
|
|
_react_17_0_2_react.Children.forEach(children, element => {
|
|
if (typeof element === 'string') {
|
|
result = true;
|
|
}
|
|
});
|
|
return result && _react_17_0_2_react.Children.count(children) > 1;
|
|
};
|
|
const isFlexMode = () => {
|
|
if (itemLayout === 'vertical') {
|
|
return !!extra;
|
|
}
|
|
return !isItemContainsTextNodeAndNotSingular();
|
|
};
|
|
const prefixCls = getPrefixCls('list', customizePrefixCls);
|
|
const actionsContent = actions && actions.length > 0 && /*#__PURE__*/_react_17_0_2_react.createElement("ul", {
|
|
className: `${prefixCls}-item-action`,
|
|
key: "actions"
|
|
}, actions.map((action, i) =>
|
|
/*#__PURE__*/
|
|
// eslint-disable-next-line react/no-array-index-key
|
|
_react_17_0_2_react.createElement("li", {
|
|
key: `${prefixCls}-item-action-${i}`
|
|
}, action, i !== actions.length - 1 && /*#__PURE__*/_react_17_0_2_react.createElement("em", {
|
|
className: `${prefixCls}-item-action-split`
|
|
}))));
|
|
const Element = grid ? 'div' : 'li';
|
|
const itemChildren = /*#__PURE__*/_react_17_0_2_react.createElement(Element, Object.assign({}, others, !grid ? {
|
|
ref
|
|
} : {}, {
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-item`, {
|
|
[`${prefixCls}-item-no-flex`]: !isFlexMode()
|
|
}, className)
|
|
}), itemLayout === 'vertical' && extra ? [/*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-item-main`,
|
|
key: "content"
|
|
}, children, actionsContent), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-item-extra`,
|
|
key: "extra"
|
|
}, extra)] : [children, actionsContent, (0,reactNode/* cloneElement */.Tm)(extra, {
|
|
key: 'extra'
|
|
})]);
|
|
return grid ? /*#__PURE__*/_react_17_0_2_react.createElement(col/* default */.Z, {
|
|
ref: ref,
|
|
flex: 1,
|
|
style: colStyle
|
|
}, itemChildren) : itemChildren;
|
|
};
|
|
const Item = /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(InternalItem);
|
|
Item.Meta = Meta;
|
|
/* harmony default export */ var list_Item = (Item);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(17313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(37613);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/list/style/index.js
|
|
|
|
|
|
const genBorderedStyle = token => {
|
|
const {
|
|
listBorderedCls,
|
|
componentCls,
|
|
paddingLG,
|
|
margin,
|
|
itemPaddingSM,
|
|
itemPaddingLG,
|
|
marginLG,
|
|
borderRadiusLG
|
|
} = token;
|
|
return {
|
|
[`${listBorderedCls}`]: {
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
borderRadius: borderRadiusLG,
|
|
[`${componentCls}-header,${componentCls}-footer,${componentCls}-item`]: {
|
|
paddingInline: paddingLG
|
|
},
|
|
[`${componentCls}-pagination`]: {
|
|
margin: `${margin}px ${marginLG}px`
|
|
}
|
|
},
|
|
[`${listBorderedCls}${componentCls}-sm`]: {
|
|
[`${componentCls}-item,${componentCls}-header,${componentCls}-footer`]: {
|
|
padding: itemPaddingSM
|
|
}
|
|
},
|
|
[`${listBorderedCls}${componentCls}-lg`]: {
|
|
[`${componentCls}-item,${componentCls}-header,${componentCls}-footer`]: {
|
|
padding: itemPaddingLG
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genResponsiveStyle = token => {
|
|
const {
|
|
componentCls,
|
|
screenSM,
|
|
screenMD,
|
|
marginLG,
|
|
marginSM,
|
|
margin
|
|
} = token;
|
|
return {
|
|
[`@media screen and (max-width:${screenMD})`]: {
|
|
[`${componentCls}`]: {
|
|
[`${componentCls}-item`]: {
|
|
[`${componentCls}-item-action`]: {
|
|
marginInlineStart: marginLG
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-vertical`]: {
|
|
[`${componentCls}-item`]: {
|
|
[`${componentCls}-item-extra`]: {
|
|
marginInlineStart: marginLG
|
|
}
|
|
}
|
|
}
|
|
},
|
|
[`@media screen and (max-width: ${screenSM})`]: {
|
|
[`${componentCls}`]: {
|
|
[`${componentCls}-item`]: {
|
|
flexWrap: 'wrap',
|
|
[`${componentCls}-action`]: {
|
|
marginInlineStart: marginSM
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-vertical`]: {
|
|
[`${componentCls}-item`]: {
|
|
flexWrap: 'wrap-reverse',
|
|
[`${componentCls}-item-main`]: {
|
|
minWidth: token.contentWidth
|
|
},
|
|
[`${componentCls}-item-extra`]: {
|
|
margin: `auto auto ${margin}px`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
// =============================== Base ===============================
|
|
const genBaseStyle = token => {
|
|
const {
|
|
componentCls,
|
|
antCls,
|
|
controlHeight,
|
|
minHeight,
|
|
paddingSM,
|
|
marginLG,
|
|
padding,
|
|
itemPadding,
|
|
colorPrimary,
|
|
itemPaddingSM,
|
|
itemPaddingLG,
|
|
paddingXS,
|
|
margin,
|
|
colorText,
|
|
colorTextDescription,
|
|
motionDurationSlow,
|
|
lineWidth,
|
|
headerBg,
|
|
footerBg,
|
|
emptyTextPadding,
|
|
metaMarginBottom,
|
|
avatarMarginRight,
|
|
titleMarginBottom,
|
|
descriptionFontSize
|
|
} = token;
|
|
const alignCls = {};
|
|
['start', 'center', 'end'].forEach(item => {
|
|
alignCls[`&-align-${item}`] = {
|
|
textAlign: item
|
|
};
|
|
});
|
|
return {
|
|
[`${componentCls}`]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
'*': {
|
|
outline: 'none'
|
|
},
|
|
[`${componentCls}-header`]: {
|
|
background: headerBg
|
|
},
|
|
[`${componentCls}-footer`]: {
|
|
background: footerBg
|
|
},
|
|
[`${componentCls}-header, ${componentCls}-footer`]: {
|
|
paddingBlock: paddingSM
|
|
},
|
|
[`${componentCls}-pagination`]: Object.assign(Object.assign({
|
|
marginBlockStart: marginLG
|
|
}, alignCls), {
|
|
// https://github.com/ant-design/ant-design/issues/20037
|
|
[`${antCls}-pagination-options`]: {
|
|
textAlign: 'start'
|
|
}
|
|
}),
|
|
[`${componentCls}-spin`]: {
|
|
minHeight,
|
|
textAlign: 'center'
|
|
},
|
|
[`${componentCls}-items`]: {
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none'
|
|
},
|
|
[`${componentCls}-item`]: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'space-between',
|
|
padding: itemPadding,
|
|
color: colorText,
|
|
[`${componentCls}-item-meta`]: {
|
|
display: 'flex',
|
|
flex: 1,
|
|
alignItems: 'flex-start',
|
|
maxWidth: '100%',
|
|
[`${componentCls}-item-meta-avatar`]: {
|
|
marginInlineEnd: avatarMarginRight
|
|
},
|
|
[`${componentCls}-item-meta-content`]: {
|
|
flex: '1 0',
|
|
width: 0,
|
|
color: colorText
|
|
},
|
|
[`${componentCls}-item-meta-title`]: {
|
|
margin: `0 0 ${token.marginXXS}px 0`,
|
|
color: colorText,
|
|
fontSize: token.fontSize,
|
|
lineHeight: token.lineHeight,
|
|
'> a': {
|
|
color: colorText,
|
|
transition: `all ${motionDurationSlow}`,
|
|
[`&:hover`]: {
|
|
color: colorPrimary
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-item-meta-description`]: {
|
|
color: colorTextDescription,
|
|
fontSize: descriptionFontSize,
|
|
lineHeight: token.lineHeight
|
|
}
|
|
},
|
|
[`${componentCls}-item-action`]: {
|
|
flex: '0 0 auto',
|
|
marginInlineStart: token.marginXXL,
|
|
padding: 0,
|
|
fontSize: 0,
|
|
listStyle: 'none',
|
|
[`& > li`]: {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
padding: `0 ${paddingXS}px`,
|
|
color: colorTextDescription,
|
|
fontSize: token.fontSize,
|
|
lineHeight: token.lineHeight,
|
|
textAlign: 'center',
|
|
[`&:first-child`]: {
|
|
paddingInlineStart: 0
|
|
}
|
|
},
|
|
[`${componentCls}-item-action-split`]: {
|
|
position: 'absolute',
|
|
insetBlockStart: '50%',
|
|
insetInlineEnd: 0,
|
|
width: lineWidth,
|
|
height: Math.ceil(token.fontSize * token.lineHeight) - token.marginXXS * 2,
|
|
transform: 'translateY(-50%)',
|
|
backgroundColor: token.colorSplit
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-empty`]: {
|
|
padding: `${padding}px 0`,
|
|
color: colorTextDescription,
|
|
fontSize: token.fontSizeSM,
|
|
textAlign: 'center'
|
|
},
|
|
[`${componentCls}-empty-text`]: {
|
|
padding: emptyTextPadding,
|
|
color: token.colorTextDisabled,
|
|
fontSize: token.fontSize,
|
|
textAlign: 'center'
|
|
},
|
|
// ============================ without flex ============================
|
|
[`${componentCls}-item-no-flex`]: {
|
|
display: 'block'
|
|
}
|
|
}),
|
|
[`${componentCls}-grid ${antCls}-col > ${componentCls}-item`]: {
|
|
display: 'block',
|
|
maxWidth: '100%',
|
|
marginBlockEnd: margin,
|
|
paddingBlock: 0,
|
|
borderBlockEnd: 'none'
|
|
},
|
|
[`${componentCls}-vertical ${componentCls}-item`]: {
|
|
alignItems: 'initial',
|
|
[`${componentCls}-item-main`]: {
|
|
display: 'block',
|
|
flex: 1
|
|
},
|
|
[`${componentCls}-item-extra`]: {
|
|
marginInlineStart: marginLG
|
|
},
|
|
[`${componentCls}-item-meta`]: {
|
|
marginBlockEnd: metaMarginBottom,
|
|
[`${componentCls}-item-meta-title`]: {
|
|
marginBlockStart: 0,
|
|
marginBlockEnd: titleMarginBottom,
|
|
color: colorText,
|
|
fontSize: token.fontSizeLG,
|
|
lineHeight: token.lineHeightLG
|
|
}
|
|
},
|
|
[`${componentCls}-item-action`]: {
|
|
marginBlockStart: padding,
|
|
marginInlineStart: 'auto',
|
|
'> li': {
|
|
padding: `0 ${padding}px`,
|
|
[`&:first-child`]: {
|
|
paddingInlineStart: 0
|
|
}
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-split ${componentCls}-item`]: {
|
|
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
|
|
[`&:last-child`]: {
|
|
borderBlockEnd: 'none'
|
|
}
|
|
},
|
|
[`${componentCls}-split ${componentCls}-header`]: {
|
|
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
},
|
|
[`${componentCls}-split${componentCls}-empty ${componentCls}-footer`]: {
|
|
borderTop: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
},
|
|
[`${componentCls}-loading ${componentCls}-spin-nested-loading`]: {
|
|
minHeight: controlHeight
|
|
},
|
|
[`${componentCls}-split${componentCls}-something-after-last-item ${antCls}-spin-container > ${componentCls}-items > ${componentCls}-item:last-child`]: {
|
|
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
},
|
|
[`${componentCls}-lg ${componentCls}-item`]: {
|
|
padding: itemPaddingLG
|
|
},
|
|
[`${componentCls}-sm ${componentCls}-item`]: {
|
|
padding: itemPaddingSM
|
|
},
|
|
// Horizontal
|
|
[`${componentCls}:not(${componentCls}-vertical)`]: {
|
|
[`${componentCls}-item-no-flex`]: {
|
|
[`${componentCls}-item-action`]: {
|
|
float: 'right'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var list_style = ((0,genComponentStyleHook/* default */.Z)('List', token => {
|
|
const listToken = (0,statistic/* merge */.TS)(token, {
|
|
listBorderedCls: `${token.componentCls}-bordered`,
|
|
minHeight: token.controlHeightLG
|
|
});
|
|
return [genBaseStyle(listToken), genBorderedStyle(listToken), genResponsiveStyle(listToken)];
|
|
}, token => ({
|
|
contentWidth: 220,
|
|
itemPadding: `${token.paddingContentVertical}px 0`,
|
|
itemPaddingSM: `${token.paddingContentVerticalSM}px ${token.paddingContentHorizontal}px`,
|
|
itemPaddingLG: `${token.paddingContentVerticalLG}px ${token.paddingContentHorizontalLG}px`,
|
|
headerBg: 'transparent',
|
|
footerBg: 'transparent',
|
|
emptyTextPadding: token.padding,
|
|
metaMarginBottom: token.padding,
|
|
avatarMarginRight: token.padding,
|
|
titleMarginBottom: token.paddingSM,
|
|
descriptionFontSize: token.fontSize
|
|
})));
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(19716);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/list/index.js
|
|
"use client";
|
|
|
|
|
|
var list_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;
|
|
};
|
|
|
|
// eslint-disable-next-line import/no-named-as-default
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSSINJS
|
|
|
|
|
|
|
|
function List(_a) {
|
|
var _b;
|
|
var {
|
|
pagination = false,
|
|
prefixCls: customizePrefixCls,
|
|
bordered = false,
|
|
split = true,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
children,
|
|
itemLayout,
|
|
loadMore,
|
|
grid,
|
|
dataSource = [],
|
|
size: customizeSize,
|
|
header,
|
|
footer,
|
|
loading = false,
|
|
rowKey,
|
|
renderItem,
|
|
locale
|
|
} = _a,
|
|
rest = list_rest(_a, ["pagination", "prefixCls", "bordered", "split", "className", "rootClassName", "style", "children", "itemLayout", "loadMore", "grid", "dataSource", "size", "header", "footer", "loading", "rowKey", "renderItem", "locale"]);
|
|
const paginationObj = pagination && typeof pagination === 'object' ? pagination : {};
|
|
const [paginationCurrent, setPaginationCurrent] = _react_17_0_2_react.useState(paginationObj.defaultCurrent || 1);
|
|
const [paginationSize, setPaginationSize] = _react_17_0_2_react.useState(paginationObj.defaultPageSize || 10);
|
|
const {
|
|
getPrefixCls,
|
|
renderEmpty,
|
|
direction,
|
|
list
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const defaultPaginationProps = {
|
|
current: 1,
|
|
total: 0
|
|
};
|
|
const triggerPaginationEvent = eventName => (page, pageSize) => {
|
|
var _a;
|
|
setPaginationCurrent(page);
|
|
setPaginationSize(pageSize);
|
|
if (pagination && pagination[eventName]) {
|
|
(_a = pagination === null || pagination === void 0 ? void 0 : pagination[eventName]) === null || _a === void 0 ? void 0 : _a.call(pagination, page, pageSize);
|
|
}
|
|
};
|
|
const onPaginationChange = triggerPaginationEvent('onChange');
|
|
const onPaginationShowSizeChange = triggerPaginationEvent('onShowSizeChange');
|
|
const renderInnerItem = (item, index) => {
|
|
if (!renderItem) return null;
|
|
let key;
|
|
if (typeof rowKey === 'function') {
|
|
key = rowKey(item);
|
|
} else if (rowKey) {
|
|
key = item[rowKey];
|
|
} else {
|
|
key = item.key;
|
|
}
|
|
if (!key) {
|
|
key = `list-item-${index}`;
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, {
|
|
key: key
|
|
}, renderItem(item, index));
|
|
};
|
|
const isSomethingAfterLastItem = () => !!(loadMore || pagination || footer);
|
|
const prefixCls = getPrefixCls('list', customizePrefixCls);
|
|
// Style
|
|
const [wrapSSR, hashId] = list_style(prefixCls);
|
|
let loadingProp = loading;
|
|
if (typeof loadingProp === 'boolean') {
|
|
loadingProp = {
|
|
spinning: loadingProp
|
|
};
|
|
}
|
|
const isLoading = loadingProp && loadingProp.spinning;
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
// large => lg
|
|
// small => sm
|
|
let sizeCls = '';
|
|
switch (mergedSize) {
|
|
case 'large':
|
|
sizeCls = 'lg';
|
|
break;
|
|
case 'small':
|
|
sizeCls = 'sm';
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
const classString = _classnames_2_5_1_classnames_default()(prefixCls, {
|
|
[`${prefixCls}-vertical`]: itemLayout === 'vertical',
|
|
[`${prefixCls}-${sizeCls}`]: sizeCls,
|
|
[`${prefixCls}-split`]: split,
|
|
[`${prefixCls}-bordered`]: bordered,
|
|
[`${prefixCls}-loading`]: isLoading,
|
|
[`${prefixCls}-grid`]: !!grid,
|
|
[`${prefixCls}-something-after-last-item`]: isSomethingAfterLastItem(),
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, list === null || list === void 0 ? void 0 : list.className, className, rootClassName, hashId);
|
|
const paginationProps = (0,extendsObject/* default */.Z)(defaultPaginationProps, {
|
|
total: dataSource.length,
|
|
current: paginationCurrent,
|
|
pageSize: paginationSize
|
|
}, pagination || {});
|
|
const largestPage = Math.ceil(paginationProps.total / paginationProps.pageSize);
|
|
if (paginationProps.current > largestPage) {
|
|
paginationProps.current = largestPage;
|
|
}
|
|
const paginationContent = pagination ? /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-pagination`, `${prefixCls}-pagination-align-${(_b = paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.align) !== null && _b !== void 0 ? _b : 'end'}`)
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es_pagination/* default */.Z, Object.assign({}, paginationProps, {
|
|
onChange: onPaginationChange,
|
|
onShowSizeChange: onPaginationShowSizeChange
|
|
}))) : null;
|
|
let splitDataSource = (0,toConsumableArray/* default */.Z)(dataSource);
|
|
if (pagination) {
|
|
if (dataSource.length > (paginationProps.current - 1) * paginationProps.pageSize) {
|
|
splitDataSource = (0,toConsumableArray/* default */.Z)(dataSource).splice((paginationProps.current - 1) * paginationProps.pageSize, paginationProps.pageSize);
|
|
}
|
|
}
|
|
const needResponsive = Object.keys(grid || {}).some(key => ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key));
|
|
const screens = (0,useBreakpoint/* default */.Z)(needResponsive);
|
|
const currentBreakpoint = _react_17_0_2_react.useMemo(() => {
|
|
for (let i = 0; i < responsiveObserver/* responsiveArray */.c4.length; i += 1) {
|
|
const breakpoint = responsiveObserver/* responsiveArray */.c4[i];
|
|
if (screens[breakpoint]) {
|
|
return breakpoint;
|
|
}
|
|
}
|
|
return undefined;
|
|
}, [screens]);
|
|
const colStyle = _react_17_0_2_react.useMemo(() => {
|
|
if (!grid) {
|
|
return undefined;
|
|
}
|
|
const columnCount = currentBreakpoint && grid[currentBreakpoint] ? grid[currentBreakpoint] : grid.column;
|
|
if (columnCount) {
|
|
return {
|
|
width: `${100 / columnCount}%`,
|
|
maxWidth: `${100 / columnCount}%`
|
|
};
|
|
}
|
|
}, [grid === null || grid === void 0 ? void 0 : grid.column, currentBreakpoint]);
|
|
let childrenContent = isLoading && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
style: {
|
|
minHeight: 53
|
|
}
|
|
});
|
|
if (splitDataSource.length > 0) {
|
|
const items = splitDataSource.map((item, index) => renderInnerItem(item, index));
|
|
childrenContent = grid ? /*#__PURE__*/_react_17_0_2_react.createElement(row/* default */.Z, {
|
|
gutter: grid.gutter
|
|
}, _react_17_0_2_react.Children.map(items, child => /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
key: child === null || child === void 0 ? void 0 : child.key,
|
|
style: colStyle
|
|
}, child))) : /*#__PURE__*/_react_17_0_2_react.createElement("ul", {
|
|
className: `${prefixCls}-items`
|
|
}, items);
|
|
} else if (!children && !isLoading) {
|
|
childrenContent = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-empty-text`
|
|
}, locale && locale.emptyText || (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('List')) || /*#__PURE__*/_react_17_0_2_react.createElement(defaultRenderEmpty/* default */.Z, {
|
|
componentName: "List"
|
|
}));
|
|
}
|
|
const paginationPosition = paginationProps.position || 'bottom';
|
|
const contextValue = _react_17_0_2_react.useMemo(() => ({
|
|
grid,
|
|
itemLayout
|
|
}), [JSON.stringify(grid), itemLayout]);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(ListContext.Provider, {
|
|
value: contextValue
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
style: Object.assign(Object.assign({}, list === null || list === void 0 ? void 0 : list.style), style),
|
|
className: classString
|
|
}, rest), (paginationPosition === 'top' || paginationPosition === 'both') && paginationContent, header && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-header`
|
|
}, header), /*#__PURE__*/_react_17_0_2_react.createElement(spin/* default */.Z, Object.assign({}, loadingProp), childrenContent, children), footer && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-footer`
|
|
}, footer), loadMore || (paginationPosition === 'bottom' || paginationPosition === 'both') && paginationContent)));
|
|
}
|
|
if (false) {}
|
|
List.Item = list_Item;
|
|
/* harmony default export */ var list = (List);
|
|
|
|
/***/ })
|
|
|
|
}]); |