first commit
This commit is contained in:
21
frontend/node_modules/antd/es/dropdown/dropdown-button.d.ts
generated
vendored
Normal file
21
frontend/node_modules/antd/es/dropdown/dropdown-button.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as React from 'react';
|
||||
import type { ButtonHTMLType, ButtonProps } from '../button';
|
||||
import type { ButtonGroupProps } from '../button/button-group';
|
||||
import type { DropdownProps } from './dropdown';
|
||||
export type DropdownButtonType = 'default' | 'primary' | 'dashed' | 'link' | 'text';
|
||||
export interface DropdownButtonProps extends ButtonGroupProps, DropdownProps {
|
||||
type?: DropdownButtonType;
|
||||
htmlType?: ButtonHTMLType;
|
||||
danger?: boolean;
|
||||
disabled?: boolean;
|
||||
loading?: ButtonProps['loading'];
|
||||
onClick?: React.MouseEventHandler<HTMLElement>;
|
||||
icon?: React.ReactNode;
|
||||
href?: string;
|
||||
children?: React.ReactNode;
|
||||
title?: string;
|
||||
buttonsRender?: (buttons: React.ReactNode[]) => React.ReactNode[];
|
||||
}
|
||||
type CompoundedComponent = React.FC<DropdownButtonProps> & {};
|
||||
declare const DropdownButton: CompoundedComponent;
|
||||
export default DropdownButton;
|
||||
120
frontend/node_modules/antd/es/dropdown/dropdown-button.js
generated
vendored
Normal file
120
frontend/node_modules/antd/es/dropdown/dropdown-button.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__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;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import EllipsisOutlined from "@ant-design/icons/es/icons/EllipsisOutlined";
|
||||
import classNames from 'classnames';
|
||||
import Button from '../button';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Space from '../space';
|
||||
import { useCompactItemContext } from '../space/Compact';
|
||||
import Dropdown from './dropdown';
|
||||
const DropdownButton = props => {
|
||||
const {
|
||||
getPopupContainer: getContextPopupContainer,
|
||||
getPrefixCls,
|
||||
direction
|
||||
} = React.useContext(ConfigContext);
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
type = 'default',
|
||||
danger,
|
||||
disabled,
|
||||
loading,
|
||||
onClick,
|
||||
htmlType,
|
||||
children,
|
||||
className,
|
||||
menu,
|
||||
arrow,
|
||||
autoFocus,
|
||||
overlay,
|
||||
trigger,
|
||||
align,
|
||||
open,
|
||||
onOpenChange,
|
||||
placement,
|
||||
getPopupContainer,
|
||||
href,
|
||||
icon = /*#__PURE__*/React.createElement(EllipsisOutlined, null),
|
||||
title,
|
||||
buttonsRender = buttons => buttons,
|
||||
mouseEnterDelay,
|
||||
mouseLeaveDelay,
|
||||
overlayClassName,
|
||||
overlayStyle,
|
||||
destroyOnHidden,
|
||||
destroyPopupOnHide,
|
||||
dropdownRender,
|
||||
popupRender
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyOnHidden", "destroyPopupOnHide", "dropdownRender", "popupRender"]);
|
||||
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
||||
const buttonPrefixCls = `${prefixCls}-button`;
|
||||
const mergedPopupRender = popupRender || dropdownRender;
|
||||
const dropdownProps = {
|
||||
menu,
|
||||
arrow,
|
||||
autoFocus,
|
||||
align,
|
||||
disabled,
|
||||
trigger: disabled ? [] : trigger,
|
||||
onOpenChange,
|
||||
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
||||
mouseEnterDelay,
|
||||
mouseLeaveDelay,
|
||||
overlayClassName,
|
||||
overlayStyle,
|
||||
destroyOnHidden,
|
||||
popupRender: mergedPopupRender
|
||||
};
|
||||
const {
|
||||
compactSize,
|
||||
compactItemClassnames
|
||||
} = useCompactItemContext(prefixCls, direction);
|
||||
const classes = classNames(buttonPrefixCls, compactItemClassnames, className);
|
||||
if ('destroyPopupOnHide' in props) {
|
||||
dropdownProps.destroyPopupOnHide = destroyPopupOnHide;
|
||||
}
|
||||
if ('overlay' in props) {
|
||||
dropdownProps.overlay = overlay;
|
||||
}
|
||||
if ('open' in props) {
|
||||
dropdownProps.open = open;
|
||||
}
|
||||
if ('placement' in props) {
|
||||
dropdownProps.placement = placement;
|
||||
} else {
|
||||
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
||||
}
|
||||
const leftButton = /*#__PURE__*/React.createElement(Button, {
|
||||
type: type,
|
||||
danger: danger,
|
||||
disabled: disabled,
|
||||
loading: loading,
|
||||
onClick: onClick,
|
||||
htmlType: htmlType,
|
||||
href: href,
|
||||
title: title
|
||||
}, children);
|
||||
const rightButton = /*#__PURE__*/React.createElement(Button, {
|
||||
type: type,
|
||||
danger: danger,
|
||||
icon: icon
|
||||
});
|
||||
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
|
||||
return /*#__PURE__*/React.createElement(Space.Compact, Object.assign({
|
||||
className: classes,
|
||||
size: compactSize,
|
||||
block: true
|
||||
}, restProps), leftButtonToRender, /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, dropdownProps), rightButtonToRender));
|
||||
};
|
||||
DropdownButton.__ANT_BUTTON = true;
|
||||
export default DropdownButton;
|
||||
60
frontend/node_modules/antd/es/dropdown/dropdown.d.ts
generated
vendored
Normal file
60
frontend/node_modules/antd/es/dropdown/dropdown.d.ts
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import * as React from 'react';
|
||||
import type { AlignType } from '@rc-component/trigger';
|
||||
import type { MenuProps as RcMenuProps } from 'rc-menu';
|
||||
import type { AdjustOverflow } from '../_util/placements';
|
||||
import type { MenuProps } from '../menu';
|
||||
declare const _Placements: readonly ["topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight", "top", "bottom"];
|
||||
type Placement = (typeof _Placements)[number];
|
||||
type OverlayFunc = () => React.ReactElement;
|
||||
export type DropdownArrowOptions = {
|
||||
pointAtCenter?: boolean;
|
||||
};
|
||||
export interface DropdownProps {
|
||||
menu?: MenuProps & {
|
||||
activeKey?: RcMenuProps['activeKey'];
|
||||
};
|
||||
autoFocus?: boolean;
|
||||
arrow?: boolean | DropdownArrowOptions;
|
||||
trigger?: ('click' | 'hover' | 'contextMenu')[];
|
||||
/** @deprecated Please use `popupRender` instead */
|
||||
dropdownRender?: (originNode: React.ReactNode) => React.ReactNode;
|
||||
popupRender?: (originNode: React.ReactNode) => React.ReactNode;
|
||||
onOpenChange?: (open: boolean, info: {
|
||||
source: 'trigger' | 'menu';
|
||||
}) => void;
|
||||
open?: boolean;
|
||||
disabled?: boolean;
|
||||
/** @deprecated Please use `destroyOnHidden` instead */
|
||||
destroyPopupOnHide?: boolean;
|
||||
/**
|
||||
* @since 5.25.0
|
||||
*/
|
||||
destroyOnHidden?: boolean;
|
||||
align?: AlignType;
|
||||
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
transitionName?: string;
|
||||
placement?: Placement;
|
||||
overlayClassName?: string;
|
||||
overlayStyle?: React.CSSProperties;
|
||||
forceRender?: boolean;
|
||||
mouseEnterDelay?: number;
|
||||
mouseLeaveDelay?: number;
|
||||
openClassName?: string;
|
||||
children?: React.ReactNode;
|
||||
autoAdjustOverflow?: boolean | AdjustOverflow;
|
||||
/** @deprecated Please use `menu` instead */
|
||||
overlay?: React.ReactElement | OverlayFunc;
|
||||
/** @deprecated Please use `open` instead */
|
||||
visible?: boolean;
|
||||
/** @deprecated Please use `onOpenChange` instead */
|
||||
onVisibleChange?: (open: boolean) => void;
|
||||
}
|
||||
type CompoundedComponent = React.FC<DropdownProps> & {
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof WrapPurePanel;
|
||||
};
|
||||
declare const Dropdown: CompoundedComponent;
|
||||
declare const WrapPurePanel: React.FC<DropdownProps>;
|
||||
export default Dropdown;
|
||||
216
frontend/node_modules/antd/es/dropdown/dropdown.js
generated
vendored
Normal file
216
frontend/node_modules/antd/es/dropdown/dropdown.js
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import LeftOutlined from "@ant-design/icons/es/icons/LeftOutlined";
|
||||
import RightOutlined from "@ant-design/icons/es/icons/RightOutlined";
|
||||
import classNames from 'classnames';
|
||||
import RcDropdown from 'rc-dropdown';
|
||||
import useEvent from "rc-util/es/hooks/useEvent";
|
||||
import useMergedState from "rc-util/es/hooks/useMergedState";
|
||||
import omit from "rc-util/es/omit";
|
||||
import { useZIndex } from '../_util/hooks';
|
||||
import isPrimitive from '../_util/isPrimitive';
|
||||
import getPlacements from '../_util/placements';
|
||||
import genPurePanel from '../_util/PurePanel';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import { devUseWarning } from '../_util/warning';
|
||||
import zIndexContext from '../_util/zindexContext';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
||||
import Menu from '../menu';
|
||||
import { OverrideProvider } from '../menu/OverrideContext';
|
||||
import { useToken } from '../theme/internal';
|
||||
import useStyle from './style';
|
||||
const _Placements = ['topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight', 'top', 'bottom'];
|
||||
const Dropdown = props => {
|
||||
var _a;
|
||||
const {
|
||||
menu,
|
||||
arrow,
|
||||
prefixCls: customizePrefixCls,
|
||||
children,
|
||||
trigger,
|
||||
disabled,
|
||||
dropdownRender,
|
||||
popupRender,
|
||||
getPopupContainer,
|
||||
overlayClassName,
|
||||
rootClassName,
|
||||
overlayStyle,
|
||||
open,
|
||||
onOpenChange,
|
||||
// Deprecated
|
||||
visible,
|
||||
onVisibleChange,
|
||||
mouseEnterDelay = 0.15,
|
||||
mouseLeaveDelay = 0.1,
|
||||
autoAdjustOverflow = true,
|
||||
placement = '',
|
||||
overlay,
|
||||
transitionName,
|
||||
destroyOnHidden,
|
||||
destroyPopupOnHide
|
||||
} = props;
|
||||
const {
|
||||
getPopupContainer: getContextPopupContainer,
|
||||
getPrefixCls,
|
||||
direction,
|
||||
dropdown
|
||||
} = React.useContext(ConfigContext);
|
||||
const mergedPopupRender = popupRender || dropdownRender;
|
||||
// Warning for deprecated usage
|
||||
const warning = devUseWarning('Dropdown');
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const deprecatedProps = {
|
||||
visible: 'open',
|
||||
onVisibleChange: 'onOpenChange',
|
||||
overlay: 'menu',
|
||||
dropdownRender: 'popupRender',
|
||||
destroyPopupOnHide: 'destroyOnHidden'
|
||||
};
|
||||
Object.entries(deprecatedProps).forEach(([deprecatedName, newName]) => {
|
||||
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
|
||||
});
|
||||
if (placement.includes('Center')) {
|
||||
warning.deprecated(!placement.includes('Center'), `placement: ${placement}`, `placement: ${placement.slice(0, placement.indexOf('Center'))}`);
|
||||
}
|
||||
}
|
||||
const memoTransitionName = React.useMemo(() => {
|
||||
const rootPrefixCls = getPrefixCls();
|
||||
if (transitionName !== undefined) {
|
||||
return transitionName;
|
||||
}
|
||||
if (placement.includes('top')) {
|
||||
return `${rootPrefixCls}-slide-down`;
|
||||
}
|
||||
return `${rootPrefixCls}-slide-up`;
|
||||
}, [getPrefixCls, placement, transitionName]);
|
||||
const memoPlacement = React.useMemo(() => {
|
||||
if (!placement) {
|
||||
return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
|
||||
}
|
||||
if (placement.includes('Center')) {
|
||||
return placement.slice(0, placement.indexOf('Center'));
|
||||
}
|
||||
return placement;
|
||||
}, [placement, direction]);
|
||||
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
||||
const rootCls = useCSSVarCls(prefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);
|
||||
const [, token] = useToken();
|
||||
const child = React.Children.only(isPrimitive(children) ? /*#__PURE__*/React.createElement("span", null, children) : children);
|
||||
const popupTrigger = cloneElement(child, {
|
||||
className: classNames(`${prefixCls}-trigger`, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, child.props.className),
|
||||
disabled: (_a = child.props.disabled) !== null && _a !== void 0 ? _a : disabled
|
||||
});
|
||||
const triggerActions = disabled ? [] : trigger;
|
||||
const alignPoint = !!(triggerActions === null || triggerActions === void 0 ? void 0 : triggerActions.includes('contextMenu'));
|
||||
// =========================== Open ============================
|
||||
const [mergedOpen, setOpen] = useMergedState(false, {
|
||||
value: open !== null && open !== void 0 ? open : visible
|
||||
});
|
||||
const onInnerOpenChange = useEvent(nextOpen => {
|
||||
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen, {
|
||||
source: 'trigger'
|
||||
});
|
||||
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(nextOpen);
|
||||
setOpen(nextOpen);
|
||||
});
|
||||
// =========================== Overlay ============================
|
||||
const overlayClassNameCustomized = classNames(overlayClassName, rootClassName, hashId, cssVarCls, rootCls, dropdown === null || dropdown === void 0 ? void 0 : dropdown.className, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
});
|
||||
const builtinPlacements = getPlacements({
|
||||
arrowPointAtCenter: typeof arrow === 'object' && arrow.pointAtCenter,
|
||||
autoAdjustOverflow,
|
||||
offset: token.marginXXS,
|
||||
arrowWidth: arrow ? token.sizePopupArrow : 0,
|
||||
borderRadius: token.borderRadius
|
||||
});
|
||||
const onMenuClick = useEvent(() => {
|
||||
if ((menu === null || menu === void 0 ? void 0 : menu.selectable) && (menu === null || menu === void 0 ? void 0 : menu.multiple)) {
|
||||
return;
|
||||
}
|
||||
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false, {
|
||||
source: 'menu'
|
||||
});
|
||||
setOpen(false);
|
||||
});
|
||||
const renderOverlay = () => {
|
||||
// rc-dropdown already can process the function of overlay, but we have check logic here.
|
||||
// So we need render the element to check and pass back to rc-dropdown.
|
||||
let overlayNode;
|
||||
if (menu === null || menu === void 0 ? void 0 : menu.items) {
|
||||
overlayNode = /*#__PURE__*/React.createElement(Menu, Object.assign({}, menu));
|
||||
} else if (typeof overlay === 'function') {
|
||||
overlayNode = overlay();
|
||||
} else {
|
||||
overlayNode = overlay;
|
||||
}
|
||||
if (mergedPopupRender) {
|
||||
overlayNode = mergedPopupRender(overlayNode);
|
||||
}
|
||||
overlayNode = React.Children.only(typeof overlayNode === 'string' ? /*#__PURE__*/React.createElement("span", null, overlayNode) : overlayNode);
|
||||
return /*#__PURE__*/React.createElement(OverrideProvider, {
|
||||
prefixCls: `${prefixCls}-menu`,
|
||||
rootClassName: classNames(cssVarCls, rootCls),
|
||||
expandIcon: /*#__PURE__*/React.createElement("span", {
|
||||
className: `${prefixCls}-menu-submenu-arrow`
|
||||
}, direction === 'rtl' ? (/*#__PURE__*/React.createElement(LeftOutlined, {
|
||||
className: `${prefixCls}-menu-submenu-arrow-icon`
|
||||
})) : (/*#__PURE__*/React.createElement(RightOutlined, {
|
||||
className: `${prefixCls}-menu-submenu-arrow-icon`
|
||||
}))),
|
||||
mode: "vertical",
|
||||
selectable: false,
|
||||
onClick: onMenuClick,
|
||||
validator: ({
|
||||
mode
|
||||
}) => {
|
||||
// Warning if use other mode
|
||||
process.env.NODE_ENV !== "production" ? warning(!mode || mode === 'vertical', 'usage', `mode="${mode}" is not supported for Dropdown's Menu.`) : void 0;
|
||||
}
|
||||
}, overlayNode);
|
||||
};
|
||||
// =========================== zIndex ============================
|
||||
const [zIndex, contextZIndex] = useZIndex('Dropdown', overlayStyle === null || overlayStyle === void 0 ? void 0 : overlayStyle.zIndex);
|
||||
// ============================ Render ============================
|
||||
let renderNode = /*#__PURE__*/React.createElement(RcDropdown, Object.assign({
|
||||
alignPoint: alignPoint
|
||||
}, omit(props, ['rootClassName']), {
|
||||
mouseEnterDelay: mouseEnterDelay,
|
||||
mouseLeaveDelay: mouseLeaveDelay,
|
||||
visible: mergedOpen,
|
||||
builtinPlacements: builtinPlacements,
|
||||
arrow: !!arrow,
|
||||
overlayClassName: overlayClassNameCustomized,
|
||||
prefixCls: prefixCls,
|
||||
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
||||
transitionName: memoTransitionName,
|
||||
trigger: triggerActions,
|
||||
overlay: renderOverlay,
|
||||
placement: memoPlacement,
|
||||
onVisibleChange: onInnerOpenChange,
|
||||
overlayStyle: Object.assign(Object.assign(Object.assign({}, dropdown === null || dropdown === void 0 ? void 0 : dropdown.style), overlayStyle), {
|
||||
zIndex
|
||||
}),
|
||||
autoDestroy: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyPopupOnHide
|
||||
}), popupTrigger);
|
||||
if (zIndex) {
|
||||
renderNode = /*#__PURE__*/React.createElement(zIndexContext.Provider, {
|
||||
value: contextZIndex
|
||||
}, renderNode);
|
||||
}
|
||||
return wrapCSSVar(renderNode);
|
||||
};
|
||||
// We don't care debug panel
|
||||
const PurePanel = genPurePanel(Dropdown, 'align', undefined, 'dropdown', prefixCls => prefixCls);
|
||||
/* istanbul ignore next */
|
||||
const WrapPurePanel = props => (/*#__PURE__*/React.createElement(PurePanel, Object.assign({}, props), /*#__PURE__*/React.createElement("span", null)));
|
||||
Dropdown._InternalPanelDoNotUseOrYouWillBeFired = WrapPurePanel;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Dropdown.displayName = 'Dropdown';
|
||||
}
|
||||
export default Dropdown;
|
||||
8
frontend/node_modules/antd/es/dropdown/index.d.ts
generated
vendored
Normal file
8
frontend/node_modules/antd/es/dropdown/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import InternalDropdown from './dropdown';
|
||||
import DropdownButton from './dropdown-button';
|
||||
export type { DropdownProps as DropDownProps, DropdownProps } from './dropdown';
|
||||
export type { DropdownButtonProps, DropdownButtonType } from './dropdown-button';
|
||||
declare const Dropdown: typeof InternalDropdown & {
|
||||
Button: typeof DropdownButton;
|
||||
};
|
||||
export default Dropdown;
|
||||
7
frontend/node_modules/antd/es/dropdown/index.js
generated
vendored
Normal file
7
frontend/node_modules/antd/es/dropdown/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import InternalDropdown from './dropdown';
|
||||
import DropdownButton from './dropdown-button';
|
||||
const Dropdown = InternalDropdown;
|
||||
Dropdown.Button = DropdownButton;
|
||||
export default Dropdown;
|
||||
40
frontend/node_modules/antd/es/dropdown/style/index.d.ts
generated
vendored
Normal file
40
frontend/node_modules/antd/es/dropdown/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { CSSProperties } from 'react';
|
||||
import type { ArrowOffsetToken } from '../../style/placementArrow';
|
||||
import type { ArrowToken } from '../../style/roundedArrow';
|
||||
import type { FullToken, GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken extends ArrowToken, ArrowOffsetToken {
|
||||
/**
|
||||
* @desc 下拉菜单 z-index
|
||||
* @descEN z-index of dropdown
|
||||
*/
|
||||
zIndexPopup: number;
|
||||
/**
|
||||
* @desc 下拉菜单纵向内边距
|
||||
* @descEN Vertical padding of dropdown
|
||||
*/
|
||||
paddingBlock: CSSProperties['paddingBlock'];
|
||||
}
|
||||
/**
|
||||
* @desc Dropdown 组件的 Token
|
||||
* @descEN Token for Dropdown component
|
||||
*/
|
||||
export interface DropdownToken extends FullToken<'Dropdown'> {
|
||||
/**
|
||||
* @desc 下拉箭头距离
|
||||
* @descEN Distance of dropdown arrow
|
||||
*/
|
||||
dropdownArrowDistance: number | string;
|
||||
/**
|
||||
* @desc 下拉菜单边缘子项内边距
|
||||
* @descEN Padding of edge child in dropdown menu
|
||||
*/
|
||||
dropdownEdgeChildPadding: number;
|
||||
/**
|
||||
* @desc 菜单类名
|
||||
* @descEN Menu class name
|
||||
*/
|
||||
menuCls: string;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Dropdown'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
298
frontend/node_modules/antd/es/dropdown/style/index.js
generated
vendored
Normal file
298
frontend/node_modules/antd/es/dropdown/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
import { unit } from '@ant-design/cssinjs';
|
||||
import { genFocusStyle, resetComponent } from '../../style';
|
||||
import { initMoveMotion, initSlideMotion, initZoomMotion, slideDownIn, slideDownOut, slideUpIn, slideUpOut } from '../../style/motion';
|
||||
import getArrowStyle, { getArrowOffsetToken } from '../../style/placementArrow';
|
||||
import { getArrowToken } from '../../style/roundedArrow';
|
||||
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
||||
import genStatusStyle from './status';
|
||||
// =============================== Base ===============================
|
||||
const genBaseStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
menuCls,
|
||||
zIndexPopup,
|
||||
dropdownArrowDistance,
|
||||
sizePopupArrow,
|
||||
antCls,
|
||||
iconCls,
|
||||
motionDurationMid,
|
||||
paddingBlock,
|
||||
fontSize,
|
||||
dropdownEdgeChildPadding,
|
||||
colorTextDisabled,
|
||||
fontSizeIcon,
|
||||
controlPaddingHorizontal,
|
||||
colorBgElevated
|
||||
} = token;
|
||||
return [{
|
||||
[componentCls]: {
|
||||
position: 'absolute',
|
||||
top: -9999,
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: -9999
|
||||
},
|
||||
zIndex: zIndexPopup,
|
||||
display: 'block',
|
||||
// A placeholder out of dropdown visible range to avoid close when user moving
|
||||
'&::before': {
|
||||
position: 'absolute',
|
||||
insetBlock: token.calc(sizePopupArrow).div(2).sub(dropdownArrowDistance).equal(),
|
||||
// insetInlineStart: -7, // FIXME: Seems not work for hidden element
|
||||
zIndex: -9999,
|
||||
opacity: 0.0001,
|
||||
content: '""'
|
||||
},
|
||||
// Makes vertical dropdowns have a scrollbar once they become taller than the viewport.
|
||||
'&-menu-vertical': {
|
||||
maxHeight: '100vh',
|
||||
overflowY: 'auto'
|
||||
},
|
||||
[`&-trigger${antCls}-btn`]: {
|
||||
[`& > ${iconCls}-down, & > ${antCls}-btn-icon > ${iconCls}-down`]: {
|
||||
fontSize: fontSizeIcon
|
||||
}
|
||||
},
|
||||
[`${componentCls}-wrap`]: {
|
||||
position: 'relative',
|
||||
[`${antCls}-btn > ${iconCls}-down`]: {
|
||||
fontSize: fontSizeIcon
|
||||
},
|
||||
[`${iconCls}-down::before`]: {
|
||||
transition: `transform ${motionDurationMid}`
|
||||
}
|
||||
},
|
||||
[`${componentCls}-wrap-open`]: {
|
||||
[`${iconCls}-down::before`]: {
|
||||
transform: `rotate(180deg)`
|
||||
}
|
||||
},
|
||||
[`
|
||||
&-hidden,
|
||||
&-menu-hidden,
|
||||
&-menu-submenu-hidden
|
||||
`]: {
|
||||
display: 'none'
|
||||
},
|
||||
// =============================================================
|
||||
// == Motion ==
|
||||
// =============================================================
|
||||
// When position is not enough for dropdown, the placement will revert.
|
||||
// We will handle this with revert motion name.
|
||||
[`&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomLeft,
|
||||
&${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomLeft,
|
||||
&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottom,
|
||||
&${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottom,
|
||||
&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomRight,
|
||||
&${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomRight`]: {
|
||||
animationName: slideUpIn
|
||||
},
|
||||
[`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topLeft,
|
||||
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topLeft,
|
||||
&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-top,
|
||||
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-top,
|
||||
&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topRight,
|
||||
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topRight`]: {
|
||||
animationName: slideDownIn
|
||||
},
|
||||
[`&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomLeft,
|
||||
&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottom,
|
||||
&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomRight`]: {
|
||||
animationName: slideUpOut
|
||||
},
|
||||
[`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topLeft,
|
||||
&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-top,
|
||||
&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topRight`]: {
|
||||
animationName: slideDownOut
|
||||
}
|
||||
}
|
||||
},
|
||||
// =============================================================
|
||||
// == Arrow style ==
|
||||
// =============================================================
|
||||
getArrowStyle(token, colorBgElevated, {
|
||||
arrowPlacement: {
|
||||
top: true,
|
||||
bottom: true
|
||||
}
|
||||
}), {
|
||||
// =============================================================
|
||||
// == Menu ==
|
||||
// =============================================================
|
||||
[`${componentCls} ${menuCls}`]: {
|
||||
position: 'relative',
|
||||
margin: 0
|
||||
},
|
||||
[`${menuCls}-submenu-popup`]: {
|
||||
position: 'absolute',
|
||||
zIndex: zIndexPopup,
|
||||
background: 'transparent',
|
||||
boxShadow: 'none',
|
||||
transformOrigin: '0 0',
|
||||
'ul, li': {
|
||||
listStyle: 'none',
|
||||
margin: 0
|
||||
}
|
||||
},
|
||||
[`${componentCls}, ${componentCls}-menu-submenu`]: Object.assign(Object.assign({}, resetComponent(token)), {
|
||||
[menuCls]: Object.assign(Object.assign({
|
||||
padding: dropdownEdgeChildPadding,
|
||||
listStyleType: 'none',
|
||||
backgroundColor: colorBgElevated,
|
||||
backgroundClip: 'padding-box',
|
||||
borderRadius: token.borderRadiusLG,
|
||||
outline: 'none',
|
||||
boxShadow: token.boxShadowSecondary
|
||||
}, genFocusStyle(token)), {
|
||||
'&:empty': {
|
||||
padding: 0,
|
||||
boxShadow: 'none'
|
||||
},
|
||||
[`${menuCls}-item-group-title`]: {
|
||||
padding: `${unit(paddingBlock)} ${unit(controlPaddingHorizontal)}`,
|
||||
color: token.colorTextDescription,
|
||||
transition: `all ${motionDurationMid}`
|
||||
},
|
||||
// ======================= Item Content =======================
|
||||
[`${menuCls}-item`]: {
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
alignItems: 'center'
|
||||
},
|
||||
[`${menuCls}-item-icon`]: {
|
||||
minWidth: fontSize,
|
||||
marginInlineEnd: token.marginXS,
|
||||
fontSize: token.fontSizeSM
|
||||
},
|
||||
[`${menuCls}-title-content`]: {
|
||||
flex: 'auto',
|
||||
'&-with-extra': {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
width: '100%'
|
||||
},
|
||||
'> a': {
|
||||
color: 'inherit',
|
||||
transition: `all ${motionDurationMid}`,
|
||||
'&:hover': {
|
||||
color: 'inherit'
|
||||
},
|
||||
'&::after': {
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
content: '""'
|
||||
}
|
||||
},
|
||||
[`${menuCls}-item-extra`]: {
|
||||
paddingInlineStart: token.padding,
|
||||
marginInlineStart: 'auto',
|
||||
fontSize: token.fontSizeSM,
|
||||
color: token.colorTextDescription
|
||||
}
|
||||
},
|
||||
// =========================== Item ===========================
|
||||
[`${menuCls}-item, ${menuCls}-submenu-title`]: Object.assign(Object.assign({
|
||||
display: 'flex',
|
||||
margin: 0,
|
||||
padding: `${unit(paddingBlock)} ${unit(controlPaddingHorizontal)}`,
|
||||
color: token.colorText,
|
||||
fontWeight: 'normal',
|
||||
fontSize,
|
||||
lineHeight: token.lineHeight,
|
||||
cursor: 'pointer',
|
||||
transition: `all ${motionDurationMid}`,
|
||||
borderRadius: token.borderRadiusSM,
|
||||
'&:hover, &-active': {
|
||||
backgroundColor: token.controlItemBgHover
|
||||
}
|
||||
}, genFocusStyle(token)), {
|
||||
'&-selected': {
|
||||
color: token.colorPrimary,
|
||||
backgroundColor: token.controlItemBgActive,
|
||||
'&:hover, &-active': {
|
||||
backgroundColor: token.controlItemBgActiveHover
|
||||
}
|
||||
},
|
||||
'&-disabled': {
|
||||
color: colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
'&:hover': {
|
||||
color: colorTextDisabled,
|
||||
backgroundColor: colorBgElevated,
|
||||
cursor: 'not-allowed'
|
||||
},
|
||||
a: {
|
||||
pointerEvents: 'none'
|
||||
}
|
||||
},
|
||||
'&-divider': {
|
||||
height: 1,
|
||||
// By design
|
||||
margin: `${unit(token.marginXXS)} 0`,
|
||||
overflow: 'hidden',
|
||||
lineHeight: 0,
|
||||
backgroundColor: token.colorSplit
|
||||
},
|
||||
[`${componentCls}-menu-submenu-expand-icon`]: {
|
||||
position: 'absolute',
|
||||
insetInlineEnd: token.paddingXS,
|
||||
[`${componentCls}-menu-submenu-arrow-icon`]: {
|
||||
marginInlineEnd: '0 !important',
|
||||
color: token.colorIcon,
|
||||
fontSize: fontSizeIcon,
|
||||
fontStyle: 'normal'
|
||||
}
|
||||
}
|
||||
}),
|
||||
[`${menuCls}-item-group-list`]: {
|
||||
margin: `0 ${unit(token.marginXS)}`,
|
||||
padding: 0,
|
||||
listStyle: 'none'
|
||||
},
|
||||
[`${menuCls}-submenu-title`]: {
|
||||
paddingInlineEnd: token.calc(controlPaddingHorizontal).add(token.fontSizeSM).equal()
|
||||
},
|
||||
[`${menuCls}-submenu-vertical`]: {
|
||||
position: 'relative'
|
||||
},
|
||||
[`${menuCls}-submenu${menuCls}-submenu-disabled ${componentCls}-menu-submenu-title`]: {
|
||||
[`&, ${componentCls}-menu-submenu-arrow-icon`]: {
|
||||
color: colorTextDisabled,
|
||||
backgroundColor: colorBgElevated,
|
||||
cursor: 'not-allowed'
|
||||
}
|
||||
},
|
||||
// https://github.com/ant-design/ant-design/issues/19264
|
||||
[`${menuCls}-submenu-selected ${componentCls}-menu-submenu-title`]: {
|
||||
color: token.colorPrimary
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// Follow code may reuse in other components
|
||||
[initSlideMotion(token, 'slide-up'), initSlideMotion(token, 'slide-down'), initMoveMotion(token, 'move-up'), initMoveMotion(token, 'move-down'), initZoomMotion(token, 'zoom-big')]];
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
export const prepareComponentToken = token => Object.assign(Object.assign({
|
||||
zIndexPopup: token.zIndexPopupBase + 50,
|
||||
paddingBlock: (token.controlHeight - token.fontSize * token.lineHeight) / 2
|
||||
}, getArrowOffsetToken({
|
||||
contentRadius: token.borderRadiusLG,
|
||||
limitVerticalRadius: true
|
||||
})), getArrowToken(token));
|
||||
export default genStyleHooks('Dropdown', token => {
|
||||
const {
|
||||
marginXXS,
|
||||
sizePopupArrow,
|
||||
paddingXXS,
|
||||
componentCls
|
||||
} = token;
|
||||
const dropdownToken = mergeToken(token, {
|
||||
menuCls: `${componentCls}-menu`,
|
||||
dropdownArrowDistance: token.calc(sizePopupArrow).div(2).add(marginXXS).equal(),
|
||||
dropdownEdgeChildPadding: paddingXXS
|
||||
});
|
||||
return [genBaseStyle(dropdownToken), genStatusStyle(dropdownToken)];
|
||||
}, prepareComponentToken, {
|
||||
resetStyle: false
|
||||
});
|
||||
4
frontend/node_modules/antd/es/dropdown/style/status.d.ts
generated
vendored
Normal file
4
frontend/node_modules/antd/es/dropdown/style/status.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { DropdownToken } from '.';
|
||||
import type { GenerateStyle } from '../../theme/internal';
|
||||
declare const genStatusStyle: GenerateStyle<DropdownToken>;
|
||||
export default genStatusStyle;
|
||||
23
frontend/node_modules/antd/es/dropdown/style/status.js
generated
vendored
Normal file
23
frontend/node_modules/antd/es/dropdown/style/status.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
const genStatusStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
menuCls,
|
||||
colorError,
|
||||
colorTextLightSolid
|
||||
} = token;
|
||||
const itemCls = `${menuCls}-item`;
|
||||
return {
|
||||
[`${componentCls}, ${componentCls}-menu-submenu`]: {
|
||||
[`${menuCls} ${itemCls}`]: {
|
||||
[`&${itemCls}-danger:not(${itemCls}-disabled)`]: {
|
||||
color: colorError,
|
||||
'&:hover': {
|
||||
color: colorTextLightSolid,
|
||||
backgroundColor: colorError
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
export default genStatusStyle;
|
||||
Reference in New Issue
Block a user