first commit
This commit is contained in:
16
frontend/node_modules/antd/lib/input/Group.d.ts
generated
vendored
Normal file
16
frontend/node_modules/antd/lib/input/Group.d.ts
generated
vendored
Normal 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;
|
||||
55
frontend/node_modules/antd/lib/input/Group.js
generated
vendored
Normal file
55
frontend/node_modules/antd/lib/input/Group.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var React = _react;
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _warning = require("../_util/warning");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _context = require("../form/context");
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
/** @deprecated Please use `Space.Compact` */
|
||||
const Group = props => {
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction
|
||||
} = (0, _react.useContext)(_configProvider.ConfigContext);
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className
|
||||
} = props;
|
||||
const prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
||||
const inputPrefixCls = getPrefixCls('input');
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(inputPrefixCls);
|
||||
const cls = (0, _classnames.default)(prefixCls, cssVarCls, {
|
||||
[`${prefixCls}-lg`]: props.size === 'large',
|
||||
[`${prefixCls}-sm`]: props.size === 'small',
|
||||
[`${prefixCls}-compact`]: props.compact,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, hashId, className);
|
||||
const formItemContext = (0, _react.useContext)(_context.FormItemInputContext);
|
||||
const groupFormItemContext = (0, _react.useMemo)(() => Object.assign(Object.assign({}, formItemContext), {
|
||||
isFormItemInput: false
|
||||
}), [formItemContext]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _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(_context.FormItemInputContext.Provider, {
|
||||
value: groupFormItemContext
|
||||
}, props.children)));
|
||||
};
|
||||
var _default = exports.default = Group;
|
||||
59
frontend/node_modules/antd/lib/input/Input.d.ts
generated
vendored
Normal file
59
frontend/node_modules/antd/lib/input/Input.d.ts
generated
vendored
Normal 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;
|
||||
197
frontend/node_modules/antd/lib/input/Input.js
generated
vendored
Normal file
197
frontend/node_modules/antd/lib/input/Input.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
Object.defineProperty(exports, "triggerFocus", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _commonUtils.triggerFocus;
|
||||
}
|
||||
});
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcInput = _interopRequireDefault(require("rc-input"));
|
||||
var _commonUtils = require("rc-input/lib/utils/commonUtils");
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _ContextIsolator = _interopRequireDefault(require("../_util/ContextIsolator"));
|
||||
var _getAllowClear = _interopRequireDefault(require("../_util/getAllowClear"));
|
||||
var _statusUtils = require("../_util/statusUtils");
|
||||
var _warning = require("../_util/warning");
|
||||
var _context = require("../config-provider/context");
|
||||
var _DisabledContext = _interopRequireDefault(require("../config-provider/DisabledContext"));
|
||||
var _useCSSVarCls = _interopRequireDefault(require("../config-provider/hooks/useCSSVarCls"));
|
||||
var _useSize = _interopRequireDefault(require("../config-provider/hooks/useSize"));
|
||||
var _context2 = require("../form/context");
|
||||
var _useVariants = _interopRequireDefault(require("../form/hooks/useVariants"));
|
||||
var _Compact = require("../space/Compact");
|
||||
var _useRemovePasswordTimeout = _interopRequireDefault(require("./hooks/useRemovePasswordTimeout"));
|
||||
var _style = _interopRequireWildcard(require("./style"));
|
||||
var _utils = require("./utils");
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Input = /*#__PURE__*/(0, _react.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
|
||||
} = (0, _warning.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
|
||||
} = (0, _context.useComponentConfig)('input');
|
||||
const prefixCls = getPrefixCls('input', customizePrefixCls);
|
||||
const inputRef = (0, _react.useRef)(null);
|
||||
// Style
|
||||
const rootCls = (0, _useCSSVarCls.default)(prefixCls);
|
||||
const [wrapSharedCSSVar, hashId, cssVarCls] = (0, _style.useSharedStyle)(prefixCls, rootClassName);
|
||||
const [wrapCSSVar] = (0, _style.default)(prefixCls, rootCls);
|
||||
// ===================== Compact Item =====================
|
||||
const {
|
||||
compactSize,
|
||||
compactItemClassnames
|
||||
} = (0, _Compact.useCompactItemContext)(prefixCls, direction);
|
||||
// ===================== Size =====================
|
||||
const mergedSize = (0, _useSize.default)(ctx => {
|
||||
var _a;
|
||||
return (_a = customSize !== null && customSize !== void 0 ? customSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
||||
});
|
||||
// ===================== Disabled =====================
|
||||
const disabled = _react.default.useContext(_DisabledContext.default);
|
||||
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
||||
// ===================== Status =====================
|
||||
const {
|
||||
status: contextStatus,
|
||||
hasFeedback,
|
||||
feedbackIcon
|
||||
} = (0, _react.useContext)(_context2.FormItemInputContext);
|
||||
const mergedStatus = (0, _statusUtils.getMergedStatus)(contextStatus, customStatus);
|
||||
// ===================== Focus warning =====================
|
||||
const inputHasPrefixSuffix = (0, _utils.hasPrefixSuffix)(props) || !!hasFeedback;
|
||||
const prevHasPrefixSuffix = (0, _react.useRef)(inputHasPrefixSuffix);
|
||||
/* eslint-disable react-hooks/rules-of-hooks */
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Input');
|
||||
// biome-ignore lint/correctness/useHookAtTopLevel: Development-only warning hook called conditionally
|
||||
(0, _react.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 = (0, _useRemovePasswordTimeout.default)(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.default.createElement(_react.default.Fragment, null, suffix, hasFeedback && feedbackIcon));
|
||||
const mergedAllowClear = (0, _getAllowClear.default)(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
|
||||
const [variant, enableVariantCls] = (0, _useVariants.default)('input', customVariant, bordered);
|
||||
return wrapSharedCSSVar(wrapCSSVar(/*#__PURE__*/_react.default.createElement(_rcInput.default, Object.assign({
|
||||
ref: (0, _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: (0, _classnames.default)(className, rootClassName, cssVarCls, rootCls, compactItemClassnames, contextClassName),
|
||||
onChange: handleChange,
|
||||
addonBefore: addonBefore && (/*#__PURE__*/_react.default.createElement(_ContextIsolator.default, {
|
||||
form: true,
|
||||
space: true
|
||||
}, addonBefore)),
|
||||
addonAfter: addonAfter && (/*#__PURE__*/_react.default.createElement(_ContextIsolator.default, {
|
||||
form: true,
|
||||
space: true
|
||||
}, addonAfter)),
|
||||
classNames: Object.assign(Object.assign(Object.assign({}, classNames), contextClassNames), {
|
||||
input: (0, _classnames.default)({
|
||||
[`${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: (0, _classnames.default)({
|
||||
[`${prefixCls}-${variant}`]: enableVariantCls
|
||||
}, (0, _statusUtils.getStatusClassNames)(prefixCls, mergedStatus)),
|
||||
affixWrapper: (0, _classnames.default)({
|
||||
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
|
||||
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
|
||||
[`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl'
|
||||
}, hashId),
|
||||
wrapper: (0, _classnames.default)({
|
||||
[`${prefixCls}-group-rtl`]: direction === 'rtl'
|
||||
}, hashId),
|
||||
groupWrapper: (0, _classnames.default)({
|
||||
[`${prefixCls}-group-wrapper-sm`]: mergedSize === 'small',
|
||||
[`${prefixCls}-group-wrapper-lg`]: mergedSize === 'large',
|
||||
[`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
|
||||
[`${prefixCls}-group-wrapper-${variant}`]: enableVariantCls
|
||||
}, (0, _statusUtils.getStatusClassNames)(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback), hashId)
|
||||
})
|
||||
}))));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Input.displayName = 'Input';
|
||||
}
|
||||
var _default = exports.default = Input;
|
||||
11
frontend/node_modules/antd/lib/input/OTP/OTPInput.d.ts
generated
vendored
Normal file
11
frontend/node_modules/antd/lib/input/OTP/OTPInput.d.ts
generated
vendored
Normal 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;
|
||||
96
frontend/node_modules/antd/lib/input/OTP/OTPInput.js
generated
vendored
Normal file
96
frontend/node_modules/antd/lib/input/OTP/OTPInput.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _raf = _interopRequireDefault(require("rc-util/lib/raf"));
|
||||
var _configProvider = require("../../config-provider");
|
||||
var _Input = _interopRequireDefault(require("../Input"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const 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(_configProvider.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 = () => {
|
||||
(0, _raf.default)(() => {
|
||||
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.default, 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: (0, _classnames.default)(className, {
|
||||
[`${prefixCls}-mask-input`]: mask
|
||||
})
|
||||
})));
|
||||
});
|
||||
var _default = exports.default = OTPInput;
|
||||
30
frontend/node_modules/antd/lib/input/OTP/index.d.ts
generated
vendored
Normal file
30
frontend/node_modules/antd/lib/input/OTP/index.d.ts
generated
vendored
Normal 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;
|
||||
219
frontend/node_modules/antd/lib/input/OTP/index.js
generated
vendored
Normal file
219
frontend/node_modules/antd/lib/input/OTP/index.js
generated
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
|
||||
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
||||
var _statusUtils = require("../../_util/statusUtils");
|
||||
var _warning = require("../../_util/warning");
|
||||
var _configProvider = require("../../config-provider");
|
||||
var _useSize = _interopRequireDefault(require("../../config-provider/hooks/useSize"));
|
||||
var _context = require("../../form/context");
|
||||
var _otp = _interopRequireDefault(require("../style/otp"));
|
||||
var _OTPInput = _interopRequireDefault(require("./OTPInput"));
|
||||
var __rest = void 0 && (void 0).__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;
|
||||
};
|
||||
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 = (0, _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(_configProvider.ConfigContext);
|
||||
const prefixCls = getPrefixCls('otp', customizePrefixCls);
|
||||
const domAttrs = (0, _pickAttrs.default)(restProps, {
|
||||
aria: true,
|
||||
data: true,
|
||||
attr: true
|
||||
});
|
||||
// ========================= Root =========================
|
||||
// Style
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _otp.default)(prefixCls);
|
||||
// ========================= Size =========================
|
||||
const mergedSize = (0, _useSize.default)(ctx => customSize !== null && customSize !== void 0 ? customSize : ctx);
|
||||
// ======================== Status ========================
|
||||
const formContext = React.useContext(_context.FormItemInputContext);
|
||||
const mergedStatus = (0, _statusUtils.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 = (0, _useEvent.default)(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 = (0, _useEvent.default)((index, txt) => {
|
||||
let nextCells = (0, _toConsumableArray2.default)(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: (0, _classnames.default)(prefixCls, {
|
||||
[`${prefixCls}-sm`]: mergedSize === 'small',
|
||||
[`${prefixCls}-lg`]: mergedSize === 'large',
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, cssVarCls, hashId),
|
||||
role: "group"
|
||||
}), /*#__PURE__*/React.createElement(_context.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.default, 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
|
||||
})));
|
||||
}))));
|
||||
});
|
||||
var _default = exports.default = OTP;
|
||||
18
frontend/node_modules/antd/lib/input/Password.d.ts
generated
vendored
Normal file
18
frontend/node_modules/antd/lib/input/Password.d.ts
generated
vendored
Normal 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;
|
||||
121
frontend/node_modules/antd/lib/input/Password.js
generated
vendored
Normal file
121
frontend/node_modules/antd/lib/input/Password.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var React = _react;
|
||||
var _EyeInvisibleOutlined = _interopRequireDefault(require("@ant-design/icons/EyeInvisibleOutlined"));
|
||||
var _EyeOutlined = _interopRequireDefault(require("@ant-design/icons/EyeOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _DisabledContext = _interopRequireDefault(require("../config-provider/DisabledContext"));
|
||||
var _useRemovePasswordTimeout = _interopRequireDefault(require("./hooks/useRemovePasswordTimeout"));
|
||||
var _Input = _interopRequireDefault(require("./Input"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const defaultIconRender = visible => visible ? /*#__PURE__*/React.createElement(_EyeOutlined.default, null) : /*#__PURE__*/React.createElement(_EyeInvisibleOutlined.default, 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.default);
|
||||
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
||||
const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
|
||||
const [visible, setVisible] = (0, _react.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
|
||||
const inputRef = (0, _react.useRef)(null);
|
||||
React.useEffect(() => {
|
||||
if (visibilityControlled) {
|
||||
setVisible(visibilityToggle.visible);
|
||||
}
|
||||
}, [visibilityControlled, visibilityToggle]);
|
||||
// Remove Password value
|
||||
const removePasswordTimeout = (0, _useRemovePasswordTimeout.default)(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(_configProvider.ConfigContext);
|
||||
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
||||
const prefixCls = getPrefixCls('input-password', customizePrefixCls);
|
||||
const suffixIcon = visibilityToggle && getIcon(prefixCls);
|
||||
const inputClassName = (0, _classnames.default)(prefixCls, className, {
|
||||
[`${prefixCls}-${size}`]: !!size
|
||||
});
|
||||
const omittedProps = Object.assign(Object.assign({}, (0, _omit.default)(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.default, Object.assign({
|
||||
ref: (0, _ref.composeRef)(ref, inputRef)
|
||||
}, omittedProps));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Password.displayName = 'Input.Password';
|
||||
}
|
||||
var _default = exports.default = Password;
|
||||
13
frontend/node_modules/antd/lib/input/Search.d.ts
generated
vendored
Normal file
13
frontend/node_modules/antd/lib/input/Search.d.ts
generated
vendored
Normal 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;
|
||||
163
frontend/node_modules/antd/lib/input/Search.js
generated
vendored
Normal file
163
frontend/node_modules/antd/lib/input/Search.js
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _SearchOutlined = _interopRequireDefault(require("@ant-design/icons/SearchOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _reactNode = require("../_util/reactNode");
|
||||
var _button = _interopRequireDefault(require("../button"));
|
||||
var _configProvider = require("../config-provider");
|
||||
var _useSize = _interopRequireDefault(require("../config-provider/hooks/useSize"));
|
||||
var _Compact = require("../space/Compact");
|
||||
var _Input = _interopRequireDefault(require("./Input"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const 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(_configProvider.ConfigContext);
|
||||
const composedRef = React.useRef(false);
|
||||
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
||||
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
||||
const {
|
||||
compactSize
|
||||
} = (0, _Compact.useCompactItemContext)(prefixCls, direction);
|
||||
const size = (0, _useSize.default)(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.default, 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 = (0, _reactNode.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.default, {
|
||||
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, (0, _reactNode.cloneElement)(addonAfter, {
|
||||
key: 'addonAfter'
|
||||
})];
|
||||
}
|
||||
const cls = (0, _classnames.default)(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.default, Object.assign({
|
||||
ref: (0, _ref.composeRef)(inputRef, ref)
|
||||
}, inputProps));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Search.displayName = 'Search';
|
||||
}
|
||||
var _default = exports.default = Search;
|
||||
25
frontend/node_modules/antd/lib/input/TextArea.d.ts
generated
vendored
Normal file
25
frontend/node_modules/antd/lib/input/TextArea.d.ts
generated
vendored
Normal 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;
|
||||
175
frontend/node_modules/antd/lib/input/TextArea.js
generated
vendored
Normal file
175
frontend/node_modules/antd/lib/input/TextArea.js
generated
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var React = _react;
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcTextarea = _interopRequireDefault(require("rc-textarea"));
|
||||
var _getAllowClear = _interopRequireDefault(require("../_util/getAllowClear"));
|
||||
var _statusUtils = require("../_util/statusUtils");
|
||||
var _warning = require("../_util/warning");
|
||||
var _context = require("../config-provider/context");
|
||||
var _DisabledContext = _interopRequireDefault(require("../config-provider/DisabledContext"));
|
||||
var _useCSSVarCls = _interopRequireDefault(require("../config-provider/hooks/useCSSVarCls"));
|
||||
var _useSize = _interopRequireDefault(require("../config-provider/hooks/useSize"));
|
||||
var _context2 = require("../form/context");
|
||||
var _useVariants = _interopRequireDefault(require("../form/hooks/useVariants"));
|
||||
var _Compact = require("../space/Compact");
|
||||
var _Input = require("./Input");
|
||||
var _style = require("./style");
|
||||
var _textarea = _interopRequireDefault(require("./style/textarea"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const TextArea = /*#__PURE__*/(0, _react.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
|
||||
} = (0, _warning.devUseWarning)('TextArea');
|
||||
deprecated(!('bordered' in props), 'bordered', 'variant');
|
||||
}
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction,
|
||||
allowClear: contextAllowClear,
|
||||
autoComplete: contextAutoComplete,
|
||||
className: contextClassName,
|
||||
style: contextStyle,
|
||||
classNames: contextClassNames,
|
||||
styles: contextStyles
|
||||
} = (0, _context.useComponentConfig)('textArea');
|
||||
// =================== Disabled ===================
|
||||
const disabled = React.useContext(_DisabledContext.default);
|
||||
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
||||
// ==================== Status ====================
|
||||
const {
|
||||
status: contextStatus,
|
||||
hasFeedback,
|
||||
feedbackIcon
|
||||
} = React.useContext(_context2.FormItemInputContext);
|
||||
const mergedStatus = (0, _statusUtils.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;
|
||||
(0, _Input.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 = (0, _useCSSVarCls.default)(prefixCls);
|
||||
const [wrapSharedCSSVar, hashId, cssVarCls] = (0, _style.useSharedStyle)(prefixCls, rootClassName);
|
||||
const [wrapCSSVar] = (0, _textarea.default)(prefixCls, rootCls);
|
||||
// ================= Compact Item =================
|
||||
const {
|
||||
compactSize,
|
||||
compactItemClassnames
|
||||
} = (0, _Compact.useCompactItemContext)(prefixCls, direction);
|
||||
// ===================== Size =====================
|
||||
const mergedSize = (0, _useSize.default)(ctx => {
|
||||
var _a;
|
||||
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
||||
});
|
||||
const [variant, enableVariantCls] = (0, _useVariants.default)('textArea', customVariant, bordered);
|
||||
const mergedAllowClear = (0, _getAllowClear.default)(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.default, Object.assign({
|
||||
autoComplete: contextAutoComplete
|
||||
}, rest, {
|
||||
style: Object.assign(Object.assign({}, contextStyle), style),
|
||||
styles: Object.assign(Object.assign({}, contextStyles), styles),
|
||||
disabled: mergedDisabled,
|
||||
allowClear: mergedAllowClear,
|
||||
className: (0, _classnames.default)(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: (0, _classnames.default)({
|
||||
[`${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: (0, _classnames.default)({
|
||||
[`${prefixCls}-${variant}`]: enableVariantCls
|
||||
}, (0, _statusUtils.getStatusClassNames)(prefixCls, mergedStatus)),
|
||||
affixWrapper: (0, _classnames.default)(`${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
|
||||
}))));
|
||||
});
|
||||
var _default = exports.default = TextArea;
|
||||
2
frontend/node_modules/antd/lib/input/hooks/useRemovePasswordTimeout.d.ts
generated
vendored
Normal file
2
frontend/node_modules/antd/lib/input/hooks/useRemovePasswordTimeout.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { InputRef } from '../Input';
|
||||
export default function useRemovePasswordTimeout(inputRef: React.RefObject<InputRef | null>, triggerOnMount?: boolean): () => void;
|
||||
29
frontend/node_modules/antd/lib/input/hooks/useRemovePasswordTimeout.js
generated
vendored
Normal file
29
frontend/node_modules/antd/lib/input/hooks/useRemovePasswordTimeout.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = useRemovePasswordTimeout;
|
||||
var _react = require("react");
|
||||
function useRemovePasswordTimeout(inputRef, triggerOnMount) {
|
||||
const removePasswordTimeoutRef = (0, _react.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');
|
||||
}
|
||||
}));
|
||||
};
|
||||
(0, _react.useEffect)(() => {
|
||||
if (triggerOnMount) {
|
||||
removePasswordTimeout();
|
||||
}
|
||||
return () => removePasswordTimeoutRef.current.forEach(timer => {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
return removePasswordTimeout;
|
||||
}
|
||||
21
frontend/node_modules/antd/lib/input/index.d.ts
generated
vendored
Normal file
21
frontend/node_modules/antd/lib/input/index.d.ts
generated
vendored
Normal 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;
|
||||
21
frontend/node_modules/antd/lib/input/index.js
generated
vendored
Normal file
21
frontend/node_modules/antd/lib/input/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _Group = _interopRequireDefault(require("./Group"));
|
||||
var _Input = _interopRequireDefault(require("./Input"));
|
||||
var _OTP = _interopRequireDefault(require("./OTP"));
|
||||
var _Password = _interopRequireDefault(require("./Password"));
|
||||
var _Search = _interopRequireDefault(require("./Search"));
|
||||
var _TextArea = _interopRequireDefault(require("./TextArea"));
|
||||
const Input = _Input.default;
|
||||
Input.Group = _Group.default;
|
||||
Input.Search = _Search.default;
|
||||
Input.TextArea = _TextArea.default;
|
||||
Input.Password = _Password.default;
|
||||
Input.OTP = _OTP.default;
|
||||
var _default = exports.default = Input;
|
||||
21
frontend/node_modules/antd/lib/input/style/index.d.ts
generated
vendored
Normal file
21
frontend/node_modules/antd/lib/input/style/index.d.ts
generated
vendored
Normal 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;
|
||||
686
frontend/node_modules/antd/lib/input/style/index.js
generated
vendored
Normal file
686
frontend/node_modules/antd/lib/input/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,686 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.genPlaceholderStyle = exports.genInputStyle = exports.genInputSmallStyle = exports.genInputGroupStyle = exports.genBasicInputStyle = exports.genAffixStyle = exports.genActiveStyle = exports.default = void 0;
|
||||
Object.defineProperty(exports, "initComponentToken", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _token.initComponentToken;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "initInputToken", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _token.initInputToken;
|
||||
}
|
||||
});
|
||||
exports.useSharedStyle = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _style = require("../../style");
|
||||
var _compactItem = require("../../style/compact-item");
|
||||
var _internal = require("../../theme/internal");
|
||||
var _token = require("./token");
|
||||
var _variants = require("./variants");
|
||||
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'
|
||||
}
|
||||
});
|
||||
exports.genPlaceholderStyle = genPlaceholderStyle;
|
||||
const genActiveStyle = token => ({
|
||||
borderColor: token.activeBorderColor,
|
||||
boxShadow: token.activeShadow,
|
||||
outline: 0,
|
||||
backgroundColor: token.activeBg
|
||||
});
|
||||
exports.genActiveStyle = genActiveStyle;
|
||||
const genInputLargeStyle = token => {
|
||||
const {
|
||||
paddingBlockLG,
|
||||
lineHeightLG,
|
||||
borderRadiusLG,
|
||||
paddingInlineLG
|
||||
} = token;
|
||||
return {
|
||||
padding: `${(0, _cssinjs.unit)(paddingBlockLG)} ${(0, _cssinjs.unit)(paddingInlineLG)}`,
|
||||
fontSize: token.inputFontSizeLG,
|
||||
lineHeight: lineHeightLG,
|
||||
borderRadius: borderRadiusLG
|
||||
};
|
||||
};
|
||||
const genInputSmallStyle = token => ({
|
||||
padding: `${(0, _cssinjs.unit)(token.paddingBlockSM)} ${(0, _cssinjs.unit)(token.paddingInlineSM)}`,
|
||||
fontSize: token.inputFontSizeSM,
|
||||
borderRadius: token.borderRadiusSM
|
||||
});
|
||||
exports.genInputSmallStyle = genInputSmallStyle;
|
||||
const genBasicInputStyle = token => Object.assign(Object.assign({
|
||||
position: 'relative',
|
||||
display: 'inline-block',
|
||||
width: '100%',
|
||||
minWidth: 0,
|
||||
padding: `${(0, _cssinjs.unit)(token.paddingBlock)} ${(0, _cssinjs.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'
|
||||
}
|
||||
});
|
||||
exports.genBasicInputStyle = genBasicInputStyle;
|
||||
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 ${(0, _cssinjs.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: `${(0, _cssinjs.unit)(token.calc(token.paddingBlock).add(1).mul(-1).equal())} ${(0, _cssinjs.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: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} transparent`,
|
||||
boxShadow: 'none'
|
||||
}
|
||||
}
|
||||
},
|
||||
// https://github.com/ant-design/ant-design/issues/31333
|
||||
[`${antCls}-cascader-picker`]: {
|
||||
margin: `-9px ${(0, _cssinjs.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'
|
||||
}, (0, _style.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
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
exports.genInputGroupStyle = genInputGroupStyle;
|
||||
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({}, (0, _style.resetComponent)(token)), genBasicInputStyle(token)), (0, _variants.genOutlinedStyle)(token)), (0, _variants.genFilledStyle)(token)), (0, _variants.genBorderlessStyle)(token)), (0, _variants.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'
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
exports.genInputStyle = genInputStyle;
|
||||
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 ${(0, _cssinjs.unit)(token.inputAffixPadding)}`
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.genAffixStyle = genAffixStyle;
|
||||
const genGroupStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
borderRadiusLG,
|
||||
borderRadiusSM
|
||||
} = token;
|
||||
return {
|
||||
[`${componentCls}-group`]: Object.assign(Object.assign(Object.assign({}, (0, _style.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
|
||||
}
|
||||
}
|
||||
}, (0, _variants.genOutlinedGroupStyle)(token)), (0, _variants.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 ==============================
|
||||
const useSharedStyle = exports.useSharedStyle = (0, _internal.genStyleHooks)(['Input', 'Shared'], token => {
|
||||
const inputToken = (0, _internal.mergeToken)(token, (0, _token.initInputToken)(token));
|
||||
return [genInputStyle(inputToken), genAffixStyle(inputToken)];
|
||||
}, _token.initComponentToken, {
|
||||
resetFont: false
|
||||
});
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)(['Input', 'Component'], token => {
|
||||
const inputToken = (0, _internal.mergeToken)(token, (0, _token.initInputToken)(token));
|
||||
return [genGroupStyle(inputToken), genSearchInputStyle(inputToken), genRangeStyle(inputToken),
|
||||
// =====================================================
|
||||
// == Space Compact ==
|
||||
// =====================================================
|
||||
(0, _compactItem.genCompactItemStyle)(inputToken)];
|
||||
}, _token.initComponentToken, {
|
||||
resetFont: false
|
||||
});
|
||||
2
frontend/node_modules/antd/lib/input/style/otp.d.ts
generated
vendored
Normal file
2
frontend/node_modules/antd/lib/input/style/otp.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
64
frontend/node_modules/antd/lib/input/style/otp.js
generated
vendored
Normal file
64
frontend/node_modules/antd/lib/input/style/otp.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _internal = require("../../theme/internal");
|
||||
var _token = require("./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 ==============================
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)(['Input', 'OTP'], token => {
|
||||
const inputToken = (0, _internal.mergeToken)(token, (0, _token.initInputToken)(token));
|
||||
return genOTPStyle(inputToken);
|
||||
}, _token.initComponentToken);
|
||||
6
frontend/node_modules/antd/lib/input/style/textarea.d.ts
generated
vendored
Normal file
6
frontend/node_modules/antd/lib/input/style/textarea.d.ts
generated
vendored
Normal 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;
|
||||
125
frontend/node_modules/antd/lib/input/style/textarea.js
generated
vendored
Normal file
125
frontend/node_modules/antd/lib/input/style/textarea.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
Object.defineProperty(exports, "initComponentToken", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _token.initComponentToken;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "initInputToken", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _token.initInputToken;
|
||||
}
|
||||
});
|
||||
var _internal = require("../../theme/internal");
|
||||
var _token = require("./token");
|
||||
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 ==============================
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)(['Input', 'TextArea'], token => {
|
||||
const inputToken = (0, _internal.mergeToken)(token, (0, _token.initInputToken)(token));
|
||||
return genTextAreaStyle(inputToken);
|
||||
}, _token.initComponentToken, {
|
||||
resetFont: false
|
||||
});
|
||||
97
frontend/node_modules/antd/lib/input/style/token.d.ts
generated
vendored
Normal file
97
frontend/node_modules/antd/lib/input/style/token.d.ts
generated
vendored
Normal 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;
|
||||
65
frontend/node_modules/antd/lib/input/style/token.js
generated
vendored
Normal file
65
frontend/node_modules/antd/lib/input/style/token.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.initComponentToken = void 0;
|
||||
exports.initInputToken = initInputToken;
|
||||
var _internal = require("../../theme/internal");
|
||||
function initInputToken(token) {
|
||||
return (0, _internal.mergeToken)(token, {
|
||||
inputAffixPadding: token.paddingXXS
|
||||
});
|
||||
}
|
||||
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
|
||||
};
|
||||
};
|
||||
exports.initComponentToken = initComponentToken;
|
||||
22
frontend/node_modules/antd/lib/input/style/variants.d.ts
generated
vendored
Normal file
22
frontend/node_modules/antd/lib/input/style/variants.d.ts
generated
vendored
Normal 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;
|
||||
314
frontend/node_modules/antd/lib/input/style/variants.js
generated
vendored
Normal file
314
frontend/node_modules/antd/lib/input/style/variants.js
generated
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.genUnderlinedStyle = exports.genOutlinedStyle = exports.genOutlinedGroupStyle = exports.genHoverStyle = exports.genFilledStyle = exports.genFilledGroupStyle = exports.genDisabledStyle = exports.genBorderlessStyle = exports.genBaseUnderlinedStyle = exports.genBaseOutlinedStyle = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _internal = require("../../theme/internal");
|
||||
const genHoverStyle = token => ({
|
||||
borderColor: token.hoverBorderColor,
|
||||
backgroundColor: token.hoverBg
|
||||
});
|
||||
exports.genHoverStyle = genHoverStyle;
|
||||
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((0, _internal.mergeToken)(token, {
|
||||
hoverBorderColor: token.colorBorder,
|
||||
hoverBg: token.colorBgContainerDisabled
|
||||
})))
|
||||
});
|
||||
/* ============== Outlined ============== */
|
||||
exports.genDisabledStyle = genDisabledStyle;
|
||||
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
|
||||
}
|
||||
});
|
||||
exports.genBaseOutlinedStyle = genBaseOutlinedStyle;
|
||||
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
|
||||
}
|
||||
});
|
||||
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)
|
||||
});
|
||||
exports.genOutlinedStyle = genOutlinedStyle;
|
||||
const genOutlinedGroupStatusStyle = (token, options) => ({
|
||||
[`&${token.componentCls}-group-wrapper-status-${options.status}`]: {
|
||||
[`${token.componentCls}-group-addon`]: {
|
||||
borderColor: options.addonBorderColor,
|
||||
color: options.addonColor
|
||||
}
|
||||
}
|
||||
});
|
||||
const genOutlinedGroupStyle = token => ({
|
||||
'&-outlined': Object.assign(Object.assign(Object.assign({
|
||||
[`${token.componentCls}-group`]: {
|
||||
'&-addon': {
|
||||
background: token.addonBg,
|
||||
border: `${(0, _cssinjs.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 ============ */
|
||||
exports.genOutlinedGroupStyle = genOutlinedGroupStyle;
|
||||
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 ============== */
|
||||
exports.genBorderlessStyle = genBorderlessStyle;
|
||||
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
|
||||
}
|
||||
})
|
||||
});
|
||||
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)
|
||||
});
|
||||
exports.genFilledStyle = genFilledStyle;
|
||||
const genFilledGroupStatusStyle = (token, options) => ({
|
||||
[`&${token.componentCls}-group-wrapper-status-${options.status}`]: {
|
||||
[`${token.componentCls}-group-addon`]: {
|
||||
background: options.addonBg,
|
||||
color: options.addonColor
|
||||
}
|
||||
}
|
||||
});
|
||||
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: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
||||
borderTop: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
||||
borderBottom: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
|
||||
},
|
||||
'&-addon:last-child': {
|
||||
borderInlineEnd: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
||||
borderTop: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
||||
borderBottom: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
/* ============== Underlined ============== */
|
||||
// https://github.com/ant-design/ant-design/issues/51379
|
||||
exports.genFilledGroupStyle = genFilledGroupStyle;
|
||||
const genBaseUnderlinedStyle = (token, options) => ({
|
||||
background: token.colorBgContainer,
|
||||
borderWidth: `${(0, _cssinjs.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
|
||||
}
|
||||
});
|
||||
exports.genBaseUnderlinedStyle = genBaseUnderlinedStyle;
|
||||
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`
|
||||
}
|
||||
});
|
||||
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)
|
||||
});
|
||||
exports.genUnderlinedStyle = genUnderlinedStyle;
|
||||
8
frontend/node_modules/antd/lib/input/utils.d.ts
generated
vendored
Normal file
8
frontend/node_modules/antd/lib/input/utils.d.ts
generated
vendored
Normal 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;
|
||||
9
frontend/node_modules/antd/lib/input/utils.js
generated
vendored
Normal file
9
frontend/node_modules/antd/lib/input/utils.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hasPrefixSuffix = hasPrefixSuffix;
|
||||
function hasPrefixSuffix(props) {
|
||||
return !!(props.prefix || props.suffix || props.allowClear || props.showCount);
|
||||
}
|
||||
Reference in New Issue
Block a user