first commit
This commit is contained in:
17
frontend/node_modules/rc-progress/es/Circle/PtgCircle.d.ts
generated
vendored
Normal file
17
frontend/node_modules/rc-progress/es/Circle/PtgCircle.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as React from 'react';
|
||||
import type { ProgressProps } from '..';
|
||||
import type { StrokeColorObject } from '../interface';
|
||||
export interface ColorGradientProps {
|
||||
prefixCls: string;
|
||||
gradientId: string;
|
||||
style: React.CSSProperties;
|
||||
ptg: number;
|
||||
radius: number;
|
||||
strokeLinecap: ProgressProps['strokeLinecap'];
|
||||
strokeWidth: ProgressProps['strokeWidth'];
|
||||
size: number;
|
||||
color: string | StrokeColorObject;
|
||||
gapDegree: number;
|
||||
}
|
||||
declare const PtgCircle: React.ForwardRefExoticComponent<ColorGradientProps & React.RefAttributes<SVGCircleElement>>;
|
||||
export default PtgCircle;
|
||||
77
frontend/node_modules/rc-progress/es/Circle/PtgCircle.js
generated
vendored
Normal file
77
frontend/node_modules/rc-progress/es/Circle/PtgCircle.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||
import * as React from 'react';
|
||||
var Block = function Block(_ref) {
|
||||
var bg = _ref.bg,
|
||||
children = _ref.children;
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
style: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: bg
|
||||
}
|
||||
}, children);
|
||||
};
|
||||
function getPtgColors(color, scale) {
|
||||
return Object.keys(color).map(function (key) {
|
||||
var parsedKey = parseFloat(key);
|
||||
var ptgKey = "".concat(Math.floor(parsedKey * scale), "%");
|
||||
return "".concat(color[key], " ").concat(ptgKey);
|
||||
});
|
||||
}
|
||||
var PtgCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
||||
var prefixCls = props.prefixCls,
|
||||
color = props.color,
|
||||
gradientId = props.gradientId,
|
||||
radius = props.radius,
|
||||
circleStyleForStack = props.style,
|
||||
ptg = props.ptg,
|
||||
strokeLinecap = props.strokeLinecap,
|
||||
strokeWidth = props.strokeWidth,
|
||||
size = props.size,
|
||||
gapDegree = props.gapDegree;
|
||||
var isGradient = color && _typeof(color) === 'object';
|
||||
var stroke = isGradient ? "#FFF" : undefined;
|
||||
|
||||
// ========================== Circle ==========================
|
||||
var halfSize = size / 2;
|
||||
var circleNode = /*#__PURE__*/React.createElement("circle", {
|
||||
className: "".concat(prefixCls, "-circle-path"),
|
||||
r: radius,
|
||||
cx: halfSize,
|
||||
cy: halfSize,
|
||||
stroke: stroke,
|
||||
strokeLinecap: strokeLinecap,
|
||||
strokeWidth: strokeWidth,
|
||||
opacity: ptg === 0 ? 0 : 1,
|
||||
style: circleStyleForStack,
|
||||
ref: ref
|
||||
});
|
||||
|
||||
// ========================== Render ==========================
|
||||
if (!isGradient) {
|
||||
return circleNode;
|
||||
}
|
||||
var maskId = "".concat(gradientId, "-conic");
|
||||
var fromDeg = gapDegree ? "".concat(180 + gapDegree / 2, "deg") : '0deg';
|
||||
var conicColors = getPtgColors(color, (360 - gapDegree) / 360);
|
||||
var linearColors = getPtgColors(color, 1);
|
||||
var conicColorBg = "conic-gradient(from ".concat(fromDeg, ", ").concat(conicColors.join(', '), ")");
|
||||
var linearColorBg = "linear-gradient(to ".concat(gapDegree ? 'bottom' : 'top', ", ").concat(linearColors.join(', '), ")");
|
||||
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("mask", {
|
||||
id: maskId
|
||||
}, circleNode), /*#__PURE__*/React.createElement("foreignObject", {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: size,
|
||||
height: size,
|
||||
mask: "url(#".concat(maskId, ")")
|
||||
}, /*#__PURE__*/React.createElement(Block, {
|
||||
bg: linearColorBg
|
||||
}, /*#__PURE__*/React.createElement(Block, {
|
||||
bg: conicColorBg
|
||||
}))));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
PtgCircle.displayName = 'PtgCircle';
|
||||
}
|
||||
export default PtgCircle;
|
||||
4
frontend/node_modules/rc-progress/es/Circle/index.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-progress/es/Circle/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { ProgressProps } from '../interface';
|
||||
declare const Circle: React.FC<ProgressProps>;
|
||||
export default Circle;
|
||||
130
frontend/node_modules/rc-progress/es/Circle/index.js
generated
vendored
Normal file
130
frontend/node_modules/rc-progress/es/Circle/index.js
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
var _excluded = ["id", "prefixCls", "steps", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"];
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { defaultProps, useTransitionDuration } from "../common";
|
||||
import useId from "../hooks/useId";
|
||||
import PtgCircle from "./PtgCircle";
|
||||
import { VIEW_BOX_SIZE, getCircleStyle } from "./util";
|
||||
function toArray(value) {
|
||||
var mergedValue = value !== null && value !== void 0 ? value : [];
|
||||
return Array.isArray(mergedValue) ? mergedValue : [mergedValue];
|
||||
}
|
||||
var Circle = function Circle(props) {
|
||||
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
||||
id = _defaultProps$props.id,
|
||||
prefixCls = _defaultProps$props.prefixCls,
|
||||
steps = _defaultProps$props.steps,
|
||||
strokeWidth = _defaultProps$props.strokeWidth,
|
||||
trailWidth = _defaultProps$props.trailWidth,
|
||||
_defaultProps$props$g = _defaultProps$props.gapDegree,
|
||||
gapDegree = _defaultProps$props$g === void 0 ? 0 : _defaultProps$props$g,
|
||||
gapPosition = _defaultProps$props.gapPosition,
|
||||
trailColor = _defaultProps$props.trailColor,
|
||||
strokeLinecap = _defaultProps$props.strokeLinecap,
|
||||
style = _defaultProps$props.style,
|
||||
className = _defaultProps$props.className,
|
||||
strokeColor = _defaultProps$props.strokeColor,
|
||||
percent = _defaultProps$props.percent,
|
||||
restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
||||
var halfSize = VIEW_BOX_SIZE / 2;
|
||||
var mergedId = useId(id);
|
||||
var gradientId = "".concat(mergedId, "-gradient");
|
||||
var radius = halfSize - strokeWidth / 2;
|
||||
var perimeter = Math.PI * 2 * radius;
|
||||
var rotateDeg = gapDegree > 0 ? 90 + gapDegree / 2 : -90;
|
||||
var perimeterWithoutGap = perimeter * ((360 - gapDegree) / 360);
|
||||
var _ref = _typeof(steps) === 'object' ? steps : {
|
||||
count: steps,
|
||||
gap: 2
|
||||
},
|
||||
stepCount = _ref.count,
|
||||
stepGap = _ref.gap;
|
||||
var percentList = toArray(percent);
|
||||
var strokeColorList = toArray(strokeColor);
|
||||
var gradient = strokeColorList.find(function (color) {
|
||||
return color && _typeof(color) === 'object';
|
||||
});
|
||||
var isConicGradient = gradient && _typeof(gradient) === 'object';
|
||||
var mergedStrokeLinecap = isConicGradient ? 'butt' : strokeLinecap;
|
||||
var circleStyle = getCircleStyle(perimeter, perimeterWithoutGap, 0, 100, rotateDeg, gapDegree, gapPosition, trailColor, mergedStrokeLinecap, strokeWidth);
|
||||
var paths = useTransitionDuration();
|
||||
var getStokeList = function getStokeList() {
|
||||
var stackPtg = 0;
|
||||
return percentList.map(function (ptg, index) {
|
||||
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
|
||||
var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, ptg, rotateDeg, gapDegree, gapPosition, color, mergedStrokeLinecap, strokeWidth);
|
||||
stackPtg += ptg;
|
||||
return /*#__PURE__*/React.createElement(PtgCircle, {
|
||||
key: index,
|
||||
color: color,
|
||||
ptg: ptg,
|
||||
radius: radius,
|
||||
prefixCls: prefixCls,
|
||||
gradientId: gradientId,
|
||||
style: circleStyleForStack,
|
||||
strokeLinecap: mergedStrokeLinecap,
|
||||
strokeWidth: strokeWidth,
|
||||
gapDegree: gapDegree,
|
||||
ref: function ref(elem) {
|
||||
// https://reactjs.org/docs/refs-and-the-dom.html#callback-refs
|
||||
// React will call the ref callback with the DOM element when the component mounts,
|
||||
// and call it with `null` when it unmounts.
|
||||
// Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
|
||||
|
||||
paths[index] = elem;
|
||||
},
|
||||
size: VIEW_BOX_SIZE
|
||||
});
|
||||
}).reverse();
|
||||
};
|
||||
var getStepStokeList = function getStepStokeList() {
|
||||
// only show the first percent when pass steps
|
||||
var current = Math.round(stepCount * (percentList[0] / 100));
|
||||
var stepPtg = 100 / stepCount;
|
||||
var stackPtg = 0;
|
||||
return new Array(stepCount).fill(null).map(function (_, index) {
|
||||
var color = index <= current - 1 ? strokeColorList[0] : trailColor;
|
||||
var stroke = color && _typeof(color) === 'object' ? "url(#".concat(gradientId, ")") : undefined;
|
||||
var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, stepPtg, rotateDeg, gapDegree, gapPosition, color, 'butt', strokeWidth, stepGap);
|
||||
stackPtg += (perimeterWithoutGap - circleStyleForStack.strokeDashoffset + stepGap) * 100 / perimeterWithoutGap;
|
||||
return /*#__PURE__*/React.createElement("circle", {
|
||||
key: index,
|
||||
className: "".concat(prefixCls, "-circle-path"),
|
||||
r: radius,
|
||||
cx: halfSize,
|
||||
cy: halfSize,
|
||||
stroke: stroke,
|
||||
strokeWidth: strokeWidth,
|
||||
opacity: 1,
|
||||
style: circleStyleForStack,
|
||||
ref: function ref(elem) {
|
||||
paths[index] = elem;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return /*#__PURE__*/React.createElement("svg", _extends({
|
||||
className: classNames("".concat(prefixCls, "-circle"), className),
|
||||
viewBox: "0 0 ".concat(VIEW_BOX_SIZE, " ").concat(VIEW_BOX_SIZE),
|
||||
style: style,
|
||||
id: id,
|
||||
role: "presentation"
|
||||
}, restProps), !stepCount && /*#__PURE__*/React.createElement("circle", {
|
||||
className: "".concat(prefixCls, "-circle-trail"),
|
||||
r: radius,
|
||||
cx: halfSize,
|
||||
cy: halfSize,
|
||||
stroke: trailColor,
|
||||
strokeLinecap: mergedStrokeLinecap,
|
||||
strokeWidth: trailWidth || strokeWidth,
|
||||
style: circleStyle
|
||||
}), stepCount ? getStepStokeList() : getStokeList());
|
||||
};
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Circle.displayName = 'Circle';
|
||||
}
|
||||
export default Circle;
|
||||
5
frontend/node_modules/rc-progress/es/Circle/util.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-progress/es/Circle/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { StrokeColorType } from '../interface';
|
||||
import type { ProgressProps } from '..';
|
||||
import type React from 'react';
|
||||
export declare const VIEW_BOX_SIZE = 100;
|
||||
export declare const getCircleStyle: (perimeter: number, perimeterWithoutGap: number, offset: number, percent: number, rotateDeg: number, gapDegree: number, gapPosition: ProgressProps['gapPosition'] | undefined, strokeColor: StrokeColorType, strokeLinecap: ProgressProps['strokeLinecap'], strokeWidth: number, stepSpace?: number) => React.CSSProperties;
|
||||
31
frontend/node_modules/rc-progress/es/Circle/util.js
generated
vendored
Normal file
31
frontend/node_modules/rc-progress/es/Circle/util.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
export var VIEW_BOX_SIZE = 100;
|
||||
export var getCircleStyle = function getCircleStyle(perimeter, perimeterWithoutGap, offset, percent, rotateDeg, gapDegree, gapPosition, strokeColor, strokeLinecap, strokeWidth) {
|
||||
var stepSpace = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 0;
|
||||
var offsetDeg = offset / 100 * 360 * ((360 - gapDegree) / 360);
|
||||
var positionDeg = gapDegree === 0 ? 0 : {
|
||||
bottom: 0,
|
||||
top: 180,
|
||||
left: 90,
|
||||
right: -90
|
||||
}[gapPosition];
|
||||
var strokeDashoffset = (100 - percent) / 100 * perimeterWithoutGap;
|
||||
// Fix percent accuracy when strokeLinecap is round
|
||||
// https://github.com/ant-design/ant-design/issues/35009
|
||||
if (strokeLinecap === 'round' && percent !== 100) {
|
||||
strokeDashoffset += strokeWidth / 2;
|
||||
// when percent is small enough (<= 1%), keep smallest value to avoid it's disappearance
|
||||
if (strokeDashoffset >= perimeterWithoutGap) {
|
||||
strokeDashoffset = perimeterWithoutGap - 0.01;
|
||||
}
|
||||
}
|
||||
var halfSize = VIEW_BOX_SIZE / 2;
|
||||
return {
|
||||
stroke: typeof strokeColor === 'string' ? strokeColor : undefined,
|
||||
strokeDasharray: "".concat(perimeterWithoutGap, "px ").concat(perimeter),
|
||||
strokeDashoffset: strokeDashoffset + stepSpace,
|
||||
transform: "rotate(".concat(rotateDeg + offsetDeg + positionDeg, "deg)"),
|
||||
transformOrigin: "".concat(halfSize, "px ").concat(halfSize, "px"),
|
||||
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s',
|
||||
fillOpacity: 0
|
||||
};
|
||||
};
|
||||
4
frontend/node_modules/rc-progress/es/Line.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-progress/es/Line.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { ProgressProps } from './interface';
|
||||
declare const Line: React.FC<ProgressProps>;
|
||||
export default Line;
|
||||
87
frontend/node_modules/rc-progress/es/Line.js
generated
vendored
Normal file
87
frontend/node_modules/rc-progress/es/Line.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
var _excluded = ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"];
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { useTransitionDuration, defaultProps } from "./common";
|
||||
var Line = function Line(props) {
|
||||
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
||||
className = _defaultProps$props.className,
|
||||
percent = _defaultProps$props.percent,
|
||||
prefixCls = _defaultProps$props.prefixCls,
|
||||
strokeColor = _defaultProps$props.strokeColor,
|
||||
strokeLinecap = _defaultProps$props.strokeLinecap,
|
||||
strokeWidth = _defaultProps$props.strokeWidth,
|
||||
style = _defaultProps$props.style,
|
||||
trailColor = _defaultProps$props.trailColor,
|
||||
trailWidth = _defaultProps$props.trailWidth,
|
||||
transition = _defaultProps$props.transition,
|
||||
restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
delete restProps.gapPosition;
|
||||
var percentList = Array.isArray(percent) ? percent : [percent];
|
||||
var strokeColorList = Array.isArray(strokeColor) ? strokeColor : [strokeColor];
|
||||
var paths = useTransitionDuration();
|
||||
var center = strokeWidth / 2;
|
||||
var right = 100 - strokeWidth / 2;
|
||||
var pathString = "M ".concat(strokeLinecap === 'round' ? center : 0, ",").concat(center, "\n L ").concat(strokeLinecap === 'round' ? right : 100, ",").concat(center);
|
||||
var viewBoxString = "0 0 100 ".concat(strokeWidth);
|
||||
var stackPtg = 0;
|
||||
return /*#__PURE__*/React.createElement("svg", _extends({
|
||||
className: classNames("".concat(prefixCls, "-line"), className),
|
||||
viewBox: viewBoxString,
|
||||
preserveAspectRatio: "none",
|
||||
style: style
|
||||
}, restProps), /*#__PURE__*/React.createElement("path", {
|
||||
className: "".concat(prefixCls, "-line-trail"),
|
||||
d: pathString,
|
||||
strokeLinecap: strokeLinecap,
|
||||
stroke: trailColor,
|
||||
strokeWidth: trailWidth || strokeWidth,
|
||||
fillOpacity: "0"
|
||||
}), percentList.map(function (ptg, index) {
|
||||
var dashPercent = 1;
|
||||
switch (strokeLinecap) {
|
||||
case 'round':
|
||||
dashPercent = 1 - strokeWidth / 100;
|
||||
break;
|
||||
case 'square':
|
||||
dashPercent = 1 - strokeWidth / 2 / 100;
|
||||
break;
|
||||
default:
|
||||
dashPercent = 1;
|
||||
break;
|
||||
}
|
||||
var pathStyle = {
|
||||
strokeDasharray: "".concat(ptg * dashPercent, "px, 100px"),
|
||||
strokeDashoffset: "-".concat(stackPtg, "px"),
|
||||
transition: transition || 'stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear'
|
||||
};
|
||||
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
|
||||
stackPtg += ptg;
|
||||
return /*#__PURE__*/React.createElement("path", {
|
||||
key: index,
|
||||
className: "".concat(prefixCls, "-line-path"),
|
||||
d: pathString,
|
||||
strokeLinecap: strokeLinecap,
|
||||
stroke: color,
|
||||
strokeWidth: strokeWidth,
|
||||
fillOpacity: "0",
|
||||
ref: function ref(elem) {
|
||||
// https://reactjs.org/docs/refs-and-the-dom.html#callback-refs
|
||||
// React will call the ref callback with the DOM element when the component mounts,
|
||||
// and call it with `null` when it unmounts.
|
||||
// Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
|
||||
|
||||
paths[index] = elem;
|
||||
},
|
||||
style: pathStyle
|
||||
});
|
||||
}));
|
||||
};
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Line.displayName = 'Line';
|
||||
}
|
||||
export default Line;
|
||||
3
frontend/node_modules/rc-progress/es/common.d.ts
generated
vendored
Normal file
3
frontend/node_modules/rc-progress/es/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { ProgressProps } from './interface';
|
||||
export declare const defaultProps: Partial<ProgressProps>;
|
||||
export declare const useTransitionDuration: () => SVGPathElement[];
|
||||
34
frontend/node_modules/rc-progress/es/common.js
generated
vendored
Normal file
34
frontend/node_modules/rc-progress/es/common.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { useRef, useEffect } from 'react';
|
||||
export var defaultProps = {
|
||||
percent: 0,
|
||||
prefixCls: 'rc-progress',
|
||||
strokeColor: '#2db7f5',
|
||||
strokeLinecap: 'round',
|
||||
strokeWidth: 1,
|
||||
trailColor: '#D9D9D9',
|
||||
trailWidth: 1,
|
||||
gapPosition: 'bottom'
|
||||
};
|
||||
export var useTransitionDuration = function useTransitionDuration() {
|
||||
var pathsRef = useRef([]);
|
||||
var prevTimeStamp = useRef(null);
|
||||
useEffect(function () {
|
||||
var now = Date.now();
|
||||
var updated = false;
|
||||
pathsRef.current.forEach(function (path) {
|
||||
if (!path) {
|
||||
return;
|
||||
}
|
||||
updated = true;
|
||||
var pathStyle = path.style;
|
||||
pathStyle.transitionDuration = '.3s, .3s, .3s, .06s';
|
||||
if (prevTimeStamp.current && now - prevTimeStamp.current < 100) {
|
||||
pathStyle.transitionDuration = '0s, 0s';
|
||||
}
|
||||
});
|
||||
if (updated) {
|
||||
prevTimeStamp.current = Date.now();
|
||||
}
|
||||
});
|
||||
return pathsRef.current;
|
||||
};
|
||||
4
frontend/node_modules/rc-progress/es/hooks/useId.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-progress/es/hooks/useId.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/** Is client side and not jsdom */
|
||||
export declare const isBrowserClient: boolean;
|
||||
declare const _default: (id?: string) => string;
|
||||
export default _default;
|
||||
33
frontend/node_modules/rc-progress/es/hooks/useId.js
generated
vendored
Normal file
33
frontend/node_modules/rc-progress/es/hooks/useId.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
||||
import * as React from 'react';
|
||||
import canUseDom from "rc-util/es/Dom/canUseDom";
|
||||
var uuid = 0;
|
||||
|
||||
/** Is client side and not jsdom */
|
||||
export var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
|
||||
|
||||
/** Get unique id for accessibility usage */
|
||||
function getUUID() {
|
||||
var retId;
|
||||
|
||||
// Test never reach
|
||||
/* istanbul ignore if */
|
||||
if (isBrowserClient) {
|
||||
retId = uuid;
|
||||
uuid += 1;
|
||||
} else {
|
||||
retId = 'TEST_OR_SSR';
|
||||
}
|
||||
return retId;
|
||||
}
|
||||
export default (function (id) {
|
||||
// Inner id for accessibility usage. Only work in client side
|
||||
var _React$useState = React.useState(),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
innerId = _React$useState2[0],
|
||||
setInnerId = _React$useState2[1];
|
||||
React.useEffect(function () {
|
||||
setInnerId("rc_progress_".concat(getUUID()));
|
||||
}, []);
|
||||
return id || innerId;
|
||||
});
|
||||
10
frontend/node_modules/rc-progress/es/index.d.ts
generated
vendored
Normal file
10
frontend/node_modules/rc-progress/es/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference types="react" />
|
||||
import Line from './Line';
|
||||
import Circle from './Circle';
|
||||
export type { ProgressProps } from './interface';
|
||||
export { Line, Circle };
|
||||
declare const _default: {
|
||||
Line: import("react").FC<import("./interface").ProgressProps>;
|
||||
Circle: import("react").FC<import("./interface").ProgressProps>;
|
||||
};
|
||||
export default _default;
|
||||
7
frontend/node_modules/rc-progress/es/index.js
generated
vendored
Normal file
7
frontend/node_modules/rc-progress/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import Line from "./Line";
|
||||
import Circle from "./Circle";
|
||||
export { Line, Circle };
|
||||
export default {
|
||||
Line: Line,
|
||||
Circle: Circle
|
||||
};
|
||||
26
frontend/node_modules/rc-progress/es/interface.d.ts
generated
vendored
Normal file
26
frontend/node_modules/rc-progress/es/interface.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/// <reference types="react" />
|
||||
export interface ProgressProps {
|
||||
id?: string;
|
||||
strokeWidth?: number;
|
||||
trailWidth?: number;
|
||||
className?: string;
|
||||
percent?: number | number[];
|
||||
strokeColor?: StrokeColorType;
|
||||
trailColor?: string;
|
||||
strokeLinecap?: StrokeLinecapType;
|
||||
prefixCls?: string;
|
||||
style?: React.CSSProperties;
|
||||
gapDegree?: number;
|
||||
gapPosition?: GapPositionType;
|
||||
transition?: string;
|
||||
onClick?: React.MouseEventHandler;
|
||||
steps?: number | {
|
||||
count: number;
|
||||
gap: number;
|
||||
};
|
||||
}
|
||||
export type StrokeColorObject = Record<string, string>;
|
||||
export type BaseStrokeColorType = string | StrokeColorObject;
|
||||
export type StrokeColorType = BaseStrokeColorType | BaseStrokeColorType[];
|
||||
export type GapPositionType = 'top' | 'right' | 'bottom' | 'left';
|
||||
export type StrokeLinecapType = 'round' | 'butt' | 'square';
|
||||
1
frontend/node_modules/rc-progress/es/interface.js
generated
vendored
Normal file
1
frontend/node_modules/rc-progress/es/interface.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in New Issue
Block a user