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.
1842 lines
66 KiB
1842 lines
66 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[13566,73755],{
|
|
|
|
/***/ 77578:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/getRenderPropValue.js ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ getRenderPropValue; }
|
|
/* harmony export */ });
|
|
const getRenderPropValue = propValue => {
|
|
if (!propValue) {
|
|
return null;
|
|
}
|
|
if (typeof propValue === 'function') {
|
|
return propValue();
|
|
}
|
|
return propValue;
|
|
};
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26743:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/avatar/index.js + 4 modules ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
C: function() { return /* binding */ es_avatar; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: Group
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-resize-observer@1.4.0@rc-resize-observer/es/index.js + 4 modules
|
|
var es = __webpack_require__(28647);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/ref.js
|
|
var es_ref = __webpack_require__(88831);
|
|
// 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/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/grid/hooks/useBreakpoint.js
|
|
var useBreakpoint = __webpack_require__(8628);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/AvatarContext.js
|
|
|
|
const AvatarContext = /*#__PURE__*/_react_17_0_2_react.createContext({});
|
|
/* harmony default export */ var avatar_AvatarContext = (AvatarContext);
|
|
// 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/avatar/style/index.js
|
|
|
|
|
|
const genBaseStyle = token => {
|
|
const {
|
|
antCls,
|
|
componentCls,
|
|
iconCls,
|
|
avatarBg,
|
|
avatarColor,
|
|
containerSize,
|
|
containerSizeLG,
|
|
containerSizeSM,
|
|
textFontSize,
|
|
textFontSizeLG,
|
|
textFontSizeSM,
|
|
borderRadius,
|
|
borderRadiusLG,
|
|
borderRadiusSM,
|
|
lineWidth,
|
|
lineType
|
|
} = token;
|
|
// Avatar size style
|
|
const avatarSizeStyle = (size, fontSize, radius) => ({
|
|
width: size,
|
|
height: size,
|
|
lineHeight: `${size - lineWidth * 2}px`,
|
|
borderRadius: '50%',
|
|
[`&${componentCls}-square`]: {
|
|
borderRadius: radius
|
|
},
|
|
[`${componentCls}-string`]: {
|
|
position: 'absolute',
|
|
left: {
|
|
_skip_check_: true,
|
|
value: '50%'
|
|
},
|
|
transformOrigin: '0 center'
|
|
},
|
|
[`&${componentCls}-icon`]: {
|
|
fontSize,
|
|
[`> ${iconCls}`]: {
|
|
margin: 0
|
|
}
|
|
}
|
|
});
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
overflow: 'hidden',
|
|
color: avatarColor,
|
|
whiteSpace: 'nowrap',
|
|
textAlign: 'center',
|
|
verticalAlign: 'middle',
|
|
background: avatarBg,
|
|
border: `${lineWidth}px ${lineType} transparent`,
|
|
[`&-image`]: {
|
|
background: 'transparent'
|
|
},
|
|
[`${antCls}-image-img`]: {
|
|
display: 'block'
|
|
}
|
|
}), avatarSizeStyle(containerSize, textFontSize, borderRadius)), {
|
|
[`&-lg`]: Object.assign({}, avatarSizeStyle(containerSizeLG, textFontSizeLG, borderRadiusLG)),
|
|
[`&-sm`]: Object.assign({}, avatarSizeStyle(containerSizeSM, textFontSizeSM, borderRadiusSM)),
|
|
'> img': {
|
|
display: 'block',
|
|
width: '100%',
|
|
height: '100%',
|
|
objectFit: 'cover'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
const genGroupStyle = token => {
|
|
const {
|
|
componentCls,
|
|
groupBorderColor,
|
|
groupOverlapping,
|
|
groupSpace
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-group`]: {
|
|
display: 'inline-flex',
|
|
[`${componentCls}`]: {
|
|
borderColor: groupBorderColor
|
|
},
|
|
[`> *:not(:first-child)`]: {
|
|
marginInlineStart: groupOverlapping
|
|
}
|
|
},
|
|
[`${componentCls}-group-popover`]: {
|
|
[`${componentCls} + ${componentCls}`]: {
|
|
marginInlineStart: groupSpace
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/* harmony default export */ var avatar_style = ((0,genComponentStyleHook/* default */.Z)('Avatar', token => {
|
|
const {
|
|
colorTextLightSolid,
|
|
colorTextPlaceholder
|
|
} = token;
|
|
const avatarToken = (0,statistic/* merge */.TS)(token, {
|
|
avatarBg: colorTextPlaceholder,
|
|
avatarColor: colorTextLightSolid
|
|
});
|
|
return [genBaseStyle(avatarToken), genGroupStyle(avatarToken)];
|
|
}, token => {
|
|
const {
|
|
controlHeight,
|
|
controlHeightLG,
|
|
controlHeightSM,
|
|
fontSize,
|
|
fontSizeLG,
|
|
fontSizeXL,
|
|
fontSizeHeading3,
|
|
marginXS,
|
|
marginXXS,
|
|
colorBorderBg
|
|
} = token;
|
|
return {
|
|
containerSize: controlHeight,
|
|
containerSizeLG: controlHeightLG,
|
|
containerSizeSM: controlHeightSM,
|
|
textFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),
|
|
textFontSizeLG: fontSizeHeading3,
|
|
textFontSizeSM: fontSize,
|
|
groupSpace: marginXXS,
|
|
groupOverlapping: -marginXS,
|
|
groupBorderColor: colorBorderBg
|
|
};
|
|
}));
|
|
// 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/avatar/avatar.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 InternalAvatar = (props, ref) => {
|
|
const [scale, setScale] = _react_17_0_2_react.useState(1);
|
|
const [mounted, setMounted] = _react_17_0_2_react.useState(false);
|
|
const [isImgExist, setIsImgExist] = _react_17_0_2_react.useState(true);
|
|
const avatarNodeRef = _react_17_0_2_react.useRef(null);
|
|
const avatarChildrenRef = _react_17_0_2_react.useRef(null);
|
|
const avatarNodeMergeRef = (0,es_ref/* composeRef */.sQ)(ref, avatarNodeRef);
|
|
const {
|
|
getPrefixCls,
|
|
avatar
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const avatarCtx = _react_17_0_2_react.useContext(avatar_AvatarContext);
|
|
const setScaleParam = () => {
|
|
if (!avatarChildrenRef.current || !avatarNodeRef.current) {
|
|
return;
|
|
}
|
|
const childrenWidth = avatarChildrenRef.current.offsetWidth; // offsetWidth avoid affecting be transform scale
|
|
const nodeWidth = avatarNodeRef.current.offsetWidth;
|
|
// denominator is 0 is no meaning
|
|
if (childrenWidth !== 0 && nodeWidth !== 0) {
|
|
const {
|
|
gap = 4
|
|
} = props;
|
|
if (gap * 2 < nodeWidth) {
|
|
setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
|
|
}
|
|
}
|
|
};
|
|
_react_17_0_2_react.useEffect(() => {
|
|
setMounted(true);
|
|
}, []);
|
|
_react_17_0_2_react.useEffect(() => {
|
|
setIsImgExist(true);
|
|
setScale(1);
|
|
}, [props.src]);
|
|
_react_17_0_2_react.useEffect(setScaleParam, [props.gap]);
|
|
const handleImgLoadError = () => {
|
|
const {
|
|
onError
|
|
} = props;
|
|
const errorFlag = onError === null || onError === void 0 ? void 0 : onError();
|
|
if (errorFlag !== false) {
|
|
setIsImgExist(false);
|
|
}
|
|
};
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
shape,
|
|
size: customSize,
|
|
src,
|
|
srcSet,
|
|
icon,
|
|
className,
|
|
rootClassName,
|
|
alt,
|
|
draggable,
|
|
children,
|
|
crossOrigin
|
|
} = props,
|
|
others = __rest(props, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "alt", "draggable", "children", "crossOrigin"]);
|
|
const size = (0,useSize/* default */.Z)(ctxSize => {
|
|
var _a, _b;
|
|
return (_b = (_a = customSize !== null && customSize !== void 0 ? customSize : avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.size) !== null && _a !== void 0 ? _a : ctxSize) !== null && _b !== void 0 ? _b : 'default';
|
|
});
|
|
const needResponsive = Object.keys(typeof size === 'object' ? size || {} : {}).some(key => ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key));
|
|
const screens = (0,useBreakpoint/* default */.Z)(needResponsive);
|
|
const responsiveSizeStyle = _react_17_0_2_react.useMemo(() => {
|
|
if (typeof size !== 'object') {
|
|
return {};
|
|
}
|
|
const currentBreakpoint = responsiveObserver/* responsiveArray */.c4.find(screen => screens[screen]);
|
|
const currentSize = size[currentBreakpoint];
|
|
return currentSize ? {
|
|
width: currentSize,
|
|
height: currentSize,
|
|
lineHeight: `${currentSize}px`,
|
|
fontSize: icon ? currentSize / 2 : 18
|
|
} : {};
|
|
}, [screens, size]);
|
|
false ? 0 : void 0;
|
|
const prefixCls = getPrefixCls('avatar', customizePrefixCls);
|
|
const [wrapSSR, hashId] = avatar_style(prefixCls);
|
|
const sizeCls = _classnames_2_5_1_classnames_default()({
|
|
[`${prefixCls}-lg`]: size === 'large',
|
|
[`${prefixCls}-sm`]: size === 'small'
|
|
});
|
|
const hasImageElement = /*#__PURE__*/_react_17_0_2_react.isValidElement(src);
|
|
const mergedShape = shape || (avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.shape) || 'circle';
|
|
const classString = _classnames_2_5_1_classnames_default()(prefixCls, sizeCls, avatar === null || avatar === void 0 ? void 0 : avatar.className, `${prefixCls}-${mergedShape}`, {
|
|
[`${prefixCls}-image`]: hasImageElement || src && isImgExist,
|
|
[`${prefixCls}-icon`]: !!icon
|
|
}, className, rootClassName, hashId);
|
|
const sizeStyle = typeof size === 'number' ? {
|
|
width: size,
|
|
height: size,
|
|
lineHeight: `${size}px`,
|
|
fontSize: icon ? size / 2 : 18
|
|
} : {};
|
|
let childrenToRender;
|
|
if (typeof src === 'string' && isImgExist) {
|
|
childrenToRender = /*#__PURE__*/_react_17_0_2_react.createElement("img", {
|
|
src: src,
|
|
draggable: draggable,
|
|
srcSet: srcSet,
|
|
onError: handleImgLoadError,
|
|
alt: alt,
|
|
crossOrigin: crossOrigin
|
|
});
|
|
} else if (hasImageElement) {
|
|
childrenToRender = src;
|
|
} else if (icon) {
|
|
childrenToRender = icon;
|
|
} else if (mounted || scale !== 1) {
|
|
const transformString = `scale(${scale}) translateX(-50%)`;
|
|
const childrenStyle = {
|
|
msTransform: transformString,
|
|
WebkitTransform: transformString,
|
|
transform: transformString
|
|
};
|
|
const sizeChildrenStyle = typeof size === 'number' ? {
|
|
lineHeight: `${size}px`
|
|
} : {};
|
|
childrenToRender = /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, {
|
|
onResize: setScaleParam
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-string`,
|
|
ref: avatarChildrenRef,
|
|
style: Object.assign(Object.assign({}, sizeChildrenStyle), childrenStyle)
|
|
}, children));
|
|
} else {
|
|
childrenToRender = /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-string`,
|
|
style: {
|
|
opacity: 0
|
|
},
|
|
ref: avatarChildrenRef
|
|
}, children);
|
|
}
|
|
// The event is triggered twice from bubbling up the DOM tree.
|
|
// see https://codesandbox.io/s/kind-snow-9lidz
|
|
delete others.onError;
|
|
delete others.gap;
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, others, {
|
|
style: Object.assign(Object.assign(Object.assign(Object.assign({}, sizeStyle), responsiveSizeStyle), avatar === null || avatar === void 0 ? void 0 : avatar.style), others.style),
|
|
className: classString,
|
|
ref: avatarNodeMergeRef
|
|
}), childrenToRender));
|
|
};
|
|
const Avatar = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalAvatar);
|
|
if (false) {}
|
|
/* harmony default export */ var avatar = (Avatar);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(45659);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/popover/index.js
|
|
var popover = __webpack_require__(60324);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(92343);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/group.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AvatarContextProvider = props => {
|
|
const {
|
|
size,
|
|
shape
|
|
} = _react_17_0_2_react.useContext(avatar_AvatarContext);
|
|
const avatarContextValue = _react_17_0_2_react.useMemo(() => ({
|
|
size: props.size || size,
|
|
shape: props.shape || shape
|
|
}), [props.size, props.shape, size, shape]);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(avatar_AvatarContext.Provider, {
|
|
value: avatarContextValue
|
|
}, props.children);
|
|
};
|
|
const Group = props => {
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
maxCount,
|
|
maxStyle,
|
|
size,
|
|
shape,
|
|
maxPopoverPlacement = 'top',
|
|
maxPopoverTrigger = 'hover',
|
|
children
|
|
} = props;
|
|
const prefixCls = getPrefixCls('avatar', customizePrefixCls);
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
const [wrapSSR, hashId] = avatar_style(prefixCls);
|
|
const cls = _classnames_2_5_1_classnames_default()(groupPrefixCls, {
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const childrenWithProps = (0,toArray/* default */.Z)(children).map((child, index) => (0,reactNode/* cloneElement */.Tm)(child, {
|
|
key: `avatar-key-${index}`
|
|
}));
|
|
const numOfChildren = childrenWithProps.length;
|
|
if (maxCount && maxCount < numOfChildren) {
|
|
const childrenShow = childrenWithProps.slice(0, maxCount);
|
|
const childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);
|
|
childrenShow.push( /*#__PURE__*/_react_17_0_2_react.createElement(popover/* default */.Z, {
|
|
key: "avatar-popover-key",
|
|
content: childrenHidden,
|
|
trigger: maxPopoverTrigger,
|
|
placement: maxPopoverPlacement,
|
|
overlayClassName: `${groupPrefixCls}-popover`
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(avatar, {
|
|
style: maxStyle
|
|
}, `+${numOfChildren - maxCount}`)));
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(AvatarContextProvider, {
|
|
shape: shape,
|
|
size: size
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: cls,
|
|
style: style
|
|
}, childrenShow)));
|
|
}
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(AvatarContextProvider, {
|
|
shape: shape,
|
|
size: size
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: cls,
|
|
style: style
|
|
}, childrenWithProps)));
|
|
};
|
|
/* harmony default export */ var group = (Group);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
const avatar_Avatar = avatar;
|
|
avatar_Avatar.Group = group;
|
|
/* harmony default export */ var es_avatar = (avatar_Avatar);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 73755:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/list/index.js + 3 modules ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ list; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(49397);
|
|
// 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__(73495);
|
|
// 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);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 39722:
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/PurePanel.js ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ t5: function() { return /* binding */ RawPurePanel; }
|
|
/* harmony export */ });
|
|
/* unused harmony export getOverlay */
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var rc_tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-tooltip */ 55477);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 77578);
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style */ 17356);
|
|
"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 getOverlay = (prefixCls, title, content) => {
|
|
if (!title && !content) return undefined;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(react__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: `${prefixCls}-title`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: `${prefixCls}-inner-content`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(content)));
|
|
};
|
|
const RawPurePanel = props => {
|
|
const {
|
|
hashId,
|
|
prefixCls,
|
|
className,
|
|
style,
|
|
placement = 'top',
|
|
title,
|
|
content,
|
|
children
|
|
} = props;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className),
|
|
style: style
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: `${prefixCls}-arrow`
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(rc_tooltip__WEBPACK_IMPORTED_MODULE_1__/* .Popup */ .G, Object.assign({}, props, {
|
|
className: hashId,
|
|
prefixCls: prefixCls
|
|
}), children || getOverlay(prefixCls, title, content)));
|
|
};
|
|
const PurePanel = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_4__/* .ConfigContext */ .E_);
|
|
const prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(prefixCls);
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(RawPurePanel, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls,
|
|
hashId: hashId
|
|
})));
|
|
};
|
|
/* harmony default export */ __webpack_exports__.ZP = (PurePanel);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 60324:
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/index.js ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 77578);
|
|
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../_util/motion */ 62892);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ 6848);
|
|
/* harmony import */ var _PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PurePanel */ 39722);
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style */ 17356);
|
|
"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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSSINJS
|
|
|
|
const Overlay = _ref => {
|
|
let {
|
|
title,
|
|
content,
|
|
prefixCls
|
|
} = _ref;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
|
|
className: `${prefixCls}-title`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
|
|
className: `${prefixCls}-inner-content`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(content)));
|
|
};
|
|
const Popover = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
title,
|
|
content,
|
|
overlayClassName,
|
|
placement = 'top',
|
|
trigger = 'hover',
|
|
mouseEnterDelay = 0.1,
|
|
mouseLeaveDelay = 0.1,
|
|
overlayStyle = {}
|
|
} = props,
|
|
otherProps = __rest(props, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react__WEBPACK_IMPORTED_MODULE_1__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_3__/* .ConfigContext */ .E_);
|
|
const prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(prefixCls);
|
|
const rootPrefixCls = getPrefixCls();
|
|
const overlayCls = classnames__WEBPACK_IMPORTED_MODULE_0___default()(overlayClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, Object.assign({
|
|
placement: placement,
|
|
trigger: trigger,
|
|
mouseEnterDelay: mouseEnterDelay,
|
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
overlayStyle: overlayStyle
|
|
}, otherProps, {
|
|
prefixCls: prefixCls,
|
|
overlayClassName: overlayCls,
|
|
ref: ref,
|
|
overlay: title || content ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(Overlay, {
|
|
prefixCls: prefixCls,
|
|
title: title,
|
|
content: content
|
|
}) : null,
|
|
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_6__/* .getTransitionName */ .m)(rootPrefixCls, 'zoom-big', otherProps.transitionName),
|
|
"data-popover-inject": true
|
|
})));
|
|
});
|
|
if (false) {}
|
|
Popover._InternalPanelDoNotUseOrYouWillBeFired = _PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP;
|
|
/* harmony default export */ __webpack_exports__.Z = (Popover);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 17356:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/style/index.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 17313);
|
|
/* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/motion */ 29878);
|
|
/* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/placementArrow */ 19447);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 33166);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ 83116);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ 37613);
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const genBaseStyle = token => {
|
|
const {
|
|
componentCls,
|
|
popoverColor,
|
|
minWidth,
|
|
fontWeightStrong,
|
|
popoverPadding,
|
|
boxShadowSecondary,
|
|
colorTextHeading,
|
|
borderRadiusLG: borderRadius,
|
|
zIndexPopup,
|
|
marginXS,
|
|
colorBgElevated,
|
|
popoverBg
|
|
} = token;
|
|
return [{
|
|
[componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
position: 'absolute',
|
|
top: 0,
|
|
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
|
|
left: {
|
|
_skip_check_: true,
|
|
value: 0
|
|
},
|
|
zIndex: zIndexPopup,
|
|
fontWeight: 'normal',
|
|
whiteSpace: 'normal',
|
|
textAlign: 'start',
|
|
cursor: 'auto',
|
|
userSelect: 'text',
|
|
transformOrigin: `var(--arrow-x, 50%) var(--arrow-y, 50%)`,
|
|
'--antd-arrow-background-color': colorBgElevated,
|
|
'&-rtl': {
|
|
direction: 'rtl'
|
|
},
|
|
'&-hidden': {
|
|
display: 'none'
|
|
},
|
|
[`${componentCls}-content`]: {
|
|
position: 'relative'
|
|
},
|
|
[`${componentCls}-inner`]: {
|
|
backgroundColor: popoverBg,
|
|
backgroundClip: 'padding-box',
|
|
borderRadius,
|
|
boxShadow: boxShadowSecondary,
|
|
padding: popoverPadding
|
|
},
|
|
[`${componentCls}-title`]: {
|
|
minWidth,
|
|
marginBottom: marginXS,
|
|
color: colorTextHeading,
|
|
fontWeight: fontWeightStrong
|
|
},
|
|
[`${componentCls}-inner-content`]: {
|
|
color: popoverColor
|
|
}
|
|
})
|
|
},
|
|
// Arrow Style
|
|
(0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(token, {
|
|
colorBg: 'var(--antd-arrow-background-color)'
|
|
}),
|
|
// Pure Render
|
|
{
|
|
[`${componentCls}-pure`]: {
|
|
position: 'relative',
|
|
maxWidth: 'none',
|
|
margin: token.sizePopupArrow,
|
|
display: 'inline-block',
|
|
[`${componentCls}-content`]: {
|
|
display: 'inline-block'
|
|
}
|
|
}
|
|
}];
|
|
};
|
|
const genColorStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: _theme_internal__WEBPACK_IMPORTED_MODULE_2__/* .PresetColors */ .i.map(colorKey => {
|
|
const lightColor = token[`${colorKey}6`];
|
|
return {
|
|
[`&${componentCls}-${colorKey}`]: {
|
|
'--antd-arrow-background-color': lightColor,
|
|
[`${componentCls}-inner`]: {
|
|
backgroundColor: lightColor
|
|
},
|
|
[`${componentCls}-arrow`]: {
|
|
background: 'transparent'
|
|
}
|
|
}
|
|
};
|
|
})
|
|
};
|
|
};
|
|
const genWireframeStyle = token => {
|
|
const {
|
|
componentCls,
|
|
lineWidth,
|
|
lineType,
|
|
colorSplit,
|
|
paddingSM,
|
|
controlHeight,
|
|
fontSize,
|
|
lineHeight,
|
|
padding
|
|
} = token;
|
|
const titlePaddingBlockDist = controlHeight - Math.round(fontSize * lineHeight);
|
|
const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
|
|
const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
|
|
const popoverPaddingHorizontal = padding;
|
|
return {
|
|
[componentCls]: {
|
|
[`${componentCls}-inner`]: {
|
|
padding: 0
|
|
},
|
|
[`${componentCls}-title`]: {
|
|
margin: 0,
|
|
padding: `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px`,
|
|
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`
|
|
},
|
|
[`${componentCls}-inner-content`]: {
|
|
padding: `${paddingSM}px ${popoverPaddingHorizontal}px`
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)('Popover', token => {
|
|
const {
|
|
colorBgElevated,
|
|
colorText,
|
|
wireframe
|
|
} = token;
|
|
const popoverToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__/* .merge */ .TS)(token, {
|
|
popoverPadding: 12,
|
|
popoverBg: colorBgElevated,
|
|
popoverColor: colorText
|
|
});
|
|
return [genBaseStyle(popoverToken), genColorStyle(popoverToken), wireframe && genWireframeStyle(popoverToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_5__/* .initZoomMotion */ ._y)(popoverToken, 'zoom-big')];
|
|
}, token => ({
|
|
width: 177,
|
|
minWidth: 177,
|
|
zIndexPopup: token.zIndexPopupBase + 30
|
|
}), {
|
|
resetStyle: false,
|
|
deprecatedTokens: [['width', 'minWidth']]
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 51581:
|
|
/*!****************************************************************************************************!*\
|
|
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/dist/InfiniteScroll.js ***!
|
|
\****************************************************************************************************/
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _react = __webpack_require__(/*! react */ 59301);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _propTypes = __webpack_require__(/*! prop-types */ 12708);
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var InfiniteScroll = function (_Component) {
|
|
_inherits(InfiniteScroll, _Component);
|
|
|
|
function InfiniteScroll(props) {
|
|
_classCallCheck(this, InfiniteScroll);
|
|
|
|
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
|
|
|
|
_this.scrollListener = _this.scrollListener.bind(_this);
|
|
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
|
|
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
|
|
return _this;
|
|
}
|
|
|
|
_createClass(InfiniteScroll, [{
|
|
key: 'componentDidMount',
|
|
value: function componentDidMount() {
|
|
this.pageLoaded = this.props.pageStart;
|
|
this.options = this.eventListenerOptions();
|
|
this.attachScrollListener();
|
|
}
|
|
}, {
|
|
key: 'componentDidUpdate',
|
|
value: function componentDidUpdate() {
|
|
if (this.props.isReverse && this.loadMore) {
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
|
|
this.loadMore = false;
|
|
}
|
|
this.attachScrollListener();
|
|
}
|
|
}, {
|
|
key: 'componentWillUnmount',
|
|
value: function componentWillUnmount() {
|
|
this.detachScrollListener();
|
|
this.detachMousewheelListener();
|
|
}
|
|
}, {
|
|
key: 'isPassiveSupported',
|
|
value: function isPassiveSupported() {
|
|
var passive = false;
|
|
|
|
var testOptions = {
|
|
get passive() {
|
|
passive = true;
|
|
}
|
|
};
|
|
|
|
try {
|
|
document.addEventListener('test', null, testOptions);
|
|
document.removeEventListener('test', null, testOptions);
|
|
} catch (e) {
|
|
// ignore
|
|
}
|
|
return passive;
|
|
}
|
|
}, {
|
|
key: 'eventListenerOptions',
|
|
value: function eventListenerOptions() {
|
|
var options = this.props.useCapture;
|
|
|
|
if (this.isPassiveSupported()) {
|
|
options = {
|
|
useCapture: this.props.useCapture,
|
|
passive: true
|
|
};
|
|
}
|
|
return options;
|
|
}
|
|
|
|
// Set a defaut loader for all your `InfiniteScroll` components
|
|
|
|
}, {
|
|
key: 'setDefaultLoader',
|
|
value: function setDefaultLoader(loader) {
|
|
this.defaultLoader = loader;
|
|
}
|
|
}, {
|
|
key: 'detachMousewheelListener',
|
|
value: function detachMousewheelListener() {
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = this.scrollComponent.parentNode;
|
|
}
|
|
|
|
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
}
|
|
}, {
|
|
key: 'detachScrollListener',
|
|
value: function detachScrollListener() {
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = this.getParentElement(this.scrollComponent);
|
|
}
|
|
|
|
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
}
|
|
}, {
|
|
key: 'getParentElement',
|
|
value: function getParentElement(el) {
|
|
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
|
|
if (scrollParent != null) {
|
|
return scrollParent;
|
|
}
|
|
return el && el.parentNode;
|
|
}
|
|
}, {
|
|
key: 'filterProps',
|
|
value: function filterProps(props) {
|
|
return props;
|
|
}
|
|
}, {
|
|
key: 'attachScrollListener',
|
|
value: function attachScrollListener() {
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
|
|
if (!this.props.hasMore || !parentElement) {
|
|
return;
|
|
}
|
|
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = parentElement;
|
|
}
|
|
|
|
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
|
if (this.props.initialLoad) {
|
|
this.scrollListener();
|
|
}
|
|
}
|
|
}, {
|
|
key: 'mousewheelListener',
|
|
value: function mousewheelListener(e) {
|
|
// Prevents Chrome hangups
|
|
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
|
|
if (e.deltaY === 1 && !this.isPassiveSupported()) {
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
}, {
|
|
key: 'scrollListener',
|
|
value: function scrollListener() {
|
|
var el = this.scrollComponent;
|
|
var scrollEl = window;
|
|
var parentNode = this.getParentElement(el);
|
|
|
|
var offset = void 0;
|
|
if (this.props.useWindow) {
|
|
var doc = document.documentElement || document.body.parentNode || document.body;
|
|
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
|
|
if (this.props.isReverse) {
|
|
offset = scrollTop;
|
|
} else {
|
|
offset = this.calculateOffset(el, scrollTop);
|
|
}
|
|
} else if (this.props.isReverse) {
|
|
offset = parentNode.scrollTop;
|
|
} else {
|
|
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
|
|
}
|
|
|
|
// Here we make sure the element is visible as well as checking the offset
|
|
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
|
|
this.detachScrollListener();
|
|
this.beforeScrollHeight = parentNode.scrollHeight;
|
|
this.beforeScrollTop = parentNode.scrollTop;
|
|
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
|
|
if (typeof this.props.loadMore === 'function') {
|
|
this.props.loadMore(this.pageLoaded += 1);
|
|
this.loadMore = true;
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
key: 'calculateOffset',
|
|
value: function calculateOffset(el, scrollTop) {
|
|
if (!el) {
|
|
return 0;
|
|
}
|
|
|
|
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
|
|
}
|
|
}, {
|
|
key: 'calculateTopPosition',
|
|
value: function calculateTopPosition(el) {
|
|
if (!el) {
|
|
return 0;
|
|
}
|
|
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
|
|
}
|
|
}, {
|
|
key: 'render',
|
|
value: function render() {
|
|
var _this2 = this;
|
|
|
|
var renderProps = this.filterProps(this.props);
|
|
|
|
var children = renderProps.children,
|
|
element = renderProps.element,
|
|
hasMore = renderProps.hasMore,
|
|
initialLoad = renderProps.initialLoad,
|
|
isReverse = renderProps.isReverse,
|
|
loader = renderProps.loader,
|
|
loadMore = renderProps.loadMore,
|
|
pageStart = renderProps.pageStart,
|
|
ref = renderProps.ref,
|
|
threshold = renderProps.threshold,
|
|
useCapture = renderProps.useCapture,
|
|
useWindow = renderProps.useWindow,
|
|
getScrollParent = renderProps.getScrollParent,
|
|
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
|
|
|
|
props.ref = function (node) {
|
|
_this2.scrollComponent = node;
|
|
if (ref) {
|
|
ref(node);
|
|
}
|
|
};
|
|
|
|
var childrenArray = [children];
|
|
if (hasMore) {
|
|
if (loader) {
|
|
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
|
|
} else if (this.defaultLoader) {
|
|
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
|
|
}
|
|
}
|
|
return _react2.default.createElement(element, props, childrenArray);
|
|
}
|
|
}]);
|
|
|
|
return InfiniteScroll;
|
|
}(_react.Component);
|
|
|
|
InfiniteScroll.propTypes = {
|
|
children: _propTypes2.default.node.isRequired,
|
|
element: _propTypes2.default.node,
|
|
hasMore: _propTypes2.default.bool,
|
|
initialLoad: _propTypes2.default.bool,
|
|
isReverse: _propTypes2.default.bool,
|
|
loader: _propTypes2.default.node,
|
|
loadMore: _propTypes2.default.func.isRequired,
|
|
pageStart: _propTypes2.default.number,
|
|
ref: _propTypes2.default.func,
|
|
getScrollParent: _propTypes2.default.func,
|
|
threshold: _propTypes2.default.number,
|
|
useCapture: _propTypes2.default.bool,
|
|
useWindow: _propTypes2.default.bool
|
|
};
|
|
InfiniteScroll.defaultProps = {
|
|
element: 'div',
|
|
hasMore: false,
|
|
initialLoad: true,
|
|
pageStart: 0,
|
|
ref: null,
|
|
threshold: 250,
|
|
useWindow: true,
|
|
isReverse: false,
|
|
useCapture: false,
|
|
loader: null,
|
|
getScrollParent: null
|
|
};
|
|
exports["default"] = InfiniteScroll;
|
|
module.exports = exports['default'];
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26724:
|
|
/*!**************************************************************************************!*\
|
|
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js ***!
|
|
\**************************************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 51581)
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |