first commit
This commit is contained in:
13
frontend/node_modules/antd/lib/typography/Base/CopyBtn.d.ts
generated
vendored
Normal file
13
frontend/node_modules/antd/lib/typography/Base/CopyBtn.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import type { CopyConfig } from '.';
|
||||
import type { Locale } from '../../locale';
|
||||
export interface CopyBtnProps extends Omit<CopyConfig, 'onCopy'> {
|
||||
prefixCls: string;
|
||||
copied: boolean;
|
||||
locale: Locale['Text'];
|
||||
onCopy: React.MouseEventHandler<HTMLButtonElement>;
|
||||
iconOnly: boolean;
|
||||
loading: boolean;
|
||||
}
|
||||
declare const CopyBtn: React.FC<CopyBtnProps>;
|
||||
export default CopyBtn;
|
||||
50
frontend/node_modules/antd/lib/typography/Base/CopyBtn.js
generated
vendored
Normal file
50
frontend/node_modules/antd/lib/typography/Base/CopyBtn.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"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 _CheckOutlined = _interopRequireDefault(require("@ant-design/icons/CheckOutlined"));
|
||||
var _CopyOutlined = _interopRequireDefault(require("@ant-design/icons/CopyOutlined"));
|
||||
var _LoadingOutlined = _interopRequireDefault(require("@ant-design/icons/LoadingOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _tooltip = _interopRequireDefault(require("../../tooltip"));
|
||||
var _util = require("./util");
|
||||
const CopyBtn = ({
|
||||
prefixCls,
|
||||
copied,
|
||||
locale,
|
||||
iconOnly,
|
||||
tooltips,
|
||||
icon,
|
||||
tabIndex,
|
||||
onCopy,
|
||||
loading: btnLoading
|
||||
}) => {
|
||||
const tooltipNodes = (0, _util.toList)(tooltips);
|
||||
const iconNodes = (0, _util.toList)(icon);
|
||||
const {
|
||||
copied: copiedText,
|
||||
copy: copyText
|
||||
} = locale !== null && locale !== void 0 ? locale : {};
|
||||
const systemStr = copied ? copiedText : copyText;
|
||||
const copyTitle = (0, _util.getNode)(tooltipNodes[copied ? 1 : 0], systemStr);
|
||||
const ariaLabel = typeof copyTitle === 'string' ? copyTitle : systemStr;
|
||||
return /*#__PURE__*/React.createElement(_tooltip.default, {
|
||||
title: copyTitle
|
||||
}, /*#__PURE__*/React.createElement("button", {
|
||||
type: "button",
|
||||
className: (0, _classnames.default)(`${prefixCls}-copy`, {
|
||||
[`${prefixCls}-copy-success`]: copied,
|
||||
[`${prefixCls}-copy-icon-only`]: iconOnly
|
||||
}),
|
||||
onClick: onCopy,
|
||||
"aria-label": ariaLabel,
|
||||
tabIndex: tabIndex
|
||||
}, copied ? (0, _util.getNode)(iconNodes[1], /*#__PURE__*/React.createElement(_CheckOutlined.default, null), true) : (0, _util.getNode)(iconNodes[0], btnLoading ? /*#__PURE__*/React.createElement(_LoadingOutlined.default, null) : /*#__PURE__*/React.createElement(_CopyOutlined.default, null), true)));
|
||||
};
|
||||
var _default = exports.default = CopyBtn;
|
||||
18
frontend/node_modules/antd/lib/typography/Base/Ellipsis.d.ts
generated
vendored
Normal file
18
frontend/node_modules/antd/lib/typography/Base/Ellipsis.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as React from 'react';
|
||||
export interface EllipsisProps {
|
||||
enableMeasure?: boolean;
|
||||
text?: React.ReactNode;
|
||||
width: number;
|
||||
rows: number;
|
||||
children: (cutChildren: React.ReactNode[],
|
||||
/** Tell current `text` is exceed the `rows` which can be ellipsis */
|
||||
canEllipsis: boolean) => React.ReactNode;
|
||||
onEllipsis: (isEllipsis: boolean) => void;
|
||||
expanded: boolean;
|
||||
/**
|
||||
* Mark for misc update. Which will not affect ellipsis content length.
|
||||
* e.g. tooltip content update.
|
||||
*/
|
||||
miscDeps: any[];
|
||||
}
|
||||
export default function EllipsisMeasure(props: EllipsisProps): React.JSX.Element;
|
||||
207
frontend/node_modules/antd/lib/typography/Base/Ellipsis.js
generated
vendored
Normal file
207
frontend/node_modules/antd/lib/typography/Base/Ellipsis.js
generated
vendored
Normal file
@@ -0,0 +1,207 @@
|
||||
"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 = EllipsisMeasure;
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
|
||||
var _useLayoutEffect = _interopRequireDefault(require("rc-util/lib/hooks/useLayoutEffect"));
|
||||
var _util = require("./util");
|
||||
const MeasureText = /*#__PURE__*/React.forwardRef(({
|
||||
style,
|
||||
children
|
||||
}, ref) => {
|
||||
const spanRef = React.useRef(null);
|
||||
React.useImperativeHandle(ref, () => ({
|
||||
isExceed: () => {
|
||||
const span = spanRef.current;
|
||||
return span.scrollHeight > span.clientHeight;
|
||||
},
|
||||
getHeight: () => spanRef.current.clientHeight
|
||||
}));
|
||||
return /*#__PURE__*/React.createElement("span", {
|
||||
"aria-hidden": true,
|
||||
ref: spanRef,
|
||||
style: Object.assign({
|
||||
position: 'fixed',
|
||||
display: 'block',
|
||||
left: 0,
|
||||
top: 0,
|
||||
pointerEvents: 'none',
|
||||
backgroundColor: 'rgba(255, 0, 0, 0.65)'
|
||||
}, style)
|
||||
}, children);
|
||||
});
|
||||
const getNodesLen = nodeList => nodeList.reduce((totalLen, node) => totalLen + ((0, _util.isValidText)(node) ? String(node).length : 1), 0);
|
||||
function sliceNodes(nodeList, len) {
|
||||
let currLen = 0;
|
||||
const currentNodeList = [];
|
||||
for (let i = 0; i < nodeList.length; i += 1) {
|
||||
// Match to return
|
||||
if (currLen === len) {
|
||||
return currentNodeList;
|
||||
}
|
||||
const node = nodeList[i];
|
||||
const canCut = (0, _util.isValidText)(node);
|
||||
const nodeLen = canCut ? String(node).length : 1;
|
||||
const nextLen = currLen + nodeLen;
|
||||
// Exceed but current not which means we need cut this
|
||||
// This will not happen on validate ReactElement
|
||||
if (nextLen > len) {
|
||||
const restLen = len - currLen;
|
||||
currentNodeList.push(String(node).slice(0, restLen));
|
||||
return currentNodeList;
|
||||
}
|
||||
currentNodeList.push(node);
|
||||
currLen = nextLen;
|
||||
}
|
||||
return nodeList;
|
||||
}
|
||||
// Measure for the `text` is exceed the `rows` or not
|
||||
const STATUS_MEASURE_NONE = 0;
|
||||
const STATUS_MEASURE_PREPARE = 1;
|
||||
const STATUS_MEASURE_START = 2;
|
||||
const STATUS_MEASURE_NEED_ELLIPSIS = 3;
|
||||
const STATUS_MEASURE_NO_NEED_ELLIPSIS = 4;
|
||||
const lineClipStyle = {
|
||||
display: '-webkit-box',
|
||||
overflow: 'hidden',
|
||||
WebkitBoxOrient: 'vertical'
|
||||
};
|
||||
function EllipsisMeasure(props) {
|
||||
const {
|
||||
enableMeasure,
|
||||
width,
|
||||
text,
|
||||
children,
|
||||
rows,
|
||||
expanded,
|
||||
miscDeps,
|
||||
onEllipsis
|
||||
} = props;
|
||||
const nodeList = React.useMemo(() => (0, _toArray.default)(text), [text]);
|
||||
const nodeLen = React.useMemo(() => getNodesLen(nodeList), [text]);
|
||||
// ========================= Full Content =========================
|
||||
// Used for measure only, which means it's always render as no need ellipsis
|
||||
const fullContent = React.useMemo(() => children(nodeList, false), [text]);
|
||||
// ========================= Cut Content ==========================
|
||||
const [ellipsisCutIndex, setEllipsisCutIndex] = React.useState(null);
|
||||
const cutMidRef = React.useRef(null);
|
||||
// ========================= NeedEllipsis =========================
|
||||
const measureWhiteSpaceRef = React.useRef(null);
|
||||
const needEllipsisRef = React.useRef(null);
|
||||
// Measure for `rows-1` height, to avoid operation exceed the line height
|
||||
const descRowsEllipsisRef = React.useRef(null);
|
||||
const symbolRowEllipsisRef = React.useRef(null);
|
||||
const [canEllipsis, setCanEllipsis] = React.useState(false);
|
||||
const [needEllipsis, setNeedEllipsis] = React.useState(STATUS_MEASURE_NONE);
|
||||
const [ellipsisHeight, setEllipsisHeight] = React.useState(0);
|
||||
const [parentWhiteSpace, setParentWhiteSpace] = React.useState(null);
|
||||
// Trigger start measure
|
||||
(0, _useLayoutEffect.default)(() => {
|
||||
if (enableMeasure && width && nodeLen) {
|
||||
setNeedEllipsis(STATUS_MEASURE_PREPARE);
|
||||
} else {
|
||||
setNeedEllipsis(STATUS_MEASURE_NONE);
|
||||
}
|
||||
}, [width, text, rows, enableMeasure, nodeList]);
|
||||
// Measure process
|
||||
(0, _useLayoutEffect.default)(() => {
|
||||
var _a, _b, _c, _d;
|
||||
if (needEllipsis === STATUS_MEASURE_PREPARE) {
|
||||
setNeedEllipsis(STATUS_MEASURE_START);
|
||||
// Parent ref `white-space`
|
||||
const nextWhiteSpace = measureWhiteSpaceRef.current && getComputedStyle(measureWhiteSpaceRef.current).whiteSpace;
|
||||
setParentWhiteSpace(nextWhiteSpace);
|
||||
} else if (needEllipsis === STATUS_MEASURE_START) {
|
||||
const isOverflow = !!((_a = needEllipsisRef.current) === null || _a === void 0 ? void 0 : _a.isExceed());
|
||||
setNeedEllipsis(isOverflow ? STATUS_MEASURE_NEED_ELLIPSIS : STATUS_MEASURE_NO_NEED_ELLIPSIS);
|
||||
setEllipsisCutIndex(isOverflow ? [0, nodeLen] : null);
|
||||
setCanEllipsis(isOverflow);
|
||||
// Get the basic height of ellipsis rows
|
||||
const baseRowsEllipsisHeight = ((_b = needEllipsisRef.current) === null || _b === void 0 ? void 0 : _b.getHeight()) || 0;
|
||||
// Get the height of `rows - 1` + symbol height
|
||||
const descRowsEllipsisHeight = rows === 1 ? 0 : ((_c = descRowsEllipsisRef.current) === null || _c === void 0 ? void 0 : _c.getHeight()) || 0;
|
||||
const symbolRowEllipsisHeight = ((_d = symbolRowEllipsisRef.current) === null || _d === void 0 ? void 0 : _d.getHeight()) || 0;
|
||||
const maxRowsHeight = Math.max(baseRowsEllipsisHeight,
|
||||
// height of rows with ellipsis
|
||||
descRowsEllipsisHeight + symbolRowEllipsisHeight);
|
||||
setEllipsisHeight(maxRowsHeight + 1);
|
||||
onEllipsis(isOverflow);
|
||||
}
|
||||
}, [needEllipsis]);
|
||||
// ========================= Cut Measure ==========================
|
||||
const cutMidIndex = ellipsisCutIndex ? Math.ceil((ellipsisCutIndex[0] + ellipsisCutIndex[1]) / 2) : 0;
|
||||
(0, _useLayoutEffect.default)(() => {
|
||||
var _a;
|
||||
const [minIndex, maxIndex] = ellipsisCutIndex || [0, 0];
|
||||
if (minIndex !== maxIndex) {
|
||||
const midHeight = ((_a = cutMidRef.current) === null || _a === void 0 ? void 0 : _a.getHeight()) || 0;
|
||||
const isOverflow = midHeight > ellipsisHeight;
|
||||
let targetMidIndex = cutMidIndex;
|
||||
if (maxIndex - minIndex === 1) {
|
||||
targetMidIndex = isOverflow ? minIndex : maxIndex;
|
||||
}
|
||||
setEllipsisCutIndex(isOverflow ? [minIndex, targetMidIndex] : [targetMidIndex, maxIndex]);
|
||||
}
|
||||
}, [ellipsisCutIndex, cutMidIndex]);
|
||||
// ========================= Text Content =========================
|
||||
const finalContent = React.useMemo(() => {
|
||||
// Skip everything if `enableMeasure` is disabled
|
||||
if (!enableMeasure) {
|
||||
return children(nodeList, false);
|
||||
}
|
||||
if (needEllipsis !== STATUS_MEASURE_NEED_ELLIPSIS || !ellipsisCutIndex || ellipsisCutIndex[0] !== ellipsisCutIndex[1]) {
|
||||
const content = children(nodeList, false);
|
||||
// Limit the max line count to avoid scrollbar blink unless no need ellipsis
|
||||
// https://github.com/ant-design/ant-design/issues/42958
|
||||
if ([STATUS_MEASURE_NO_NEED_ELLIPSIS, STATUS_MEASURE_NONE].includes(needEllipsis)) {
|
||||
return content;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("span", {
|
||||
style: Object.assign(Object.assign({}, lineClipStyle), {
|
||||
WebkitLineClamp: rows
|
||||
})
|
||||
}, content);
|
||||
}
|
||||
return children(expanded ? nodeList : sliceNodes(nodeList, ellipsisCutIndex[0]), canEllipsis);
|
||||
}, [expanded, needEllipsis, ellipsisCutIndex, nodeList].concat((0, _toConsumableArray2.default)(miscDeps)));
|
||||
// ============================ Render ============================
|
||||
const measureStyle = {
|
||||
width,
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
whiteSpace: parentWhiteSpace === 'nowrap' ? 'normal' : 'inherit'
|
||||
};
|
||||
return /*#__PURE__*/React.createElement(React.Fragment, null, finalContent, needEllipsis === STATUS_MEASURE_START && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MeasureText, {
|
||||
style: Object.assign(Object.assign(Object.assign({}, measureStyle), lineClipStyle), {
|
||||
WebkitLineClamp: rows
|
||||
}),
|
||||
ref: needEllipsisRef
|
||||
}, fullContent), /*#__PURE__*/React.createElement(MeasureText, {
|
||||
style: Object.assign(Object.assign(Object.assign({}, measureStyle), lineClipStyle), {
|
||||
WebkitLineClamp: rows - 1
|
||||
}),
|
||||
ref: descRowsEllipsisRef
|
||||
}, fullContent), /*#__PURE__*/React.createElement(MeasureText, {
|
||||
style: Object.assign(Object.assign(Object.assign({}, measureStyle), lineClipStyle), {
|
||||
WebkitLineClamp: 1
|
||||
}),
|
||||
ref: symbolRowEllipsisRef
|
||||
}, children([], true)))), needEllipsis === STATUS_MEASURE_NEED_ELLIPSIS && ellipsisCutIndex && ellipsisCutIndex[0] !== ellipsisCutIndex[1] && (/*#__PURE__*/React.createElement(MeasureText, {
|
||||
style: Object.assign(Object.assign({}, measureStyle), {
|
||||
top: 400
|
||||
}),
|
||||
ref: cutMidRef
|
||||
}, children(sliceNodes(nodeList, cutMidIndex), true))), needEllipsis === STATUS_MEASURE_PREPARE && (/*#__PURE__*/React.createElement("span", {
|
||||
style: {
|
||||
whiteSpace: 'inherit'
|
||||
},
|
||||
ref: measureWhiteSpaceRef
|
||||
})));
|
||||
}
|
||||
10
frontend/node_modules/antd/lib/typography/Base/EllipsisTooltip.d.ts
generated
vendored
Normal file
10
frontend/node_modules/antd/lib/typography/Base/EllipsisTooltip.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import type { TooltipProps } from '../../tooltip';
|
||||
export interface EllipsisTooltipProps {
|
||||
tooltipProps?: TooltipProps;
|
||||
enableEllipsis: boolean;
|
||||
isEllipsis?: boolean;
|
||||
children: React.ReactElement;
|
||||
}
|
||||
declare const EllipsisTooltip: React.FC<EllipsisTooltipProps>;
|
||||
export default EllipsisTooltip;
|
||||
28
frontend/node_modules/antd/lib/typography/Base/EllipsisTooltip.js
generated
vendored
Normal file
28
frontend/node_modules/antd/lib/typography/Base/EllipsisTooltip.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"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 _tooltip = _interopRequireDefault(require("../../tooltip"));
|
||||
const EllipsisTooltip = ({
|
||||
enableEllipsis,
|
||||
isEllipsis,
|
||||
children,
|
||||
tooltipProps
|
||||
}) => {
|
||||
if (!(tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.title) || !enableEllipsis) {
|
||||
return children;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(_tooltip.default, Object.assign({
|
||||
open: isEllipsis ? undefined : false
|
||||
}, tooltipProps), children);
|
||||
};
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
EllipsisTooltip.displayName = 'EllipsisTooltip';
|
||||
}
|
||||
var _default = exports.default = EllipsisTooltip;
|
||||
59
frontend/node_modules/antd/lib/typography/Base/index.d.ts
generated
vendored
Normal file
59
frontend/node_modules/antd/lib/typography/Base/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import * as React from 'react';
|
||||
import type { JSX } from 'react';
|
||||
import type { AutoSizeType } from 'rc-textarea';
|
||||
import type { TooltipProps } from '../../tooltip';
|
||||
import type { TypographyProps } from '../Typography';
|
||||
export type BaseType = 'secondary' | 'success' | 'warning' | 'danger';
|
||||
export interface CopyConfig {
|
||||
text?: string | (() => string | Promise<string>);
|
||||
onCopy?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
||||
icon?: React.ReactNode;
|
||||
tooltips?: React.ReactNode;
|
||||
format?: 'text/plain' | 'text/html';
|
||||
tabIndex?: number;
|
||||
}
|
||||
interface EditConfig {
|
||||
text?: string;
|
||||
editing?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
tooltip?: React.ReactNode;
|
||||
onStart?: () => void;
|
||||
onChange?: (value: string) => void;
|
||||
onCancel?: () => void;
|
||||
onEnd?: () => void;
|
||||
maxLength?: number;
|
||||
autoSize?: boolean | AutoSizeType;
|
||||
triggerType?: ('icon' | 'text')[];
|
||||
enterIcon?: React.ReactNode;
|
||||
tabIndex?: number;
|
||||
}
|
||||
export interface EllipsisConfig {
|
||||
rows?: number;
|
||||
expandable?: boolean | 'collapsible';
|
||||
suffix?: string;
|
||||
symbol?: React.ReactNode | ((expanded: boolean) => React.ReactNode);
|
||||
defaultExpanded?: boolean;
|
||||
expanded?: boolean;
|
||||
onExpand?: (e: React.MouseEvent<HTMLElement, MouseEvent>, info: {
|
||||
expanded: boolean;
|
||||
}) => void;
|
||||
onEllipsis?: (ellipsis: boolean) => void;
|
||||
tooltip?: React.ReactNode | TooltipProps;
|
||||
}
|
||||
export interface BlockProps<C extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements> extends TypographyProps<C> {
|
||||
title?: string;
|
||||
editable?: boolean | EditConfig;
|
||||
copyable?: boolean | CopyConfig;
|
||||
type?: BaseType;
|
||||
disabled?: boolean;
|
||||
ellipsis?: boolean | EllipsisConfig;
|
||||
code?: boolean;
|
||||
mark?: boolean;
|
||||
underline?: boolean;
|
||||
delete?: boolean;
|
||||
strong?: boolean;
|
||||
keyboard?: boolean;
|
||||
italic?: boolean;
|
||||
}
|
||||
declare const Base: React.ForwardRefExoticComponent<BlockProps<keyof JSX.IntrinsicElements> & React.RefAttributes<HTMLElement>>;
|
||||
export default Base;
|
||||
366
frontend/node_modules/antd/lib/typography/Base/index.js
generated
vendored
Normal file
366
frontend/node_modules/antd/lib/typography/Base/index.js
generated
vendored
Normal file
@@ -0,0 +1,366 @@
|
||||
"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 _EditOutlined = _interopRequireDefault(require("@ant-design/icons/EditOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
|
||||
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
|
||||
var _useLayoutEffect = _interopRequireDefault(require("rc-util/lib/hooks/useLayoutEffect"));
|
||||
var _useMergedState = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
|
||||
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _styleChecker = require("../../_util/styleChecker");
|
||||
var _configProvider = require("../../config-provider");
|
||||
var _useLocale = _interopRequireDefault(require("../../locale/useLocale"));
|
||||
var _tooltip = _interopRequireDefault(require("../../tooltip"));
|
||||
var _Editable = _interopRequireDefault(require("../Editable"));
|
||||
var _useCopyClick = _interopRequireDefault(require("../hooks/useCopyClick"));
|
||||
var _useMergedConfig = _interopRequireDefault(require("../hooks/useMergedConfig"));
|
||||
var _usePrevious = _interopRequireDefault(require("../hooks/usePrevious"));
|
||||
var _useTooltipProps = _interopRequireDefault(require("../hooks/useTooltipProps"));
|
||||
var _Typography = _interopRequireDefault(require("../Typography"));
|
||||
var _CopyBtn = _interopRequireDefault(require("./CopyBtn"));
|
||||
var _Ellipsis = _interopRequireDefault(require("./Ellipsis"));
|
||||
var _EllipsisTooltip = _interopRequireDefault(require("./EllipsisTooltip"));
|
||||
var _util = require("./util");
|
||||
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 wrapperDecorations({
|
||||
mark,
|
||||
code,
|
||||
underline,
|
||||
delete: del,
|
||||
strong,
|
||||
keyboard,
|
||||
italic
|
||||
}, content) {
|
||||
let currentContent = content;
|
||||
function wrap(tag, needed) {
|
||||
if (!needed) {
|
||||
return;
|
||||
}
|
||||
currentContent = /*#__PURE__*/React.createElement(tag, {}, currentContent);
|
||||
}
|
||||
wrap('strong', strong);
|
||||
wrap('u', underline);
|
||||
wrap('del', del);
|
||||
wrap('code', code);
|
||||
wrap('mark', mark);
|
||||
wrap('kbd', keyboard);
|
||||
wrap('i', italic);
|
||||
return currentContent;
|
||||
}
|
||||
const ELLIPSIS_STR = '...';
|
||||
const DECORATION_PROPS = ['delete', 'mark', 'code', 'underline', 'strong', 'keyboard', 'italic'];
|
||||
const Base = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
var _a;
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
style,
|
||||
type,
|
||||
disabled,
|
||||
children,
|
||||
ellipsis,
|
||||
editable,
|
||||
copyable,
|
||||
component,
|
||||
title
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"]);
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction
|
||||
} = React.useContext(_configProvider.ConfigContext);
|
||||
const [textLocale] = (0, _useLocale.default)('Text');
|
||||
const typographyRef = React.useRef(null);
|
||||
const editIconRef = React.useRef(null);
|
||||
// ============================ MISC ============================
|
||||
const prefixCls = getPrefixCls('typography', customizePrefixCls);
|
||||
const textProps = (0, _omit.default)(restProps, DECORATION_PROPS);
|
||||
// ========================== Editable ==========================
|
||||
const [enableEdit, editConfig] = (0, _useMergedConfig.default)(editable);
|
||||
const [editing, setEditing] = (0, _useMergedState.default)(false, {
|
||||
value: editConfig.editing
|
||||
});
|
||||
const {
|
||||
triggerType = ['icon']
|
||||
} = editConfig;
|
||||
const triggerEdit = edit => {
|
||||
var _a;
|
||||
if (edit) {
|
||||
(_a = editConfig.onStart) === null || _a === void 0 ? void 0 : _a.call(editConfig);
|
||||
}
|
||||
setEditing(edit);
|
||||
};
|
||||
// Focus edit icon when back
|
||||
const prevEditing = (0, _usePrevious.default)(editing);
|
||||
(0, _useLayoutEffect.default)(() => {
|
||||
var _a;
|
||||
if (!editing && prevEditing) {
|
||||
(_a = editIconRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
||||
}
|
||||
}, [editing]);
|
||||
const onEditClick = e => {
|
||||
e === null || e === void 0 ? void 0 : e.preventDefault();
|
||||
triggerEdit(true);
|
||||
};
|
||||
const onEditChange = value => {
|
||||
var _a;
|
||||
(_a = editConfig.onChange) === null || _a === void 0 ? void 0 : _a.call(editConfig, value);
|
||||
triggerEdit(false);
|
||||
};
|
||||
const onEditCancel = () => {
|
||||
var _a;
|
||||
(_a = editConfig.onCancel) === null || _a === void 0 ? void 0 : _a.call(editConfig);
|
||||
triggerEdit(false);
|
||||
};
|
||||
// ========================== Copyable ==========================
|
||||
const [enableCopy, copyConfig] = (0, _useMergedConfig.default)(copyable);
|
||||
const {
|
||||
copied,
|
||||
copyLoading,
|
||||
onClick: onCopyClick
|
||||
} = (0, _useCopyClick.default)({
|
||||
copyConfig,
|
||||
children
|
||||
});
|
||||
// ========================== Ellipsis ==========================
|
||||
const [isLineClampSupport, setIsLineClampSupport] = React.useState(false);
|
||||
const [isTextOverflowSupport, setIsTextOverflowSupport] = React.useState(false);
|
||||
const [isJsEllipsis, setIsJsEllipsis] = React.useState(false);
|
||||
const [isNativeEllipsis, setIsNativeEllipsis] = React.useState(false);
|
||||
const [isNativeVisible, setIsNativeVisible] = React.useState(true);
|
||||
const [enableEllipsis, ellipsisConfig] = (0, _useMergedConfig.default)(ellipsis, {
|
||||
expandable: false,
|
||||
symbol: isExpanded => isExpanded ? textLocale === null || textLocale === void 0 ? void 0 : textLocale.collapse : textLocale === null || textLocale === void 0 ? void 0 : textLocale.expand
|
||||
});
|
||||
const [expanded, setExpanded] = (0, _useMergedState.default)(ellipsisConfig.defaultExpanded || false, {
|
||||
value: ellipsisConfig.expanded
|
||||
});
|
||||
const mergedEnableEllipsis = enableEllipsis && (!expanded || ellipsisConfig.expandable === 'collapsible');
|
||||
// Shared prop to reduce bundle size
|
||||
const {
|
||||
rows = 1
|
||||
} = ellipsisConfig;
|
||||
const needMeasureEllipsis = React.useMemo(() =>
|
||||
// Disable ellipsis
|
||||
mergedEnableEllipsis && (
|
||||
// Provide suffix
|
||||
ellipsisConfig.suffix !== undefined || ellipsisConfig.onEllipsis ||
|
||||
// Can't use css ellipsis since we need to provide the place for button
|
||||
ellipsisConfig.expandable || enableEdit || enableCopy), [mergedEnableEllipsis, ellipsisConfig, enableEdit, enableCopy]);
|
||||
(0, _useLayoutEffect.default)(() => {
|
||||
if (enableEllipsis && !needMeasureEllipsis) {
|
||||
setIsLineClampSupport((0, _styleChecker.isStyleSupport)('webkitLineClamp'));
|
||||
setIsTextOverflowSupport((0, _styleChecker.isStyleSupport)('textOverflow'));
|
||||
}
|
||||
}, [needMeasureEllipsis, enableEllipsis]);
|
||||
const [cssEllipsis, setCssEllipsis] = React.useState(mergedEnableEllipsis);
|
||||
const canUseCssEllipsis = React.useMemo(() => {
|
||||
if (needMeasureEllipsis) {
|
||||
return false;
|
||||
}
|
||||
if (rows === 1) {
|
||||
return isTextOverflowSupport;
|
||||
}
|
||||
return isLineClampSupport;
|
||||
}, [needMeasureEllipsis, isTextOverflowSupport, isLineClampSupport]);
|
||||
// We use effect to change from css ellipsis to js ellipsis.
|
||||
// To make SSR still can see the ellipsis.
|
||||
(0, _useLayoutEffect.default)(() => {
|
||||
setCssEllipsis(canUseCssEllipsis && mergedEnableEllipsis);
|
||||
}, [canUseCssEllipsis, mergedEnableEllipsis]);
|
||||
const isMergedEllipsis = mergedEnableEllipsis && (cssEllipsis ? isNativeEllipsis : isJsEllipsis);
|
||||
const cssTextOverflow = mergedEnableEllipsis && rows === 1 && cssEllipsis;
|
||||
const cssLineClamp = mergedEnableEllipsis && rows > 1 && cssEllipsis;
|
||||
// >>>>> Expand
|
||||
const onExpandClick = (e, info) => {
|
||||
var _a;
|
||||
setExpanded(info.expanded);
|
||||
(_a = ellipsisConfig.onExpand) === null || _a === void 0 ? void 0 : _a.call(ellipsisConfig, e, info);
|
||||
};
|
||||
const [ellipsisWidth, setEllipsisWidth] = React.useState(0);
|
||||
const onResize = ({
|
||||
offsetWidth
|
||||
}) => {
|
||||
setEllipsisWidth(offsetWidth);
|
||||
};
|
||||
// >>>>> JS Ellipsis
|
||||
const onJsEllipsis = jsEllipsis => {
|
||||
var _a;
|
||||
setIsJsEllipsis(jsEllipsis);
|
||||
// Trigger if changed
|
||||
if (isJsEllipsis !== jsEllipsis) {
|
||||
(_a = ellipsisConfig.onEllipsis) === null || _a === void 0 ? void 0 : _a.call(ellipsisConfig, jsEllipsis);
|
||||
}
|
||||
};
|
||||
// >>>>> Native ellipsis
|
||||
React.useEffect(() => {
|
||||
const textEle = typographyRef.current;
|
||||
if (enableEllipsis && cssEllipsis && textEle) {
|
||||
const currentEllipsis = (0, _util.isEleEllipsis)(textEle);
|
||||
if (isNativeEllipsis !== currentEllipsis) {
|
||||
setIsNativeEllipsis(currentEllipsis);
|
||||
}
|
||||
}
|
||||
}, [enableEllipsis, cssEllipsis, children, cssLineClamp, isNativeVisible, ellipsisWidth]);
|
||||
// https://github.com/ant-design/ant-design/issues/36786
|
||||
// Use IntersectionObserver to check if element is invisible
|
||||
React.useEffect(() => {
|
||||
const textEle = typographyRef.current;
|
||||
if (typeof IntersectionObserver === 'undefined' || !textEle || !cssEllipsis || !mergedEnableEllipsis) {
|
||||
return;
|
||||
}
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
const observer = new IntersectionObserver(() => {
|
||||
setIsNativeVisible(!!textEle.offsetParent);
|
||||
});
|
||||
observer.observe(textEle);
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
};
|
||||
}, [cssEllipsis, mergedEnableEllipsis]);
|
||||
// ========================== Tooltip ===========================
|
||||
const tooltipProps = (0, _useTooltipProps.default)(ellipsisConfig.tooltip, editConfig.text, children);
|
||||
const topAriaLabel = React.useMemo(() => {
|
||||
if (!enableEllipsis || cssEllipsis) {
|
||||
return undefined;
|
||||
}
|
||||
return [editConfig.text, children, title, tooltipProps.title].find(_util.isValidText);
|
||||
}, [enableEllipsis, cssEllipsis, title, tooltipProps.title, isMergedEllipsis]);
|
||||
// =========================== Render ===========================
|
||||
// >>>>>>>>>>> Editing input
|
||||
if (editing) {
|
||||
return /*#__PURE__*/React.createElement(_Editable.default, {
|
||||
value: (_a = editConfig.text) !== null && _a !== void 0 ? _a : typeof children === 'string' ? children : '',
|
||||
onSave: onEditChange,
|
||||
onCancel: onEditCancel,
|
||||
onEnd: editConfig.onEnd,
|
||||
prefixCls: prefixCls,
|
||||
className: className,
|
||||
style: style,
|
||||
direction: direction,
|
||||
component: component,
|
||||
maxLength: editConfig.maxLength,
|
||||
autoSize: editConfig.autoSize,
|
||||
enterIcon: editConfig.enterIcon
|
||||
});
|
||||
}
|
||||
// >>>>>>>>>>> Typography
|
||||
// Expand
|
||||
const renderExpand = () => {
|
||||
const {
|
||||
expandable,
|
||||
symbol
|
||||
} = ellipsisConfig;
|
||||
return expandable ? (/*#__PURE__*/React.createElement("button", {
|
||||
type: "button",
|
||||
key: "expand",
|
||||
className: `${prefixCls}-${expanded ? 'collapse' : 'expand'}`,
|
||||
onClick: e => onExpandClick(e, {
|
||||
expanded: !expanded
|
||||
}),
|
||||
"aria-label": expanded ? textLocale.collapse : textLocale === null || textLocale === void 0 ? void 0 : textLocale.expand
|
||||
}, typeof symbol === 'function' ? symbol(expanded) : symbol)) : null;
|
||||
};
|
||||
// Edit
|
||||
const renderEdit = () => {
|
||||
if (!enableEdit) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
icon,
|
||||
tooltip,
|
||||
tabIndex
|
||||
} = editConfig;
|
||||
const editTitle = (0, _toArray.default)(tooltip)[0] || (textLocale === null || textLocale === void 0 ? void 0 : textLocale.edit);
|
||||
const ariaLabel = typeof editTitle === 'string' ? editTitle : '';
|
||||
return triggerType.includes('icon') ? (/*#__PURE__*/React.createElement(_tooltip.default, {
|
||||
key: "edit",
|
||||
title: tooltip === false ? '' : editTitle
|
||||
}, /*#__PURE__*/React.createElement("button", {
|
||||
type: "button",
|
||||
ref: editIconRef,
|
||||
className: `${prefixCls}-edit`,
|
||||
onClick: onEditClick,
|
||||
"aria-label": ariaLabel,
|
||||
tabIndex: tabIndex
|
||||
}, icon || /*#__PURE__*/React.createElement(_EditOutlined.default, {
|
||||
role: "button"
|
||||
})))) : null;
|
||||
};
|
||||
// Copy
|
||||
const renderCopy = () => {
|
||||
if (!enableCopy) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(_CopyBtn.default, Object.assign({
|
||||
key: "copy"
|
||||
}, copyConfig, {
|
||||
prefixCls: prefixCls,
|
||||
copied: copied,
|
||||
locale: textLocale,
|
||||
onCopy: onCopyClick,
|
||||
loading: copyLoading,
|
||||
iconOnly: children === null || children === undefined
|
||||
}));
|
||||
};
|
||||
const renderOperations = canEllipsis => [canEllipsis && renderExpand(), renderEdit(), renderCopy()];
|
||||
const renderEllipsis = canEllipsis => [canEllipsis && !expanded && (/*#__PURE__*/React.createElement("span", {
|
||||
"aria-hidden": true,
|
||||
key: "ellipsis"
|
||||
}, ELLIPSIS_STR)), ellipsisConfig.suffix, renderOperations(canEllipsis)];
|
||||
return /*#__PURE__*/React.createElement(_rcResizeObserver.default, {
|
||||
onResize: onResize,
|
||||
disabled: !mergedEnableEllipsis
|
||||
}, resizeRef => (/*#__PURE__*/React.createElement(_EllipsisTooltip.default, {
|
||||
tooltipProps: tooltipProps,
|
||||
enableEllipsis: mergedEnableEllipsis,
|
||||
isEllipsis: isMergedEllipsis
|
||||
}, /*#__PURE__*/React.createElement(_Typography.default, Object.assign({
|
||||
className: (0, _classnames.default)({
|
||||
[`${prefixCls}-${type}`]: type,
|
||||
[`${prefixCls}-disabled`]: disabled,
|
||||
[`${prefixCls}-ellipsis`]: enableEllipsis,
|
||||
[`${prefixCls}-ellipsis-single-line`]: cssTextOverflow,
|
||||
[`${prefixCls}-ellipsis-multiple-line`]: cssLineClamp
|
||||
}, className),
|
||||
prefixCls: customizePrefixCls,
|
||||
style: Object.assign(Object.assign({}, style), {
|
||||
WebkitLineClamp: cssLineClamp ? rows : undefined
|
||||
}),
|
||||
component: component,
|
||||
ref: (0, _ref.composeRef)(resizeRef, typographyRef, ref),
|
||||
direction: direction,
|
||||
onClick: triggerType.includes('text') ? onEditClick : undefined,
|
||||
"aria-label": topAriaLabel === null || topAriaLabel === void 0 ? void 0 : topAriaLabel.toString(),
|
||||
title: title
|
||||
}, textProps), /*#__PURE__*/React.createElement(_Ellipsis.default, {
|
||||
enableMeasure: mergedEnableEllipsis && !cssEllipsis,
|
||||
text: children,
|
||||
rows: rows,
|
||||
width: ellipsisWidth,
|
||||
onEllipsis: onJsEllipsis,
|
||||
expanded: expanded,
|
||||
miscDeps: [copied, expanded, copyLoading, enableEdit, enableCopy, textLocale].concat((0, _toConsumableArray2.default)(DECORATION_PROPS.map(key => props[key])))
|
||||
}, (node, canEllipsis) => wrapperDecorations(props, /*#__PURE__*/React.createElement(React.Fragment, null, node.length > 0 && canEllipsis && !expanded && topAriaLabel ? (/*#__PURE__*/React.createElement("span", {
|
||||
key: "show-content",
|
||||
"aria-hidden": true
|
||||
}, node)) : node, renderEllipsis(canEllipsis))))))));
|
||||
});
|
||||
var _default = exports.default = Base;
|
||||
10
frontend/node_modules/antd/lib/typography/Base/util.d.ts
generated
vendored
Normal file
10
frontend/node_modules/antd/lib/typography/Base/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export declare function toList<T>(val: T | T[]): T[];
|
||||
export declare function getNode(dom: React.ReactNode, defaultNode: React.ReactNode, needDom?: boolean): import("react").ReactNode;
|
||||
/**
|
||||
* Check for element is native ellipsis
|
||||
* ref:
|
||||
* - https://github.com/ant-design/ant-design/issues/50143
|
||||
* - https://github.com/ant-design/ant-design/issues/50414
|
||||
*/
|
||||
export declare function isEleEllipsis(ele: HTMLElement): boolean;
|
||||
export declare const isValidText: (val: any) => val is string | number;
|
||||
49
frontend/node_modules/antd/lib/typography/Base/util.js
generated
vendored
Normal file
49
frontend/node_modules/antd/lib/typography/Base/util.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getNode = getNode;
|
||||
exports.isEleEllipsis = isEleEllipsis;
|
||||
exports.isValidText = void 0;
|
||||
exports.toList = toList;
|
||||
function toList(val) {
|
||||
if (val === false) {
|
||||
return [false, false];
|
||||
}
|
||||
return Array.isArray(val) ? val : [val];
|
||||
}
|
||||
function getNode(dom, defaultNode, needDom) {
|
||||
if (dom === true || dom === undefined) {
|
||||
return defaultNode;
|
||||
}
|
||||
return dom || needDom && defaultNode;
|
||||
}
|
||||
/**
|
||||
* Check for element is native ellipsis
|
||||
* ref:
|
||||
* - https://github.com/ant-design/ant-design/issues/50143
|
||||
* - https://github.com/ant-design/ant-design/issues/50414
|
||||
*/
|
||||
function isEleEllipsis(ele) {
|
||||
// Create a new div to get the size
|
||||
const childDiv = document.createElement('em');
|
||||
ele.appendChild(childDiv);
|
||||
// For test case
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
childDiv.className = 'ant-typography-css-ellipsis-content-measure';
|
||||
}
|
||||
const rect = ele.getBoundingClientRect();
|
||||
const childRect = childDiv.getBoundingClientRect();
|
||||
// Reset
|
||||
ele.removeChild(childDiv);
|
||||
// Range checker
|
||||
return (
|
||||
// Horizontal out of range
|
||||
rect.left > childRect.left || childRect.right > rect.right ||
|
||||
// Vertical out of range
|
||||
rect.top > childRect.top || childRect.bottom > rect.bottom
|
||||
);
|
||||
}
|
||||
const isValidText = val => ['string', 'number'].includes(typeof val);
|
||||
exports.isValidText = isValidText;
|
||||
20
frontend/node_modules/antd/lib/typography/Editable.d.ts
generated
vendored
Normal file
20
frontend/node_modules/antd/lib/typography/Editable.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as React from 'react';
|
||||
import type { TextAreaProps } from 'rc-textarea';
|
||||
import type { DirectionType } from '../config-provider';
|
||||
interface EditableProps {
|
||||
prefixCls: string;
|
||||
value: string;
|
||||
'aria-label'?: string;
|
||||
onSave: (value: string) => void;
|
||||
onCancel: () => void;
|
||||
onEnd?: () => void;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
direction?: DirectionType;
|
||||
maxLength?: number;
|
||||
autoSize?: TextAreaProps['autoSize'];
|
||||
enterIcon?: React.ReactNode;
|
||||
component?: string;
|
||||
}
|
||||
declare const Editable: React.FC<EditableProps>;
|
||||
export default Editable;
|
||||
122
frontend/node_modules/antd/lib/typography/Editable.js
generated
vendored
Normal file
122
frontend/node_modules/antd/lib/typography/Editable.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
"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 _EnterOutlined = _interopRequireDefault(require("@ant-design/icons/EnterOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
|
||||
var _reactNode = require("../_util/reactNode");
|
||||
var _TextArea = _interopRequireDefault(require("../input/TextArea"));
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
const Editable = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
'aria-label': ariaLabel,
|
||||
className,
|
||||
style,
|
||||
direction,
|
||||
maxLength,
|
||||
autoSize = true,
|
||||
value,
|
||||
onSave,
|
||||
onCancel,
|
||||
onEnd,
|
||||
component,
|
||||
enterIcon = /*#__PURE__*/React.createElement(_EnterOutlined.default, null)
|
||||
} = props;
|
||||
const ref = React.useRef(null);
|
||||
const inComposition = React.useRef(false);
|
||||
const lastKeyCode = React.useRef(null);
|
||||
const [current, setCurrent] = React.useState(value);
|
||||
React.useEffect(() => {
|
||||
setCurrent(value);
|
||||
}, [value]);
|
||||
React.useEffect(() => {
|
||||
var _a;
|
||||
if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) {
|
||||
const {
|
||||
textArea
|
||||
} = ref.current.resizableTextArea;
|
||||
textArea.focus();
|
||||
const {
|
||||
length
|
||||
} = textArea.value;
|
||||
textArea.setSelectionRange(length, length);
|
||||
}
|
||||
}, []);
|
||||
const onChange = ({
|
||||
target
|
||||
}) => {
|
||||
setCurrent(target.value.replace(/[\n\r]/g, ''));
|
||||
};
|
||||
const onCompositionStart = () => {
|
||||
inComposition.current = true;
|
||||
};
|
||||
const onCompositionEnd = () => {
|
||||
inComposition.current = false;
|
||||
};
|
||||
const onKeyDown = ({
|
||||
keyCode
|
||||
}) => {
|
||||
// We don't record keyCode when IME is using
|
||||
if (inComposition.current) {
|
||||
return;
|
||||
}
|
||||
lastKeyCode.current = keyCode;
|
||||
};
|
||||
const confirmChange = () => {
|
||||
onSave(current.trim());
|
||||
};
|
||||
const onKeyUp = ({
|
||||
keyCode,
|
||||
ctrlKey,
|
||||
altKey,
|
||||
metaKey,
|
||||
shiftKey
|
||||
}) => {
|
||||
// Check if it's a real key
|
||||
if (lastKeyCode.current !== keyCode || inComposition.current || ctrlKey || altKey || metaKey || shiftKey) {
|
||||
return;
|
||||
}
|
||||
if (keyCode === _KeyCode.default.ENTER) {
|
||||
confirmChange();
|
||||
onEnd === null || onEnd === void 0 ? void 0 : onEnd();
|
||||
} else if (keyCode === _KeyCode.default.ESC) {
|
||||
onCancel();
|
||||
}
|
||||
};
|
||||
const onBlur = () => {
|
||||
confirmChange();
|
||||
};
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls);
|
||||
const textAreaClassName = (0, _classnames.default)(prefixCls, `${prefixCls}-edit-content`, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
[`${prefixCls}-${component}`]: !!component
|
||||
}, className, hashId, cssVarCls);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", {
|
||||
className: textAreaClassName,
|
||||
style: style
|
||||
}, /*#__PURE__*/React.createElement(_TextArea.default, {
|
||||
ref: ref,
|
||||
maxLength: maxLength,
|
||||
value: current,
|
||||
onChange: onChange,
|
||||
onKeyDown: onKeyDown,
|
||||
onKeyUp: onKeyUp,
|
||||
onCompositionStart: onCompositionStart,
|
||||
onCompositionEnd: onCompositionEnd,
|
||||
onBlur: onBlur,
|
||||
"aria-label": ariaLabel,
|
||||
rows: 1,
|
||||
autoSize: autoSize
|
||||
}), enterIcon !== null ? (0, _reactNode.cloneElement)(enterIcon, {
|
||||
className: `${prefixCls}-edit-content-confirm`
|
||||
}) : null));
|
||||
};
|
||||
var _default = exports.default = Editable;
|
||||
7
frontend/node_modules/antd/lib/typography/Link.d.ts
generated
vendored
Normal file
7
frontend/node_modules/antd/lib/typography/Link.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import type { BlockProps } from './Base';
|
||||
export interface LinkProps extends BlockProps<'a'>, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'type' | keyof BlockProps<'a'>> {
|
||||
ellipsis?: boolean;
|
||||
}
|
||||
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLElement>>;
|
||||
export default Link;
|
||||
43
frontend/node_modules/antd/lib/typography/Link.js
generated
vendored
Normal file
43
frontend/node_modules/antd/lib/typography/Link.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"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 _warning = require("../_util/warning");
|
||||
var _Base = _interopRequireDefault(require("./Base"));
|
||||
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 Link = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
ellipsis,
|
||||
rel,
|
||||
children,
|
||||
// @ts-expect-error: https://github.com/ant-design/ant-design/issues/26622
|
||||
navigate: _navigate
|
||||
} = props,
|
||||
restProps = __rest(props, ["ellipsis", "rel", "children", "navigate"]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Typography.Link');
|
||||
process.env.NODE_ENV !== "production" ? warning(typeof ellipsis !== 'object', 'usage', '`ellipsis` only supports boolean value.') : void 0;
|
||||
}
|
||||
const mergedProps = Object.assign(Object.assign({}, restProps), {
|
||||
rel: rel === undefined && restProps.target === '_blank' ? 'noopener noreferrer' : rel
|
||||
});
|
||||
return /*#__PURE__*/React.createElement(_Base.default, Object.assign({}, mergedProps, {
|
||||
ref: ref,
|
||||
ellipsis: !!ellipsis,
|
||||
component: "a"
|
||||
}), children);
|
||||
});
|
||||
var _default = exports.default = Link;
|
||||
6
frontend/node_modules/antd/lib/typography/Paragraph.d.ts
generated
vendored
Normal file
6
frontend/node_modules/antd/lib/typography/Paragraph.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import type { BlockProps } from './Base';
|
||||
export interface ParagraphProps extends BlockProps<'div'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'type' | keyof BlockProps<'div'>> {
|
||||
}
|
||||
declare const Paragraph: React.ForwardRefExoticComponent<ParagraphProps & React.RefAttributes<HTMLElement>>;
|
||||
export default Paragraph;
|
||||
31
frontend/node_modules/antd/lib/typography/Paragraph.js
generated
vendored
Normal file
31
frontend/node_modules/antd/lib/typography/Paragraph.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"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 _Base = _interopRequireDefault(require("./Base"));
|
||||
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 Paragraph = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
children
|
||||
} = props,
|
||||
restProps = __rest(props, ["children"]);
|
||||
return /*#__PURE__*/React.createElement(_Base.default, Object.assign({
|
||||
ref: ref
|
||||
}, restProps, {
|
||||
component: "div"
|
||||
}), children);
|
||||
});
|
||||
var _default = exports.default = Paragraph;
|
||||
7
frontend/node_modules/antd/lib/typography/Text.d.ts
generated
vendored
Normal file
7
frontend/node_modules/antd/lib/typography/Text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import type { BlockProps, EllipsisConfig } from './Base';
|
||||
export interface TextProps extends BlockProps<'span'>, Omit<React.HTMLAttributes<HTMLSpanElement>, 'type' | keyof BlockProps<'span'>> {
|
||||
ellipsis?: boolean | Omit<EllipsisConfig, 'expandable' | 'rows' | 'onExpand'>;
|
||||
}
|
||||
declare const _default: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
|
||||
export default _default;
|
||||
45
frontend/node_modules/antd/lib/typography/Text.js
generated
vendored
Normal file
45
frontend/node_modules/antd/lib/typography/Text.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"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 _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
||||
var _warning = require("../_util/warning");
|
||||
var _Base = _interopRequireDefault(require("./Base"));
|
||||
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 Text = (props, ref) => {
|
||||
const {
|
||||
ellipsis,
|
||||
children
|
||||
} = props,
|
||||
restProps = __rest(props, ["ellipsis", "children"]);
|
||||
const mergedEllipsis = React.useMemo(() => {
|
||||
if (ellipsis && typeof ellipsis === 'object') {
|
||||
return (0, _omit.default)(ellipsis, ['expandable', 'rows']);
|
||||
}
|
||||
return ellipsis;
|
||||
}, [ellipsis]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Typography.Text');
|
||||
process.env.NODE_ENV !== "production" ? warning(typeof ellipsis !== 'object' || !ellipsis || !('expandable' in ellipsis) && !('rows' in ellipsis), 'usage', '`ellipsis` do not support `expandable` or `rows` props.') : void 0;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(_Base.default, Object.assign({
|
||||
ref: ref
|
||||
}, restProps, {
|
||||
ellipsis: mergedEllipsis,
|
||||
component: "span"
|
||||
}), children);
|
||||
};
|
||||
var _default = exports.default = /*#__PURE__*/React.forwardRef(Text);
|
||||
8
frontend/node_modules/antd/lib/typography/Title.d.ts
generated
vendored
Normal file
8
frontend/node_modules/antd/lib/typography/Title.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import type { BlockProps } from './Base';
|
||||
declare const TITLE_ELE_LIST: readonly [1, 2, 3, 4, 5];
|
||||
export interface TitleProps extends Omit<BlockProps<'h1' | 'h2' | 'h3' | 'h4' | 'h5'>, 'strong'>, Omit<React.HTMLAttributes<HTMLHeadElement>, 'type' | keyof BlockProps<'h1' | 'h2' | 'h3' | 'h4' | 'h5'>> {
|
||||
level?: (typeof TITLE_ELE_LIST)[number];
|
||||
}
|
||||
declare const Title: React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLElement>>;
|
||||
export default Title;
|
||||
39
frontend/node_modules/antd/lib/typography/Title.js
generated
vendored
Normal file
39
frontend/node_modules/antd/lib/typography/Title.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"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 _warning = require("../_util/warning");
|
||||
var _Base = _interopRequireDefault(require("./Base"));
|
||||
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 TITLE_ELE_LIST = [1, 2, 3, 4, 5];
|
||||
const Title = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
level = 1,
|
||||
children
|
||||
} = props,
|
||||
restProps = __rest(props, ["level", "children"]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Typography.Title');
|
||||
process.env.NODE_ENV !== "production" ? warning(TITLE_ELE_LIST.includes(level), 'usage', 'Title only accept `1 | 2 | 3 | 4 | 5` as `level` value. And `5` need 4.6.0+ version.') : void 0;
|
||||
}
|
||||
const component = TITLE_ELE_LIST.includes(level) ? `h${level}` : `h1`;
|
||||
return /*#__PURE__*/React.createElement(_Base.default, Object.assign({
|
||||
ref: ref
|
||||
}, restProps, {
|
||||
component: component
|
||||
}), children);
|
||||
});
|
||||
var _default = exports.default = Title;
|
||||
19
frontend/node_modules/antd/lib/typography/Typography.d.ts
generated
vendored
Normal file
19
frontend/node_modules/antd/lib/typography/Typography.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as React from 'react';
|
||||
import type { JSX } from 'react';
|
||||
import type { DirectionType } from '../config-provider';
|
||||
export interface TypographyProps<C extends keyof JSX.IntrinsicElements> extends React.HTMLAttributes<HTMLElement> {
|
||||
id?: string;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
style?: React.CSSProperties;
|
||||
children?: React.ReactNode;
|
||||
'aria-label'?: string;
|
||||
direction?: DirectionType;
|
||||
}
|
||||
interface InternalTypographyProps<C extends keyof JSX.IntrinsicElements> extends TypographyProps<C> {
|
||||
/** @deprecated Use `ref` directly if using React 16 */
|
||||
setContentRef?: (node: HTMLElement) => void;
|
||||
}
|
||||
declare const Typography: React.ForwardRefExoticComponent<InternalTypographyProps<keyof JSX.IntrinsicElements> & React.RefAttributes<HTMLElement>>;
|
||||
export default Typography;
|
||||
67
frontend/node_modules/antd/lib/typography/Typography.js
generated
vendored
Normal file
67
frontend/node_modules/antd/lib/typography/Typography.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"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 _ref = require("rc-util/lib/ref");
|
||||
var _warning = require("../_util/warning");
|
||||
var _context = require("../config-provider/context");
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
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 Typography = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
component: Component = 'article',
|
||||
className,
|
||||
rootClassName,
|
||||
setContentRef,
|
||||
children,
|
||||
direction: typographyDirection,
|
||||
style
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "component", "className", "rootClassName", "setContentRef", "children", "direction", "style"]);
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction: contextDirection,
|
||||
className: contextClassName,
|
||||
style: contextStyle
|
||||
} = (0, _context.useComponentConfig)('typography');
|
||||
const direction = typographyDirection !== null && typographyDirection !== void 0 ? typographyDirection : contextDirection;
|
||||
const mergedRef = setContentRef ? (0, _ref.composeRef)(ref, setContentRef) : ref;
|
||||
const prefixCls = getPrefixCls('typography', customizePrefixCls);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Typography');
|
||||
warning.deprecated(!setContentRef, 'setContentRef', 'ref');
|
||||
}
|
||||
// Style
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls);
|
||||
const componentClassName = (0, _classnames.default)(prefixCls, contextClassName, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, className, rootClassName, hashId, cssVarCls);
|
||||
const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
|
||||
return wrapCSSVar(
|
||||
/*#__PURE__*/
|
||||
// @ts-expect-error: Expression produces a union type that is too complex to represent.
|
||||
React.createElement(Component, Object.assign({
|
||||
className: componentClassName,
|
||||
style: mergedStyle,
|
||||
ref: mergedRef
|
||||
}, restProps), children));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Typography.displayName = 'Typography';
|
||||
}
|
||||
var _default = exports.default = Typography;
|
||||
11
frontend/node_modules/antd/lib/typography/hooks/useCopyClick.d.ts
generated
vendored
Normal file
11
frontend/node_modules/antd/lib/typography/hooks/useCopyClick.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react';
|
||||
import type { CopyConfig } from '../Base';
|
||||
declare const useCopyClick: ({ copyConfig, children, }: {
|
||||
copyConfig: CopyConfig;
|
||||
children?: React.ReactNode;
|
||||
}) => {
|
||||
copied: boolean;
|
||||
copyLoading: boolean;
|
||||
onClick: (e?: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
|
||||
};
|
||||
export default useCopyClick;
|
||||
85
frontend/node_modules/antd/lib/typography/hooks/useCopyClick.js
generated
vendored
Normal file
85
frontend/node_modules/antd/lib/typography/hooks/useCopyClick.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
|
||||
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 _copyToClipboard = _interopRequireDefault(require("copy-to-clipboard"));
|
||||
var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
|
||||
var _toList = _interopRequireDefault(require("../../_util/toList"));
|
||||
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) {
|
||||
return value instanceof P ? value : new P(function (resolve) {
|
||||
resolve(value);
|
||||
});
|
||||
}
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) {
|
||||
try {
|
||||
step(generator.next(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
function rejected(value) {
|
||||
try {
|
||||
step(generator["throw"](value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
function step(result) {
|
||||
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
||||
}
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
const useCopyClick = ({
|
||||
copyConfig,
|
||||
children
|
||||
}) => {
|
||||
const [copied, setCopied] = React.useState(false);
|
||||
const [copyLoading, setCopyLoading] = React.useState(false);
|
||||
const copyIdRef = React.useRef(null);
|
||||
const cleanCopyId = () => {
|
||||
if (copyIdRef.current) {
|
||||
clearTimeout(copyIdRef.current);
|
||||
}
|
||||
};
|
||||
const copyOptions = {};
|
||||
if (copyConfig.format) {
|
||||
copyOptions.format = copyConfig.format;
|
||||
}
|
||||
React.useEffect(() => cleanCopyId, []);
|
||||
// Keep copy action up to date
|
||||
const onClick = (0, _useEvent.default)(e => __awaiter(void 0, void 0, void 0, function* () {
|
||||
var _a;
|
||||
e === null || e === void 0 ? void 0 : e.preventDefault();
|
||||
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
||||
setCopyLoading(true);
|
||||
try {
|
||||
const text = typeof copyConfig.text === 'function' ? yield copyConfig.text() : copyConfig.text;
|
||||
(0, _copyToClipboard.default)(text || (0, _toList.default)(children, true).join('') || '', copyOptions);
|
||||
setCopyLoading(false);
|
||||
setCopied(true);
|
||||
// Trigger tips update
|
||||
cleanCopyId();
|
||||
copyIdRef.current = setTimeout(() => {
|
||||
setCopied(false);
|
||||
}, 3000);
|
||||
(_a = copyConfig.onCopy) === null || _a === void 0 ? void 0 : _a.call(copyConfig, e);
|
||||
} catch (error) {
|
||||
setCopyLoading(false);
|
||||
throw error;
|
||||
}
|
||||
}));
|
||||
return {
|
||||
copied,
|
||||
copyLoading,
|
||||
onClick
|
||||
};
|
||||
};
|
||||
var _default = exports.default = useCopyClick;
|
||||
1
frontend/node_modules/antd/lib/typography/hooks/useMergedConfig.d.ts
generated
vendored
Normal file
1
frontend/node_modules/antd/lib/typography/hooks/useMergedConfig.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function useMergedConfig<Target>(propConfig: any, templateConfig?: Target): readonly [boolean, Target];
|
||||
14
frontend/node_modules/antd/lib/typography/hooks/useMergedConfig.js
generated
vendored
Normal file
14
frontend/node_modules/antd/lib/typography/hooks/useMergedConfig.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = useMergedConfig;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
function useMergedConfig(propConfig, templateConfig) {
|
||||
return React.useMemo(() => {
|
||||
const support = !!propConfig;
|
||||
return [support, Object.assign(Object.assign({}, templateConfig), support && typeof propConfig === 'object' ? propConfig : null)];
|
||||
}, [propConfig]);
|
||||
}
|
||||
2
frontend/node_modules/antd/lib/typography/hooks/usePrevious.d.ts
generated
vendored
Normal file
2
frontend/node_modules/antd/lib/typography/hooks/usePrevious.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const usePrevious: <T>(value: T) => T | undefined;
|
||||
export default usePrevious;
|
||||
15
frontend/node_modules/antd/lib/typography/hooks/usePrevious.js
generated
vendored
Normal file
15
frontend/node_modules/antd/lib/typography/hooks/usePrevious.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = require("react");
|
||||
const usePrevious = value => {
|
||||
const ref = (0, _react.useRef)(undefined);
|
||||
(0, _react.useEffect)(() => {
|
||||
ref.current = value;
|
||||
});
|
||||
return ref.current;
|
||||
};
|
||||
var _default = exports.default = usePrevious;
|
||||
64
frontend/node_modules/antd/lib/typography/hooks/useTooltipProps.d.ts
generated
vendored
Normal file
64
frontend/node_modules/antd/lib/typography/hooks/useTooltipProps.d.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { TooltipProps } from '../../tooltip';
|
||||
declare const useTooltipProps: (tooltip: React.ReactNode | TooltipProps, editConfigText: React.ReactNode, children: React.ReactNode) => {
|
||||
[Symbol.iterator](): Iterator<import("react").ReactNode, any, any>;
|
||||
title: import("react").ReactNode;
|
||||
} | {
|
||||
then<TResult1 = string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined, TResult2 = never>(onfulfilled?: ((value: string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
||||
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<(string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined) | TResult>;
|
||||
finally(onfinally?: (() => void) | null | undefined): Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
|
||||
[Symbol.toStringTag]: string;
|
||||
title: import("react").ReactNode;
|
||||
} | {
|
||||
title: React.ReactNode | import("../../_util/getRenderPropValue").RenderFunction;
|
||||
overlay?: React.ReactNode | import("../../_util/getRenderPropValue").RenderFunction;
|
||||
styles?: Partial<Record<"body" | "root", React.CSSProperties>>;
|
||||
classNames?: Partial<Record<"body" | "root", string>>;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
color?: import("../../_util/type").LiteralUnion<import("../../_util/colors").PresetColorType>;
|
||||
placement?: import("../../tooltip").TooltipPlacement;
|
||||
builtinPlacements?: typeof import("rc-tooltip/lib/placements").placements;
|
||||
openClassName?: string;
|
||||
arrowPointAtCenter?: boolean;
|
||||
arrow?: boolean | {
|
||||
arrowPointAtCenter?: boolean;
|
||||
pointAtCenter?: boolean;
|
||||
};
|
||||
autoAdjustOverflow?: boolean | import("../../tooltip").AdjustOverflow;
|
||||
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
||||
children?: React.ReactNode;
|
||||
destroyTooltipOnHide?: boolean | {
|
||||
keepParent?: boolean;
|
||||
};
|
||||
destroyOnHidden?: boolean;
|
||||
open?: import("rc-tooltip/lib/Tooltip").TooltipProps["visible"];
|
||||
defaultOpen?: import("rc-tooltip/lib/Tooltip").TooltipProps["defaultVisible"];
|
||||
onOpenChange?: import("rc-tooltip/lib/Tooltip").TooltipProps["onVisibleChange"];
|
||||
afterOpenChange?: import("rc-tooltip/lib/Tooltip").TooltipProps["afterVisibleChange"];
|
||||
visible?: import("rc-tooltip/lib/Tooltip").TooltipProps["visible"];
|
||||
defaultVisible?: import("rc-tooltip/lib/Tooltip").TooltipProps["defaultVisible"];
|
||||
onVisibleChange?: import("rc-tooltip/lib/Tooltip").TooltipProps["onVisibleChange"];
|
||||
afterVisibleChange?: import("rc-tooltip/lib/Tooltip").TooltipProps["afterVisibleChange"];
|
||||
zIndex?: number | undefined;
|
||||
animation?: import("@rc-component/trigger/lib/interface").AnimationType | undefined;
|
||||
motion?: import("rc-motion").CSSMotionProps | undefined;
|
||||
prefixCls?: string | undefined;
|
||||
align?: import("@rc-component/trigger").AlignType | undefined;
|
||||
id?: string | undefined;
|
||||
transitionName?: string | undefined;
|
||||
showArrow?: (boolean | import("@rc-component/trigger").ArrowType) | undefined;
|
||||
forceRender?: boolean | undefined;
|
||||
popupVisible?: boolean | undefined;
|
||||
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
||||
fresh?: boolean | undefined;
|
||||
mouseLeaveDelay?: number | undefined;
|
||||
mouseEnterDelay?: number | undefined;
|
||||
trigger?: (import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[]) | undefined;
|
||||
overlayStyle?: React.CSSProperties | undefined;
|
||||
overlayClassName?: string | undefined;
|
||||
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
||||
arrowContent?: import("react").ReactNode;
|
||||
overlayInnerStyle?: React.CSSProperties | undefined;
|
||||
};
|
||||
export default useTooltipProps;
|
||||
28
frontend/node_modules/antd/lib/typography/hooks/useTooltipProps.js
generated
vendored
Normal file
28
frontend/node_modules/antd/lib/typography/hooks/useTooltipProps.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = require("react");
|
||||
const useTooltipProps = (tooltip, editConfigText, children) => (0, _react.useMemo)(() => {
|
||||
if (tooltip === true) {
|
||||
return {
|
||||
title: editConfigText !== null && editConfigText !== void 0 ? editConfigText : children
|
||||
};
|
||||
}
|
||||
if (/*#__PURE__*/(0, _react.isValidElement)(tooltip)) {
|
||||
return {
|
||||
title: tooltip
|
||||
};
|
||||
}
|
||||
if (typeof tooltip === 'object') {
|
||||
return Object.assign({
|
||||
title: editConfigText !== null && editConfigText !== void 0 ? editConfigText : children
|
||||
}, tooltip);
|
||||
}
|
||||
return {
|
||||
title: tooltip
|
||||
};
|
||||
}, [tooltip, editConfigText, children]);
|
||||
var _default = exports.default = useTooltipProps;
|
||||
13
frontend/node_modules/antd/lib/typography/index.d.ts
generated
vendored
Normal file
13
frontend/node_modules/antd/lib/typography/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import Link from './Link';
|
||||
import Paragraph from './Paragraph';
|
||||
import Text from './Text';
|
||||
import Title from './Title';
|
||||
import OriginTypography from './Typography';
|
||||
export type TypographyProps = typeof OriginTypography & {
|
||||
Text: typeof Text;
|
||||
Link: typeof Link;
|
||||
Title: typeof Title;
|
||||
Paragraph: typeof Paragraph;
|
||||
};
|
||||
declare const Typography: TypographyProps;
|
||||
export default Typography;
|
||||
19
frontend/node_modules/antd/lib/typography/index.js
generated
vendored
Normal file
19
frontend/node_modules/antd/lib/typography/index.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _Link = _interopRequireDefault(require("./Link"));
|
||||
var _Paragraph = _interopRequireDefault(require("./Paragraph"));
|
||||
var _Text = _interopRequireDefault(require("./Text"));
|
||||
var _Title = _interopRequireDefault(require("./Title"));
|
||||
var _Typography = _interopRequireDefault(require("./Typography"));
|
||||
const Typography = _Typography.default;
|
||||
Typography.Text = _Text.default;
|
||||
Typography.Link = _Link.default;
|
||||
Typography.Title = _Title.default;
|
||||
Typography.Paragraph = _Paragraph.default;
|
||||
var _default = exports.default = Typography;
|
||||
18
frontend/node_modules/antd/lib/typography/style/index.d.ts
generated
vendored
Normal file
18
frontend/node_modules/antd/lib/typography/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { FullToken, GetDefaultToken } from '../../theme/internal';
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 标题上间距
|
||||
* @descEN Margin top of title
|
||||
*/
|
||||
titleMarginTop: number | string;
|
||||
/**
|
||||
* @desc 标题下间距
|
||||
* @descEN Margin bottom of title
|
||||
*/
|
||||
titleMarginBottom: number | string;
|
||||
}
|
||||
export type TypographyToken = FullToken<'Typography'>;
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Typography'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
102
frontend/node_modules/antd/lib/typography/style/index.js
generated
vendored
Normal file
102
frontend/node_modules/antd/lib/typography/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
var _mixins = require("./mixins");
|
||||
const genTypographyStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
titleMarginTop
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
||||
color: token.colorText,
|
||||
wordBreak: 'break-word',
|
||||
lineHeight: token.lineHeight,
|
||||
[`&${componentCls}-secondary`]: {
|
||||
color: token.colorTextDescription
|
||||
},
|
||||
[`&${componentCls}-success`]: {
|
||||
color: token.colorSuccessText
|
||||
},
|
||||
[`&${componentCls}-warning`]: {
|
||||
color: token.colorWarningText
|
||||
},
|
||||
[`&${componentCls}-danger`]: {
|
||||
color: token.colorErrorText,
|
||||
'a&:active, a&:focus': {
|
||||
color: token.colorErrorTextActive
|
||||
},
|
||||
'a&:hover': {
|
||||
color: token.colorErrorTextHover
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-disabled`]: {
|
||||
color: token.colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
userSelect: 'none'
|
||||
},
|
||||
[`
|
||||
div&,
|
||||
p
|
||||
`]: {
|
||||
marginBottom: '1em'
|
||||
}
|
||||
}, (0, _mixins.getTitleStyles)(token)), {
|
||||
[`
|
||||
& + h1${componentCls},
|
||||
& + h2${componentCls},
|
||||
& + h3${componentCls},
|
||||
& + h4${componentCls},
|
||||
& + h5${componentCls}
|
||||
`]: {
|
||||
marginTop: titleMarginTop
|
||||
},
|
||||
[`
|
||||
div,
|
||||
ul,
|
||||
li,
|
||||
p,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5`]: {
|
||||
[`
|
||||
+ h1,
|
||||
+ h2,
|
||||
+ h3,
|
||||
+ h4,
|
||||
+ h5
|
||||
`]: {
|
||||
marginTop: titleMarginTop
|
||||
}
|
||||
}
|
||||
}), (0, _mixins.getResetStyles)(token)), (0, _mixins.getLinkStyles)(token)), {
|
||||
// Operation
|
||||
[`
|
||||
${componentCls}-expand,
|
||||
${componentCls}-collapse,
|
||||
${componentCls}-edit,
|
||||
${componentCls}-copy
|
||||
`]: Object.assign(Object.assign({}, (0, _style.operationUnit)(token)), {
|
||||
marginInlineStart: token.marginXXS
|
||||
})
|
||||
}), (0, _mixins.getEditableStyles)(token)), (0, _mixins.getCopyableStyles)(token)), (0, _mixins.getEllipsisStyles)()), {
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
const prepareComponentToken = () => ({
|
||||
titleMarginTop: '1.2em',
|
||||
titleMarginBottom: '0.5em'
|
||||
});
|
||||
// ============================== Export ==============================
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Typography', genTypographyStyle, prepareComponentToken);
|
||||
9
frontend/node_modules/antd/lib/typography/style/mixins.d.ts
generated
vendored
Normal file
9
frontend/node_modules/antd/lib/typography/style/mixins.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { CSSObject } from '@ant-design/cssinjs';
|
||||
import type { TypographyToken } from '.';
|
||||
import type { GenerateStyle } from '../../theme/internal';
|
||||
export declare const getTitleStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getLinkStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getResetStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getEditableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getCopyableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getEllipsisStyles: () => CSSObject;
|
||||
239
frontend/node_modules/antd/lib/typography/style/mixins.js
generated
vendored
Normal file
239
frontend/node_modules/antd/lib/typography/style/mixins.js
generated
vendored
Normal file
@@ -0,0 +1,239 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getTitleStyles = exports.getResetStyles = exports.getLinkStyles = exports.getEllipsisStyles = exports.getEditableStyles = exports.getCopyableStyles = void 0;
|
||||
var _colors = require("@ant-design/colors");
|
||||
var _style = require("../../style");
|
||||
/*
|
||||
.typography-title(@fontSize; @fontWeight; @lineHeight; @headingColor; @headingMarginBottom;) {
|
||||
margin-bottom: @headingMarginBottom;
|
||||
color: @headingColor;
|
||||
font-weight: @fontWeight;
|
||||
fontSize: @fontSize;
|
||||
line-height: @lineHeight;
|
||||
}
|
||||
*/
|
||||
|
||||
const getTitleStyle = (fontSize, lineHeight, color, token) => {
|
||||
const {
|
||||
titleMarginBottom,
|
||||
fontWeightStrong
|
||||
} = token;
|
||||
return {
|
||||
marginBottom: titleMarginBottom,
|
||||
color,
|
||||
fontWeight: fontWeightStrong,
|
||||
fontSize,
|
||||
lineHeight
|
||||
};
|
||||
};
|
||||
const getTitleStyles = token => {
|
||||
const headings = [1, 2, 3, 4, 5];
|
||||
const styles = {};
|
||||
headings.forEach(headingLevel => {
|
||||
styles[`
|
||||
h${headingLevel}&,
|
||||
div&-h${headingLevel},
|
||||
div&-h${headingLevel} > textarea,
|
||||
h${headingLevel}
|
||||
`] = getTitleStyle(token[`fontSizeHeading${headingLevel}`], token[`lineHeightHeading${headingLevel}`], token.colorTextHeading, token);
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
exports.getTitleStyles = getTitleStyles;
|
||||
const getLinkStyles = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
'a&, a': Object.assign(Object.assign({}, (0, _style.operationUnit)(token)), {
|
||||
userSelect: 'text',
|
||||
[`&[disabled], &${componentCls}-disabled`]: {
|
||||
color: token.colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
'&:active, &:hover': {
|
||||
color: token.colorTextDisabled
|
||||
},
|
||||
'&:active': {
|
||||
pointerEvents: 'none'
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
exports.getLinkStyles = getLinkStyles;
|
||||
const getResetStyles = token => ({
|
||||
code: {
|
||||
margin: '0 0.2em',
|
||||
paddingInline: '0.4em',
|
||||
paddingBlock: '0.2em 0.1em',
|
||||
fontSize: '85%',
|
||||
fontFamily: token.fontFamilyCode,
|
||||
background: 'rgba(150, 150, 150, 0.1)',
|
||||
border: '1px solid rgba(100, 100, 100, 0.2)',
|
||||
borderRadius: 3
|
||||
},
|
||||
kbd: {
|
||||
margin: '0 0.2em',
|
||||
paddingInline: '0.4em',
|
||||
paddingBlock: '0.15em 0.1em',
|
||||
fontSize: '90%',
|
||||
fontFamily: token.fontFamilyCode,
|
||||
background: 'rgba(150, 150, 150, 0.06)',
|
||||
border: '1px solid rgba(100, 100, 100, 0.2)',
|
||||
borderBottomWidth: 2,
|
||||
borderRadius: 3
|
||||
},
|
||||
mark: {
|
||||
padding: 0,
|
||||
// FIXME hardcode in v4
|
||||
backgroundColor: _colors.gold[2]
|
||||
},
|
||||
'u, ins': {
|
||||
textDecoration: 'underline',
|
||||
textDecorationSkipInk: 'auto'
|
||||
},
|
||||
's, del': {
|
||||
textDecoration: 'line-through'
|
||||
},
|
||||
strong: {
|
||||
fontWeight: token.fontWeightStrong
|
||||
},
|
||||
// list
|
||||
'ul, ol': {
|
||||
marginInline: 0,
|
||||
marginBlock: '0 1em',
|
||||
padding: 0,
|
||||
li: {
|
||||
marginInline: '20px 0',
|
||||
marginBlock: 0,
|
||||
paddingInline: '4px 0',
|
||||
paddingBlock: 0
|
||||
}
|
||||
},
|
||||
ul: {
|
||||
listStyleType: 'circle',
|
||||
ul: {
|
||||
listStyleType: 'disc'
|
||||
}
|
||||
},
|
||||
ol: {
|
||||
listStyleType: 'decimal'
|
||||
},
|
||||
// pre & block
|
||||
'pre, blockquote': {
|
||||
margin: '1em 0'
|
||||
},
|
||||
pre: {
|
||||
padding: '0.4em 0.6em',
|
||||
whiteSpace: 'pre-wrap',
|
||||
wordWrap: 'break-word',
|
||||
background: 'rgba(150, 150, 150, 0.1)',
|
||||
border: '1px solid rgba(100, 100, 100, 0.2)',
|
||||
borderRadius: 3,
|
||||
fontFamily: token.fontFamilyCode,
|
||||
// Compatible for marked
|
||||
code: {
|
||||
display: 'inline',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
fontSize: 'inherit',
|
||||
fontFamily: 'inherit',
|
||||
background: 'transparent',
|
||||
border: 0
|
||||
}
|
||||
},
|
||||
blockquote: {
|
||||
paddingInline: '0.6em 0',
|
||||
paddingBlock: 0,
|
||||
borderInlineStart: '4px solid rgba(100, 100, 100, 0.2)',
|
||||
opacity: 0.85
|
||||
}
|
||||
});
|
||||
exports.getResetStyles = getResetStyles;
|
||||
const getEditableStyles = token => {
|
||||
const {
|
||||
componentCls,
|
||||
paddingSM
|
||||
} = token;
|
||||
const inputShift = paddingSM;
|
||||
return {
|
||||
'&-edit-content': {
|
||||
position: 'relative',
|
||||
'div&': {
|
||||
insetInlineStart: token.calc(token.paddingSM).mul(-1).equal(),
|
||||
insetBlockStart: token.calc(inputShift).div(-2).add(1).equal(),
|
||||
marginBottom: token.calc(inputShift).div(2).sub(2).equal()
|
||||
},
|
||||
[`${componentCls}-edit-content-confirm`]: {
|
||||
position: 'absolute',
|
||||
insetInlineEnd: token.calc(token.marginXS).add(2).equal(),
|
||||
insetBlockEnd: token.marginXS,
|
||||
color: token.colorIcon,
|
||||
// default style
|
||||
fontWeight: 'normal',
|
||||
fontSize: token.fontSize,
|
||||
fontStyle: 'normal',
|
||||
pointerEvents: 'none'
|
||||
},
|
||||
textarea: {
|
||||
margin: '0!important',
|
||||
// Fix Editable Textarea flash in Firefox
|
||||
MozTransition: 'none',
|
||||
height: '1em'
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.getEditableStyles = getEditableStyles;
|
||||
const getCopyableStyles = token => ({
|
||||
[`${token.componentCls}-copy-success`]: {
|
||||
[`
|
||||
&,
|
||||
&:hover,
|
||||
&:focus`]: {
|
||||
color: token.colorSuccess
|
||||
}
|
||||
},
|
||||
[`${token.componentCls}-copy-icon-only`]: {
|
||||
marginInlineStart: 0
|
||||
}
|
||||
});
|
||||
exports.getCopyableStyles = getCopyableStyles;
|
||||
const getEllipsisStyles = () => ({
|
||||
[`
|
||||
a&-ellipsis,
|
||||
span&-ellipsis
|
||||
`]: {
|
||||
display: 'inline-block',
|
||||
maxWidth: '100%'
|
||||
},
|
||||
'&-ellipsis-single-line': {
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
// https://blog.csdn.net/iefreer/article/details/50421025
|
||||
'a&, span&': {
|
||||
verticalAlign: 'bottom'
|
||||
},
|
||||
'> code': {
|
||||
paddingBlock: 0,
|
||||
maxWidth: 'calc(100% - 1.2em)',
|
||||
display: 'inline-block',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
verticalAlign: 'bottom',
|
||||
// https://github.com/ant-design/ant-design/issues/45953
|
||||
boxSizing: 'content-box'
|
||||
}
|
||||
},
|
||||
'&-ellipsis-multiple-line': {
|
||||
display: '-webkit-box',
|
||||
overflow: 'hidden',
|
||||
WebkitLineClamp: 3,
|
||||
WebkitBoxOrient: 'vertical'
|
||||
}
|
||||
});
|
||||
exports.getEllipsisStyles = getEllipsisStyles;
|
||||
Reference in New Issue
Block a user