first commit
This commit is contained in:
14
frontend/node_modules/antd/lib/back-top/index.d.ts
generated
vendored
Normal file
14
frontend/node_modules/antd/lib/back-top/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
export interface BackTopProps {
|
||||
visibilityHeight?: number;
|
||||
onClick?: React.MouseEventHandler<HTMLElement>;
|
||||
target?: () => HTMLElement | Window | Document;
|
||||
prefixCls?: string;
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
style?: React.CSSProperties;
|
||||
duration?: number;
|
||||
}
|
||||
declare const BackTop: React.FC<BackTopProps>;
|
||||
export default BackTop;
|
||||
100
frontend/node_modules/antd/lib/back-top/index.js
generated
vendored
Normal file
100
frontend/node_modules/antd/lib/back-top/index.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _VerticalAlignTopOutlined = _interopRequireDefault(require("@ant-design/icons/VerticalAlignTopOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcMotion = _interopRequireDefault(require("rc-motion"));
|
||||
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
||||
var _getScroll = _interopRequireDefault(require("../_util/getScroll"));
|
||||
var _reactNode = require("../_util/reactNode");
|
||||
var _scrollTo = _interopRequireDefault(require("../_util/scrollTo"));
|
||||
var _throttleByAnimationFrame = _interopRequireDefault(require("../_util/throttleByAnimationFrame"));
|
||||
var _warning = require("../_util/warning");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
const BackTop = props => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
rootClassName,
|
||||
visibilityHeight = 400,
|
||||
target,
|
||||
onClick,
|
||||
duration = 450
|
||||
} = props;
|
||||
const [visible, setVisible] = React.useState(visibilityHeight === 0);
|
||||
const ref = React.useRef(null);
|
||||
const getDefaultTarget = () => {
|
||||
var _a;
|
||||
return ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) || window;
|
||||
};
|
||||
const handleScroll = (0, _throttleByAnimationFrame.default)(e => {
|
||||
const scrollTop = (0, _getScroll.default)(e.target);
|
||||
setVisible(scrollTop >= visibilityHeight);
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('BackTop');
|
||||
warning.deprecated(false, 'BackTop', 'FloatButton.BackTop');
|
||||
}
|
||||
React.useEffect(() => {
|
||||
const getTarget = target || getDefaultTarget;
|
||||
const container = getTarget();
|
||||
handleScroll({
|
||||
target: container
|
||||
});
|
||||
container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);
|
||||
return () => {
|
||||
handleScroll.cancel();
|
||||
container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);
|
||||
};
|
||||
}, [target]);
|
||||
const scrollToTop = e => {
|
||||
(0, _scrollTo.default)(0, {
|
||||
getContainer: target || getDefaultTarget,
|
||||
duration
|
||||
});
|
||||
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
||||
};
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction
|
||||
} = React.useContext(_configProvider.ConfigContext);
|
||||
const prefixCls = getPrefixCls('back-top', customizePrefixCls);
|
||||
const rootPrefixCls = getPrefixCls();
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls);
|
||||
const classString = (0, _classnames.default)(hashId, cssVarCls, prefixCls, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, className, rootClassName);
|
||||
// fix https://fb.me/react-unknown-prop
|
||||
const divProps = (0, _omit.default)(props, ['prefixCls', 'className', 'rootClassName', 'children', 'visibilityHeight', 'target']);
|
||||
const defaultElement = /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-content`
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-icon`
|
||||
}, /*#__PURE__*/React.createElement(_VerticalAlignTopOutlined.default, null)));
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", Object.assign({}, divProps, {
|
||||
className: classString,
|
||||
onClick: scrollToTop,
|
||||
ref: ref
|
||||
}), /*#__PURE__*/React.createElement(_rcMotion.default, {
|
||||
visible: visible,
|
||||
motionName: `${rootPrefixCls}-fade`
|
||||
}, ({
|
||||
className: motionClassName
|
||||
}) => (0, _reactNode.cloneElement)(props.children || defaultElement, ({
|
||||
className: cloneCls
|
||||
}) => ({
|
||||
className: (0, _classnames.default)(motionClassName, cloneCls)
|
||||
})))));
|
||||
};
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
BackTop.displayName = 'BackTop';
|
||||
}
|
||||
var _default = exports.default = BackTop;
|
||||
12
frontend/node_modules/antd/lib/back-top/style/index.d.ts
generated
vendored
Normal file
12
frontend/node_modules/antd/lib/back-top/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 弹出层的 z-index
|
||||
* @descEN z-index of popup
|
||||
*/
|
||||
zIndexPopup: number;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'BackTop'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
99
frontend/node_modules/antd/lib/back-top/style/index.js
generated
vendored
Normal file
99
frontend/node_modules/antd/lib/back-top/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
// ============================== Shared ==============================
|
||||
const genSharedBackTopStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
backTopFontSize,
|
||||
backTopSize,
|
||||
zIndexPopup
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
position: 'fixed',
|
||||
insetInlineEnd: token.backTopInlineEnd,
|
||||
insetBlockEnd: token.backTopBlockEnd,
|
||||
zIndex: zIndexPopup,
|
||||
width: 40,
|
||||
height: 40,
|
||||
cursor: 'pointer',
|
||||
'&:empty': {
|
||||
display: 'none'
|
||||
},
|
||||
[`${componentCls}-content`]: {
|
||||
width: backTopSize,
|
||||
height: backTopSize,
|
||||
overflow: 'hidden',
|
||||
color: token.backTopColor,
|
||||
textAlign: 'center',
|
||||
backgroundColor: token.backTopBackground,
|
||||
borderRadius: backTopSize,
|
||||
transition: `all ${token.motionDurationMid}`,
|
||||
'&:hover': {
|
||||
backgroundColor: token.backTopHoverBackground,
|
||||
transition: `all ${token.motionDurationMid}`
|
||||
}
|
||||
},
|
||||
// change to .backtop .backtop-icon
|
||||
[`${componentCls}-icon`]: {
|
||||
fontSize: backTopFontSize,
|
||||
lineHeight: (0, _cssinjs.unit)(backTopSize)
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
const genMediaBackTopStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
screenMD,
|
||||
screenXS,
|
||||
backTopInlineEndMD,
|
||||
backTopInlineEndXS
|
||||
} = token;
|
||||
return {
|
||||
[`@media (max-width: ${(0, _cssinjs.unit)(screenMD)})`]: {
|
||||
[componentCls]: {
|
||||
insetInlineEnd: backTopInlineEndMD
|
||||
}
|
||||
},
|
||||
[`@media (max-width: ${(0, _cssinjs.unit)(screenXS)})`]: {
|
||||
[componentCls]: {
|
||||
insetInlineEnd: backTopInlineEndXS
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const prepareComponentToken = token => ({
|
||||
zIndexPopup: token.zIndexBase + 10
|
||||
});
|
||||
// ============================== Export ==============================
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('BackTop', token => {
|
||||
const {
|
||||
fontSizeHeading3,
|
||||
colorTextDescription,
|
||||
colorTextLightSolid,
|
||||
colorText,
|
||||
controlHeightLG,
|
||||
calc
|
||||
} = token;
|
||||
const backTopToken = (0, _internal.mergeToken)(token, {
|
||||
backTopBackground: colorTextDescription,
|
||||
backTopColor: colorTextLightSolid,
|
||||
backTopHoverBackground: colorText,
|
||||
backTopFontSize: fontSizeHeading3,
|
||||
backTopSize: controlHeightLG,
|
||||
backTopBlockEnd: calc(controlHeightLG).mul(1.25).equal(),
|
||||
backTopInlineEnd: calc(controlHeightLG).mul(2.5).equal(),
|
||||
backTopInlineEndMD: calc(controlHeightLG).mul(1.5).equal(),
|
||||
backTopInlineEndXS: calc(controlHeightLG).mul(0.5).equal()
|
||||
});
|
||||
return [genSharedBackTopStyle(backTopToken), genMediaBackTopStyle(backTopToken)];
|
||||
}, prepareComponentToken);
|
||||
Reference in New Issue
Block a user