first commit
This commit is contained in:
45
frontend/node_modules/antd/lib/mentions/index.d.ts
generated
vendored
Normal file
45
frontend/node_modules/antd/lib/mentions/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import * as React from 'react';
|
||||
import type { DataDrivenOptionProps as MentionsOptionProps, MentionsProps as RcMentionsProps, MentionsRef as RcMentionsRef } from 'rc-mentions/lib/Mentions';
|
||||
import type { InputStatus } from '../_util/statusUtils';
|
||||
import type { Variant } from '../config-provider';
|
||||
export declare const Option: React.FC<import("rc-mentions/lib/Option").OptionProps>;
|
||||
export type MentionPlacement = 'top' | 'bottom';
|
||||
export type { DataDrivenOptionProps as MentionsOptionProps } from 'rc-mentions/lib/Mentions';
|
||||
export interface OptionProps {
|
||||
value: string;
|
||||
children: React.ReactNode;
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface MentionProps extends Omit<RcMentionsProps, 'suffix'> {
|
||||
rootClassName?: string;
|
||||
loading?: boolean;
|
||||
status?: InputStatus;
|
||||
options?: MentionsOptionProps[];
|
||||
popupClassName?: string;
|
||||
/**
|
||||
* @since 5.13.0
|
||||
* @default "outlined"
|
||||
*/
|
||||
variant?: Variant;
|
||||
}
|
||||
export interface MentionsProps extends MentionProps {
|
||||
}
|
||||
export interface MentionsRef extends RcMentionsRef {
|
||||
}
|
||||
interface MentionsConfig {
|
||||
prefix?: string | string[];
|
||||
split?: string;
|
||||
}
|
||||
interface MentionsEntity {
|
||||
prefix: string;
|
||||
value: string;
|
||||
}
|
||||
declare const InternalMentions: React.ForwardRefExoticComponent<MentionProps & React.RefAttributes<MentionsRef>>;
|
||||
type CompoundedComponent = typeof InternalMentions & {
|
||||
Option: typeof Option;
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
|
||||
getMentions: (value: string, config?: MentionsConfig) => MentionsEntity[];
|
||||
};
|
||||
declare const Mentions: CompoundedComponent;
|
||||
declare const PurePanel: (props: import("../_util/type").AnyObject) => React.JSX.Element;
|
||||
export default Mentions;
|
||||
195
frontend/node_modules/antd/lib/mentions/index.js
generated
vendored
Normal file
195
frontend/node_modules/antd/lib/mentions/index.js
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
"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 = exports.Option = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcMentions = _interopRequireDefault(require("rc-mentions"));
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _getAllowClear = _interopRequireDefault(require("../_util/getAllowClear"));
|
||||
var _PurePanel = _interopRequireDefault(require("../_util/PurePanel"));
|
||||
var _statusUtils = require("../_util/statusUtils");
|
||||
var _toList = _interopRequireDefault(require("../_util/toList"));
|
||||
var _warning = require("../_util/warning");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _defaultRenderEmpty = _interopRequireDefault(require("../config-provider/defaultRenderEmpty"));
|
||||
var _useCSSVarCls = _interopRequireDefault(require("../config-provider/hooks/useCSSVarCls"));
|
||||
var _context = require("../form/context");
|
||||
var _useVariants = _interopRequireDefault(require("../form/hooks/useVariants"));
|
||||
var _spin = _interopRequireDefault(require("../spin"));
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
var _DisabledContext = _interopRequireDefault(require("../config-provider/DisabledContext"));
|
||||
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 {
|
||||
Option
|
||||
} = _rcMentions.default;
|
||||
exports.Option = Option;
|
||||
function loadingFilterOption() {
|
||||
return true;
|
||||
}
|
||||
const InternalMentions = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
rootClassName,
|
||||
disabled: customDisabled,
|
||||
loading,
|
||||
filterOption,
|
||||
children,
|
||||
notFoundContent,
|
||||
options,
|
||||
status: customStatus,
|
||||
allowClear = false,
|
||||
popupClassName,
|
||||
style,
|
||||
variant: customVariant
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "disabled", "loading", "filterOption", "children", "notFoundContent", "options", "status", "allowClear", "popupClassName", "style", "variant"]);
|
||||
const [focused, setFocused] = React.useState(false);
|
||||
const innerRef = React.useRef(null);
|
||||
const mergedRef = (0, _ref.composeRef)(ref, innerRef);
|
||||
// =================== Warning =====================
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Mentions');
|
||||
warning.deprecated(!children, 'Mentions.Option', 'options');
|
||||
}
|
||||
const {
|
||||
getPrefixCls,
|
||||
renderEmpty,
|
||||
direction,
|
||||
mentions: contextMentions
|
||||
} = React.useContext(_configProvider.ConfigContext);
|
||||
const {
|
||||
status: contextStatus,
|
||||
hasFeedback,
|
||||
feedbackIcon
|
||||
} = React.useContext(_context.FormItemInputContext);
|
||||
const mergedStatus = (0, _statusUtils.getMergedStatus)(contextStatus, customStatus);
|
||||
// ===================== Disabled =====================
|
||||
const contextDisabled = React.useContext(_DisabledContext.default);
|
||||
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : contextDisabled;
|
||||
const onFocus = (...args) => {
|
||||
if (restProps.onFocus) {
|
||||
restProps.onFocus.apply(restProps, args);
|
||||
}
|
||||
setFocused(true);
|
||||
};
|
||||
const onBlur = (...args) => {
|
||||
if (restProps.onBlur) {
|
||||
restProps.onBlur.apply(restProps, args);
|
||||
}
|
||||
setFocused(false);
|
||||
};
|
||||
const notFoundContentEle = React.useMemo(() => {
|
||||
if (notFoundContent !== undefined) {
|
||||
return notFoundContent;
|
||||
}
|
||||
return (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/React.createElement(_defaultRenderEmpty.default, {
|
||||
componentName: "Select"
|
||||
});
|
||||
}, [notFoundContent, renderEmpty]);
|
||||
const mentionOptions = React.useMemo(() => {
|
||||
if (loading) {
|
||||
return /*#__PURE__*/React.createElement(Option, {
|
||||
value: "ANTD_SEARCHING",
|
||||
disabled: true
|
||||
}, /*#__PURE__*/React.createElement(_spin.default, {
|
||||
size: "small"
|
||||
}));
|
||||
}
|
||||
return children;
|
||||
}, [loading, children]);
|
||||
const mergedOptions = loading ? [{
|
||||
value: 'ANTD_SEARCHING',
|
||||
disabled: true,
|
||||
label: /*#__PURE__*/React.createElement(_spin.default, {
|
||||
size: "small"
|
||||
})
|
||||
}] : options;
|
||||
const mentionsfilterOption = loading ? loadingFilterOption : filterOption;
|
||||
const prefixCls = getPrefixCls('mentions', customizePrefixCls);
|
||||
const mergedAllowClear = (0, _getAllowClear.default)(allowClear);
|
||||
// Style
|
||||
const rootCls = (0, _useCSSVarCls.default)(prefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls, rootCls);
|
||||
const [variant, enableVariantCls] = (0, _useVariants.default)('mentions', customVariant);
|
||||
const suffixNode = hasFeedback && /*#__PURE__*/React.createElement(React.Fragment, null, feedbackIcon);
|
||||
const mergedClassName = (0, _classnames.default)(contextMentions === null || contextMentions === void 0 ? void 0 : contextMentions.className, className, rootClassName, cssVarCls, rootCls);
|
||||
const mentions = /*#__PURE__*/React.createElement(_rcMentions.default, Object.assign({
|
||||
silent: loading,
|
||||
prefixCls: prefixCls,
|
||||
notFoundContent: notFoundContentEle,
|
||||
className: mergedClassName,
|
||||
disabled: mergedDisabled,
|
||||
allowClear: mergedAllowClear,
|
||||
direction: direction,
|
||||
style: Object.assign(Object.assign({}, contextMentions === null || contextMentions === void 0 ? void 0 : contextMentions.style), style)
|
||||
}, restProps, {
|
||||
filterOption: mentionsfilterOption,
|
||||
onFocus: onFocus,
|
||||
onBlur: onBlur,
|
||||
dropdownClassName: (0, _classnames.default)(popupClassName, rootClassName, hashId, cssVarCls, rootCls),
|
||||
ref: mergedRef,
|
||||
options: mergedOptions,
|
||||
suffix: suffixNode,
|
||||
classNames: {
|
||||
mentions: (0, _classnames.default)({
|
||||
[`${prefixCls}-disabled`]: mergedDisabled,
|
||||
[`${prefixCls}-focused`]: focused,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, hashId),
|
||||
variant: (0, _classnames.default)({
|
||||
[`${prefixCls}-${variant}`]: enableVariantCls
|
||||
}, (0, _statusUtils.getStatusClassNames)(prefixCls, mergedStatus)),
|
||||
affixWrapper: hashId
|
||||
}
|
||||
}), mentionOptions);
|
||||
return wrapCSSVar(mentions);
|
||||
});
|
||||
const Mentions = InternalMentions;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Mentions.displayName = 'Mentions';
|
||||
}
|
||||
Mentions.Option = Option;
|
||||
// We don't care debug panel
|
||||
/* istanbul ignore next */
|
||||
const PurePanel = (0, _PurePanel.default)(Mentions, undefined, undefined, 'mentions');
|
||||
Mentions._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
||||
Mentions.getMentions = (value = '', config = {}) => {
|
||||
const {
|
||||
prefix = '@',
|
||||
split = ' '
|
||||
} = config;
|
||||
const prefixList = (0, _toList.default)(prefix);
|
||||
return value.split(split).map((str = '') => {
|
||||
let hitPrefix = null;
|
||||
prefixList.some(prefixStr => {
|
||||
const startStr = str.slice(0, prefixStr.length);
|
||||
if (startStr === prefixStr) {
|
||||
hitPrefix = prefixStr;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (hitPrefix !== null) {
|
||||
return {
|
||||
prefix: hitPrefix,
|
||||
value: str.slice(hitPrefix.length)
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}).filter(entity => !!entity && !!entity.value);
|
||||
};
|
||||
var _default = exports.default = Mentions;
|
||||
22
frontend/node_modules/antd/lib/mentions/style/index.d.ts
generated
vendored
Normal file
22
frontend/node_modules/antd/lib/mentions/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { SharedComponentToken } from '../../input/style/token';
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken extends SharedComponentToken {
|
||||
/**
|
||||
* @desc 弹层 z-index
|
||||
* @descEN z-index of popup
|
||||
*/
|
||||
zIndexPopup: number;
|
||||
/**
|
||||
* @desc 弹层高度
|
||||
* @descEN Height of popup
|
||||
*/
|
||||
dropdownHeight: number | string;
|
||||
/**
|
||||
* @desc 菜单项高度
|
||||
* @descEN Height of menu item
|
||||
*/
|
||||
controlItemWidth: number | string;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Mentions'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
230
frontend/node_modules/antd/lib/mentions/style/index.js
generated
vendored
Normal file
230
frontend/node_modules/antd/lib/mentions/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,230 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _style = require("../../input/style");
|
||||
var _variants = require("../../input/style/variants");
|
||||
var _style2 = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
const genMentionsStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
antCls,
|
||||
colorTextDisabled,
|
||||
controlItemBgHover,
|
||||
controlPaddingHorizontal,
|
||||
colorText,
|
||||
motionDurationSlow,
|
||||
lineHeight,
|
||||
controlHeight,
|
||||
paddingInline,
|
||||
paddingBlock,
|
||||
fontSize,
|
||||
fontSizeIcon,
|
||||
colorIcon,
|
||||
colorTextQuaternary,
|
||||
colorBgElevated,
|
||||
paddingXXS,
|
||||
borderRadius,
|
||||
borderRadiusLG,
|
||||
boxShadowSecondary,
|
||||
itemPaddingVertical,
|
||||
calc
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, _style2.resetComponent)(token)), (0, _style.genBasicInputStyle)(token)), {
|
||||
position: 'relative',
|
||||
display: 'inline-block',
|
||||
height: 'auto',
|
||||
padding: `0 ${(0, _cssinjs.unit)(token.paddingInline)}`,
|
||||
overflow: 'hidden',
|
||||
lineHeight,
|
||||
whiteSpace: 'pre-wrap',
|
||||
verticalAlign: 'bottom'
|
||||
}), (0, _variants.genOutlinedStyle)(token)), (0, _variants.genFilledStyle)(token)), (0, _variants.genBorderlessStyle)(token)), {
|
||||
'&-affix-wrapper': Object.assign(Object.assign({}, (0, _style.genBasicInputStyle)(token)), {
|
||||
display: 'inline-flex',
|
||||
paddingBlock: 0,
|
||||
paddingInlineStart: 0,
|
||||
paddingInlineEnd: token.paddingInline,
|
||||
'&::before': {
|
||||
display: 'inline-block',
|
||||
width: 0,
|
||||
visibility: 'hidden',
|
||||
content: '"\\a0"'
|
||||
},
|
||||
[`${componentCls}-suffix`]: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
// 当页面中存在 feedback-icon 时,给 clear-icon 添加右边距
|
||||
[`&:has(${antCls}-form-item-feedback-icon) ${componentCls}-clear-icon`]: {
|
||||
marginInlineEnd: token.marginXS
|
||||
},
|
||||
[`${antCls}-form-item-feedback-icon`]: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-clear-icon`]: {
|
||||
insetInlineEnd: 0,
|
||||
insetBlockStart: calc(fontSize).mul(lineHeight).mul(0.5).add(paddingBlock).equal(),
|
||||
padding: 0,
|
||||
lineHeight: 0,
|
||||
color: colorTextQuaternary,
|
||||
fontSize: fontSizeIcon,
|
||||
verticalAlign: -1,
|
||||
// https://github.com/ant-design/ant-design/pull/18151
|
||||
// https://codesandbox.io/s/wizardly-sun-u10br
|
||||
cursor: 'pointer',
|
||||
transition: `color ${motionDurationSlow}`,
|
||||
border: 'none',
|
||||
outline: 'none',
|
||||
backgroundColor: 'transparent',
|
||||
'&:hover': {
|
||||
color: colorIcon
|
||||
},
|
||||
'&:active': {
|
||||
color: colorText
|
||||
},
|
||||
'&-hidden': {
|
||||
visibility: 'hidden'
|
||||
}
|
||||
}
|
||||
})
|
||||
}), (0, _variants.genUnderlinedStyle)(token)), {
|
||||
'&-disabled': {
|
||||
'> textarea': Object.assign({}, (0, _variants.genDisabledStyle)(token))
|
||||
},
|
||||
// ================= Input Area =================
|
||||
[`&, &-affix-wrapper > ${componentCls}`]: {
|
||||
[`> textarea, ${componentCls}-measure`]: {
|
||||
color: colorText,
|
||||
boxSizing: 'border-box',
|
||||
minHeight: token.calc(controlHeight).sub(2).equal(),
|
||||
margin: 0,
|
||||
padding: `${(0, _cssinjs.unit)(paddingBlock)} ${(0, _cssinjs.unit)(paddingInline)}`,
|
||||
overflow: 'inherit',
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'auto',
|
||||
fontWeight: 'inherit',
|
||||
fontSize: 'inherit',
|
||||
fontFamily: 'inherit',
|
||||
fontStyle: 'inherit',
|
||||
fontVariant: 'inherit',
|
||||
fontSizeAdjust: 'inherit',
|
||||
fontStretch: 'inherit',
|
||||
lineHeight: 'inherit',
|
||||
direction: 'inherit',
|
||||
letterSpacing: 'inherit',
|
||||
whiteSpace: 'inherit',
|
||||
textAlign: 'inherit',
|
||||
verticalAlign: 'top',
|
||||
wordWrap: 'break-word',
|
||||
wordBreak: 'inherit',
|
||||
tabSize: 'inherit'
|
||||
},
|
||||
'> textarea:disabled': {
|
||||
color: colorTextDisabled
|
||||
},
|
||||
'> textarea': Object.assign(Object.assign({
|
||||
width: '100%',
|
||||
border: 'none',
|
||||
outline: 'none',
|
||||
resize: 'none',
|
||||
backgroundColor: 'transparent'
|
||||
}, (0, _style.genPlaceholderStyle)(token.colorTextPlaceholder)), {
|
||||
padding: `${(0, _cssinjs.unit)(token.paddingBlock)} 0`
|
||||
}),
|
||||
[`${componentCls}-measure`]: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
insetInlineEnd: 0,
|
||||
bottom: 0,
|
||||
insetInlineStart: 0,
|
||||
zIndex: -1,
|
||||
color: 'transparent',
|
||||
pointerEvents: 'none',
|
||||
'> span': {
|
||||
display: 'inline-block',
|
||||
minHeight: '1em'
|
||||
}
|
||||
}
|
||||
},
|
||||
// ================== Dropdown ==================
|
||||
'&-dropdown': Object.assign(Object.assign({}, (0, _style2.resetComponent)(token)), {
|
||||
position: 'absolute',
|
||||
top: -9999,
|
||||
insetInlineStart: -9999,
|
||||
zIndex: token.zIndexPopup,
|
||||
boxSizing: 'border-box',
|
||||
fontSize,
|
||||
fontVariant: 'initial',
|
||||
padding: paddingXXS,
|
||||
backgroundColor: colorBgElevated,
|
||||
borderRadius: borderRadiusLG,
|
||||
outline: 'none',
|
||||
boxShadow: boxShadowSecondary,
|
||||
'&-hidden': {
|
||||
display: 'none'
|
||||
},
|
||||
[`${componentCls}-dropdown-menu`]: {
|
||||
maxHeight: token.dropdownHeight,
|
||||
margin: 0,
|
||||
paddingInlineStart: 0,
|
||||
// Override default ul/ol
|
||||
overflow: 'auto',
|
||||
listStyle: 'none',
|
||||
outline: 'none',
|
||||
'&-item': Object.assign(Object.assign({}, _style2.textEllipsis), {
|
||||
position: 'relative',
|
||||
display: 'block',
|
||||
minWidth: token.controlItemWidth,
|
||||
padding: `${(0, _cssinjs.unit)(itemPaddingVertical)} ${(0, _cssinjs.unit)(controlPaddingHorizontal)}`,
|
||||
color: colorText,
|
||||
borderRadius,
|
||||
fontWeight: 'normal',
|
||||
lineHeight,
|
||||
cursor: 'pointer',
|
||||
transition: `background ${motionDurationSlow} ease`,
|
||||
'&:hover': {
|
||||
backgroundColor: controlItemBgHover
|
||||
},
|
||||
'&-disabled': {
|
||||
color: colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
'&:hover': {
|
||||
color: colorTextDisabled,
|
||||
backgroundColor: controlItemBgHover,
|
||||
cursor: 'not-allowed'
|
||||
}
|
||||
},
|
||||
'&-selected': {
|
||||
color: colorText,
|
||||
fontWeight: token.fontWeightStrong,
|
||||
backgroundColor: controlItemBgHover
|
||||
},
|
||||
'&-active': {
|
||||
backgroundColor: controlItemBgHover
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
};
|
||||
};
|
||||
const prepareComponentToken = token => Object.assign(Object.assign({}, (0, _style.initComponentToken)(token)), {
|
||||
dropdownHeight: 250,
|
||||
controlItemWidth: 100,
|
||||
zIndexPopup: token.zIndexPopupBase + 50,
|
||||
itemPaddingVertical: (token.controlHeight - token.fontHeight) / 2
|
||||
});
|
||||
// ============================== Export ==============================
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Mentions', token => {
|
||||
const mentionsToken = (0, _internal.mergeToken)(token, (0, _style.initInputToken)(token));
|
||||
return genMentionsStyle(mentionsToken);
|
||||
}, prepareComponentToken);
|
||||
Reference in New Issue
Block a user