add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

77
node_modules/antd/es/select/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,77 @@
import * as React from 'react';
import type { BaseSelectRef, SelectProps as RcSelectProps } from 'rc-select';
import { OptGroup, Option } from 'rc-select';
import type { OptionProps } from 'rc-select/lib/Option';
import type { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
import type { SelectCommonPlacement } from '../_util/motion';
import type { InputStatus } from '../_util/statusUtils';
import type { Variant } from '../config-provider';
import type { SizeType } from '../config-provider/SizeContext';
type RawValue = string | number;
type SemanticName = 'root';
type PopupSemantic = 'root';
export type { BaseOptionType, DefaultOptionType, OptionProps, BaseSelectRef as RefSelectProps };
export interface LabeledValue {
key?: string;
value: RawValue;
label: React.ReactNode;
}
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {
rootClassName?: string;
prefix?: React.ReactNode;
suffixIcon?: React.ReactNode;
size?: SizeType;
disabled?: boolean;
mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE' | 'combobox';
/** @deprecated Use `variant` instead. */
bordered?: boolean;
/**
* @deprecated `showArrow` is deprecated which will be removed in next major version. It will be a
* default behavior, you can hide it by setting `suffixIcon` to null.
*/
showArrow?: boolean;
/**
* @since 5.13.0
* @default "outlined"
*/
variant?: Variant;
styles?: Partial<Record<SemanticName, React.CSSProperties>> & {
popup?: Partial<Record<PopupSemantic, React.CSSProperties>>;
};
classNames?: Partial<Record<SemanticName, string>> & {
popup?: Partial<Record<PopupSemantic, string>>;
};
}
export interface SelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<InternalSelectProps<ValueType, OptionType>, 'mode' | 'getInputElement' | 'getRawInputElement' | 'backfill' | 'placement'> {
placement?: SelectCommonPlacement;
mode?: 'multiple' | 'tags';
status?: InputStatus;
/** @deprecated Please use `classNames.popup.root` instead */
popupClassName?: string;
/** @deprecated Please use `classNames.popup.root` instead */
dropdownClassName?: string;
/** @deprecated Please use `popupMatchSelectWidth` instead */
dropdownMatchSelectWidth?: boolean | number;
popupMatchSelectWidth?: boolean | number;
/** @deprecated Please use `popupRender` instead */
dropdownRender?: (menu: React.ReactElement) => React.ReactElement;
/**
* @since 5.25.0
*/
popupRender?: (menu: React.ReactElement) => React.ReactElement;
/** @deprecated Please use `styles.popup.root` instead */
dropdownStyle?: React.CSSProperties;
/** @deprecated Please use `onOpenChange` instead */
onDropdownVisibleChange?: (visible: boolean) => void;
onOpenChange?: (visible: boolean) => void;
}
declare const Select: (<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: React.PropsWithChildren<SelectProps<ValueType, OptionType>> & React.RefAttributes<BaseSelectRef>) => React.ReactElement) & {
displayName?: string;
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
Option: typeof Option;
OptGroup: typeof OptGroup;
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
};
declare const PurePanel: (props: import("../_util/type").AnyObject) => React.JSX.Element;
export default Select;

250
node_modules/antd/es/select/index.js generated vendored Normal file
View File

@@ -0,0 +1,250 @@
"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;
};
// TODO: 4.0 - codemod should help to change `filterOption` to support node props.
import * as React from 'react';
import cls from 'classnames';
import RcSelect, { OptGroup, Option } from 'rc-select';
import omit from "rc-util/es/omit";
import { useZIndex } from '../_util/hooks';
import { getTransitionName } from '../_util/motion';
import genPurePanel from '../_util/PurePanel';
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
import { devUseWarning } from '../_util/warning';
import { ConfigContext } from '../config-provider';
import { useComponentConfig } from '../config-provider/context';
import DefaultRenderEmpty from '../config-provider/defaultRenderEmpty';
import DisabledContext from '../config-provider/DisabledContext';
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
import useSize from '../config-provider/hooks/useSize';
import { FormItemInputContext } from '../form/context';
import useVariants from '../form/hooks/useVariants';
import { useCompactItemContext } from '../space/Compact';
import { useToken } from '../theme/internal';
import mergedBuiltinPlacements from './mergedBuiltinPlacements';
import useStyle from './style';
import useIcons from './useIcons';
import usePopupRender from './usePopupRender';
import useShowArrow from './useShowArrow';
const SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
const InternalSelect = (props, ref) => {
var _a, _b, _c, _d, _e;
const {
prefixCls: customizePrefixCls,
bordered,
className,
rootClassName,
getPopupContainer,
popupClassName,
dropdownClassName,
listHeight = 256,
placement,
listItemHeight: customListItemHeight,
size: customizeSize,
disabled: customDisabled,
notFoundContent,
status: customStatus,
builtinPlacements,
dropdownMatchSelectWidth,
popupMatchSelectWidth,
direction: propDirection,
style,
allowClear,
variant: customizeVariant,
dropdownStyle,
transitionName,
tagRender,
maxCount,
prefix,
dropdownRender,
popupRender,
onDropdownVisibleChange,
onOpenChange,
styles,
classNames
} = props,
rest = __rest(props, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount", "prefix", "dropdownRender", "popupRender", "onDropdownVisibleChange", "onOpenChange", "styles", "classNames"]);
const {
getPopupContainer: getContextPopupContainer,
getPrefixCls,
renderEmpty,
direction: contextDirection,
virtual,
popupMatchSelectWidth: contextPopupMatchSelectWidth,
popupOverflow
} = React.useContext(ConfigContext);
const {
showSearch,
style: contextStyle,
styles: contextStyles,
className: contextClassName,
classNames: contextClassNames
} = useComponentConfig('select');
const [, token] = useToken();
const listItemHeight = customListItemHeight !== null && customListItemHeight !== void 0 ? customListItemHeight : token === null || token === void 0 ? void 0 : token.controlHeight;
const prefixCls = getPrefixCls('select', customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const direction = propDirection !== null && propDirection !== void 0 ? propDirection : contextDirection;
const {
compactSize,
compactItemClassnames
} = useCompactItemContext(prefixCls, direction);
const [variant, enableVariantCls] = useVariants('select', customizeVariant, bordered);
const rootCls = useCSSVarCls(prefixCls);
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);
const mode = React.useMemo(() => {
const {
mode: m
} = props;
if (m === 'combobox') {
return undefined;
}
if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
return 'combobox';
}
return m;
}, [props.mode]);
const isMultiple = mode === 'multiple' || mode === 'tags';
const showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
const mergedPopupMatchSelectWidth = (_a = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : contextPopupMatchSelectWidth;
const mergedPopupStyle = ((_b = styles === null || styles === void 0 ? void 0 : styles.popup) === null || _b === void 0 ? void 0 : _b.root) || ((_c = contextStyles.popup) === null || _c === void 0 ? void 0 : _c.root) || dropdownStyle;
const mergedPopupRender = usePopupRender(popupRender || dropdownRender);
const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
// ===================== Form Status =====================
const {
status: contextStatus,
hasFeedback,
isFormItemInput,
feedbackIcon
} = React.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
// ===================== Empty =====================
let mergedNotFound;
if (notFoundContent !== undefined) {
mergedNotFound = notFoundContent;
} else if (mode === 'combobox') {
mergedNotFound = null;
} else {
mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/React.createElement(DefaultRenderEmpty, {
componentName: "Select"
});
}
// ===================== Icons =====================
const {
suffixIcon,
itemIcon,
removeIcon,
clearIcon
} = useIcons(Object.assign(Object.assign({}, rest), {
multiple: isMultiple,
hasFeedback,
feedbackIcon,
showSuffixIcon,
prefixCls,
componentName: 'Select'
}));
const mergedAllowClear = allowClear === true ? {
clearIcon
} : allowClear;
const selectProps = omit(rest, ['suffixIcon', 'itemIcon']);
const mergedPopupClassName = cls(((_d = classNames === null || classNames === void 0 ? void 0 : classNames.popup) === null || _d === void 0 ? void 0 : _d.root) || ((_e = contextClassNames === null || contextClassNames === void 0 ? void 0 : contextClassNames.popup) === null || _e === void 0 ? void 0 : _e.root) || popupClassName || dropdownClassName, {
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl'
}, rootClassName, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, cssVarCls, rootCls, hashId);
const mergedSize = useSize(ctx => {
var _a;
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
});
// ===================== Disabled =====================
const disabled = React.useContext(DisabledContext);
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
const mergedClassName = cls({
[`${prefixCls}-lg`]: mergedSize === 'large',
[`${prefixCls}-sm`]: mergedSize === 'small',
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-${variant}`]: enableVariantCls,
[`${prefixCls}-in-form-item`]: isFormItemInput
}, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, contextClassName, className, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, rootClassName, cssVarCls, rootCls, hashId);
// ===================== Placement =====================
const memoPlacement = React.useMemo(() => {
if (placement !== undefined) {
return placement;
}
return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
}, [placement, direction]);
// ====================== Warning ======================
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Select');
const deprecatedProps = {
dropdownMatchSelectWidth: 'popupMatchSelectWidth',
dropdownStyle: 'styles.popup.root',
dropdownClassName: 'classNames.popup.root',
popupClassName: 'classNames.popup.root',
dropdownRender: 'popupRender',
onDropdownVisibleChange: 'onOpenChange',
bordered: 'variant'
};
Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
process.env.NODE_ENV !== "production" ? warning(!('showArrow' in props), 'deprecated', '`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.') : void 0;
process.env.NODE_ENV !== "production" ? warning(!(typeof maxCount !== 'undefined' && !isMultiple), 'usage', '`maxCount` only works with mode `multiple` or `tags`') : void 0;
}
// ====================== zIndex =========================
const [zIndex] = useZIndex('SelectLike', mergedPopupStyle === null || mergedPopupStyle === void 0 ? void 0 : mergedPopupStyle.zIndex);
// ====================== Render =======================
return wrapCSSVar(/*#__PURE__*/React.createElement(RcSelect, Object.assign({
ref: ref,
virtual: virtual,
showSearch: showSearch
}, selectProps, {
style: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), contextStyle), style),
dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
transitionName: getTransitionName(rootPrefixCls, 'slide-up', transitionName),
builtinPlacements: mergedBuiltinPlacements(builtinPlacements, popupOverflow),
listHeight: listHeight,
listItemHeight: listItemHeight,
mode: mode,
prefixCls: prefixCls,
placement: memoPlacement,
direction: direction,
prefix: prefix,
suffixIcon: suffixIcon,
menuItemSelectedIcon: itemIcon,
removeIcon: removeIcon,
allowClear: mergedAllowClear,
notFoundContent: mergedNotFound,
className: mergedClassName,
getPopupContainer: getPopupContainer || getContextPopupContainer,
dropdownClassName: mergedPopupClassName,
disabled: mergedDisabled,
dropdownStyle: Object.assign(Object.assign({}, mergedPopupStyle), {
zIndex
}),
maxCount: isMultiple ? maxCount : undefined,
tagRender: isMultiple ? tagRender : undefined,
dropdownRender: mergedPopupRender,
onDropdownVisibleChange: mergedOnOpenChange
})));
};
if (process.env.NODE_ENV !== 'production') {
InternalSelect.displayName = 'Select';
}
const Select = /*#__PURE__*/React.forwardRef(InternalSelect);
// We don't care debug panel
/* istanbul ignore next */
const PurePanel = genPurePanel(Select, 'dropdownAlign');
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
Select.Option = Option;
Select.OptGroup = OptGroup;
Select._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (process.env.NODE_ENV !== 'production') {
Select.displayName = 'Select';
}
export default Select;

View File

@@ -0,0 +1,4 @@
import type { BuildInPlacements } from '@rc-component/trigger';
import type { PopupOverflow } from '../config-provider/context';
declare function mergedBuiltinPlacements(buildInPlacements?: BuildInPlacements, popupOverflow?: PopupOverflow): BuildInPlacements;
export default mergedBuiltinPlacements;

34
node_modules/antd/es/select/mergedBuiltinPlacements.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
const getBuiltInPlacements = popupOverflow => {
const htmlRegion = popupOverflow === 'scroll' ? 'scroll' : 'visible';
const sharedConfig = {
overflow: {
adjustX: true,
adjustY: true,
shiftY: true
},
htmlRegion,
dynamicInset: true
};
return {
bottomLeft: Object.assign(Object.assign({}, sharedConfig), {
points: ['tl', 'bl'],
offset: [0, 4]
}),
bottomRight: Object.assign(Object.assign({}, sharedConfig), {
points: ['tr', 'br'],
offset: [0, 4]
}),
topLeft: Object.assign(Object.assign({}, sharedConfig), {
points: ['bl', 'tl'],
offset: [0, -4]
}),
topRight: Object.assign(Object.assign({}, sharedConfig), {
points: ['br', 'tr'],
offset: [0, -4]
})
};
};
function mergedBuiltinPlacements(buildInPlacements, popupOverflow) {
return buildInPlacements || getBuiltInPlacements(popupOverflow);
}
export default mergedBuiltinPlacements;

4
node_modules/antd/es/select/style/dropdown.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import type { GenerateStyle } from '../../theme/internal';
import type { SelectToken } from './token';
declare const genSingleStyle: GenerateStyle<SelectToken>;
export default genSingleStyle;

141
node_modules/antd/es/select/style/dropdown.js generated vendored Normal file
View File

@@ -0,0 +1,141 @@
import { resetComponent, textEllipsis } from '../../style';
import { initMoveMotion, initSlideMotion, slideDownIn, slideDownOut, slideUpIn, slideUpOut } from '../../style/motion';
const genItemStyle = token => {
const {
optionHeight,
optionFontSize,
optionLineHeight,
optionPadding
} = token;
return {
position: 'relative',
display: 'block',
minHeight: optionHeight,
padding: optionPadding,
color: token.colorText,
fontWeight: 'normal',
fontSize: optionFontSize,
lineHeight: optionLineHeight,
boxSizing: 'border-box'
};
};
const genSingleStyle = token => {
const {
antCls,
componentCls
} = token;
const selectItemCls = `${componentCls}-item`;
const slideUpEnterActive = `&${antCls}-slide-up-enter${antCls}-slide-up-enter-active`;
const slideUpAppearActive = `&${antCls}-slide-up-appear${antCls}-slide-up-appear-active`;
const slideUpLeaveActive = `&${antCls}-slide-up-leave${antCls}-slide-up-leave-active`;
const dropdownPlacementCls = `${componentCls}-dropdown-placement-`;
const selectedItemCls = `${selectItemCls}-option-selected`;
return [{
[`${componentCls}-dropdown`]: Object.assign(Object.assign({}, resetComponent(token)), {
position: 'absolute',
top: -9999,
zIndex: token.zIndexPopup,
boxSizing: 'border-box',
padding: token.paddingXXS,
overflow: 'hidden',
fontSize: token.fontSize,
// Fix select render lag of long text in chrome
// https://github.com/ant-design/ant-design/issues/11456
// https://github.com/ant-design/ant-design/issues/11843
fontVariant: 'initial',
backgroundColor: token.colorBgElevated,
borderRadius: token.borderRadiusLG,
outline: 'none',
boxShadow: token.boxShadowSecondary,
[`
${slideUpEnterActive}${dropdownPlacementCls}bottomLeft,
${slideUpAppearActive}${dropdownPlacementCls}bottomLeft
`]: {
animationName: slideUpIn
},
[`
${slideUpEnterActive}${dropdownPlacementCls}topLeft,
${slideUpAppearActive}${dropdownPlacementCls}topLeft,
${slideUpEnterActive}${dropdownPlacementCls}topRight,
${slideUpAppearActive}${dropdownPlacementCls}topRight
`]: {
animationName: slideDownIn
},
[`${slideUpLeaveActive}${dropdownPlacementCls}bottomLeft`]: {
animationName: slideUpOut
},
[`
${slideUpLeaveActive}${dropdownPlacementCls}topLeft,
${slideUpLeaveActive}${dropdownPlacementCls}topRight
`]: {
animationName: slideDownOut
},
'&-hidden': {
display: 'none'
},
[selectItemCls]: Object.assign(Object.assign({}, genItemStyle(token)), {
cursor: 'pointer',
transition: `background ${token.motionDurationSlow} ease`,
borderRadius: token.borderRadiusSM,
// =========== Group ============
'&-group': {
color: token.colorTextDescription,
fontSize: token.fontSizeSM,
cursor: 'default'
},
// =========== Option ===========
'&-option': {
display: 'flex',
'&-content': Object.assign({
flex: 'auto'
}, textEllipsis),
'&-state': {
flex: 'none',
display: 'flex',
alignItems: 'center'
},
[`&-active:not(${selectItemCls}-option-disabled)`]: {
backgroundColor: token.optionActiveBg
},
[`&-selected:not(${selectItemCls}-option-disabled)`]: {
color: token.optionSelectedColor,
fontWeight: token.optionSelectedFontWeight,
backgroundColor: token.optionSelectedBg,
[`${selectItemCls}-option-state`]: {
color: token.colorPrimary
}
},
'&-disabled': {
[`&${selectItemCls}-option-selected`]: {
backgroundColor: token.colorBgContainerDisabled
},
color: token.colorTextDisabled,
cursor: 'not-allowed'
},
'&-grouped': {
paddingInlineStart: token.calc(token.controlPaddingHorizontal).mul(2).equal()
}
},
'&-empty': Object.assign(Object.assign({}, genItemStyle(token)), {
color: token.colorTextDisabled
})
}),
// https://github.com/ant-design/ant-design/pull/46646
[`${selectedItemCls}:has(+ ${selectedItemCls})`]: {
borderEndStartRadius: 0,
borderEndEndRadius: 0,
[`& + ${selectedItemCls}`]: {
borderStartStartRadius: 0,
borderStartEndRadius: 0
}
},
// =========================== RTL ===========================
'&-rtl': {
direction: 'rtl'
}
})
},
// Follow code may reuse in other components
initSlideMotion(token, 'slide-up'), initSlideMotion(token, 'slide-down'), initMoveMotion(token, 'move-up'), initMoveMotion(token, 'move-down')];
};
export default genSingleStyle;

4
node_modules/antd/es/select/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import type { ComponentToken } from './token';
export type { ComponentToken };
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
export default _default;

250
node_modules/antd/es/select/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,250 @@
import { resetComponent, resetIcon, textEllipsis } from '../../style';
import { genCompactItemStyle } from '../../style/compact-item';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import genDropdownStyle from './dropdown';
import genMultipleStyle from './multiple';
import genSingleStyle from './single';
import { prepareComponentToken } from './token';
import genVariantsStyle from './variants';
// ============================= Selector =============================
const genSelectorStyle = token => {
const {
componentCls
} = token;
return {
position: 'relative',
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
input: {
cursor: 'pointer'
},
[`${componentCls}-show-search&`]: {
cursor: 'text',
input: {
cursor: 'auto',
color: 'inherit',
height: '100%'
}
},
[`${componentCls}-disabled&`]: {
cursor: 'not-allowed',
input: {
cursor: 'not-allowed'
}
}
};
};
// ============================== Styles ==============================
// /* Reset search input style */
const getSearchInputWithoutBorderStyle = token => {
const {
componentCls
} = token;
return {
[`${componentCls}-selection-search-input`]: {
margin: 0,
padding: 0,
background: 'transparent',
border: 'none',
outline: 'none',
appearance: 'none',
fontFamily: 'inherit',
'&::-webkit-search-cancel-button': {
display: 'none',
appearance: 'none'
}
}
};
};
// =============================== Base ===============================
const genBaseStyle = token => {
const {
antCls,
componentCls,
inputPaddingHorizontalBase,
iconCls
} = token;
const hoverShowClearStyle = {
[`${componentCls}-clear`]: {
opacity: 1,
background: token.colorBgBase,
borderRadius: '50%'
}
};
return {
[componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {
position: 'relative',
display: 'inline-flex',
cursor: 'pointer',
[`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: Object.assign(Object.assign({}, genSelectorStyle(token)), getSearchInputWithoutBorderStyle(token)),
// ======================== Selection ========================
[`${componentCls}-selection-item`]: Object.assign(Object.assign({
flex: 1,
fontWeight: 'normal',
position: 'relative',
userSelect: 'none'
}, textEllipsis), {
// https://github.com/ant-design/ant-design/issues/40421
[`> ${antCls}-typography`]: {
display: 'inline'
}
}),
// ======================= Placeholder =======================
[`${componentCls}-selection-placeholder`]: Object.assign(Object.assign({}, textEllipsis), {
flex: 1,
color: token.colorTextPlaceholder,
pointerEvents: 'none'
}),
// ========================== Arrow ==========================
[`${componentCls}-arrow`]: Object.assign(Object.assign({}, resetIcon()), {
position: 'absolute',
top: '50%',
insetInlineStart: 'auto',
insetInlineEnd: inputPaddingHorizontalBase,
height: token.fontSizeIcon,
marginTop: token.calc(token.fontSizeIcon).mul(-1).div(2).equal(),
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
lineHeight: 1,
textAlign: 'center',
pointerEvents: 'none',
display: 'flex',
alignItems: 'center',
transition: `opacity ${token.motionDurationSlow} ease`,
[iconCls]: {
verticalAlign: 'top',
transition: `transform ${token.motionDurationSlow}`,
'> svg': {
verticalAlign: 'top'
},
[`&:not(${componentCls}-suffix)`]: {
pointerEvents: 'auto'
}
},
[`${componentCls}-disabled &`]: {
cursor: 'not-allowed'
},
'> *:not(:last-child)': {
marginInlineEnd: 8 // FIXME: magic
}
}),
// ========================== Wrap ===========================
[`${componentCls}-selection-wrap`]: {
display: 'flex',
width: '100%',
position: 'relative',
minWidth: 0,
// https://github.com/ant-design/ant-design/issues/51669
'&:after': {
content: '"\\a0"',
width: 0,
overflow: 'hidden'
}
},
// ========================= Prefix ==========================
[`${componentCls}-prefix`]: {
flex: 'none',
marginInlineEnd: token.selectAffixPadding
},
// ========================== Clear ==========================
[`${componentCls}-clear`]: {
position: 'absolute',
top: '50%',
insetInlineStart: 'auto',
insetInlineEnd: inputPaddingHorizontalBase,
zIndex: 1,
display: 'inline-block',
width: token.fontSizeIcon,
height: token.fontSizeIcon,
marginTop: token.calc(token.fontSizeIcon).mul(-1).div(2).equal(),
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
fontStyle: 'normal',
lineHeight: 1,
textAlign: 'center',
textTransform: 'none',
cursor: 'pointer',
opacity: 0,
transition: `color ${token.motionDurationMid} ease, opacity ${token.motionDurationSlow} ease`,
textRendering: 'auto',
// https://github.com/ant-design/ant-design/issues/54205
// Force GPU compositing on Safari to prevent flickering on opacity/transform transitions
transform: 'translateZ(0)',
'&:before': {
display: 'block'
},
'&:hover': {
color: token.colorIcon
}
},
'@media(hover:none)': hoverShowClearStyle,
'&:hover': hoverShowClearStyle
}),
// ========================= Feedback ==========================
[`${componentCls}-status`]: {
'&-error, &-warning, &-success, &-validating': {
[`&${componentCls}-has-feedback`]: {
[`${componentCls}-clear`]: {
insetInlineEnd: token.calc(inputPaddingHorizontalBase).add(token.fontSize).add(token.paddingXS).equal()
}
}
}
}
};
};
// ============================== Styles ==============================
const genSelectStyle = token => {
const {
componentCls
} = token;
return [{
[componentCls]: {
// ==================== In Form ====================
[`&${componentCls}-in-form-item`]: {
width: '100%'
}
}
},
// =====================================================
// == LTR ==
// =====================================================
// Base
genBaseStyle(token),
// Single
genSingleStyle(token),
// Multiple
genMultipleStyle(token),
// Dropdown
genDropdownStyle(token),
// =====================================================
// == RTL ==
// =====================================================
{
[`${componentCls}-rtl`]: {
direction: 'rtl'
}
},
// =====================================================
// == Space Compact ==
// =====================================================
genCompactItemStyle(token, {
borderElCls: `${componentCls}-selector`,
focusElCls: `${componentCls}-focused`
})];
};
// ============================== Export ==============================
export default genStyleHooks('Select', (token, {
rootPrefixCls
}) => {
const selectToken = mergeToken(token, {
rootPrefixCls,
inputPaddingHorizontalBase: token.calc(token.paddingSM).sub(1).equal(),
multipleSelectItemHeight: token.multipleItemHeight,
selectHeight: token.controlHeight
});
return [genSelectStyle(selectToken), genVariantsStyle(selectToken)];
}, prepareComponentToken, {
unitless: {
optionLineHeight: true,
optionSelectedFontWeight: true
}
});

32
node_modules/antd/es/select/style/multiple.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { SelectToken } from './token';
/**
* Get multiple selector needed style. The calculation:
*
* ContainerPadding = BasePadding - ItemMargin
*
* Border: ╔═══════════════════════════╗ ┬
* ContainerPadding: ║ ║ │
* ╟───────────────────────────╢ ┬ │
* Item Margin: ║ ║ │ │
* ║ ┌──────────┐ ║ │ │
* Item(multipleItemHeight): ║ BasePadding │ Item │ ║ Overflow Container(ControlHeight)
* ║ └──────────┘ ║ │ │
* Item Margin: ║ ║ │ │
* ╟───────────────────────────╢ ┴ │
* ContainerPadding: ║ ║ │
* Border: ╚═══════════════════════════╝ ┴
*/
export declare const getMultipleSelectorUnit: (token: Pick<SelectToken, "max" | "calc" | "multipleSelectItemHeight" | "paddingXXS" | "lineWidth" | "INTERNAL_FIXED_ITEM_MARGIN">) => {
basePadding: string | number;
containerPadding: string | number;
itemHeight: string;
itemLineHeight: string;
};
/**
* Get the `rc-overflow` needed style.
* It's a share style which means not affected by `size`.
*/
export declare const genOverflowStyle: (token: Pick<SelectToken, "calc" | "componentCls" | "iconCls" | "borderRadiusSM" | "motionDurationSlow" | "paddingXS" | "multipleItemColorDisabled" | "multipleItemBorderColorDisabled" | "colorIcon" | "colorIconHover" | "INTERNAL_FIXED_ITEM_MARGIN">) => CSSObject;
declare const genMultipleStyle: (token: SelectToken) => CSSInterpolation;
export default genMultipleStyle;

298
node_modules/antd/es/select/style/multiple.js generated vendored Normal file
View File

@@ -0,0 +1,298 @@
import { unit } from '@ant-design/cssinjs';
import { resetIcon } from '../../style';
import { mergeToken } from '../../theme/internal';
/**
* Get multiple selector needed style. The calculation:
*
* ContainerPadding = BasePadding - ItemMargin
*
* Border: ╔═══════════════════════════╗ ┬
* ContainerPadding: ║ ║ │
* ╟───────────────────────────╢ ┬ │
* Item Margin: ║ ║ │ │
* ║ ┌──────────┐ ║ │ │
* Item(multipleItemHeight): ║ BasePadding │ Item │ ║ Overflow Container(ControlHeight)
* ║ └──────────┘ ║ │ │
* Item Margin: ║ ║ │ │
* ╟───────────────────────────╢ ┴ │
* ContainerPadding: ║ ║ │
* Border: ╚═══════════════════════════╝ ┴
*/
export const getMultipleSelectorUnit = token => {
const {
multipleSelectItemHeight,
paddingXXS,
lineWidth,
INTERNAL_FIXED_ITEM_MARGIN
} = token;
const basePadding = token.max(token.calc(paddingXXS).sub(lineWidth).equal(), 0);
const containerPadding = token.max(token.calc(basePadding).sub(INTERNAL_FIXED_ITEM_MARGIN).equal(), 0);
return {
basePadding,
containerPadding,
itemHeight: unit(multipleSelectItemHeight),
itemLineHeight: unit(token.calc(multipleSelectItemHeight).sub(token.calc(token.lineWidth).mul(2)).equal())
};
};
const getSelectItemStyle = token => {
const {
multipleSelectItemHeight,
selectHeight,
lineWidth
} = token;
const selectItemDist = token.calc(selectHeight).sub(multipleSelectItemHeight).div(2).sub(lineWidth).equal();
return selectItemDist;
};
/**
* Get the `rc-overflow` needed style.
* It's a share style which means not affected by `size`.
*/
export const genOverflowStyle = token => {
const {
componentCls,
iconCls,
borderRadiusSM,
motionDurationSlow,
paddingXS,
multipleItemColorDisabled,
multipleItemBorderColorDisabled,
colorIcon,
colorIconHover,
INTERNAL_FIXED_ITEM_MARGIN
} = token;
const selectOverflowPrefixCls = `${componentCls}-selection-overflow`;
return {
/**
* Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
* may update to redesign with its align logic.
*/
// =========================== Overflow ===========================
[selectOverflowPrefixCls]: {
position: 'relative',
display: 'flex',
flex: 'auto',
flexWrap: 'wrap',
maxWidth: '100%',
'&-item': {
flex: 'none',
alignSelf: 'center',
// https://github.com/ant-design/ant-design/issues/54179
maxWidth: 'calc(100% - 4px)',
display: 'inline-flex'
},
// ======================== Selections ==========================
[`${componentCls}-selection-item`]: {
display: 'flex',
alignSelf: 'center',
flex: 'none',
boxSizing: 'border-box',
maxWidth: '100%',
marginBlock: INTERNAL_FIXED_ITEM_MARGIN,
borderRadius: borderRadiusSM,
cursor: 'default',
transition: `font-size ${motionDurationSlow}, line-height ${motionDurationSlow}, height ${motionDurationSlow}`,
marginInlineEnd: token.calc(INTERNAL_FIXED_ITEM_MARGIN).mul(2).equal(),
paddingInlineStart: paddingXS,
paddingInlineEnd: token.calc(paddingXS).div(2).equal(),
[`${componentCls}-disabled&`]: {
color: multipleItemColorDisabled,
borderColor: multipleItemBorderColorDisabled,
cursor: 'not-allowed'
},
// It's ok not to do this, but 24px makes bottom narrow in view should adjust
'&-content': {
display: 'inline-block',
marginInlineEnd: token.calc(paddingXS).div(2).equal(),
overflow: 'hidden',
whiteSpace: 'pre',
// fix whitespace wrapping. custom tags display all whitespace within.
textOverflow: 'ellipsis'
},
'&-remove': Object.assign(Object.assign({}, resetIcon()), {
display: 'inline-flex',
alignItems: 'center',
color: colorIcon,
fontWeight: 'bold',
fontSize: 10,
lineHeight: 'inherit',
cursor: 'pointer',
[`> ${iconCls}`]: {
verticalAlign: '-0.2em'
},
'&:hover': {
color: colorIconHover
}
})
}
}
};
};
const genSelectionStyle = (token, suffix) => {
const {
componentCls,
INTERNAL_FIXED_ITEM_MARGIN
} = token;
const selectOverflowPrefixCls = `${componentCls}-selection-overflow`;
const selectItemHeight = token.multipleSelectItemHeight;
const selectItemDist = getSelectItemStyle(token);
const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
const multipleSelectorUnit = getMultipleSelectorUnit(token);
return {
[`${componentCls}-multiple${suffixCls}`]: Object.assign(Object.assign({}, genOverflowStyle(token)), {
// ========================= Selector =========================
[`${componentCls}-selector`]: {
display: 'flex',
alignItems: 'center',
width: '100%',
height: '100%',
// Multiple is little different that horizontal is follow the vertical
paddingInline: multipleSelectorUnit.basePadding,
paddingBlock: multipleSelectorUnit.containerPadding,
borderRadius: token.borderRadius,
[`${componentCls}-disabled&`]: {
background: token.multipleSelectorBgDisabled,
cursor: 'not-allowed'
},
'&:after': {
display: 'inline-block',
width: 0,
margin: `${unit(INTERNAL_FIXED_ITEM_MARGIN)} 0`,
lineHeight: unit(selectItemHeight),
visibility: 'hidden',
content: '"\\a0"'
}
},
// ======================== Selections ========================
[`${componentCls}-selection-item`]: {
height: multipleSelectorUnit.itemHeight,
lineHeight: unit(multipleSelectorUnit.itemLineHeight)
},
// ========================== Wrap ===========================
[`${componentCls}-selection-wrap`]: {
alignSelf: 'flex-start',
'&:after': {
lineHeight: unit(selectItemHeight),
marginBlock: INTERNAL_FIXED_ITEM_MARGIN
}
},
// ========================== Input ==========================
[`${componentCls}-prefix`]: {
marginInlineStart: token.calc(token.inputPaddingHorizontalBase).sub(multipleSelectorUnit.basePadding).equal()
},
[`${selectOverflowPrefixCls}-item + ${selectOverflowPrefixCls}-item,
${componentCls}-prefix + ${componentCls}-selection-wrap
`]: {
[`${componentCls}-selection-search`]: {
marginInlineStart: 0
},
[`${componentCls}-selection-placeholder`]: {
insetInlineStart: 0
}
},
// https://github.com/ant-design/ant-design/issues/44754
// Same as `wrap:after`
[`${selectOverflowPrefixCls}-item-suffix`]: {
minHeight: multipleSelectorUnit.itemHeight,
marginBlock: INTERNAL_FIXED_ITEM_MARGIN
},
[`${componentCls}-selection-search`]: {
display: 'inline-flex',
position: 'relative',
maxWidth: '100%',
marginInlineStart: token.calc(token.inputPaddingHorizontalBase).sub(selectItemDist).equal(),
[`
&-input,
&-mirror
`]: {
height: selectItemHeight,
fontFamily: token.fontFamily,
lineHeight: unit(selectItemHeight),
transition: `all ${token.motionDurationSlow}`
},
'&-input': {
width: '100%',
minWidth: 4.1 // fix search cursor missing
},
'&-mirror': {
position: 'absolute',
top: 0,
insetInlineStart: 0,
insetInlineEnd: 'auto',
zIndex: 999,
whiteSpace: 'pre',
// fix whitespace wrapping caused width calculation bug
visibility: 'hidden'
}
},
// ======================= Placeholder =======================
[`${componentCls}-selection-placeholder`]: {
position: 'absolute',
top: '50%',
insetInlineStart: token.calc(token.inputPaddingHorizontalBase).sub(multipleSelectorUnit.basePadding).equal(),
insetInlineEnd: token.inputPaddingHorizontalBase,
transform: 'translateY(-50%)',
transition: `all ${token.motionDurationSlow}`
}
})
};
};
function genSizeStyle(token, suffix) {
const {
componentCls
} = token;
const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
const rawStyle = {
[`${componentCls}-multiple${suffixCls}`]: {
fontSize: token.fontSize,
// ========================= Selector =========================
[`${componentCls}-selector`]: {
[`${componentCls}-show-search&`]: {
cursor: 'text'
}
},
[`
&${componentCls}-show-arrow ${componentCls}-selector,
&${componentCls}-allow-clear ${componentCls}-selector
`]: {
paddingInlineEnd: token.calc(token.fontSizeIcon).add(token.controlPaddingHorizontal).equal()
}
}
};
return [genSelectionStyle(token, suffix), rawStyle];
}
const genMultipleStyle = token => {
const {
componentCls
} = token;
const smallToken = mergeToken(token, {
selectHeight: token.controlHeightSM,
multipleSelectItemHeight: token.multipleItemHeightSM,
borderRadius: token.borderRadiusSM,
borderRadiusSM: token.borderRadiusXS
});
const largeToken = mergeToken(token, {
fontSize: token.fontSizeLG,
selectHeight: token.controlHeightLG,
multipleSelectItemHeight: token.multipleItemHeightLG,
borderRadius: token.borderRadiusLG,
borderRadiusSM: token.borderRadius
});
return [genSizeStyle(token),
// ======================== Small ========================
genSizeStyle(smallToken, 'sm'),
// Padding
{
[`${componentCls}-multiple${componentCls}-sm`]: {
[`${componentCls}-selection-placeholder`]: {
insetInline: token.calc(token.controlPaddingHorizontalSM).sub(token.lineWidth).equal()
},
// https://github.com/ant-design/ant-design/issues/29559
[`${componentCls}-selection-search`]: {
marginInlineStart: 2 // Magic Number
}
}
},
// ======================== Large ========================
genSizeStyle(largeToken, 'lg')];
};
export default genMultipleStyle;

3
node_modules/antd/es/select/style/single.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
import type { SelectToken } from './token';
export default function genSingleStyle(token: SelectToken): CSSInterpolation;

148
node_modules/antd/es/select/style/single.js generated vendored Normal file
View File

@@ -0,0 +1,148 @@
import { unit } from '@ant-design/cssinjs';
import { resetComponent } from '../../style';
import { mergeToken } from '../../theme/internal';
function genSizeStyle(token, suffix) {
const {
componentCls,
inputPaddingHorizontalBase,
borderRadius
} = token;
const selectHeightWithoutBorder = token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal();
const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
return {
[`${componentCls}-single${suffixCls}`]: {
fontSize: token.fontSize,
height: token.controlHeight,
// ========================= Selector =========================
[`${componentCls}-selector`]: Object.assign(Object.assign({}, resetComponent(token, true)), {
display: 'flex',
borderRadius,
flex: '1 1 auto',
[`${componentCls}-selection-wrap:after`]: {
lineHeight: unit(selectHeightWithoutBorder)
},
[`${componentCls}-selection-search`]: {
position: 'absolute',
inset: 0,
width: '100%',
'&-input': {
width: '100%',
WebkitAppearance: 'textfield'
}
},
[`
${componentCls}-selection-item,
${componentCls}-selection-placeholder
`]: {
display: 'block',
padding: 0,
lineHeight: unit(selectHeightWithoutBorder),
transition: `all ${token.motionDurationSlow}, visibility 0s`,
alignSelf: 'center'
},
[`${componentCls}-selection-placeholder`]: {
transition: 'none',
pointerEvents: 'none'
},
// For common baseline align
[['&:after', /* For '' value baseline align */
`${componentCls}-selection-item:empty:after`, /* For undefined value baseline align */
`${componentCls}-selection-placeholder:empty:after`].join(',')]: {
display: 'inline-block',
width: 0,
visibility: 'hidden',
content: '"\\a0"'
}
}),
[`
&${componentCls}-show-arrow ${componentCls}-selection-item,
&${componentCls}-show-arrow ${componentCls}-selection-search,
&${componentCls}-show-arrow ${componentCls}-selection-placeholder
`]: {
paddingInlineEnd: token.showArrowPaddingInlineEnd
},
// Opacity selection if open
[`&${componentCls}-open ${componentCls}-selection-item`]: {
color: token.colorTextPlaceholder
},
// ========================== Input ==========================
// We only change the style of non-customize input which is only support by `combobox` mode.
// Not customize
[`&:not(${componentCls}-customize-input)`]: {
[`${componentCls}-selector`]: {
width: '100%',
height: '100%',
alignItems: 'center',
padding: `0 ${unit(inputPaddingHorizontalBase)}`,
[`${componentCls}-selection-search-input`]: {
height: selectHeightWithoutBorder,
fontSize: token.fontSize
},
'&:after': {
lineHeight: unit(selectHeightWithoutBorder)
}
}
},
[`&${componentCls}-customize-input`]: {
[`${componentCls}-selector`]: {
'&:after': {
display: 'none'
},
[`${componentCls}-selection-search`]: {
position: 'static',
width: '100%'
},
[`${componentCls}-selection-placeholder`]: {
position: 'absolute',
insetInlineStart: 0,
insetInlineEnd: 0,
padding: `0 ${unit(inputPaddingHorizontalBase)}`,
'&:after': {
display: 'none'
}
}
}
}
}
};
}
export default function genSingleStyle(token) {
const {
componentCls
} = token;
const inputPaddingHorizontalSM = token.calc(token.controlPaddingHorizontalSM).sub(token.lineWidth).equal();
return [genSizeStyle(token),
// ======================== Small ========================
// Shared
genSizeStyle(mergeToken(token, {
controlHeight: token.controlHeightSM,
borderRadius: token.borderRadiusSM
}), 'sm'),
// padding
{
[`${componentCls}-single${componentCls}-sm`]: {
[`&:not(${componentCls}-customize-input)`]: {
[`${componentCls}-selector`]: {
padding: `0 ${unit(inputPaddingHorizontalSM)}`
},
// With arrow should provides `padding-right` to show the arrow
[`&${componentCls}-show-arrow ${componentCls}-selection-search`]: {
insetInlineEnd: token.calc(inputPaddingHorizontalSM).add(token.calc(token.fontSize).mul(1.5)).equal()
},
[`
&${componentCls}-show-arrow ${componentCls}-selection-item,
&${componentCls}-show-arrow ${componentCls}-selection-placeholder
`]: {
paddingInlineEnd: token.calc(token.fontSize).mul(1.5).equal()
}
}
}
},
// ======================== Large ========================
// Shared
genSizeStyle(mergeToken(token, {
controlHeight: token.singleItemHeightLG,
fontSize: token.fontSizeLG,
borderRadius: token.borderRadiusLG
}), 'lg')];
}

138
node_modules/antd/es/select/style/token.d.ts generated vendored Normal file
View File

@@ -0,0 +1,138 @@
import type { CSSProperties } from 'react';
import type { FullToken, GetDefaultToken } from 'antd/es/theme/internal';
export interface MultipleSelectorToken {
/**
* @desc 多选标签背景色
* @descEN Background color of multiple tag
*/
multipleItemBg: string;
/**
* @desc 多选标签边框色
* @descEN Border color of multiple tag
*/
multipleItemBorderColor: string;
/**
* @desc 多选标签高度
* @descEN Height of multiple tag
*/
multipleItemHeight: number;
/**
* @desc 小号多选标签高度
* @descEN Height of multiple tag with small size
*/
multipleItemHeightSM: number;
/**
* @desc 大号多选标签高度
* @descEN Height of multiple tag with large size
*/
multipleItemHeightLG: number;
/**
* @desc 多选框禁用背景
* @descEN Background color of multiple selector when disabled
*/
multipleSelectorBgDisabled: string;
/**
* @desc 多选标签禁用文本颜色
* @descEN Text color of multiple tag when disabled
*/
multipleItemColorDisabled: string;
/**
* @desc 多选标签禁用边框色
* @descEN Border color of multiple tag when disabled
*/
multipleItemBorderColorDisabled: string;
}
export interface ComponentToken extends MultipleSelectorToken {
/**
* @desc 下拉菜单 z-index
* @descEN z-index of dropdown
*/
zIndexPopup: number;
/**
* @desc 选项选中时文本颜色
* @descEN Text color when option is selected
*/
optionSelectedColor: string;
/**
* @desc 选项选中时文本字重
* @descEN Font weight when option is selected
*/
optionSelectedFontWeight: CSSProperties['fontWeight'];
/**
* @desc 选项选中时背景色
* @descEN Background color when option is selected
*/
optionSelectedBg: string;
/**
* @desc 选项激活态时背景色
* @descEN Background color when option is active
*/
optionActiveBg: string;
/**
* @desc 选项内间距
* @descEN Padding of option
*/
optionPadding: CSSProperties['padding'];
/**
* @desc 选项字体大小
* @descEN Font size of option
*/
optionFontSize: number;
/**
* @desc 选项行高
* @descEN Line height of option
*/
optionLineHeight: CSSProperties['lineHeight'];
/**
* @desc 选项高度
* @descEN Height of option
*/
optionHeight: number;
/**
* @desc 选框背景色
* @descEN Background color of selector
*/
selectorBg: string;
/**
* @desc 清空按钮背景色
* @descEN Background color of clear button
*/
clearBg: string;
/**
* @desc 单选大号回填项高度
* @descEN Height of single selected item with large size
*/
singleItemHeightLG: number;
/**
* @desc 箭头的行末内边距
* @descEN Inline end padding of arrow
*/
showArrowPaddingInlineEnd: number;
/**
* @desc 悬浮态边框色
* @descEN Hover border color
*/
hoverBorderColor: string;
/**
* @desc 激活态边框色
* @descEN Active border color
*/
activeBorderColor: string;
/**
* @desc 激活态 outline 颜色
* @descEN Active outline color
*/
activeOutlineColor: string;
}
export interface SelectorToken {
selectAffixPadding: number | string;
inputPaddingHorizontalBase: number | string;
multipleSelectItemHeight: number;
selectHeight: number;
}
export interface SelectToken extends FullToken<'Select'>, SelectorToken {
rootPrefixCls: string;
/** @private Used for internal calculation */
INTERNAL_FIXED_ITEM_MARGIN: number;
}
export declare const prepareComponentToken: GetDefaultToken<'Select'>;

62
node_modules/antd/es/select/style/token.js generated vendored Normal file
View File

@@ -0,0 +1,62 @@
export const prepareComponentToken = token => {
const {
fontSize,
lineHeight,
lineWidth,
controlHeight,
controlHeightSM,
controlHeightLG,
paddingXXS,
controlPaddingHorizontal,
zIndexPopupBase,
colorText,
fontWeightStrong,
controlItemBgActive,
controlItemBgHover,
colorBgContainer,
colorFillSecondary,
colorBgContainerDisabled,
colorTextDisabled,
colorPrimaryHover,
colorPrimary,
controlOutline
} = token;
// Item height default use `controlHeight - 2 * paddingXXS`,
// but some case `paddingXXS=0`.
// Let's fallback it.
const dblPaddingXXS = paddingXXS * 2;
const dblLineWidth = lineWidth * 2;
const multipleItemHeight = Math.min(controlHeight - dblPaddingXXS, controlHeight - dblLineWidth);
const multipleItemHeightSM = Math.min(controlHeightSM - dblPaddingXXS, controlHeightSM - dblLineWidth);
const multipleItemHeightLG = Math.min(controlHeightLG - dblPaddingXXS, controlHeightLG - dblLineWidth);
// FIXED_ITEM_MARGIN is a hardcode calculation since calc not support rounding
const INTERNAL_FIXED_ITEM_MARGIN = Math.floor(paddingXXS / 2);
return {
INTERNAL_FIXED_ITEM_MARGIN,
zIndexPopup: zIndexPopupBase + 50,
optionSelectedColor: colorText,
optionSelectedFontWeight: fontWeightStrong,
optionSelectedBg: controlItemBgActive,
optionActiveBg: controlItemBgHover,
optionPadding: `${(controlHeight - fontSize * lineHeight) / 2}px ${controlPaddingHorizontal}px`,
optionFontSize: fontSize,
optionLineHeight: lineHeight,
optionHeight: controlHeight,
selectorBg: colorBgContainer,
clearBg: colorBgContainer,
singleItemHeightLG: controlHeightLG,
multipleItemBg: colorFillSecondary,
multipleItemBorderColor: 'transparent',
multipleItemHeight,
multipleItemHeightSM,
multipleItemHeightLG,
multipleSelectorBgDisabled: colorBgContainerDisabled,
multipleItemColorDisabled: colorTextDisabled,
multipleItemBorderColorDisabled: 'transparent',
showArrowPaddingInlineEnd: Math.ceil(token.fontSize * 1.25),
hoverBorderColor: colorPrimaryHover,
activeBorderColor: colorPrimary,
activeOutlineColor: controlOutline,
selectAffixPadding: paddingXXS
};
};

4
node_modules/antd/es/select/style/variants.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import type { CSSObject } from '@ant-design/cssinjs';
import type { SelectToken } from './token';
declare const genVariantsStyle: (token: SelectToken) => CSSObject;
export default genVariantsStyle;

229
node_modules/antd/es/select/style/variants.js generated vendored Normal file
View File

@@ -0,0 +1,229 @@
import { unit } from '@ant-design/cssinjs';
// =====================================================
// == Outlined ==
// =====================================================
const genBaseOutlinedStyle = (token, options) => {
const {
componentCls,
antCls,
controlOutlineWidth
} = token;
return {
[`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: {
border: `${unit(token.lineWidth)} ${token.lineType} ${options.borderColor}`,
background: token.selectorBg
},
[`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: {
[`&:hover ${componentCls}-selector`]: {
borderColor: options.hoverBorderHover
},
[`${componentCls}-focused& ${componentCls}-selector`]: {
borderColor: options.activeBorderColor,
boxShadow: `0 0 0 ${unit(controlOutlineWidth)} ${options.activeOutlineColor}`,
outline: 0
},
[`${componentCls}-prefix`]: {
color: options.color
}
}
};
};
const genOutlinedStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}`]: Object.assign({}, genBaseOutlinedStyle(token, options))
});
const genOutlinedStyle = token => ({
'&-outlined': Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseOutlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderHover: token.hoverBorderColor,
activeBorderColor: token.activeBorderColor,
activeOutlineColor: token.activeOutlineColor,
color: token.colorText
})), genOutlinedStatusStyle(token, {
status: 'error',
borderColor: token.colorError,
hoverBorderHover: token.colorErrorHover,
activeBorderColor: token.colorError,
activeOutlineColor: token.colorErrorOutline,
color: token.colorError
})), genOutlinedStatusStyle(token, {
status: 'warning',
borderColor: token.colorWarning,
hoverBorderHover: token.colorWarningHover,
activeBorderColor: token.colorWarning,
activeOutlineColor: token.colorWarningOutline,
color: token.colorWarning
})), {
[`&${token.componentCls}-disabled`]: {
[`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
background: token.colorBgContainerDisabled,
color: token.colorTextDisabled
}
},
[`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
background: token.multipleItemBg,
border: `${unit(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
}
})
});
// =====================================================
// == Filled ==
// =====================================================
const genBaseFilledStyle = (token, options) => {
const {
componentCls,
antCls
} = token;
return {
[`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: {
background: options.bg,
border: `${unit(token.lineWidth)} ${token.lineType} transparent`,
color: options.color
},
[`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: {
[`&:hover ${componentCls}-selector`]: {
background: options.hoverBg
},
[`${componentCls}-focused& ${componentCls}-selector`]: {
background: token.selectorBg,
borderColor: options.activeBorderColor,
outline: 0
}
}
};
};
const genFilledStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}`]: Object.assign({}, genBaseFilledStyle(token, options))
});
const genFilledStyle = token => ({
'&-filled': Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseFilledStyle(token, {
bg: token.colorFillTertiary,
hoverBg: token.colorFillSecondary,
activeBorderColor: token.activeBorderColor,
color: token.colorText
})), genFilledStatusStyle(token, {
status: 'error',
bg: token.colorErrorBg,
hoverBg: token.colorErrorBgHover,
activeBorderColor: token.colorError,
color: token.colorError
})), genFilledStatusStyle(token, {
status: 'warning',
bg: token.colorWarningBg,
hoverBg: token.colorWarningBgHover,
activeBorderColor: token.colorWarning,
color: token.colorWarning
})), {
[`&${token.componentCls}-disabled`]: {
[`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
borderColor: token.colorBorder,
background: token.colorBgContainerDisabled,
color: token.colorTextDisabled
}
},
[`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
background: token.colorBgContainer,
border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
}
})
});
// =====================================================
// == Borderless ==
// =====================================================
const genBorderlessStyle = token => ({
'&-borderless': {
[`${token.componentCls}-selector`]: {
background: 'transparent',
border: `${unit(token.lineWidth)} ${token.lineType} transparent`
},
[`&${token.componentCls}-disabled`]: {
[`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
color: token.colorTextDisabled
}
},
[`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
background: token.multipleItemBg,
border: `${unit(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
},
// Status
[`&${token.componentCls}-status-error`]: {
[`${token.componentCls}-prefix, ${token.componentCls}-selection-item`]: {
color: token.colorError
}
},
[`&${token.componentCls}-status-warning`]: {
[`${token.componentCls}-prefix, ${token.componentCls}-selection-item`]: {
color: token.colorWarning
}
}
}
});
// =====================================================
// == Underlined ==
// =====================================================
const genBaseUnderlinedStyle = (token, options) => {
const {
componentCls,
antCls
} = token;
return {
[`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: {
borderWidth: `${unit(token.lineWidth)} 0`,
borderStyle: `${token.lineType} none`,
borderColor: `transparent transparent ${options.borderColor} transparent`,
background: token.selectorBg,
borderRadius: 0
},
[`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: {
[`&:hover ${componentCls}-selector`]: {
borderColor: `transparent transparent ${options.hoverBorderHover} transparent`
},
[`${componentCls}-focused& ${componentCls}-selector`]: {
borderColor: `transparent transparent ${options.activeBorderColor} transparent`,
outline: 0
},
[`${componentCls}-prefix`]: {
color: options.color
}
}
};
};
const genUnderlinedStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}`]: Object.assign({}, genBaseUnderlinedStyle(token, options))
});
const genUnderlinedStyle = token => ({
'&-underlined': Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseUnderlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderHover: token.hoverBorderColor,
activeBorderColor: token.activeBorderColor,
activeOutlineColor: token.activeOutlineColor,
color: token.colorText
})), genUnderlinedStatusStyle(token, {
status: 'error',
borderColor: token.colorError,
hoverBorderHover: token.colorErrorHover,
activeBorderColor: token.colorError,
activeOutlineColor: token.colorErrorOutline,
color: token.colorError
})), genUnderlinedStatusStyle(token, {
status: 'warning',
borderColor: token.colorWarning,
hoverBorderHover: token.colorWarningHover,
activeBorderColor: token.colorWarning,
activeOutlineColor: token.colorWarningOutline,
color: token.colorWarning
})), {
[`&${token.componentCls}-disabled`]: {
[`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
color: token.colorTextDisabled
}
},
[`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
background: token.multipleItemBg,
border: `${unit(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
}
})
});
const genVariantsStyle = token => ({
[token.componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)), genUnderlinedStyle(token))
});
export default genVariantsStyle;

26
node_modules/antd/es/select/useIcons.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import type { ReactNode } from 'react';
import * as React from 'react';
type RenderNode = React.ReactNode | ((props: any) => React.ReactNode);
export default function useIcons({ suffixIcon, clearIcon, menuItemSelectedIcon, removeIcon, loading, multiple, hasFeedback, prefixCls, showSuffixIcon, feedbackIcon, showArrow, componentName, }: {
suffixIcon?: React.ReactNode;
clearIcon?: RenderNode;
menuItemSelectedIcon?: RenderNode;
removeIcon?: RenderNode;
loading?: boolean;
multiple?: boolean;
hasFeedback?: boolean;
feedbackIcon?: ReactNode;
prefixCls: string;
showSuffixIcon?: boolean;
showArrow?: boolean;
componentName: string;
}): {
clearIcon: string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | React.JSX.Element | ((props: any) => React.ReactNode);
suffixIcon: React.JSX.Element | (({ open, showSearch }: {
open: boolean;
showSearch: boolean;
}) => React.JSX.Element | null) | null;
itemIcon: string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | React.JSX.Element | ((props: any) => React.ReactNode) | null;
removeIcon: string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | React.JSX.Element | ((props: any) => React.ReactNode) | null;
};
export {};

83
node_modules/antd/es/select/useIcons.js generated vendored Normal file
View File

@@ -0,0 +1,83 @@
"use client";
import * as React from 'react';
import CheckOutlined from "@ant-design/icons/es/icons/CheckOutlined";
import CloseCircleFilled from "@ant-design/icons/es/icons/CloseCircleFilled";
import CloseOutlined from "@ant-design/icons/es/icons/CloseOutlined";
import DownOutlined from "@ant-design/icons/es/icons/DownOutlined";
import LoadingOutlined from "@ant-design/icons/es/icons/LoadingOutlined";
import SearchOutlined from "@ant-design/icons/es/icons/SearchOutlined";
import { devUseWarning } from '../_util/warning';
export default function useIcons({
suffixIcon,
clearIcon,
menuItemSelectedIcon,
removeIcon,
loading,
multiple,
hasFeedback,
prefixCls,
showSuffixIcon,
feedbackIcon,
showArrow,
componentName
}) {
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning(componentName);
warning.deprecated(!clearIcon, 'clearIcon', 'allowClear={{ clearIcon: React.ReactNode }}');
}
// Clear Icon
const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /*#__PURE__*/React.createElement(CloseCircleFilled, null);
// Validation Feedback Icon
const getSuffixIconNode = arrowIcon => {
if (suffixIcon === null && !hasFeedback && !showArrow) {
return null;
}
return /*#__PURE__*/React.createElement(React.Fragment, null, showSuffixIcon !== false && arrowIcon, hasFeedback && feedbackIcon);
};
// Arrow item icon
let mergedSuffixIcon = null;
if (suffixIcon !== undefined) {
mergedSuffixIcon = getSuffixIconNode(suffixIcon);
} else if (loading) {
mergedSuffixIcon = getSuffixIconNode(/*#__PURE__*/React.createElement(LoadingOutlined, {
spin: true
}));
} else {
const iconCls = `${prefixCls}-suffix`;
mergedSuffixIcon = ({
open,
showSearch
}) => {
if (open && showSearch) {
return getSuffixIconNode(/*#__PURE__*/React.createElement(SearchOutlined, {
className: iconCls
}));
}
return getSuffixIconNode(/*#__PURE__*/React.createElement(DownOutlined, {
className: iconCls
}));
};
}
// Checked item icon
let mergedItemIcon = null;
if (menuItemSelectedIcon !== undefined) {
mergedItemIcon = menuItemSelectedIcon;
} else if (multiple) {
mergedItemIcon = /*#__PURE__*/React.createElement(CheckOutlined, null);
} else {
mergedItemIcon = null;
}
let mergedRemoveIcon = null;
if (removeIcon !== undefined) {
mergedRemoveIcon = removeIcon;
} else {
mergedRemoveIcon = /*#__PURE__*/React.createElement(CloseOutlined, null);
}
return {
clearIcon: mergedClearIcon,
suffixIcon: mergedSuffixIcon,
itemIcon: mergedItemIcon,
removeIcon: mergedRemoveIcon
};
}

4
node_modules/antd/es/select/usePopupRender.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import React from 'react';
type RenderFunction<T extends any[]> = (...args: T) => React.ReactNode;
declare function usePopupRender<T extends [React.ReactElement, ...any[]]>(renderFn?: RenderFunction<T>): ((...args: T) => React.ReactElement) | undefined;
export default usePopupRender;

15
node_modules/antd/es/select/usePopupRender.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use client";
import React from 'react';
import ContextIsolator from '../_util/ContextIsolator';
function usePopupRender(renderFn) {
return React.useMemo(() => {
if (!renderFn) {
return undefined;
}
return (...args) => /*#__PURE__*/React.createElement(ContextIsolator, {
space: true
}, renderFn.apply(void 0, args));
}, [renderFn]);
}
export default usePopupRender;

8
node_modules/antd/es/select/useShowArrow.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import type { ReactNode } from 'react';
/**
* Since Select, TreeSelect, Cascader is same Select like component.
* We just use same hook to handle this logic.
*
* If `suffixIcon` is not equal to `null`, always show it.
*/
export default function useShowArrow(suffixIcon?: ReactNode, showArrow?: boolean): boolean;

9
node_modules/antd/es/select/useShowArrow.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/**
* Since Select, TreeSelect, Cascader is same Select like component.
* We just use same hook to handle this logic.
*
* If `suffixIcon` is not equal to `null`, always show it.
*/
export default function useShowArrow(suffixIcon, showArrow) {
return showArrow !== undefined ? showArrow : suffixIcon !== null;
}