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

16
node_modules/antd/es/input/Group.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import * as React from 'react';
export interface GroupProps {
className?: string;
size?: 'large' | 'small' | 'default';
children?: React.ReactNode;
style?: React.CSSProperties;
onMouseEnter?: React.MouseEventHandler<HTMLSpanElement>;
onMouseLeave?: React.MouseEventHandler<HTMLSpanElement>;
onFocus?: React.FocusEventHandler<HTMLSpanElement>;
onBlur?: React.FocusEventHandler<HTMLSpanElement>;
prefixCls?: string;
compact?: boolean;
}
/** @deprecated Please use `Space.Compact` */
declare const Group: React.FC<GroupProps>;
export default Group;

48
node_modules/antd/es/input/Group.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use client";
import * as React from 'react';
import { useContext, useMemo } from 'react';
import classNames from 'classnames';
import { devUseWarning } from '../_util/warning';
import { ConfigContext } from '../config-provider';
import { FormItemInputContext } from '../form/context';
import useStyle from './style';
/** @deprecated Please use `Space.Compact` */
const Group = props => {
const {
getPrefixCls,
direction
} = useContext(ConfigContext);
const {
prefixCls: customizePrefixCls,
className
} = props;
const prefixCls = getPrefixCls('input-group', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input');
const [wrapCSSVar, hashId, cssVarCls] = useStyle(inputPrefixCls);
const cls = classNames(prefixCls, cssVarCls, {
[`${prefixCls}-lg`]: props.size === 'large',
[`${prefixCls}-sm`]: props.size === 'small',
[`${prefixCls}-compact`]: props.compact,
[`${prefixCls}-rtl`]: direction === 'rtl'
}, hashId, className);
const formItemContext = useContext(FormItemInputContext);
const groupFormItemContext = useMemo(() => Object.assign(Object.assign({}, formItemContext), {
isFormItemInput: false
}), [formItemContext]);
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Input.Group');
warning.deprecated(false, 'Input.Group', 'Space.Compact');
}
return wrapCSSVar(/*#__PURE__*/React.createElement("span", {
className: cls,
style: props.style,
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
onFocus: props.onFocus,
onBlur: props.onBlur
}, /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {
value: groupFormItemContext
}, props.children)));
};
export default Group;

59
node_modules/antd/es/input/Input.d.ts generated vendored Normal file
View File

@@ -0,0 +1,59 @@
import React from 'react';
import type { InputRef, InputProps as RcInputProps } from 'rc-input';
import { triggerFocus } from 'rc-input/lib/utils/commonUtils';
import type { InputFocusOptions } from 'rc-input/lib/utils/commonUtils';
import type { InputStatus } from '../_util/statusUtils';
import type { Variant } from '../config-provider';
import type { SizeType } from '../config-provider/SizeContext';
export type { InputFocusOptions };
export type { InputRef };
export { triggerFocus };
type SemanticName = 'prefix' | 'suffix' | 'input' | 'count';
export interface InputProps extends Omit<RcInputProps, 'wrapperClassName' | 'groupClassName' | 'inputClassName' | 'affixWrapperClassName' | 'classes'> {
rootClassName?: string;
size?: SizeType;
disabled?: boolean;
status?: InputStatus;
/**
* @deprecated Use `Space.Compact` instead.
*
* @example
* ```tsx
* import { Space, Input } from 'antd';
*
* <Space.Compact>
* {addon}
* <Input defaultValue="name" />
* </Space.Compact>
* ```
*/
addonBefore?: React.ReactNode;
/**
* @deprecated Use `Space.Compact` instead.
*
* @example
* ```tsx
* import { Space, Input } from 'antd';
*
* <Space.Compact>
* <Input defaultValue="name" />
* {addon}
* </Space.Compact>
* ```
*/
addonAfter?: React.ReactNode;
/** @deprecated Use `variant="borderless"` instead. */
bordered?: boolean;
/**
* @since 5.13.0
* @default "outlined"
*/
variant?: Variant;
classNames?: Partial<Record<SemanticName, string>>;
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
[key: `data-${string}`]: string | undefined;
/** @private Skip warning of addon. Only work in dev mode */
_skipAddonWarning?: boolean;
}
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
export default Input;

185
node_modules/antd/es/input/Input.js generated vendored Normal file
View File

@@ -0,0 +1,185 @@
"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 React, { forwardRef, useContext, useEffect, useRef } from 'react';
import cls from 'classnames';
import RcInput from 'rc-input';
import { triggerFocus } from "rc-input/es/utils/commonUtils";
import { composeRef } from "rc-util/es/ref";
import ContextIsolator from '../_util/ContextIsolator';
import getAllowClear from '../_util/getAllowClear';
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
import { devUseWarning } from '../_util/warning';
import { useComponentConfig } from '../config-provider/context';
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 useVariant from '../form/hooks/useVariants';
import { useCompactItemContext } from '../space/Compact';
import useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';
import useStyle, { useSharedStyle } from './style';
import { hasPrefixSuffix } from './utils';
export { triggerFocus };
const Input = /*#__PURE__*/forwardRef((props, ref) => {
const {
prefixCls: customizePrefixCls,
bordered = true,
status: customStatus,
size: customSize,
disabled: customDisabled,
onBlur,
onFocus,
suffix,
allowClear,
addonAfter,
addonBefore,
className,
style,
styles,
rootClassName,
onChange,
classNames,
variant: customVariant,
_skipAddonWarning
} = props,
rest = __rest(props, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant", "_skipAddonWarning"]);
if (process.env.NODE_ENV !== 'production') {
const {
deprecated
} = devUseWarning('Input');
deprecated(!('bordered' in props), 'bordered', 'variant');
if (!_skipAddonWarning) {
[['addonAfter', 'Space.Compact'], ['addonBefore', 'Space.Compact']].forEach(([prop, newProp]) => {
deprecated(!(prop in props), prop, newProp);
});
}
}
const {
getPrefixCls,
direction,
allowClear: contextAllowClear,
autoComplete: contextAutoComplete,
className: contextClassName,
style: contextStyle,
classNames: contextClassNames,
styles: contextStyles
} = useComponentConfig('input');
const prefixCls = getPrefixCls('input', customizePrefixCls);
const inputRef = useRef(null);
// Style
const rootCls = useCSSVarCls(prefixCls);
const [wrapSharedCSSVar, hashId, cssVarCls] = useSharedStyle(prefixCls, rootClassName);
const [wrapCSSVar] = useStyle(prefixCls, rootCls);
// ===================== Compact Item =====================
const {
compactSize,
compactItemClassnames
} = useCompactItemContext(prefixCls, direction);
// ===================== Size =====================
const mergedSize = useSize(ctx => {
var _a;
return (_a = customSize !== null && customSize !== void 0 ? customSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
});
// ===================== Disabled =====================
const disabled = React.useContext(DisabledContext);
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
// ===================== Status =====================
const {
status: contextStatus,
hasFeedback,
feedbackIcon
} = useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
// ===================== Focus warning =====================
const inputHasPrefixSuffix = hasPrefixSuffix(props) || !!hasFeedback;
const prevHasPrefixSuffix = useRef(inputHasPrefixSuffix);
/* eslint-disable react-hooks/rules-of-hooks */
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Input');
// biome-ignore lint/correctness/useHookAtTopLevel: Development-only warning hook called conditionally
useEffect(() => {
var _a;
if (inputHasPrefixSuffix && !prevHasPrefixSuffix.current) {
process.env.NODE_ENV !== "production" ? warning(document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input), 'usage', `When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ`) : void 0;
}
prevHasPrefixSuffix.current = inputHasPrefixSuffix;
}, [inputHasPrefixSuffix]);
}
/* eslint-enable */
// ===================== Remove Password value =====================
const removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
const handleBlur = e => {
removePasswordTimeout();
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
};
const handleFocus = e => {
removePasswordTimeout();
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
};
const handleChange = e => {
removePasswordTimeout();
onChange === null || onChange === void 0 ? void 0 : onChange(e);
};
const suffixNode = (hasFeedback || suffix) && (/*#__PURE__*/React.createElement(React.Fragment, null, suffix, hasFeedback && feedbackIcon));
const mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
const [variant, enableVariantCls] = useVariant('input', customVariant, bordered);
return wrapSharedCSSVar(wrapCSSVar(/*#__PURE__*/React.createElement(RcInput, Object.assign({
ref: composeRef(ref, inputRef),
prefixCls: prefixCls,
autoComplete: contextAutoComplete
}, rest, {
disabled: mergedDisabled,
onBlur: handleBlur,
onFocus: handleFocus,
style: Object.assign(Object.assign({}, contextStyle), style),
styles: Object.assign(Object.assign({}, contextStyles), styles),
suffix: suffixNode,
allowClear: mergedAllowClear,
className: cls(className, rootClassName, cssVarCls, rootCls, compactItemClassnames, contextClassName),
onChange: handleChange,
addonBefore: addonBefore && (/*#__PURE__*/React.createElement(ContextIsolator, {
form: true,
space: true
}, addonBefore)),
addonAfter: addonAfter && (/*#__PURE__*/React.createElement(ContextIsolator, {
form: true,
space: true
}, addonAfter)),
classNames: Object.assign(Object.assign(Object.assign({}, classNames), contextClassNames), {
input: cls({
[`${prefixCls}-sm`]: mergedSize === 'small',
[`${prefixCls}-lg`]: mergedSize === 'large',
[`${prefixCls}-rtl`]: direction === 'rtl'
}, classNames === null || classNames === void 0 ? void 0 : classNames.input, contextClassNames.input, hashId),
variant: cls({
[`${prefixCls}-${variant}`]: enableVariantCls
}, getStatusClassNames(prefixCls, mergedStatus)),
affixWrapper: cls({
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
[`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl'
}, hashId),
wrapper: cls({
[`${prefixCls}-group-rtl`]: direction === 'rtl'
}, hashId),
groupWrapper: cls({
[`${prefixCls}-group-wrapper-sm`]: mergedSize === 'small',
[`${prefixCls}-group-wrapper-lg`]: mergedSize === 'large',
[`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
[`${prefixCls}-group-wrapper-${variant}`]: enableVariantCls
}, getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback), hashId)
})
}))));
});
if (process.env.NODE_ENV !== 'production') {
Input.displayName = 'Input';
}
export default Input;

11
node_modules/antd/es/input/OTP/OTPInput.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import * as React from 'react';
import type { InputProps, InputRef } from '../Input';
export interface OTPInputProps extends Omit<InputProps, 'onChange'> {
index: number;
onChange: (index: number, value: string) => void;
/** Tell parent to do active offset */
onActiveChange: (nextIndex: number) => void;
mask?: boolean | string;
}
declare const OTPInput: React.ForwardRefExoticComponent<OTPInputProps & React.RefAttributes<InputRef>>;
export default OTPInput;

89
node_modules/antd/es/input/OTP/OTPInput.js generated vendored Normal file
View File

@@ -0,0 +1,89 @@
"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 classNames from 'classnames';
import raf from "rc-util/es/raf";
import { ConfigContext } from '../../config-provider';
import Input from '../Input';
const OTPInput = /*#__PURE__*/React.forwardRef((props, ref) => {
const {
className,
value,
onChange,
onActiveChange,
index,
mask
} = props,
restProps = __rest(props, ["className", "value", "onChange", "onActiveChange", "index", "mask"]);
const {
getPrefixCls
} = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('otp');
const maskValue = typeof mask === 'string' ? mask : value;
// ========================== Ref ===========================
const inputRef = React.useRef(null);
React.useImperativeHandle(ref, () => inputRef.current);
// ========================= Input ==========================
const onInternalChange = e => {
onChange(index, e.target.value);
};
// ========================= Focus ==========================
const syncSelection = () => {
raf(() => {
var _a;
const inputEle = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
if (document.activeElement === inputEle && inputEle) {
inputEle.select();
}
});
};
// ======================== Keyboard ========================
const onInternalKeyDown = event => {
const {
key,
ctrlKey,
metaKey
} = event;
if (key === 'ArrowLeft') {
onActiveChange(index - 1);
} else if (key === 'ArrowRight') {
onActiveChange(index + 1);
} else if (key === 'z' && (ctrlKey || metaKey)) {
event.preventDefault();
} else if (key === 'Backspace' && !value) {
onActiveChange(index - 1);
}
syncSelection();
};
// ========================= Render =========================
return /*#__PURE__*/React.createElement("span", {
className: `${prefixCls}-input-wrapper`,
role: "presentation"
}, mask && value !== '' && value !== undefined && (/*#__PURE__*/React.createElement("span", {
className: `${prefixCls}-mask-icon`,
"aria-hidden": "true"
}, maskValue)), /*#__PURE__*/React.createElement(Input, Object.assign({
"aria-label": `OTP Input ${index + 1}`,
type: mask === true ? 'password' : 'text'
}, restProps, {
ref: inputRef,
value: value,
onInput: onInternalChange,
onFocus: syncSelection,
onKeyDown: onInternalKeyDown,
onMouseDown: syncSelection,
onMouseUp: syncSelection,
className: classNames(className, {
[`${prefixCls}-mask-input`]: mask
})
})));
});
export default OTPInput;

30
node_modules/antd/es/input/OTP/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import * as React from 'react';
import type { InputStatus } from '../../_util/statusUtils';
import type { Variant } from '../../config-provider';
import type { SizeType } from '../../config-provider/SizeContext';
export interface OTPRef {
focus: VoidFunction;
blur: VoidFunction;
nativeElement: HTMLDivElement;
}
export interface OTPProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onInput'> {
prefixCls?: string;
length?: number;
variant?: Variant;
rootClassName?: string;
className?: string;
style?: React.CSSProperties;
size?: SizeType;
defaultValue?: string;
value?: string;
onChange?: (value: string) => void;
formatter?: (value: string) => string;
separator?: ((index: number) => React.ReactNode) | React.ReactNode;
disabled?: boolean;
status?: InputStatus;
mask?: boolean | string;
type?: React.HTMLInputTypeAttribute;
onInput?: (value: string[]) => void;
}
declare const OTP: React.ForwardRefExoticComponent<OTPProps & React.RefAttributes<OTPRef>>;
export default OTP;

212
node_modules/antd/es/input/OTP/index.js generated vendored Normal file
View File

@@ -0,0 +1,212 @@
"use client";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
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 classNames from 'classnames';
import useEvent from "rc-util/es/hooks/useEvent";
import pickAttrs from "rc-util/es/pickAttrs";
import { getMergedStatus } from '../../_util/statusUtils';
import { devUseWarning } from '../../_util/warning';
import { ConfigContext } from '../../config-provider';
import useSize from '../../config-provider/hooks/useSize';
import { FormItemInputContext } from '../../form/context';
import useStyle from '../style/otp';
import OTPInput from './OTPInput';
function strToArr(str) {
return (str || '').split('');
}
const Separator = props => {
const {
index,
prefixCls,
separator
} = props;
const separatorNode = typeof separator === 'function' ? separator(index) : separator;
if (!separatorNode) {
return null;
}
return /*#__PURE__*/React.createElement("span", {
className: `${prefixCls}-separator`
}, separatorNode);
};
const OTP = /*#__PURE__*/React.forwardRef((props, ref) => {
const {
prefixCls: customizePrefixCls,
length = 6,
size: customSize,
defaultValue,
value,
onChange,
formatter,
separator,
variant,
disabled,
status: customStatus,
autoFocus,
mask,
type,
onInput,
inputMode
} = props,
restProps = __rest(props, ["prefixCls", "length", "size", "defaultValue", "value", "onChange", "formatter", "separator", "variant", "disabled", "status", "autoFocus", "mask", "type", "onInput", "inputMode"]);
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Input.OTP');
process.env.NODE_ENV !== "production" ? warning(!(typeof mask === 'string' && mask.length > 1), 'usage', '`mask` prop should be a single character.') : void 0;
}
const {
getPrefixCls,
direction
} = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('otp', customizePrefixCls);
const domAttrs = pickAttrs(restProps, {
aria: true,
data: true,
attr: true
});
// ========================= Root =========================
// Style
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
// ========================= Size =========================
const mergedSize = useSize(ctx => customSize !== null && customSize !== void 0 ? customSize : ctx);
// ======================== Status ========================
const formContext = React.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(formContext.status, customStatus);
const proxyFormContext = React.useMemo(() => Object.assign(Object.assign({}, formContext), {
status: mergedStatus,
hasFeedback: false,
feedbackIcon: null
}), [formContext, mergedStatus]);
// ========================= Refs =========================
const containerRef = React.useRef(null);
const refs = React.useRef({});
React.useImperativeHandle(ref, () => ({
focus: () => {
var _a;
(_a = refs.current[0]) === null || _a === void 0 ? void 0 : _a.focus();
},
blur: () => {
var _a;
for (let i = 0; i < length; i += 1) {
(_a = refs.current[i]) === null || _a === void 0 ? void 0 : _a.blur();
}
},
nativeElement: containerRef.current
}));
// ======================= Formatter ======================
const internalFormatter = txt => formatter ? formatter(txt) : txt;
// ======================== Values ========================
const [valueCells, setValueCells] = React.useState(() => strToArr(internalFormatter(defaultValue || '')));
React.useEffect(() => {
if (value !== undefined) {
setValueCells(strToArr(value));
}
}, [value]);
const triggerValueCellsChange = useEvent(nextValueCells => {
setValueCells(nextValueCells);
if (onInput) {
onInput(nextValueCells);
}
// Trigger if all cells are filled
if (onChange && nextValueCells.length === length && nextValueCells.every(c => c) && nextValueCells.some((c, index) => valueCells[index] !== c)) {
onChange(nextValueCells.join(''));
}
});
const patchValue = useEvent((index, txt) => {
let nextCells = _toConsumableArray(valueCells);
// Fill cells till index
for (let i = 0; i < index; i += 1) {
if (!nextCells[i]) {
nextCells[i] = '';
}
}
if (txt.length <= 1) {
nextCells[index] = txt;
} else {
nextCells = nextCells.slice(0, index).concat(strToArr(txt));
}
nextCells = nextCells.slice(0, length);
// Clean the last empty cell
for (let i = nextCells.length - 1; i >= 0; i -= 1) {
if (nextCells[i]) {
break;
}
nextCells.pop();
}
// Format if needed
const formattedValue = internalFormatter(nextCells.map(c => c || ' ').join(''));
nextCells = strToArr(formattedValue).map((c, i) => {
if (c === ' ' && !nextCells[i]) {
return nextCells[i];
}
return c;
});
return nextCells;
});
// ======================== Change ========================
const onInputChange = (index, txt) => {
var _a;
const nextCells = patchValue(index, txt);
const nextIndex = Math.min(index + txt.length, length - 1);
if (nextIndex !== index && nextCells[index] !== undefined) {
(_a = refs.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
}
triggerValueCellsChange(nextCells);
};
const onInputActiveChange = nextIndex => {
var _a;
(_a = refs.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
};
// ======================== Render ========================
const inputSharedProps = {
variant,
disabled,
status: mergedStatus,
mask,
type,
inputMode
};
return wrapCSSVar(/*#__PURE__*/React.createElement("div", Object.assign({}, domAttrs, {
ref: containerRef,
className: classNames(prefixCls, {
[`${prefixCls}-sm`]: mergedSize === 'small',
[`${prefixCls}-lg`]: mergedSize === 'large',
[`${prefixCls}-rtl`]: direction === 'rtl'
}, cssVarCls, hashId),
role: "group"
}), /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {
value: proxyFormContext
}, Array.from({
length
}).map((_, index) => {
const key = `otp-${index}`;
const singleValue = valueCells[index] || '';
return /*#__PURE__*/React.createElement(React.Fragment, {
key: key
}, /*#__PURE__*/React.createElement(OTPInput, Object.assign({
ref: inputEle => {
refs.current[index] = inputEle;
},
index: index,
size: mergedSize,
htmlSize: 1,
className: `${prefixCls}-input`,
onChange: onInputChange,
value: singleValue,
onActiveChange: onInputActiveChange,
autoFocus: index === 0 && autoFocus
}, inputSharedProps)), index < length - 1 && (/*#__PURE__*/React.createElement(Separator, {
separator: separator,
index: index,
prefixCls: prefixCls
})));
}))));
});
export default OTP;

18
node_modules/antd/es/input/Password.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import * as React from 'react';
import type { InputProps, InputRef } from './Input';
interface VisibilityToggle {
visible?: boolean;
onVisibleChange?: (visible: boolean) => void;
}
export interface PasswordProps extends InputProps {
readonly inputPrefixCls?: string;
readonly action?: 'click' | 'hover';
visibilityToggle?: boolean | VisibilityToggle;
/**
* @since 5.27.0
*/
suffix?: React.ReactNode;
iconRender?: (visible: boolean) => React.ReactNode;
}
declare const Password: React.ForwardRefExoticComponent<PasswordProps & React.RefAttributes<InputRef>>;
export default Password;

114
node_modules/antd/es/input/Password.js generated vendored Normal file
View File

@@ -0,0 +1,114 @@
"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 { useRef, useState } from 'react';
import EyeInvisibleOutlined from "@ant-design/icons/es/icons/EyeInvisibleOutlined";
import EyeOutlined from "@ant-design/icons/es/icons/EyeOutlined";
import classNames from 'classnames';
import omit from "rc-util/es/omit";
import { composeRef } from "rc-util/es/ref";
import { ConfigContext } from '../config-provider';
import DisabledContext from '../config-provider/DisabledContext';
import useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';
import Input from './Input';
const defaultIconRender = visible => visible ? /*#__PURE__*/React.createElement(EyeOutlined, null) : /*#__PURE__*/React.createElement(EyeInvisibleOutlined, null);
const actionMap = {
click: 'onClick',
hover: 'onMouseOver'
};
const Password = /*#__PURE__*/React.forwardRef((props, ref) => {
const {
disabled: customDisabled,
action = 'click',
visibilityToggle = true,
iconRender = defaultIconRender,
suffix
} = props;
// ===================== Disabled =====================
const disabled = React.useContext(DisabledContext);
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
const [visible, setVisible] = useState(() => visibilityControlled ? visibilityToggle.visible : false);
const inputRef = useRef(null);
React.useEffect(() => {
if (visibilityControlled) {
setVisible(visibilityToggle.visible);
}
}, [visibilityControlled, visibilityToggle]);
// Remove Password value
const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
const onVisibleChange = () => {
var _a;
if (mergedDisabled) {
return;
}
if (visible) {
removePasswordTimeout();
}
const nextVisible = !visible;
setVisible(nextVisible);
if (typeof visibilityToggle === 'object') {
(_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, nextVisible);
}
};
const getIcon = prefixCls => {
const iconTrigger = actionMap[action] || '';
const icon = iconRender(visible);
const iconProps = {
[iconTrigger]: onVisibleChange,
className: `${prefixCls}-icon`,
key: 'passwordIcon',
onMouseDown: e => {
// Prevent focused state lost
// https://github.com/ant-design/ant-design/issues/15173
e.preventDefault();
},
onMouseUp: e => {
// Prevent caret position change
// https://github.com/ant-design/ant-design/issues/23524
e.preventDefault();
}
};
return /*#__PURE__*/React.cloneElement(/*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement("span", null, icon), iconProps);
};
const {
className,
prefixCls: customizePrefixCls,
inputPrefixCls: customizeInputPrefixCls,
size
} = props,
restProps = __rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
const {
getPrefixCls
} = React.useContext(ConfigContext);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
const prefixCls = getPrefixCls('input-password', customizePrefixCls);
const suffixIcon = visibilityToggle && getIcon(prefixCls);
const inputClassName = classNames(prefixCls, className, {
[`${prefixCls}-${size}`]: !!size
});
const omittedProps = Object.assign(Object.assign({}, omit(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
type: visible ? 'text' : 'password',
className: inputClassName,
prefixCls: inputPrefixCls,
suffix: (/*#__PURE__*/React.createElement(React.Fragment, null, suffixIcon, suffix))
});
if (size) {
omittedProps.size = size;
}
return /*#__PURE__*/React.createElement(Input, Object.assign({
ref: composeRef(ref, inputRef)
}, omittedProps));
});
if (process.env.NODE_ENV !== 'production') {
Password.displayName = 'Input.Password';
}
export default Password;

13
node_modules/antd/es/input/Search.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import * as React from 'react';
import type { InputProps, InputRef } from './Input';
export interface SearchProps extends InputProps {
inputPrefixCls?: string;
onSearch?: (value: string, event?: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLInputElement>, info?: {
source?: 'clear' | 'input';
}) => void;
enterButton?: React.ReactNode;
loading?: boolean;
onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
}
declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<InputRef>>;
export default Search;

156
node_modules/antd/es/input/Search.js generated vendored Normal file
View File

@@ -0,0 +1,156 @@
"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 SearchOutlined from "@ant-design/icons/es/icons/SearchOutlined";
import classNames from 'classnames';
import { composeRef } from "rc-util/es/ref";
import { cloneElement } from '../_util/reactNode';
import Button from '../button';
import { ConfigContext } from '../config-provider';
import useSize from '../config-provider/hooks/useSize';
import { useCompactItemContext } from '../space/Compact';
import Input from './Input';
const Search = /*#__PURE__*/React.forwardRef((props, ref) => {
const {
prefixCls: customizePrefixCls,
inputPrefixCls: customizeInputPrefixCls,
className,
size: customizeSize,
suffix,
enterButton = false,
addonAfter,
loading,
disabled,
onSearch: customOnSearch,
onChange: customOnChange,
onCompositionStart,
onCompositionEnd,
variant,
onPressEnter: customOnPressEnter
} = props,
restProps = __rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd", "variant", "onPressEnter"]);
const {
getPrefixCls,
direction
} = React.useContext(ConfigContext);
const composedRef = React.useRef(false);
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
const {
compactSize
} = useCompactItemContext(prefixCls, direction);
const size = useSize(ctx => {
var _a;
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
});
const inputRef = React.useRef(null);
const onChange = e => {
if ((e === null || e === void 0 ? void 0 : e.target) && e.type === 'click' && customOnSearch) {
customOnSearch(e.target.value, e, {
source: 'clear'
});
}
customOnChange === null || customOnChange === void 0 ? void 0 : customOnChange(e);
};
const onMouseDown = e => {
var _a;
if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
e.preventDefault();
}
};
const onSearch = e => {
var _a, _b;
if (customOnSearch) {
customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e, {
source: 'input'
});
}
};
const onPressEnter = e => {
if (composedRef.current || loading) {
return;
}
customOnPressEnter === null || customOnPressEnter === void 0 ? void 0 : customOnPressEnter(e);
onSearch(e);
};
const searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/React.createElement(SearchOutlined, null) : null;
const btnClassName = `${prefixCls}-button`;
let button;
const enterButtonAsElement = enterButton || {};
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
if (isAntdButton || enterButtonAsElement.type === 'button') {
button = cloneElement(enterButtonAsElement, Object.assign({
onMouseDown,
onClick: e => {
var _a, _b;
(_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
onSearch(e);
},
key: 'enterButton'
}, isAntdButton ? {
className: btnClassName,
size
} : {}));
} else {
button = /*#__PURE__*/React.createElement(Button, {
className: btnClassName,
color: enterButton ? 'primary' : 'default',
size: size,
disabled: disabled,
key: "enterButton",
onMouseDown: onMouseDown,
onClick: onSearch,
loading: loading,
icon: searchIcon,
variant: variant === 'borderless' || variant === 'filled' || variant === 'underlined' ? 'text' : enterButton ? 'solid' : undefined
}, enterButton);
}
if (addonAfter) {
button = [button, cloneElement(addonAfter, {
key: 'addonAfter'
})];
}
const cls = classNames(prefixCls, {
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-${size}`]: !!size,
[`${prefixCls}-with-button`]: !!enterButton
}, className);
const handleOnCompositionStart = e => {
composedRef.current = true;
onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
};
const handleOnCompositionEnd = e => {
composedRef.current = false;
onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
};
const inputProps = Object.assign(Object.assign({}, restProps), {
className: cls,
prefixCls: inputPrefixCls,
type: 'search',
size,
variant,
onPressEnter,
onCompositionStart: handleOnCompositionStart,
onCompositionEnd: handleOnCompositionEnd,
addonAfter: button,
suffix,
onChange,
disabled,
_skipAddonWarning: true
});
return /*#__PURE__*/React.createElement(Input, Object.assign({
ref: composeRef(inputRef, ref)
}, inputProps));
});
if (process.env.NODE_ENV !== 'production') {
Search.displayName = 'Search';
}
export default Search;

25
node_modules/antd/es/input/TextArea.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import * as React from 'react';
import type { TextAreaProps as RcTextAreaProps, TextAreaRef as RcTextAreaRef } from 'rc-textarea';
import type { InputStatus } from '../_util/statusUtils';
import type { Variant } from '../config-provider';
import type { SizeType } from '../config-provider/SizeContext';
import type { InputFocusOptions } from './Input';
export interface TextAreaProps extends Omit<RcTextAreaProps, 'suffix'> {
/** @deprecated Use `variant` instead */
bordered?: boolean;
size?: SizeType;
status?: InputStatus;
rootClassName?: string;
/**
* @since 5.13.0
* @default "outlined"
*/
variant?: Variant;
}
export interface TextAreaRef {
focus: (options?: InputFocusOptions) => void;
blur: () => void;
resizableTextArea?: RcTextAreaRef['resizableTextArea'];
}
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaRef>>;
export default TextArea;

168
node_modules/antd/es/input/TextArea.js generated vendored Normal file
View File

@@ -0,0 +1,168 @@
"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 { forwardRef } from 'react';
import classNames from 'classnames';
import RcTextArea from 'rc-textarea';
import getAllowClear from '../_util/getAllowClear';
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
import { devUseWarning } from '../_util/warning';
import { useComponentConfig } from '../config-provider/context';
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 useVariant from '../form/hooks/useVariants';
import { useCompactItemContext } from '../space/Compact';
import { triggerFocus } from './Input';
import { useSharedStyle } from './style';
import useStyle from './style/textarea';
const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
var _a;
const {
prefixCls: customizePrefixCls,
bordered = true,
size: customizeSize,
disabled: customDisabled,
status: customStatus,
allowClear,
classNames: classes,
rootClassName,
className,
style,
styles,
variant: customVariant,
showCount,
onMouseDown,
onResize
} = props,
rest = __rest(props, ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "style", "styles", "variant", "showCount", "onMouseDown", "onResize"]);
if (process.env.NODE_ENV !== 'production') {
const {
deprecated
} = devUseWarning('TextArea');
deprecated(!('bordered' in props), 'bordered', 'variant');
}
const {
getPrefixCls,
direction,
allowClear: contextAllowClear,
autoComplete: contextAutoComplete,
className: contextClassName,
style: contextStyle,
classNames: contextClassNames,
styles: contextStyles
} = useComponentConfig('textArea');
// =================== Disabled ===================
const disabled = React.useContext(DisabledContext);
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
// ==================== Status ====================
const {
status: contextStatus,
hasFeedback,
feedbackIcon
} = React.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
// ===================== Ref ======================
const innerRef = React.useRef(null);
React.useImperativeHandle(ref, () => {
var _a;
return {
resizableTextArea: (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea,
focus: option => {
var _a, _b;
triggerFocus((_b = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) === null || _b === void 0 ? void 0 : _b.textArea, option);
},
blur: () => {
var _a;
return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();
}
};
});
const prefixCls = getPrefixCls('input', customizePrefixCls);
// ==================== Style =====================
const rootCls = useCSSVarCls(prefixCls);
const [wrapSharedCSSVar, hashId, cssVarCls] = useSharedStyle(prefixCls, rootClassName);
const [wrapCSSVar] = useStyle(prefixCls, rootCls);
// ================= Compact Item =================
const {
compactSize,
compactItemClassnames
} = useCompactItemContext(prefixCls, direction);
// ===================== Size =====================
const mergedSize = useSize(ctx => {
var _a;
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
});
const [variant, enableVariantCls] = useVariant('textArea', customVariant, bordered);
const mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
// ==================== Resize ====================
// https://github.com/ant-design/ant-design/issues/51594
const [isMouseDown, setIsMouseDown] = React.useState(false);
// When has wrapper, resize will make as dirty for `resize: both` style
const [resizeDirty, setResizeDirty] = React.useState(false);
const onInternalMouseDown = e => {
setIsMouseDown(true);
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
const onMouseUp = () => {
setIsMouseDown(false);
document.removeEventListener('mouseup', onMouseUp);
};
document.addEventListener('mouseup', onMouseUp);
};
const onInternalResize = size => {
var _a, _b;
onResize === null || onResize === void 0 ? void 0 : onResize(size);
// Change to dirty since this maybe from the `resize: both` style
if (isMouseDown && typeof getComputedStyle === 'function') {
const ele = (_b = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.querySelector('textarea');
if (ele && getComputedStyle(ele).resize === 'both') {
setResizeDirty(true);
}
}
};
// ==================== Render ====================
return wrapSharedCSSVar(wrapCSSVar(/*#__PURE__*/React.createElement(RcTextArea, Object.assign({
autoComplete: contextAutoComplete
}, rest, {
style: Object.assign(Object.assign({}, contextStyle), style),
styles: Object.assign(Object.assign({}, contextStyles), styles),
disabled: mergedDisabled,
allowClear: mergedAllowClear,
className: classNames(cssVarCls, rootCls, className, rootClassName, compactItemClassnames, contextClassName,
// Only for wrapper
resizeDirty && `${prefixCls}-textarea-affix-wrapper-resize-dirty`),
classNames: Object.assign(Object.assign(Object.assign({}, classes), contextClassNames), {
textarea: classNames({
[`${prefixCls}-sm`]: mergedSize === 'small',
[`${prefixCls}-lg`]: mergedSize === 'large'
}, hashId, classes === null || classes === void 0 ? void 0 : classes.textarea, contextClassNames.textarea, isMouseDown && `${prefixCls}-mouse-active`),
variant: classNames({
[`${prefixCls}-${variant}`]: enableVariantCls
}, getStatusClassNames(prefixCls, mergedStatus)),
affixWrapper: classNames(`${prefixCls}-textarea-affix-wrapper`, {
[`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl',
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
[`${prefixCls}-textarea-show-count`]: showCount || ((_a = props.count) === null || _a === void 0 ? void 0 : _a.show)
}, hashId)
}),
prefixCls: prefixCls,
suffix: hasFeedback && /*#__PURE__*/React.createElement("span", {
className: `${prefixCls}-textarea-suffix`
}, feedbackIcon),
showCount: showCount,
ref: innerRef,
onResize: onInternalResize,
onMouseDown: onInternalMouseDown
}))));
});
export default TextArea;

View File

@@ -0,0 +1,2 @@
import type { InputRef } from '../Input';
export default function useRemovePasswordTimeout(inputRef: React.RefObject<InputRef | null>, triggerOnMount?: boolean): () => void;

View File

@@ -0,0 +1,23 @@
import { useEffect, useRef } from 'react';
export default function useRemovePasswordTimeout(inputRef, triggerOnMount) {
const removePasswordTimeoutRef = useRef([]);
const removePasswordTimeout = () => {
removePasswordTimeoutRef.current.push(setTimeout(() => {
var _a, _b, _c, _d;
if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute('type')) === 'password' && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute('value'))) {
(_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute('value');
}
}));
};
useEffect(() => {
if (triggerOnMount) {
removePasswordTimeout();
}
return () => removePasswordTimeoutRef.current.forEach(timer => {
if (timer) {
clearTimeout(timer);
}
});
}, []);
return removePasswordTimeout;
}

21
node_modules/antd/es/input/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import Group from './Group';
import InternalInput from './Input';
import OTP from './OTP';
import Password from './Password';
import Search from './Search';
import TextArea from './TextArea';
export type { GroupProps } from './Group';
export type { InputProps, InputRef } from './Input';
export type { PasswordProps } from './Password';
export type { SearchProps } from './Search';
export type { TextAreaProps } from './TextArea';
type CompoundedComponent = typeof InternalInput & {
/** @deprecated Please use `Space.Compact` */
Group: typeof Group;
Search: typeof Search;
TextArea: typeof TextArea;
Password: typeof Password;
OTP: typeof OTP;
};
declare const Input: CompoundedComponent;
export default Input;

15
node_modules/antd/es/input/index.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use client";
import Group from './Group';
import InternalInput from './Input';
import OTP from './OTP';
import Password from './Password';
import Search from './Search';
import TextArea from './TextArea';
const Input = InternalInput;
Input.Group = Group;
Input.Search = Search;
Input.TextArea = TextArea;
Input.Password = Password;
Input.OTP = OTP;
export default Input;

21
node_modules/antd/es/input/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import type { CSSObject } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../theme/internal';
import type { ComponentToken, InputToken } from './token';
import { initComponentToken, initInputToken } from './token';
export type { ComponentToken };
export { initComponentToken, initInputToken };
export declare const genPlaceholderStyle: (color: string) => CSSObject;
export declare const genActiveStyle: (token: InputToken) => {
borderColor: string;
boxShadow: string;
outline: number;
backgroundColor: string;
};
export declare const genInputSmallStyle: (token: InputToken) => CSSObject;
export declare const genBasicInputStyle: (token: InputToken) => CSSObject;
export declare const genInputGroupStyle: (token: InputToken) => CSSObject;
export declare const genInputStyle: GenerateStyle<InputToken>;
export declare const genAffixStyle: GenerateStyle<InputToken>;
export declare const useSharedStyle: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
export default _default;

661
node_modules/antd/es/input/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,661 @@
import { unit } from '@ant-design/cssinjs';
import { clearFix, resetComponent } from '../../style';
import { genCompactItemStyle } from '../../style/compact-item';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import { initComponentToken, initInputToken } from './token';
import { genBorderlessStyle, genFilledGroupStyle, genFilledStyle, genOutlinedGroupStyle, genOutlinedStyle, genUnderlinedStyle } from './variants';
export { initComponentToken, initInputToken };
export const genPlaceholderStyle = color => ({
// Firefox
'&::-moz-placeholder': {
opacity: 1
},
'&::placeholder': {
color,
userSelect: 'none' // https://github.com/ant-design/ant-design/pull/32639
},
'&:placeholder-shown': {
textOverflow: 'ellipsis'
}
});
export const genActiveStyle = token => ({
borderColor: token.activeBorderColor,
boxShadow: token.activeShadow,
outline: 0,
backgroundColor: token.activeBg
});
const genInputLargeStyle = token => {
const {
paddingBlockLG,
lineHeightLG,
borderRadiusLG,
paddingInlineLG
} = token;
return {
padding: `${unit(paddingBlockLG)} ${unit(paddingInlineLG)}`,
fontSize: token.inputFontSizeLG,
lineHeight: lineHeightLG,
borderRadius: borderRadiusLG
};
};
export const genInputSmallStyle = token => ({
padding: `${unit(token.paddingBlockSM)} ${unit(token.paddingInlineSM)}`,
fontSize: token.inputFontSizeSM,
borderRadius: token.borderRadiusSM
});
export const genBasicInputStyle = token => Object.assign(Object.assign({
position: 'relative',
display: 'inline-block',
width: '100%',
minWidth: 0,
padding: `${unit(token.paddingBlock)} ${unit(token.paddingInline)}`,
color: token.colorText,
fontSize: token.inputFontSize,
lineHeight: token.lineHeight,
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationMid}`
}, genPlaceholderStyle(token.colorTextPlaceholder)), {
// Size
'&-lg': Object.assign({}, genInputLargeStyle(token)),
'&-sm': Object.assign({}, genInputSmallStyle(token)),
// RTL
'&-rtl, &-textarea-rtl': {
direction: 'rtl'
}
});
export const genInputGroupStyle = token => {
const {
componentCls,
antCls
} = token;
return {
position: 'relative',
display: 'table',
width: '100%',
borderCollapse: 'separate',
borderSpacing: 0,
// Undo padding and float of grid classes
"&[class*='col-']": {
paddingInlineEnd: token.paddingXS,
'&:last-child': {
paddingInlineEnd: 0
}
},
// Sizing options
[`&-lg ${componentCls}, &-lg > ${componentCls}-group-addon`]: Object.assign({}, genInputLargeStyle(token)),
[`&-sm ${componentCls}, &-sm > ${componentCls}-group-addon`]: Object.assign({}, genInputSmallStyle(token)),
// Fix https://github.com/ant-design/ant-design/issues/5754
[`&-lg ${antCls}-select-single ${antCls}-select-selector`]: {
height: token.controlHeightLG
},
[`&-sm ${antCls}-select-single ${antCls}-select-selector`]: {
height: token.controlHeightSM
},
[`> ${componentCls}`]: {
display: 'table-cell',
'&:not(:first-child):not(:last-child)': {
borderRadius: 0
}
},
[`${componentCls}-group`]: {
'&-addon, &-wrap': {
display: 'table-cell',
width: 1,
whiteSpace: 'nowrap',
verticalAlign: 'middle',
'&:not(:first-child):not(:last-child)': {
borderRadius: 0
}
},
'&-wrap > *': {
display: 'block !important'
},
'&-addon': {
position: 'relative',
padding: `0 ${unit(token.paddingInline)}`,
color: token.colorText,
fontWeight: 'normal',
fontSize: token.inputFontSize,
textAlign: 'center',
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationSlow}`,
lineHeight: 1,
// Reset Select's style in addon
[`${antCls}-select`]: {
margin: `${unit(token.calc(token.paddingBlock).add(1).mul(-1).equal())} ${unit(token.calc(token.paddingInline).mul(-1).equal())}`,
[`&${antCls}-select-single:not(${antCls}-select-customize-input):not(${antCls}-pagination-size-changer)`]: {
[`${antCls}-select-selector`]: {
backgroundColor: 'inherit',
border: `${unit(token.lineWidth)} ${token.lineType} transparent`,
boxShadow: 'none'
}
}
},
// https://github.com/ant-design/ant-design/issues/31333
[`${antCls}-cascader-picker`]: {
margin: `-9px ${unit(token.calc(token.paddingInline).mul(-1).equal())}`,
backgroundColor: 'transparent',
[`${antCls}-cascader-input`]: {
textAlign: 'start',
border: 0,
boxShadow: 'none'
}
}
}
},
[componentCls]: {
width: '100%',
marginBottom: 0,
textAlign: 'inherit',
'&:focus': {
zIndex: 1,
// Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png
borderInlineEndWidth: 1
},
'&:hover': {
zIndex: 1,
borderInlineEndWidth: 1,
[`${componentCls}-search-with-button &`]: {
zIndex: 0
}
}
},
// Reset rounded corners
[`> ${componentCls}:first-child, ${componentCls}-group-addon:first-child`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0,
// Reset Select's style in addon
[`${antCls}-select ${antCls}-select-selector`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
[`> ${componentCls}-affix-wrapper`]: {
[`&:not(:first-child) ${componentCls}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
},
[`&:not(:last-child) ${componentCls}`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
[`> ${componentCls}:last-child, ${componentCls}-group-addon:last-child`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0,
// Reset Select's style in addon
[`${antCls}-select ${antCls}-select-selector`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
},
[`${componentCls}-affix-wrapper`]: {
'&:not(:last-child)': {
borderStartEndRadius: 0,
borderEndEndRadius: 0,
[`${componentCls}-search &`]: {
borderStartStartRadius: token.borderRadius,
borderEndStartRadius: token.borderRadius
}
},
[`&:not(:first-child), ${componentCls}-search &:not(:first-child)`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
},
[`&${componentCls}-group-compact`]: Object.assign(Object.assign({
display: 'block'
}, clearFix()), {
[`${componentCls}-group-addon, ${componentCls}-group-wrap, > ${componentCls}`]: {
'&:not(:first-child):not(:last-child)': {
borderInlineEndWidth: token.lineWidth,
'&:hover, &:focus': {
zIndex: 1
}
}
},
'& > *': {
display: 'inline-flex',
float: 'none',
verticalAlign: 'top',
// https://github.com/ant-design/ant-design-pro/issues/139
borderRadius: 0
},
[`
& > ${componentCls}-affix-wrapper,
& > ${componentCls}-number-affix-wrapper,
& > ${antCls}-picker-range
`]: {
display: 'inline-flex'
},
'& > *:not(:last-child)': {
marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal(),
borderInlineEndWidth: token.lineWidth
},
// Undo float for .ant-input-group .ant-input
[componentCls]: {
float: 'none'
},
// reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
[`& > ${antCls}-select > ${antCls}-select-selector,
& > ${antCls}-select-auto-complete ${componentCls},
& > ${antCls}-cascader-picker ${componentCls},
& > ${componentCls}-group-wrapper ${componentCls}`]: {
borderInlineEndWidth: token.lineWidth,
borderRadius: 0,
'&:hover, &:focus': {
zIndex: 1
}
},
[`& > ${antCls}-select-focused`]: {
zIndex: 1
},
// update z-index for arrow icon
[`& > ${antCls}-select > ${antCls}-select-arrow`]: {
zIndex: 1 // https://github.com/ant-design/ant-design/issues/20371
},
[`& > *:first-child,
& > ${antCls}-select:first-child > ${antCls}-select-selector,
& > ${antCls}-select-auto-complete:first-child ${componentCls},
& > ${antCls}-cascader-picker:first-child ${componentCls}`]: {
borderStartStartRadius: token.borderRadius,
borderEndStartRadius: token.borderRadius
},
[`& > *:last-child,
& > ${antCls}-select:last-child > ${antCls}-select-selector,
& > ${antCls}-cascader-picker:last-child ${componentCls},
& > ${antCls}-cascader-picker-focused:last-child ${componentCls}`]: {
borderInlineEndWidth: token.lineWidth,
borderStartEndRadius: token.borderRadius,
borderEndEndRadius: token.borderRadius
},
// https://github.com/ant-design/ant-design/issues/12493
[`& > ${antCls}-select-auto-complete ${componentCls}`]: {
verticalAlign: 'top'
},
[`${componentCls}-group-wrapper + ${componentCls}-group-wrapper`]: {
marginInlineStart: token.calc(token.lineWidth).mul(-1).equal(),
[`${componentCls}-affix-wrapper`]: {
borderRadius: 0
}
},
[`${componentCls}-group-wrapper:not(:last-child)`]: {
[`&${componentCls}-search > ${componentCls}-group`]: {
[`& > ${componentCls}-group-addon > ${componentCls}-search-button`]: {
borderRadius: 0
},
[`& > ${componentCls}`]: {
borderStartStartRadius: token.borderRadius,
borderStartEndRadius: 0,
borderEndEndRadius: 0,
borderEndStartRadius: token.borderRadius
}
}
}
})
};
};
export const genInputStyle = token => {
const {
componentCls,
controlHeightSM,
lineWidth,
calc
} = token;
const FIXED_CHROME_COLOR_HEIGHT = 16;
const colorSmallPadding = calc(controlHeightSM).sub(calc(lineWidth).mul(2)).sub(FIXED_CHROME_COLOR_HEIGHT).div(2).equal();
return {
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), genBasicInputStyle(token)), genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)), genUnderlinedStyle(token)), {
'&[type="color"]': {
height: token.controlHeight,
[`&${componentCls}-lg`]: {
height: token.controlHeightLG
},
[`&${componentCls}-sm`]: {
height: controlHeightSM,
paddingTop: colorSmallPadding,
paddingBottom: colorSmallPadding
}
},
'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration': {
appearance: 'none'
}
})
};
};
const genAllowClearStyle = token => {
const {
componentCls
} = token;
return {
// ========================= Input =========================
[`${componentCls}-clear-icon`]: {
margin: 0,
padding: 0,
lineHeight: 0,
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
verticalAlign: -1,
// https://github.com/ant-design/ant-design/pull/18151
// https://codesandbox.io/s/wizardly-sun-u10br
cursor: 'pointer',
transition: `color ${token.motionDurationSlow}`,
border: 'none',
outline: 'none',
backgroundColor: 'transparent',
'&:hover': {
color: token.colorIcon
},
'&:active': {
color: token.colorText
},
'&-hidden': {
visibility: 'hidden'
},
'&-has-suffix': {
margin: `0 ${unit(token.inputAffixPadding)}`
}
}
};
};
export const genAffixStyle = token => {
const {
componentCls,
inputAffixPadding,
colorTextDescription,
motionDurationSlow,
colorIcon,
colorIconHover,
iconCls
} = token;
const affixCls = `${componentCls}-affix-wrapper`;
const affixClsDisabled = `${componentCls}-affix-wrapper-disabled`;
return {
[affixCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, genBasicInputStyle(token)), {
display: 'inline-flex',
[`&:not(${componentCls}-disabled):hover`]: {
zIndex: 1,
[`${componentCls}-search-with-button &`]: {
zIndex: 0
}
},
'&-focused, &:focus': {
zIndex: 1
},
[`> input${componentCls}`]: {
padding: 0
},
[`> input${componentCls}, > textarea${componentCls}`]: {
fontSize: 'inherit',
border: 'none',
borderRadius: 0,
outline: 'none',
background: 'transparent',
color: 'inherit',
'&::-ms-reveal': {
display: 'none'
},
'&:focus': {
boxShadow: 'none !important'
}
},
'&::before': {
display: 'inline-block',
width: 0,
visibility: 'hidden',
content: '"\\a0"'
},
[componentCls]: {
'&-prefix, &-suffix': {
display: 'flex',
flex: 'none',
alignItems: 'center',
'> *:not(:last-child)': {
marginInlineEnd: token.paddingXS
}
},
'&-show-count-suffix': {
color: colorTextDescription,
direction: 'ltr'
},
'&-show-count-has-suffix': {
marginInlineEnd: token.paddingXXS
},
'&-prefix': {
marginInlineEnd: inputAffixPadding
},
'&-suffix': {
marginInlineStart: inputAffixPadding
}
}
}), genAllowClearStyle(token)), {
// password
[`${iconCls}${componentCls}-password-icon`]: {
color: colorIcon,
cursor: 'pointer',
transition: `all ${motionDurationSlow}`,
'&:hover': {
color: colorIconHover
}
}
}),
// 覆盖 affix-wrapper borderRadius
[`${componentCls}-underlined`]: {
borderRadius: 0
},
[affixClsDisabled]: {
// password disabled
[`${iconCls}${componentCls}-password-icon`]: {
color: colorIcon,
cursor: 'not-allowed',
'&:hover': {
color: colorIcon
}
}
}
};
};
const genGroupStyle = token => {
const {
componentCls,
borderRadiusLG,
borderRadiusSM
} = token;
return {
[`${componentCls}-group`]: Object.assign(Object.assign(Object.assign({}, resetComponent(token)), genInputGroupStyle(token)), {
'&-rtl': {
direction: 'rtl'
},
'&-wrapper': Object.assign(Object.assign(Object.assign({
display: 'inline-block',
width: '100%',
textAlign: 'start',
verticalAlign: 'top',
'&-rtl': {
direction: 'rtl'
},
// Size
'&-lg': {
[`${componentCls}-group-addon`]: {
borderRadius: borderRadiusLG,
fontSize: token.inputFontSizeLG
}
},
'&-sm': {
[`${componentCls}-group-addon`]: {
borderRadius: borderRadiusSM
}
}
}, genOutlinedGroupStyle(token)), genFilledGroupStyle(token)), {
// '&-disabled': {
// [`${componentCls}-group-addon`]: {
// ...genDisabledStyle(token),
// },
// },
// Fix the issue of using icons in Space Compact mode
// https://github.com/ant-design/ant-design/issues/42122
[`&:not(${componentCls}-compact-first-item):not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: {
[`${componentCls}, ${componentCls}-group-addon`]: {
borderRadius: 0
}
},
[`&:not(${componentCls}-compact-last-item)${componentCls}-compact-first-item`]: {
[`${componentCls}, ${componentCls}-group-addon`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
[`&:not(${componentCls}-compact-first-item)${componentCls}-compact-last-item`]: {
[`${componentCls}, ${componentCls}-group-addon`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
},
// Fix the issue of input use show-count param in space compact mode
// https://github.com/ant-design/ant-design/issues/46872
[`&:not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: {
[`${componentCls}-affix-wrapper`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
// Fix the issue of input use `addonAfter` param in space compact mode
// https://github.com/ant-design/ant-design/issues/52483
[`&:not(${componentCls}-compact-first-item)${componentCls}-compact-item`]: {
[`${componentCls}-affix-wrapper`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
}
})
})
};
};
const genSearchInputStyle = token => {
const {
componentCls,
antCls
} = token;
const searchPrefixCls = `${componentCls}-search`;
return {
[searchPrefixCls]: {
[componentCls]: {
'&:not([disabled]):hover, &:not([disabled]):focus': {
[`+ ${componentCls}-group-addon ${searchPrefixCls}-button:not(${antCls}-btn-color-primary):not(${antCls}-btn-variant-text)`]: {
borderInlineStartColor: token.colorPrimaryHover
}
}
},
[`${componentCls}-affix-wrapper`]: {
height: token.controlHeight,
borderRadius: 0
},
// fix slight height diff in Firefox:
// https://ant.design/components/auto-complete-cn/#auto-complete-demo-certain-category
[`${componentCls}-lg`]: {
lineHeight: token.calc(token.lineHeightLG).sub(0.0002).equal()
},
[`> ${componentCls}-group`]: {
[`> ${componentCls}-group-addon:last-child`]: {
insetInlineStart: -1,
padding: 0,
border: 0,
[`${searchPrefixCls}-button`]: {
// Fix https://github.com/ant-design/ant-design/issues/47150
marginInlineEnd: -1,
borderStartStartRadius: 0,
borderEndStartRadius: 0,
boxShadow: 'none'
},
[`${searchPrefixCls}-button:not(${antCls}-btn-color-primary)`]: {
color: token.colorTextDescription,
'&:not([disabled]):hover': {
color: token.colorPrimaryHover
},
'&:active': {
color: token.colorPrimaryActive
},
[`&${antCls}-btn-loading::before`]: {
inset: 0
}
}
}
},
[`${searchPrefixCls}-button`]: {
height: token.controlHeight,
'&:hover, &:focus': {
zIndex: 1
}
},
'&-large': {
[`${componentCls}-affix-wrapper, ${searchPrefixCls}-button`]: {
height: token.controlHeightLG
}
},
'&-small': {
[`${componentCls}-affix-wrapper, ${searchPrefixCls}-button`]: {
height: token.controlHeightSM
}
},
'&-rtl': {
direction: 'rtl'
},
// ===================== Compact Item Customized Styles =====================
[`&${componentCls}-compact-item`]: {
[`&:not(${componentCls}-compact-last-item)`]: {
[`${componentCls}-group-addon`]: {
[`${componentCls}-search-button`]: {
marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal(),
borderRadius: 0
}
}
},
[`&:not(${componentCls}-compact-first-item)`]: {
[`${componentCls},${componentCls}-affix-wrapper`]: {
borderRadius: 0
}
},
[`> ${componentCls}-group-addon ${componentCls}-search-button,
> ${componentCls},
${componentCls}-affix-wrapper`]: {
'&:hover, &:focus, &:active': {
zIndex: 2
}
},
[`> ${componentCls}-affix-wrapper-focused`]: {
zIndex: 2
}
}
}
};
};
// ============================== Range ===============================
const genRangeStyle = token => {
const {
componentCls
} = token;
return {
[`${componentCls}-out-of-range`]: {
[`&, & input, & textarea, ${componentCls}-show-count-suffix, ${componentCls}-data-count`]: {
color: token.colorError
}
}
};
};
// ============================== Export ==============================
export const useSharedStyle = genStyleHooks(['Input', 'Shared'], token => {
const inputToken = mergeToken(token, initInputToken(token));
return [genInputStyle(inputToken), genAffixStyle(inputToken)];
}, initComponentToken, {
resetFont: false
});
export default genStyleHooks(['Input', 'Component'], token => {
const inputToken = mergeToken(token, initInputToken(token));
return [genGroupStyle(inputToken), genSearchInputStyle(inputToken), genRangeStyle(inputToken),
// =====================================================
// == Space Compact ==
// =====================================================
genCompactItemStyle(inputToken)];
}, initComponentToken, {
resetFont: false
});

2
node_modules/antd/es/input/style/otp.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
export default _default;

58
node_modules/antd/es/input/style/otp.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
import { genStyleHooks, mergeToken } from '../../theme/internal';
import { initComponentToken, initInputToken } from './token';
// =============================== OTP ================================
const genOTPStyle = token => {
const {
componentCls,
paddingXS
} = token;
return {
[componentCls]: {
display: 'inline-flex',
alignItems: 'center',
flexWrap: 'nowrap',
columnGap: paddingXS,
[`${componentCls}-input-wrapper`]: {
position: 'relative',
[`${componentCls}-mask-icon`]: {
position: 'absolute',
zIndex: '1',
top: '50%',
right: '50%',
transform: 'translate(50%, -50%)',
pointerEvents: 'none'
},
[`${componentCls}-mask-input`]: {
color: 'transparent',
caretColor: token.colorText
},
[`${componentCls}-mask-input[type=number]::-webkit-inner-spin-button`]: {
'-webkit-appearance': 'none',
margin: 0
},
[`${componentCls}-mask-input[type=number]`]: {
'-moz-appearance': 'textfield'
}
},
'&-rtl': {
direction: 'rtl'
},
[`${componentCls}-input`]: {
textAlign: 'center',
paddingInline: token.paddingXXS
},
// ================= Size =================
[`&${componentCls}-sm ${componentCls}-input`]: {
paddingInline: token.calc(token.paddingXXS).div(2).equal()
},
[`&${componentCls}-lg ${componentCls}-input`]: {
paddingInline: token.paddingXS
}
}
};
};
// ============================== Export ==============================
export default genStyleHooks(['Input', 'OTP'], token => {
const inputToken = mergeToken(token, initInputToken(token));
return genOTPStyle(inputToken);
}, initComponentToken);

6
node_modules/antd/es/input/style/textarea.d.ts generated vendored Normal file
View File

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

108
node_modules/antd/es/input/style/textarea.js generated vendored Normal file
View File

@@ -0,0 +1,108 @@
import { genStyleHooks, mergeToken } from '../../theme/internal';
import { initComponentToken, initInputToken } from './token';
export { initComponentToken, initInputToken };
const genTextAreaStyle = token => {
const {
componentCls,
paddingLG
} = token;
const textareaPrefixCls = `${componentCls}-textarea`;
return {
// Raw Textarea
[`textarea${componentCls}`]: {
maxWidth: '100%',
// prevent textarea resize from coming out of its container
height: 'auto',
minHeight: token.controlHeight,
lineHeight: token.lineHeight,
verticalAlign: 'bottom',
transition: `all ${token.motionDurationSlow}`,
resize: 'vertical',
[`&${componentCls}-mouse-active`]: {
transition: `all ${token.motionDurationSlow}, height 0s, width 0s`
}
},
// Wrapper for resize
[`${componentCls}-textarea-affix-wrapper-resize-dirty`]: {
width: 'auto'
},
[textareaPrefixCls]: {
position: 'relative',
'&-show-count': {
[`${componentCls}-data-count`]: {
position: 'absolute',
bottom: token.calc(token.fontSize).mul(token.lineHeight).mul(-1).equal(),
insetInlineEnd: 0,
color: token.colorTextDescription,
whiteSpace: 'nowrap',
pointerEvents: 'none'
}
},
[`
&-allow-clear > ${componentCls},
&-affix-wrapper${textareaPrefixCls}-has-feedback ${componentCls}
`]: {
paddingInlineEnd: paddingLG
},
[`&-affix-wrapper${componentCls}-affix-wrapper`]: {
padding: 0,
[`> textarea${componentCls}`]: {
fontSize: 'inherit',
border: 'none',
outline: 'none',
background: 'transparent',
minHeight: token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal(),
'&:focus': {
boxShadow: 'none !important'
}
},
[`${componentCls}-suffix`]: {
margin: 0,
'> *:not(:last-child)': {
marginInline: 0
},
// Clear Icon
[`${componentCls}-clear-icon`]: {
position: 'absolute',
insetInlineEnd: token.paddingInline,
insetBlockStart: token.paddingXS
},
// Feedback Icon
[`${textareaPrefixCls}-suffix`]: {
position: 'absolute',
top: 0,
insetInlineEnd: token.paddingInline,
bottom: 0,
zIndex: 1,
display: 'inline-flex',
alignItems: 'center',
margin: 'auto',
pointerEvents: 'none'
}
}
},
[`&-affix-wrapper${componentCls}-affix-wrapper-rtl`]: {
[`${componentCls}-suffix`]: {
[`${componentCls}-data-count`]: {
direction: 'ltr',
insetInlineStart: 0
}
}
},
[`&-affix-wrapper${componentCls}-affix-wrapper-sm`]: {
[`${componentCls}-suffix`]: {
[`${componentCls}-clear-icon`]: {
insetInlineEnd: token.paddingInlineSM
}
}
}
}
};
};
// ============================== Export ==============================
export default genStyleHooks(['Input', 'TextArea'], token => {
const inputToken = mergeToken(token, initInputToken(token));
return genTextAreaStyle(inputToken);
}, initComponentToken, {
resetFont: false
});

97
node_modules/antd/es/input/style/token.d.ts generated vendored Normal file
View File

@@ -0,0 +1,97 @@
import type { AliasToken, FullToken } from '../../theme/internal';
export interface SharedComponentToken {
/**
* @desc 输入框横向内边距
* @descEN Horizontal padding of input
*/
paddingInline: number;
/**
* @desc 小号输入框横向内边距
* @descEN Horizontal padding of small input
*/
paddingInlineSM: number;
/**
* @desc 大号输入框横向内边距
* @descEN Horizontal padding of large input
*/
paddingInlineLG: number;
/**
* @desc 输入框纵向内边距
* @descEN Vertical padding of input
*/
paddingBlock: number;
/**
* @desc 小号输入框纵向内边距
* @descEN Vertical padding of small input
*/
paddingBlockSM: number;
/**
* @desc 大号输入框纵向内边距
* @descEN Vertical padding of large input
*/
paddingBlockLG: number;
/**
* @desc 前/后置标签背景色
* @descEN Background color of addon
*/
addonBg: string;
/**
* @desc 悬浮态边框色
* @descEN Hover border color
*/
hoverBorderColor: string;
/**
* @desc 激活态边框色
* @descEN Active border color
*/
activeBorderColor: string;
/**
* @desc 激活态阴影
* @descEN Box-shadow when active
*/
activeShadow: string;
/**
* @desc 错误状态时激活态阴影
* @descEN Box-shadow when active in error status
*/
errorActiveShadow: string;
/**
* @desc 警告状态时激活态阴影
* @descEN Box-shadow when active in warning status
*/
warningActiveShadow: string;
/**
* @desc 输入框hover状态时背景颜色
* @descEN Background color when the input box hovers
*/
hoverBg: string;
/**
* @desc 输入框激活状态时背景颜色
* @descEN Background color when the input box is activated
*/
activeBg: string;
/**
* @desc 字体大小
* @descEN Font size
*/
inputFontSize: number;
/**
* @desc 大号字体大小
* @descEN Font size of large
*/
inputFontSizeLG: number;
/**
* @desc 小号字体大小
* @descEN Font size of small
*/
inputFontSizeSM: number;
}
export interface ComponentToken extends SharedComponentToken {
}
export interface SharedInputToken {
inputAffixPadding: number;
}
export interface InputToken extends FullToken<'Input'>, SharedInputToken {
}
export declare function initInputToken(token: AliasToken): SharedInputToken;
export declare const initComponentToken: (token: AliasToken & Partial<SharedComponentToken>) => SharedComponentToken;

57
node_modules/antd/es/input/style/token.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
import { mergeToken } from '../../theme/internal';
export function initInputToken(token) {
return mergeToken(token, {
inputAffixPadding: token.paddingXXS
});
}
export const initComponentToken = token => {
const {
controlHeight,
fontSize,
lineHeight,
lineWidth,
controlHeightSM,
controlHeightLG,
fontSizeLG,
lineHeightLG,
paddingSM,
controlPaddingHorizontalSM,
controlPaddingHorizontal,
colorFillAlter,
colorPrimaryHover,
colorPrimary,
controlOutlineWidth,
controlOutline,
colorErrorOutline,
colorWarningOutline,
colorBgContainer,
inputFontSize,
inputFontSizeLG,
inputFontSizeSM
} = token;
const mergedFontSize = inputFontSize || fontSize;
const mergedFontSizeSM = inputFontSizeSM || mergedFontSize;
const mergedFontSizeLG = inputFontSizeLG || fontSizeLG;
const paddingBlock = Math.round((controlHeight - mergedFontSize * lineHeight) / 2 * 10) / 10 - lineWidth;
const paddingBlockSM = Math.round((controlHeightSM - mergedFontSizeSM * lineHeight) / 2 * 10) / 10 - lineWidth;
const paddingBlockLG = Math.ceil((controlHeightLG - mergedFontSizeLG * lineHeightLG) / 2 * 10) / 10 - lineWidth;
return {
paddingBlock: Math.max(paddingBlock, 0),
paddingBlockSM: Math.max(paddingBlockSM, 0),
paddingBlockLG: Math.max(paddingBlockLG, 0),
paddingInline: paddingSM - lineWidth,
paddingInlineSM: controlPaddingHorizontalSM - lineWidth,
paddingInlineLG: controlPaddingHorizontal - lineWidth,
addonBg: colorFillAlter,
activeBorderColor: colorPrimary,
hoverBorderColor: colorPrimaryHover,
activeShadow: `0 0 0 ${controlOutlineWidth}px ${controlOutline}`,
errorActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorErrorOutline}`,
warningActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorWarningOutline}`,
hoverBg: colorBgContainer,
activeBg: colorBgContainer,
inputFontSize: mergedFontSize,
inputFontSizeLG: mergedFontSizeLG,
inputFontSizeSM: mergedFontSizeSM
};
};

22
node_modules/antd/es/input/style/variants.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import type { CSSObject } from '@ant-design/cssinjs';
import type { InputToken } from './token';
export declare const genHoverStyle: (token: InputToken) => CSSObject;
export declare const genDisabledStyle: (token: InputToken) => CSSObject;
export declare const genBaseOutlinedStyle: (token: InputToken, options: {
borderColor: string;
hoverBorderColor: string;
activeBorderColor: string;
activeShadow: string;
}) => CSSObject;
export declare const genOutlinedStyle: (token: InputToken, extraStyles?: CSSObject) => CSSObject;
export declare const genOutlinedGroupStyle: (token: InputToken) => CSSObject;
export declare const genBorderlessStyle: (token: InputToken, extraStyles?: CSSObject) => CSSObject;
export declare const genFilledStyle: (token: InputToken, extraStyles?: CSSObject) => CSSObject;
export declare const genFilledGroupStyle: (token: InputToken) => CSSObject;
export declare const genBaseUnderlinedStyle: (token: InputToken, options: {
borderColor: string;
hoverBorderColor: string;
activeBorderColor: string;
activeShadow: string;
}) => CSSObject;
export declare const genUnderlinedStyle: (token: InputToken, extraStyles?: CSSObject) => CSSObject;

298
node_modules/antd/es/input/style/variants.js generated vendored Normal file
View File

@@ -0,0 +1,298 @@
import { unit } from '@ant-design/cssinjs';
import { mergeToken } from '../../theme/internal';
export const genHoverStyle = token => ({
borderColor: token.hoverBorderColor,
backgroundColor: token.hoverBg
});
export const genDisabledStyle = token => ({
color: token.colorTextDisabled,
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
boxShadow: 'none',
cursor: 'not-allowed',
opacity: 1,
'input[disabled], textarea[disabled]': {
cursor: 'not-allowed'
},
'&:hover:not([disabled])': Object.assign({}, genHoverStyle(mergeToken(token, {
hoverBorderColor: token.colorBorder,
hoverBg: token.colorBgContainerDisabled
})))
});
/* ============== Outlined ============== */
export const genBaseOutlinedStyle = (token, options) => ({
background: token.colorBgContainer,
borderWidth: token.lineWidth,
borderStyle: token.lineType,
borderColor: options.borderColor,
'&:hover': {
borderColor: options.hoverBorderColor,
backgroundColor: token.hoverBg
},
'&:focus, &:focus-within': {
borderColor: options.activeBorderColor,
boxShadow: options.activeShadow,
outline: 0,
backgroundColor: token.activeBg
}
});
const genOutlinedStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseOutlinedStyle(token, options)), {
[`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {
color: options.affixColor
}
}),
[`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: {
borderColor: options.borderColor
}
});
export const genOutlinedStyle = (token, extraStyles) => ({
'&-outlined': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseOutlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderColor: token.hoverBorderColor,
activeBorderColor: token.activeBorderColor,
activeShadow: token.activeShadow
})), {
[`&${token.componentCls}-disabled, &[disabled]`]: Object.assign({}, genDisabledStyle(token))
}), genOutlinedStatusStyle(token, {
status: 'error',
borderColor: token.colorError,
hoverBorderColor: token.colorErrorBorderHover,
activeBorderColor: token.colorError,
activeShadow: token.errorActiveShadow,
affixColor: token.colorError
})), genOutlinedStatusStyle(token, {
status: 'warning',
borderColor: token.colorWarning,
hoverBorderColor: token.colorWarningBorderHover,
activeBorderColor: token.colorWarning,
activeShadow: token.warningActiveShadow,
affixColor: token.colorWarning
})), extraStyles)
});
const genOutlinedGroupStatusStyle = (token, options) => ({
[`&${token.componentCls}-group-wrapper-status-${options.status}`]: {
[`${token.componentCls}-group-addon`]: {
borderColor: options.addonBorderColor,
color: options.addonColor
}
}
});
export const genOutlinedGroupStyle = token => ({
'&-outlined': Object.assign(Object.assign(Object.assign({
[`${token.componentCls}-group`]: {
'&-addon': {
background: token.addonBg,
border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
'&-addon:first-child': {
borderInlineEnd: 0
},
'&-addon:last-child': {
borderInlineStart: 0
}
}
}, genOutlinedGroupStatusStyle(token, {
status: 'error',
addonBorderColor: token.colorError,
addonColor: token.colorErrorText
})), genOutlinedGroupStatusStyle(token, {
status: 'warning',
addonBorderColor: token.colorWarning,
addonColor: token.colorWarningText
})), {
[`&${token.componentCls}-group-wrapper-disabled`]: {
[`${token.componentCls}-group-addon`]: Object.assign({}, genDisabledStyle(token))
}
})
});
/* ============ Borderless ============ */
export const genBorderlessStyle = (token, extraStyles) => {
const {
componentCls
} = token;
return {
'&-borderless': Object.assign({
background: 'transparent',
border: 'none',
'&:focus, &:focus-within': {
outline: 'none'
},
// >>>>> Disabled
[`&${componentCls}-disabled, &[disabled]`]: {
color: token.colorTextDisabled,
cursor: 'not-allowed'
},
// >>>>> Status
[`&${componentCls}-status-error`]: {
'&, & input, & textarea': {
color: token.colorError
}
},
[`&${componentCls}-status-warning`]: {
'&, & input, & textarea': {
color: token.colorWarning
}
}
}, extraStyles)
};
};
/* ============== Filled ============== */
const genBaseFilledStyle = (token, options) => {
var _a;
return {
background: options.bg,
borderWidth: token.lineWidth,
borderStyle: token.lineType,
borderColor: 'transparent',
'input&, & input, textarea&, & textarea': {
color: (_a = options === null || options === void 0 ? void 0 : options.inputColor) !== null && _a !== void 0 ? _a : 'unset'
},
'&:hover': {
background: options.hoverBg
},
'&:focus, &:focus-within': {
outline: 0,
borderColor: options.activeBorderColor,
backgroundColor: token.activeBg
}
};
};
const genFilledStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseFilledStyle(token, options)), {
[`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {
color: options.affixColor
}
})
});
export const genFilledStyle = (token, extraStyles) => ({
'&-filled': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseFilledStyle(token, {
bg: token.colorFillTertiary,
hoverBg: token.colorFillSecondary,
activeBorderColor: token.activeBorderColor
})), {
[`&${token.componentCls}-disabled, &[disabled]`]: Object.assign({}, genDisabledStyle(token))
}), genFilledStatusStyle(token, {
status: 'error',
bg: token.colorErrorBg,
hoverBg: token.colorErrorBgHover,
activeBorderColor: token.colorError,
inputColor: token.colorErrorText,
affixColor: token.colorError
})), genFilledStatusStyle(token, {
status: 'warning',
bg: token.colorWarningBg,
hoverBg: token.colorWarningBgHover,
activeBorderColor: token.colorWarning,
inputColor: token.colorWarningText,
affixColor: token.colorWarning
})), extraStyles)
});
const genFilledGroupStatusStyle = (token, options) => ({
[`&${token.componentCls}-group-wrapper-status-${options.status}`]: {
[`${token.componentCls}-group-addon`]: {
background: options.addonBg,
color: options.addonColor
}
}
});
export const genFilledGroupStyle = token => ({
'&-filled': Object.assign(Object.assign(Object.assign({
[`${token.componentCls}-group-addon`]: {
background: token.colorFillTertiary,
'&:last-child': {
position: 'static'
}
}
}, genFilledGroupStatusStyle(token, {
status: 'error',
addonBg: token.colorErrorBg,
addonColor: token.colorErrorText
})), genFilledGroupStatusStyle(token, {
status: 'warning',
addonBg: token.colorWarningBg,
addonColor: token.colorWarningText
})), {
[`&${token.componentCls}-group-wrapper-disabled`]: {
[`${token.componentCls}-group`]: {
'&-addon': {
background: token.colorFillTertiary,
color: token.colorTextDisabled
},
'&-addon:first-child': {
borderInlineStart: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderTop: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
'&-addon:last-child': {
borderInlineEnd: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderTop: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
}
}
}
})
});
/* ============== Underlined ============== */
// https://github.com/ant-design/ant-design/issues/51379
export const genBaseUnderlinedStyle = (token, options) => ({
background: token.colorBgContainer,
borderWidth: `${unit(token.lineWidth)} 0`,
borderStyle: `${token.lineType} none`,
borderColor: `transparent transparent ${options.borderColor} transparent`,
borderRadius: 0,
'&:hover': {
borderColor: `transparent transparent ${options.hoverBorderColor} transparent`,
backgroundColor: token.hoverBg
},
'&:focus, &:focus-within': {
borderColor: `transparent transparent ${options.activeBorderColor} transparent`,
outline: 0,
backgroundColor: token.activeBg
}
});
const genUnderlinedStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseUnderlinedStyle(token, options)), {
[`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {
color: options.affixColor
}
}),
[`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: {
borderColor: `transparent transparent ${options.borderColor} transparent`
}
});
export const genUnderlinedStyle = (token, extraStyles) => ({
'&-underlined': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseUnderlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderColor: token.hoverBorderColor,
activeBorderColor: token.activeBorderColor,
activeShadow: token.activeShadow
})), {
// >>>>> Disabled
[`&${token.componentCls}-disabled, &[disabled]`]: {
color: token.colorTextDisabled,
boxShadow: 'none',
cursor: 'not-allowed',
'&:hover': {
borderColor: `transparent transparent ${token.colorBorder} transparent`
}
},
'input[disabled], textarea[disabled]': {
cursor: 'not-allowed'
}
}), genUnderlinedStatusStyle(token, {
status: 'error',
borderColor: token.colorError,
hoverBorderColor: token.colorErrorBorderHover,
activeBorderColor: token.colorError,
activeShadow: token.errorActiveShadow,
affixColor: token.colorError
})), genUnderlinedStatusStyle(token, {
status: 'warning',
borderColor: token.colorWarning,
hoverBorderColor: token.colorWarningBorderHover,
activeBorderColor: token.colorWarning,
activeShadow: token.warningActiveShadow,
affixColor: token.colorWarning
})), extraStyles)
});

8
node_modules/antd/es/input/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import type { ReactNode } from 'react';
import type { InputProps } from './Input';
export declare function hasPrefixSuffix(props: {
prefix?: ReactNode;
suffix?: ReactNode;
allowClear?: InputProps['allowClear'];
showCount?: InputProps['showCount'];
}): boolean;

3
node_modules/antd/es/input/utils.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export function hasPrefixSuffix(props) {
return !!(props.prefix || props.suffix || props.allowClear || props.showCount);
}