first commit
This commit is contained in:
10
frontend/node_modules/antd/es/progress/Circle.d.ts
generated
vendored
Normal file
10
frontend/node_modules/antd/es/progress/Circle.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import type { ProgressGradient, ProgressProps } from './progress';
|
||||
export interface CircleProps extends ProgressProps {
|
||||
prefixCls: string;
|
||||
children: React.ReactNode;
|
||||
progressStatus: string;
|
||||
strokeColor?: string | ProgressGradient;
|
||||
}
|
||||
declare const Circle: React.FC<CircleProps>;
|
||||
export default Circle;
|
||||
81
frontend/node_modules/antd/es/progress/Circle.js
generated
vendored
Normal file
81
frontend/node_modules/antd/es/progress/Circle.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Circle as RCCircle } from 'rc-progress';
|
||||
import Tooltip from '../tooltip';
|
||||
import { getPercentage, getSize, getStrokeColor } from './utils';
|
||||
const CIRCLE_MIN_STROKE_WIDTH = 3;
|
||||
const getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;
|
||||
const Circle = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
trailColor = null,
|
||||
strokeLinecap = 'round',
|
||||
gapPosition,
|
||||
gapDegree,
|
||||
width: originWidth = 120,
|
||||
type,
|
||||
children,
|
||||
success,
|
||||
size = originWidth,
|
||||
steps
|
||||
} = props;
|
||||
const [width, height] = getSize(size, 'circle');
|
||||
let {
|
||||
strokeWidth
|
||||
} = props;
|
||||
if (strokeWidth === undefined) {
|
||||
strokeWidth = Math.max(getMinPercent(width), 6);
|
||||
}
|
||||
const circleStyle = {
|
||||
width,
|
||||
height,
|
||||
fontSize: width * 0.15 + 6
|
||||
};
|
||||
const realGapDegree = React.useMemo(() => {
|
||||
// Support gapDeg = 0 when type = 'dashboard'
|
||||
if (gapDegree || gapDegree === 0) {
|
||||
return gapDegree;
|
||||
}
|
||||
if (type === 'dashboard') {
|
||||
return 75;
|
||||
}
|
||||
return undefined;
|
||||
}, [gapDegree, type]);
|
||||
const percentArray = getPercentage(props);
|
||||
const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;
|
||||
// using className to style stroke color
|
||||
const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';
|
||||
const strokeColor = getStrokeColor({
|
||||
success,
|
||||
strokeColor: props.strokeColor
|
||||
});
|
||||
const wrapperClassName = classNames(`${prefixCls}-inner`, {
|
||||
[`${prefixCls}-circle-gradient`]: isGradient
|
||||
});
|
||||
const circleContent = /*#__PURE__*/React.createElement(RCCircle, {
|
||||
steps: steps,
|
||||
percent: steps ? percentArray[1] : percentArray,
|
||||
strokeWidth: strokeWidth,
|
||||
trailWidth: strokeWidth,
|
||||
strokeColor: steps ? strokeColor[1] : strokeColor,
|
||||
strokeLinecap: strokeLinecap,
|
||||
trailColor: trailColor,
|
||||
prefixCls: prefixCls,
|
||||
gapDegree: realGapDegree,
|
||||
gapPosition: gapPos
|
||||
});
|
||||
const smallCircle = width <= 20;
|
||||
const node = /*#__PURE__*/React.createElement("div", {
|
||||
className: wrapperClassName,
|
||||
style: circleStyle
|
||||
}, circleContent, !smallCircle && children);
|
||||
if (smallCircle) {
|
||||
return /*#__PURE__*/React.createElement(Tooltip, {
|
||||
title: children
|
||||
}, node);
|
||||
}
|
||||
return node;
|
||||
};
|
||||
export default Circle;
|
||||
36
frontend/node_modules/antd/es/progress/Line.d.ts
generated
vendored
Normal file
36
frontend/node_modules/antd/es/progress/Line.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import * as React from 'react';
|
||||
import type { DirectionType } from '../config-provider';
|
||||
import type { PercentPositionType, ProgressGradient, ProgressProps, StringGradients } from './progress';
|
||||
interface LineProps extends ProgressProps {
|
||||
prefixCls: string;
|
||||
direction?: DirectionType;
|
||||
strokeColor?: string | ProgressGradient;
|
||||
percentPosition: PercentPositionType;
|
||||
}
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* "0%": "#afc163",
|
||||
* "75%": "#009900",
|
||||
* "50%": "green", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'
|
||||
* "25%": "#66FF00",
|
||||
* "100%": "#ffffff"
|
||||
* }
|
||||
*/
|
||||
export declare const sortGradient: (gradients: StringGradients) => string;
|
||||
/**
|
||||
* Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
|
||||
* butter, there is the bug. And... Besides women, there is the code.
|
||||
*
|
||||
* @example
|
||||
* {
|
||||
* "0%": "#afc163",
|
||||
* "25%": "#66FF00",
|
||||
* "50%": "#00CC00", // ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,
|
||||
* "75%": "#009900", // #00CC00 50%, #009900 75%, #ffffff 100%)
|
||||
* "100%": "#ffffff"
|
||||
* }
|
||||
*/
|
||||
export declare const handleGradient: (strokeColor: ProgressGradient, directionConfig?: DirectionType) => React.CSSProperties;
|
||||
declare const Line: React.FC<LineProps>;
|
||||
export default Line;
|
||||
149
frontend/node_modules/antd/es/progress/Line.js
generated
vendored
Normal file
149
frontend/node_modules/antd/es/progress/Line.js
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import { presetPrimaryColors } from '@ant-design/colors';
|
||||
import classNames from 'classnames';
|
||||
import { devUseWarning } from '../_util/warning';
|
||||
import { LineStrokeColorVar, Percent } from './style';
|
||||
import { getSize, getSuccessPercent, validProgress } from './utils';
|
||||
/**
|
||||
* @example
|
||||
* {
|
||||
* "0%": "#afc163",
|
||||
* "75%": "#009900",
|
||||
* "50%": "green", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'
|
||||
* "25%": "#66FF00",
|
||||
* "100%": "#ffffff"
|
||||
* }
|
||||
*/
|
||||
export const sortGradient = gradients => {
|
||||
let tempArr = [];
|
||||
Object.keys(gradients).forEach(key => {
|
||||
const formattedKey = Number.parseFloat(key.replace(/%/g, ''));
|
||||
if (!Number.isNaN(formattedKey)) {
|
||||
tempArr.push({
|
||||
key: formattedKey,
|
||||
value: gradients[key]
|
||||
});
|
||||
}
|
||||
});
|
||||
tempArr = tempArr.sort((a, b) => a.key - b.key);
|
||||
return tempArr.map(({
|
||||
key,
|
||||
value
|
||||
}) => `${value} ${key}%`).join(', ');
|
||||
};
|
||||
/**
|
||||
* Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
|
||||
* butter, there is the bug. And... Besides women, there is the code.
|
||||
*
|
||||
* @example
|
||||
* {
|
||||
* "0%": "#afc163",
|
||||
* "25%": "#66FF00",
|
||||
* "50%": "#00CC00", // ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,
|
||||
* "75%": "#009900", // #00CC00 50%, #009900 75%, #ffffff 100%)
|
||||
* "100%": "#ffffff"
|
||||
* }
|
||||
*/
|
||||
export const handleGradient = (strokeColor, directionConfig) => {
|
||||
const {
|
||||
from = presetPrimaryColors.blue,
|
||||
to = presetPrimaryColors.blue,
|
||||
direction = directionConfig === 'rtl' ? 'to left' : 'to right'
|
||||
} = strokeColor,
|
||||
rest = __rest(strokeColor, ["from", "to", "direction"]);
|
||||
if (Object.keys(rest).length !== 0) {
|
||||
const sortedGradients = sortGradient(rest);
|
||||
const background = `linear-gradient(${direction}, ${sortedGradients})`;
|
||||
return {
|
||||
background,
|
||||
[LineStrokeColorVar]: background
|
||||
};
|
||||
}
|
||||
const background = `linear-gradient(${direction}, ${from}, ${to})`;
|
||||
return {
|
||||
background,
|
||||
[LineStrokeColorVar]: background
|
||||
};
|
||||
};
|
||||
const Line = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
direction: directionConfig,
|
||||
percent,
|
||||
size,
|
||||
strokeWidth,
|
||||
strokeColor,
|
||||
strokeLinecap = 'round',
|
||||
children,
|
||||
trailColor = null,
|
||||
percentPosition,
|
||||
success
|
||||
} = props;
|
||||
const {
|
||||
align: infoAlign,
|
||||
type: infoPosition
|
||||
} = percentPosition;
|
||||
const backgroundProps = strokeColor && typeof strokeColor !== 'string' ? handleGradient(strokeColor, directionConfig) : {
|
||||
[LineStrokeColorVar]: strokeColor,
|
||||
background: strokeColor
|
||||
};
|
||||
const borderRadius = strokeLinecap === 'square' || strokeLinecap === 'butt' ? 0 : undefined;
|
||||
const mergedSize = size !== null && size !== void 0 ? size : [-1, strokeWidth || (size === 'small' ? 6 : 8)];
|
||||
const [width, height] = getSize(mergedSize, 'line', {
|
||||
strokeWidth
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = devUseWarning('Progress');
|
||||
warning.deprecated(!('strokeWidth' in props), 'strokeWidth', 'size');
|
||||
}
|
||||
const trailStyle = {
|
||||
backgroundColor: trailColor || undefined,
|
||||
borderRadius
|
||||
};
|
||||
const percentStyle = Object.assign(Object.assign({
|
||||
width: `${validProgress(percent)}%`,
|
||||
height,
|
||||
borderRadius
|
||||
}, backgroundProps), {
|
||||
[Percent]: validProgress(percent) / 100
|
||||
});
|
||||
const successPercent = getSuccessPercent(props);
|
||||
const successPercentStyle = {
|
||||
width: `${validProgress(successPercent)}%`,
|
||||
height,
|
||||
borderRadius,
|
||||
backgroundColor: success === null || success === void 0 ? void 0 : success.strokeColor
|
||||
};
|
||||
const outerStyle = {
|
||||
width: width < 0 ? '100%' : width
|
||||
};
|
||||
const lineInner = /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-inner`,
|
||||
style: trailStyle
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: classNames(`${prefixCls}-bg`, `${prefixCls}-bg-${infoPosition}`),
|
||||
style: percentStyle
|
||||
}, infoPosition === 'inner' && children), successPercent !== undefined && (/*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-success-bg`,
|
||||
style: successPercentStyle
|
||||
})));
|
||||
const isOuterStart = infoPosition === 'outer' && infoAlign === 'start';
|
||||
const isOuterEnd = infoPosition === 'outer' && infoAlign === 'end';
|
||||
return infoPosition === 'outer' && infoAlign === 'center' ? (/*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-layout-bottom`
|
||||
}, lineInner, children)) : (/*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-outer`,
|
||||
style: outerStyle
|
||||
}, isOuterStart && children, lineInner, isOuterEnd && children));
|
||||
};
|
||||
export default Line;
|
||||
9
frontend/node_modules/antd/es/progress/Steps.d.ts
generated
vendored
Normal file
9
frontend/node_modules/antd/es/progress/Steps.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import type { ProgressProps } from './progress';
|
||||
interface ProgressStepsProps extends ProgressProps {
|
||||
steps: number;
|
||||
strokeColor?: string | string[];
|
||||
trailColor?: string;
|
||||
}
|
||||
declare const Steps: React.FC<ProgressStepsProps>;
|
||||
export default Steps;
|
||||
47
frontend/node_modules/antd/es/progress/Steps.js
generated
vendored
Normal file
47
frontend/node_modules/antd/es/progress/Steps.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { getSize } from './utils';
|
||||
const Steps = props => {
|
||||
const {
|
||||
size,
|
||||
steps,
|
||||
rounding: customRounding = Math.round,
|
||||
percent = 0,
|
||||
strokeWidth = 8,
|
||||
strokeColor,
|
||||
trailColor = null,
|
||||
prefixCls,
|
||||
children
|
||||
} = props;
|
||||
const current = customRounding(steps * (percent / 100));
|
||||
const stepWidth = size === 'small' ? 2 : 14;
|
||||
const mergedSize = size !== null && size !== void 0 ? size : [stepWidth, strokeWidth];
|
||||
const [width, height] = getSize(mergedSize, 'step', {
|
||||
steps,
|
||||
strokeWidth
|
||||
});
|
||||
const unitWidth = width / steps;
|
||||
const styledSteps = Array.from({
|
||||
length: steps
|
||||
});
|
||||
for (let i = 0; i < steps; i++) {
|
||||
const color = Array.isArray(strokeColor) ? strokeColor[i] : strokeColor;
|
||||
styledSteps[i] = /*#__PURE__*/React.createElement("div", {
|
||||
key: i,
|
||||
className: classNames(`${prefixCls}-steps-item`, {
|
||||
[`${prefixCls}-steps-item-active`]: i <= current - 1
|
||||
}),
|
||||
style: {
|
||||
backgroundColor: i <= current - 1 ? color : trailColor,
|
||||
width: unitWidth,
|
||||
height
|
||||
}
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-steps-outer`
|
||||
}, styledSteps, children);
|
||||
};
|
||||
export default Steps;
|
||||
3
frontend/node_modules/antd/es/progress/index.d.ts
generated
vendored
Normal file
3
frontend/node_modules/antd/es/progress/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import Progress from './progress';
|
||||
export type { ProgressAriaProps, ProgressProps } from './progress';
|
||||
export default Progress;
|
||||
4
frontend/node_modules/antd/es/progress/index.js
generated
vendored
Normal file
4
frontend/node_modules/antd/es/progress/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use client";
|
||||
|
||||
import Progress from './progress';
|
||||
export default Progress;
|
||||
59
frontend/node_modules/antd/es/progress/progress.d.ts
generated
vendored
Normal file
59
frontend/node_modules/antd/es/progress/progress.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import * as React from 'react';
|
||||
export declare const ProgressTypes: readonly ["line", "circle", "dashboard"];
|
||||
export type ProgressType = (typeof ProgressTypes)[number];
|
||||
declare const ProgressStatuses: readonly ["normal", "exception", "active", "success"];
|
||||
export type ProgressSize = 'default' | 'small';
|
||||
export type StringGradients = Record<string, string>;
|
||||
type FromToGradients = {
|
||||
from: string;
|
||||
to: string;
|
||||
};
|
||||
export type ProgressGradient = {
|
||||
direction?: string;
|
||||
} & (StringGradients | FromToGradients);
|
||||
export interface PercentPositionType {
|
||||
align?: 'start' | 'center' | 'end';
|
||||
type?: 'inner' | 'outer';
|
||||
}
|
||||
export interface SuccessProps {
|
||||
percent?: number;
|
||||
/** @deprecated Use `percent` instead */
|
||||
progress?: number;
|
||||
strokeColor?: string;
|
||||
}
|
||||
export type ProgressAriaProps = Pick<React.AriaAttributes, 'aria-label' | 'aria-labelledby'>;
|
||||
export interface ProgressProps extends ProgressAriaProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
type?: ProgressType;
|
||||
percent?: number;
|
||||
format?: (percent?: number, successPercent?: number) => React.ReactNode;
|
||||
status?: (typeof ProgressStatuses)[number];
|
||||
showInfo?: boolean;
|
||||
strokeWidth?: number;
|
||||
strokeLinecap?: 'butt' | 'square' | 'round';
|
||||
strokeColor?: string | string[] | ProgressGradient;
|
||||
trailColor?: string;
|
||||
/** @deprecated Use `size` instead */
|
||||
width?: number;
|
||||
success?: SuccessProps;
|
||||
style?: React.CSSProperties;
|
||||
gapDegree?: number;
|
||||
gapPosition?: 'top' | 'bottom' | 'left' | 'right';
|
||||
size?: number | [number | string, number] | ProgressSize | {
|
||||
width?: number;
|
||||
height?: number;
|
||||
};
|
||||
steps?: number | {
|
||||
count: number;
|
||||
gap: number;
|
||||
};
|
||||
/** @deprecated Use `success` instead */
|
||||
successPercent?: number;
|
||||
percentPosition?: PercentPositionType;
|
||||
children?: React.ReactNode;
|
||||
rounding?: (step: number) => number;
|
||||
}
|
||||
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
||||
export default Progress;
|
||||
164
frontend/node_modules/antd/es/progress/progress.js
generated
vendored
Normal file
164
frontend/node_modules/antd/es/progress/progress.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import { FastColor } from '@ant-design/fast-color';
|
||||
import CheckCircleFilled from "@ant-design/icons/es/icons/CheckCircleFilled";
|
||||
import CheckOutlined from "@ant-design/icons/es/icons/CheckOutlined";
|
||||
import CloseCircleFilled from "@ant-design/icons/es/icons/CloseCircleFilled";
|
||||
import CloseOutlined from "@ant-design/icons/es/icons/CloseOutlined";
|
||||
import classNames from 'classnames';
|
||||
import omit from "rc-util/es/omit";
|
||||
import { devUseWarning } from '../_util/warning';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Circle from './Circle';
|
||||
import Line from './Line';
|
||||
import Steps from './Steps';
|
||||
import useStyle from './style';
|
||||
import { getSize, getSuccessPercent, validProgress } from './utils';
|
||||
export const ProgressTypes = ['line', 'circle', 'dashboard'];
|
||||
const ProgressStatuses = ['normal', 'exception', 'active', 'success'];
|
||||
const Progress = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
rootClassName,
|
||||
steps,
|
||||
strokeColor,
|
||||
percent = 0,
|
||||
size = 'default',
|
||||
showInfo = true,
|
||||
type = 'line',
|
||||
status,
|
||||
format,
|
||||
style,
|
||||
percentPosition = {}
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "steps", "strokeColor", "percent", "size", "showInfo", "type", "status", "format", "style", "percentPosition"]);
|
||||
const {
|
||||
align: infoAlign = 'end',
|
||||
type: infoPosition = 'outer'
|
||||
} = percentPosition;
|
||||
const strokeColorNotArray = Array.isArray(strokeColor) ? strokeColor[0] : strokeColor;
|
||||
const strokeColorNotGradient = typeof strokeColor === 'string' || Array.isArray(strokeColor) ? strokeColor : undefined;
|
||||
const strokeColorIsBright = React.useMemo(() => {
|
||||
if (strokeColorNotArray) {
|
||||
const color = typeof strokeColorNotArray === 'string' ? strokeColorNotArray : Object.values(strokeColorNotArray)[0];
|
||||
return new FastColor(color).isLight();
|
||||
}
|
||||
return false;
|
||||
}, [strokeColor]);
|
||||
const percentNumber = React.useMemo(() => {
|
||||
var _a, _b;
|
||||
const successPercent = getSuccessPercent(props);
|
||||
return Number.parseInt(successPercent !== undefined ? (_a = successPercent !== null && successPercent !== void 0 ? successPercent : 0) === null || _a === void 0 ? void 0 : _a.toString() : (_b = percent !== null && percent !== void 0 ? percent : 0) === null || _b === void 0 ? void 0 : _b.toString(), 10);
|
||||
}, [percent, props.success, props.successPercent]);
|
||||
const progressStatus = React.useMemo(() => {
|
||||
if (!ProgressStatuses.includes(status) && percentNumber >= 100) {
|
||||
return 'success';
|
||||
}
|
||||
return status || 'normal';
|
||||
}, [status, percentNumber]);
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction,
|
||||
progress: progressStyle
|
||||
} = React.useContext(ConfigContext);
|
||||
const prefixCls = getPrefixCls('progress', customizePrefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
||||
const isLineType = type === 'line';
|
||||
const isPureLineType = isLineType && !steps;
|
||||
const progressInfo = React.useMemo(() => {
|
||||
if (!showInfo) {
|
||||
return null;
|
||||
}
|
||||
const successPercent = getSuccessPercent(props);
|
||||
let text;
|
||||
const textFormatter = format || (number => `${number}%`);
|
||||
const isBrightInnerColor = isLineType && strokeColorIsBright && infoPosition === 'inner';
|
||||
if (infoPosition === 'inner' || format || progressStatus !== 'exception' && progressStatus !== 'success') {
|
||||
text = textFormatter(validProgress(percent), validProgress(successPercent));
|
||||
} else if (progressStatus === 'exception') {
|
||||
text = isLineType ? /*#__PURE__*/React.createElement(CloseCircleFilled, null) : /*#__PURE__*/React.createElement(CloseOutlined, null);
|
||||
} else if (progressStatus === 'success') {
|
||||
text = isLineType ? /*#__PURE__*/React.createElement(CheckCircleFilled, null) : /*#__PURE__*/React.createElement(CheckOutlined, null);
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("span", {
|
||||
className: classNames(`${prefixCls}-text`, {
|
||||
[`${prefixCls}-text-bright`]: isBrightInnerColor,
|
||||
[`${prefixCls}-text-${infoAlign}`]: isPureLineType,
|
||||
[`${prefixCls}-text-${infoPosition}`]: isPureLineType
|
||||
}),
|
||||
title: typeof text === 'string' ? text : undefined
|
||||
}, text);
|
||||
}, [showInfo, percent, percentNumber, progressStatus, type, prefixCls, format]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = devUseWarning('Progress');
|
||||
warning.deprecated(!('successPercent' in props), 'successPercent', 'success.percent');
|
||||
warning.deprecated(!('width' in props), 'width', 'size');
|
||||
if (type === 'circle' || type === 'dashboard') {
|
||||
if (Array.isArray(size)) {
|
||||
process.env.NODE_ENV !== "production" ? warning(false, 'usage', 'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.') : void 0;
|
||||
} else if (typeof size === 'object') {
|
||||
process.env.NODE_ENV !== "production" ? warning(false, 'usage', 'Type "circle" and "dashboard" do not accept object as `size`, please use number or preset size instead.') : void 0;
|
||||
}
|
||||
}
|
||||
if (props.success && 'progress' in props.success) {
|
||||
warning.deprecated(false, 'success.progress', 'success.percent');
|
||||
}
|
||||
}
|
||||
let progress;
|
||||
// Render progress shape
|
||||
if (type === 'line') {
|
||||
progress = steps ? (/*#__PURE__*/React.createElement(Steps, Object.assign({}, props, {
|
||||
strokeColor: strokeColorNotGradient,
|
||||
prefixCls: prefixCls,
|
||||
steps: typeof steps === 'object' ? steps.count : steps
|
||||
}), progressInfo)) : (/*#__PURE__*/React.createElement(Line, Object.assign({}, props, {
|
||||
strokeColor: strokeColorNotArray,
|
||||
prefixCls: prefixCls,
|
||||
direction: direction,
|
||||
percentPosition: {
|
||||
align: infoAlign,
|
||||
type: infoPosition
|
||||
}
|
||||
}), progressInfo));
|
||||
} else if (type === 'circle' || type === 'dashboard') {
|
||||
progress = /*#__PURE__*/React.createElement(Circle, Object.assign({}, props, {
|
||||
strokeColor: strokeColorNotArray,
|
||||
prefixCls: prefixCls,
|
||||
progressStatus: progressStatus
|
||||
}), progressInfo);
|
||||
}
|
||||
const classString = classNames(prefixCls, `${prefixCls}-status-${progressStatus}`, {
|
||||
[`${prefixCls}-${type === 'dashboard' && 'circle' || type}`]: type !== 'line',
|
||||
[`${prefixCls}-inline-circle`]: type === 'circle' && getSize(size, 'circle')[0] <= 20,
|
||||
[`${prefixCls}-line`]: isPureLineType,
|
||||
[`${prefixCls}-line-align-${infoAlign}`]: isPureLineType,
|
||||
[`${prefixCls}-line-position-${infoPosition}`]: isPureLineType,
|
||||
[`${prefixCls}-steps`]: steps,
|
||||
[`${prefixCls}-show-info`]: showInfo,
|
||||
[`${prefixCls}-${size}`]: typeof size === 'string',
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, progressStyle === null || progressStyle === void 0 ? void 0 : progressStyle.className, className, rootClassName, hashId, cssVarCls);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", Object.assign({
|
||||
ref: ref,
|
||||
style: Object.assign(Object.assign({}, progressStyle === null || progressStyle === void 0 ? void 0 : progressStyle.style), style),
|
||||
className: classString,
|
||||
role: "progressbar",
|
||||
"aria-valuenow": percentNumber,
|
||||
"aria-valuemin": 0,
|
||||
"aria-valuemax": 100
|
||||
}, omit(restProps, ['trailColor', 'strokeWidth', 'width', 'gapDegree', 'gapPosition', 'strokeLinecap', 'success', 'successPercent'])), progress));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Progress.displayName = 'Progress';
|
||||
}
|
||||
export default Progress;
|
||||
38
frontend/node_modules/antd/es/progress/style/index.d.ts
generated
vendored
Normal file
38
frontend/node_modules/antd/es/progress/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 进度条默认颜色
|
||||
* @descEN Default color of progress bar
|
||||
*/
|
||||
defaultColor: string;
|
||||
/**
|
||||
* @desc 进度条剩余部分颜色
|
||||
* @descEN Color of remaining part of progress bar
|
||||
*/
|
||||
remainingColor: string;
|
||||
/**
|
||||
* @desc 圆形进度条文字颜色
|
||||
* @descEN Text color of circular progress bar
|
||||
*/
|
||||
circleTextColor: string;
|
||||
/**
|
||||
* @desc 条状进度条圆角
|
||||
* @descEN Border radius of line progress bar
|
||||
*/
|
||||
lineBorderRadius: number;
|
||||
/**
|
||||
* @desc 圆形进度条文本大小
|
||||
* @descEN Text size of circular progress bar
|
||||
*/
|
||||
circleTextFontSize: string;
|
||||
/**
|
||||
* @desc 圆形进度条图标大小
|
||||
* @descEN Icon size of circular progress bar
|
||||
*/
|
||||
circleIconFontSize: string;
|
||||
}
|
||||
export declare const LineStrokeColorVar = "--progress-line-stroke-color";
|
||||
export declare const Percent = "--progress-percent";
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Progress'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
300
frontend/node_modules/antd/es/progress/style/index.js
generated
vendored
Normal file
300
frontend/node_modules/antd/es/progress/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,300 @@
|
||||
import { Keyframes, unit } from '@ant-design/cssinjs';
|
||||
import { resetComponent } from '../../style';
|
||||
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
||||
export const LineStrokeColorVar = '--progress-line-stroke-color';
|
||||
export const Percent = '--progress-percent';
|
||||
const genAntProgressActive = isRtl => {
|
||||
const direction = isRtl ? '100%' : '-100%';
|
||||
return new Keyframes(`antProgress${isRtl ? 'RTL' : 'LTR'}Active`, {
|
||||
'0%': {
|
||||
transform: `translateX(${direction}) scaleX(0)`,
|
||||
opacity: 0.1
|
||||
},
|
||||
'20%': {
|
||||
transform: `translateX(${direction}) scaleX(0)`,
|
||||
opacity: 0.5
|
||||
},
|
||||
to: {
|
||||
transform: 'translateX(0) scaleX(1)',
|
||||
opacity: 0
|
||||
}
|
||||
});
|
||||
};
|
||||
const genBaseStyle = token => {
|
||||
const {
|
||||
componentCls: progressCls,
|
||||
iconCls: iconPrefixCls
|
||||
} = token;
|
||||
return {
|
||||
[progressCls]: Object.assign(Object.assign({}, resetComponent(token)), {
|
||||
display: 'inline-block',
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
},
|
||||
'&-line': {
|
||||
position: 'relative',
|
||||
width: '100%',
|
||||
fontSize: token.fontSize
|
||||
},
|
||||
[`${progressCls}-outer`]: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
width: '100%'
|
||||
},
|
||||
[`${progressCls}-inner`]: {
|
||||
position: 'relative',
|
||||
display: 'inline-block',
|
||||
width: '100%',
|
||||
flex: 1,
|
||||
overflow: 'hidden',
|
||||
verticalAlign: 'middle',
|
||||
backgroundColor: token.remainingColor,
|
||||
borderRadius: token.lineBorderRadius
|
||||
},
|
||||
[`${progressCls}-inner:not(${progressCls}-circle-gradient)`]: {
|
||||
[`${progressCls}-circle-path`]: {
|
||||
stroke: token.defaultColor
|
||||
}
|
||||
},
|
||||
[`${progressCls}-success-bg, ${progressCls}-bg`]: {
|
||||
position: 'relative',
|
||||
background: token.defaultColor,
|
||||
borderRadius: token.lineBorderRadius,
|
||||
transition: `all ${token.motionDurationSlow} ${token.motionEaseInOutCirc}`
|
||||
},
|
||||
[`${progressCls}-layout-bottom`]: {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
[`${progressCls}-text`]: {
|
||||
width: 'max-content',
|
||||
marginInlineStart: 0,
|
||||
marginTop: token.marginXXS
|
||||
}
|
||||
},
|
||||
[`${progressCls}-bg`]: {
|
||||
overflow: 'hidden',
|
||||
'&::after': {
|
||||
content: '""',
|
||||
background: {
|
||||
_multi_value_: true,
|
||||
value: ['inherit', `var(${LineStrokeColorVar})`]
|
||||
},
|
||||
height: '100%',
|
||||
width: `calc(1 / var(${Percent}) * 100%)`,
|
||||
display: 'block'
|
||||
},
|
||||
[`&${progressCls}-bg-inner`]: {
|
||||
minWidth: 'max-content',
|
||||
'&::after': {
|
||||
content: 'none'
|
||||
},
|
||||
[`${progressCls}-text-inner`]: {
|
||||
color: token.colorWhite,
|
||||
[`&${progressCls}-text-bright`]: {
|
||||
color: 'rgba(0, 0, 0, 0.45)'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${progressCls}-success-bg`]: {
|
||||
position: 'absolute',
|
||||
insetBlockStart: 0,
|
||||
insetInlineStart: 0,
|
||||
backgroundColor: token.colorSuccess
|
||||
},
|
||||
[`${progressCls}-text`]: {
|
||||
display: 'inline-block',
|
||||
marginInlineStart: token.marginXS,
|
||||
color: token.colorText,
|
||||
lineHeight: 1,
|
||||
width: '2em',
|
||||
whiteSpace: 'nowrap',
|
||||
textAlign: 'start',
|
||||
verticalAlign: 'middle',
|
||||
wordBreak: 'normal',
|
||||
[iconPrefixCls]: {
|
||||
fontSize: token.fontSize
|
||||
},
|
||||
[`&${progressCls}-text-outer`]: {
|
||||
width: 'max-content'
|
||||
},
|
||||
[`&${progressCls}-text-outer${progressCls}-text-start`]: {
|
||||
width: 'max-content',
|
||||
marginInlineStart: 0,
|
||||
marginInlineEnd: token.marginXS
|
||||
}
|
||||
},
|
||||
[`${progressCls}-text-inner`]: {
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
marginInlineStart: 0,
|
||||
padding: `0 ${unit(token.paddingXXS)}`,
|
||||
[`&${progressCls}-text-start`]: {
|
||||
justifyContent: 'start'
|
||||
},
|
||||
[`&${progressCls}-text-end`]: {
|
||||
justifyContent: 'end'
|
||||
}
|
||||
},
|
||||
[`&${progressCls}-status-active`]: {
|
||||
[`${progressCls}-bg::before`]: {
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
backgroundColor: token.colorBgContainer,
|
||||
borderRadius: token.lineBorderRadius,
|
||||
opacity: 0,
|
||||
animationName: genAntProgressActive(),
|
||||
animationDuration: token.progressActiveMotionDuration,
|
||||
animationTimingFunction: token.motionEaseOutQuint,
|
||||
animationIterationCount: 'infinite',
|
||||
content: '""'
|
||||
}
|
||||
},
|
||||
[`&${progressCls}-rtl${progressCls}-status-active`]: {
|
||||
[`${progressCls}-bg::before`]: {
|
||||
animationName: genAntProgressActive(true)
|
||||
}
|
||||
},
|
||||
[`&${progressCls}-status-exception`]: {
|
||||
[`${progressCls}-bg`]: {
|
||||
backgroundColor: token.colorError
|
||||
},
|
||||
[`${progressCls}-text`]: {
|
||||
color: token.colorError
|
||||
}
|
||||
},
|
||||
[`&${progressCls}-status-exception ${progressCls}-inner:not(${progressCls}-circle-gradient)`]: {
|
||||
[`${progressCls}-circle-path`]: {
|
||||
stroke: token.colorError
|
||||
}
|
||||
},
|
||||
[`&${progressCls}-status-success`]: {
|
||||
[`${progressCls}-bg`]: {
|
||||
backgroundColor: token.colorSuccess
|
||||
},
|
||||
[`${progressCls}-text`]: {
|
||||
color: token.colorSuccess
|
||||
}
|
||||
},
|
||||
[`&${progressCls}-status-success ${progressCls}-inner:not(${progressCls}-circle-gradient)`]: {
|
||||
[`${progressCls}-circle-path`]: {
|
||||
stroke: token.colorSuccess
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
const genCircleStyle = token => {
|
||||
const {
|
||||
componentCls: progressCls,
|
||||
iconCls: iconPrefixCls
|
||||
} = token;
|
||||
return {
|
||||
[progressCls]: {
|
||||
[`${progressCls}-circle-trail`]: {
|
||||
stroke: token.remainingColor
|
||||
},
|
||||
[`&${progressCls}-circle ${progressCls}-inner`]: {
|
||||
position: 'relative',
|
||||
lineHeight: 1,
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
[`&${progressCls}-circle ${progressCls}-text`]: {
|
||||
position: 'absolute',
|
||||
insetBlockStart: '50%',
|
||||
insetInlineStart: 0,
|
||||
width: '100%',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
color: token.circleTextColor,
|
||||
fontSize: token.circleTextFontSize,
|
||||
lineHeight: 1,
|
||||
whiteSpace: 'normal',
|
||||
textAlign: 'center',
|
||||
transform: 'translateY(-50%)',
|
||||
[iconPrefixCls]: {
|
||||
fontSize: token.circleIconFontSize
|
||||
}
|
||||
},
|
||||
[`${progressCls}-circle&-status-exception`]: {
|
||||
[`${progressCls}-text`]: {
|
||||
color: token.colorError
|
||||
}
|
||||
},
|
||||
[`${progressCls}-circle&-status-success`]: {
|
||||
[`${progressCls}-text`]: {
|
||||
color: token.colorSuccess
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${progressCls}-inline-circle`]: {
|
||||
lineHeight: 1,
|
||||
[`${progressCls}-inner`]: {
|
||||
verticalAlign: 'bottom'
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genStepStyle = token => {
|
||||
const {
|
||||
componentCls: progressCls
|
||||
} = token;
|
||||
return {
|
||||
[progressCls]: {
|
||||
[`${progressCls}-steps`]: {
|
||||
display: 'inline-block',
|
||||
'&-outer': {
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center'
|
||||
},
|
||||
'&-item': {
|
||||
flexShrink: 0,
|
||||
minWidth: token.progressStepMinWidth,
|
||||
marginInlineEnd: token.progressStepMarginInlineEnd,
|
||||
backgroundColor: token.remainingColor,
|
||||
transition: `all ${token.motionDurationSlow}`,
|
||||
'&-active': {
|
||||
backgroundColor: token.defaultColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSmallLine = token => {
|
||||
const {
|
||||
componentCls: progressCls,
|
||||
iconCls: iconPrefixCls
|
||||
} = token;
|
||||
return {
|
||||
[progressCls]: {
|
||||
[`${progressCls}-small&-line, ${progressCls}-small&-line ${progressCls}-text ${iconPrefixCls}`]: {
|
||||
fontSize: token.fontSizeSM
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
export const prepareComponentToken = token => ({
|
||||
circleTextColor: token.colorText,
|
||||
defaultColor: token.colorInfo,
|
||||
remainingColor: token.colorFillSecondary,
|
||||
lineBorderRadius: 100,
|
||||
// magic for capsule shape, should be a very large number
|
||||
circleTextFontSize: '1em',
|
||||
circleIconFontSize: `${token.fontSize / token.fontSizeSM}em`
|
||||
});
|
||||
export default genStyleHooks('Progress', token => {
|
||||
const progressStepMarginInlineEnd = token.calc(token.marginXXS).div(2).equal();
|
||||
const progressToken = mergeToken(token, {
|
||||
progressStepMarginInlineEnd,
|
||||
progressStepMinWidth: progressStepMarginInlineEnd,
|
||||
progressActiveMotionDuration: '2.4s'
|
||||
});
|
||||
return [genBaseStyle(progressToken), genCircleStyle(progressToken), genStepStyle(progressToken), genSmallLine(progressToken)];
|
||||
}, prepareComponentToken);
|
||||
10
frontend/node_modules/antd/es/progress/utils.d.ts
generated
vendored
Normal file
10
frontend/node_modules/antd/es/progress/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { CircleProps } from './Circle';
|
||||
import type { ProgressProps } from './progress';
|
||||
export declare function validProgress(progress?: number): number;
|
||||
export declare function getSuccessPercent({ success, successPercent }: ProgressProps): number | undefined;
|
||||
export declare const getPercentage: ({ percent, success, successPercent }: ProgressProps) => number[];
|
||||
export declare const getStrokeColor: ({ success, strokeColor, }: Partial<CircleProps>) => (string | Record<PropertyKey, string>)[];
|
||||
export declare const getSize: (size: ProgressProps["size"], type: ProgressProps["type"] | "step", extra?: {
|
||||
steps?: number;
|
||||
strokeWidth?: number;
|
||||
}) => [number, number];
|
||||
81
frontend/node_modules/antd/es/progress/utils.js
generated
vendored
Normal file
81
frontend/node_modules/antd/es/progress/utils.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import { presetPrimaryColors } from '@ant-design/colors';
|
||||
export function validProgress(progress) {
|
||||
if (!progress || progress < 0) {
|
||||
return 0;
|
||||
}
|
||||
if (progress > 100) {
|
||||
return 100;
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
export function getSuccessPercent({
|
||||
success,
|
||||
successPercent
|
||||
}) {
|
||||
let percent = successPercent;
|
||||
/** @deprecated Use `percent` instead */
|
||||
if (success && 'progress' in success) {
|
||||
percent = success.progress;
|
||||
}
|
||||
if (success && 'percent' in success) {
|
||||
percent = success.percent;
|
||||
}
|
||||
return percent;
|
||||
}
|
||||
export const getPercentage = ({
|
||||
percent,
|
||||
success,
|
||||
successPercent
|
||||
}) => {
|
||||
const realSuccessPercent = validProgress(getSuccessPercent({
|
||||
success,
|
||||
successPercent
|
||||
}));
|
||||
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
|
||||
};
|
||||
export const getStrokeColor = ({
|
||||
success = {},
|
||||
strokeColor
|
||||
}) => {
|
||||
const {
|
||||
strokeColor: successColor
|
||||
} = success;
|
||||
return [successColor || presetPrimaryColors.green, strokeColor || null];
|
||||
};
|
||||
export const getSize = (size, type, extra) => {
|
||||
var _a, _b, _c, _d;
|
||||
let width = -1;
|
||||
let height = -1;
|
||||
if (type === 'step') {
|
||||
const steps = extra.steps;
|
||||
const strokeWidth = extra.strokeWidth;
|
||||
if (typeof size === 'string' || typeof size === 'undefined') {
|
||||
width = size === 'small' ? 2 : 14;
|
||||
height = strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 8;
|
||||
} else if (typeof size === 'number') {
|
||||
[width, height] = [size, size];
|
||||
} else {
|
||||
[width = 14, height = 8] = Array.isArray(size) ? size : [size.width, size.height];
|
||||
}
|
||||
width *= steps;
|
||||
} else if (type === 'line') {
|
||||
const strokeWidth = extra === null || extra === void 0 ? void 0 : extra.strokeWidth;
|
||||
if (typeof size === 'string' || typeof size === 'undefined') {
|
||||
height = strokeWidth || (size === 'small' ? 6 : 8);
|
||||
} else if (typeof size === 'number') {
|
||||
[width, height] = [size, size];
|
||||
} else {
|
||||
[width = -1, height = 8] = Array.isArray(size) ? size : [size.width, size.height];
|
||||
}
|
||||
} else if (type === 'circle' || type === 'dashboard') {
|
||||
if (typeof size === 'string' || typeof size === 'undefined') {
|
||||
[width, height] = size === 'small' ? [60, 60] : [120, 120];
|
||||
} else if (typeof size === 'number') {
|
||||
[width, height] = [size, size];
|
||||
} else if (Array.isArray(size)) {
|
||||
width = (_b = (_a = size[0]) !== null && _a !== void 0 ? _a : size[1]) !== null && _b !== void 0 ? _b : 120;
|
||||
height = (_d = (_c = size[0]) !== null && _c !== void 0 ? _c : size[1]) !== null && _d !== void 0 ? _d : 120;
|
||||
}
|
||||
}
|
||||
return [width, height];
|
||||
};
|
||||
Reference in New Issue
Block a user