add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

9
node_modules/rc-progress/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2014-present yiminghe
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

157
node_modules/rc-progress/README.md generated vendored Normal file
View File

@@ -0,0 +1,157 @@
# rc-progress
Progress Bar.
[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][coveralls-image]][coveralls-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
[npm-image]: http://img.shields.io/npm/v/rc-progress.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-progress
[github-actions-image]: https://github.com/react-component/progress/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/progress/actions
[circleci-image]: https://img.shields.io/circleci/react-component/progress/master?style=flat-square
[circleci-url]: https://circleci.com/gh/react-component/progress
[coveralls-image]: https://img.shields.io/coveralls/react-component/progress.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/progress?branch=master
[david-url]: https://david-dm.org/react-component/progress
[david-image]: https://david-dm.org/react-component/progress/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/react-component/progress?type=dev
[david-dev-image]: https://david-dm.org/react-component/progress/dev-status.svg?style=flat-square
[download-image]: https://img.shields.io/npm/dm/rc-progress.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-progress
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-progress
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-progress
## Example
https://progress.react-component.vercel.app/
## Screenshots
<img src="https://t.alipayobjects.com/images/T12p8gXjpgXXXXXXXX.gif" />
## Browsers
* support IE9+, Chrome, Firefox, Safari
## Install
[![rc-progress](https://nodei.co/npm/rc-progress.png)](https://npmjs.org/package/rc-progress)
## Usage
```js
import { Line, Circle } from 'rc-progress';
export default () => (
<>
<Line percent={10} strokeWidth={4} strokeColor="#D3D3D3" />
<Circle percent={10} strokeWidth={4} strokeColor="#D3D3D3" />
</>
);
```
## Compatibility
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Electron |
| --- | --- | --- | --- | --- |
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## API
### props
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width: 100px;">name</th>
<th style="width: 50px;">type</th>
<th style="width: 50px;">default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>strokeWidth</td>
<td>Number</td>
<td>1</td>
<td>Width of the stroke. Unit is percentage of SVG canvas size.</td>
</tr>
<tr>
<td>strokeColor</td>
<td>String</td>
<td>#2db7f5</td>
<td>Stroke color.</td>
</tr>
<tr>
<td>trailWidth</td>
<td>Number</td>
<td>1</td>
<td>Width of the trail stroke. Unit is percentage of SVG canvas size. Trail is always centered relative to actual progress path. If trailWidth is not defined, it is the same as strokeWidth.</td>
</tr>
<tr>
<td>trailColor</td>
<td>String</td>
<td>#D9D9D9</td>
<td>Color for lighter trail stroke underneath the actual progress path.</td>
</tr>
<tr>
<td>strokeLinecap</td>
<td>String</td>
<td>'round'</td>
<td>The shape to be used at the end of the progress bar: can be `butt`, `square` or `round`.</td>
</tr>
<tr>
<td>prefixCls</td>
<td>String</td>
<td>rc-progress</td>
<td>prefix className for component</td>
</tr>
<tr>
<td>className</td>
<td>String</td>
<td></td>
<td>customized className</td>
</tr>
<tr>
<td>style</td>
<td>Object</td>
<td></td>
<td>style object will be added to svg element</td>
</tr>
<tr>
<td>percent</td>
<td>Number | Number[]</td>
<td>0</td>
<td>the percent of the progress</td>
</tr>
<tr>
<td>gapDegree</td>
<td>Number</td>
<td>0</td>
<td>the gap degree of half circle, 0 - 360</td>
</tr>
<tr>
<td>gapPosition</td>
<td>String</td>
<td>top</td>
<td>the gap position: can be `top`, `bottom`, `left`, or `right`. </td>
</tr>
</tbody>
</table>
## Installation
```
npm install --save rc-progress
```
## Development
```
npm install
npm start
```
## License
rc-progress is released under the MIT license.

17
node_modules/rc-progress/es/Circle/PtgCircle.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/Circle/PtgCircle.js generated vendored Normal file
View 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
node_modules/rc-progress/es/Circle/index.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/Circle/index.js generated vendored Normal file
View 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
node_modules/rc-progress/es/Circle/util.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/Circle/util.js generated vendored Normal file
View 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
node_modules/rc-progress/es/Line.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/Line.js generated vendored Normal file
View 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
node_modules/rc-progress/es/common.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { ProgressProps } from './interface';
export declare const defaultProps: Partial<ProgressProps>;
export declare const useTransitionDuration: () => SVGPathElement[];

34
node_modules/rc-progress/es/common.js generated vendored Normal file
View 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
node_modules/rc-progress/es/hooks/useId.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/hooks/useId.js generated vendored Normal file
View 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
node_modules/rc-progress/es/index.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import Line from "./Line";
import Circle from "./Circle";
export { Line, Circle };
export default {
Line: Line,
Circle: Circle
};

26
node_modules/rc-progress/es/interface.d.ts generated vendored Normal file
View 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
node_modules/rc-progress/es/interface.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

17
node_modules/rc-progress/lib/Circle/PtgCircle.d.ts generated vendored Normal file
View 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;

87
node_modules/rc-progress/lib/Circle/PtgCircle.js generated vendored Normal file
View File

@@ -0,0 +1,87 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof3 = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 && (0, _typeof2.default)(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';
}
var _default = exports.default = PtgCircle;

4
node_modules/rc-progress/lib/Circle/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import * as React from 'react';
import type { ProgressProps } from '../interface';
declare const Circle: React.FC<ProgressProps>;
export default Circle;

140
node_modules/rc-progress/lib/Circle/index.js generated vendored Normal file
View File

@@ -0,0 +1,140 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof3 = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _common = require("../common");
var _useId = _interopRequireDefault(require("../hooks/useId"));
var _PtgCircle = _interopRequireDefault(require("./PtgCircle"));
var _util = require("./util");
var _excluded = ["id", "prefixCls", "steps", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"];
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _common.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 = (0, _objectWithoutProperties2.default)(_defaultProps$props, _excluded);
var halfSize = _util.VIEW_BOX_SIZE / 2;
var mergedId = (0, _useId.default)(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 = (0, _typeof2.default)(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 && (0, _typeof2.default)(color) === 'object';
});
var isConicGradient = gradient && (0, _typeof2.default)(gradient) === 'object';
var mergedStrokeLinecap = isConicGradient ? 'butt' : strokeLinecap;
var circleStyle = (0, _util.getCircleStyle)(perimeter, perimeterWithoutGap, 0, 100, rotateDeg, gapDegree, gapPosition, trailColor, mergedStrokeLinecap, strokeWidth);
var paths = (0, _common.useTransitionDuration)();
var getStokeList = function getStokeList() {
var stackPtg = 0;
return percentList.map(function (ptg, index) {
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
var circleStyleForStack = (0, _util.getCircleStyle)(perimeter, perimeterWithoutGap, stackPtg, ptg, rotateDeg, gapDegree, gapPosition, color, mergedStrokeLinecap, strokeWidth);
stackPtg += ptg;
return /*#__PURE__*/React.createElement(_PtgCircle.default, {
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: _util.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 && (0, _typeof2.default)(color) === 'object' ? "url(#".concat(gradientId, ")") : undefined;
var circleStyleForStack = (0, _util.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", (0, _extends2.default)({
className: (0, _classnames.default)("".concat(prefixCls, "-circle"), className),
viewBox: "0 0 ".concat(_util.VIEW_BOX_SIZE, " ").concat(_util.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';
}
var _default = exports.default = Circle;

5
node_modules/rc-progress/lib/Circle/util.d.ts generated vendored Normal file
View 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;

37
node_modules/rc-progress/lib/Circle/util.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCircleStyle = exports.VIEW_BOX_SIZE = void 0;
var VIEW_BOX_SIZE = exports.VIEW_BOX_SIZE = 100;
var getCircleStyle = exports.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
node_modules/rc-progress/lib/Line.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import * as React from 'react';
import type { ProgressProps } from './interface';
declare const Line: React.FC<ProgressProps>;
export default Line;

97
node_modules/rc-progress/lib/Line.js generated vendored Normal file
View File

@@ -0,0 +1,97 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _common = require("./common");
var _excluded = ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"];
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
var Line = function Line(props) {
var _defaultProps$props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _common.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 = (0, _objectWithoutProperties2.default)(_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 = (0, _common.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", (0, _extends2.default)({
className: (0, _classnames.default)("".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';
}
var _default = exports.default = Line;

3
node_modules/rc-progress/lib/common.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { ProgressProps } from './interface';
export declare const defaultProps: Partial<ProgressProps>;
export declare const useTransitionDuration: () => SVGPathElement[];

40
node_modules/rc-progress/lib/common.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useTransitionDuration = exports.defaultProps = void 0;
var _react = require("react");
var defaultProps = exports.defaultProps = {
percent: 0,
prefixCls: 'rc-progress',
strokeColor: '#2db7f5',
strokeLinecap: 'round',
strokeWidth: 1,
trailColor: '#D9D9D9',
trailWidth: 1,
gapPosition: 'bottom'
};
var useTransitionDuration = exports.useTransitionDuration = function useTransitionDuration() {
var pathsRef = (0, _react.useRef)([]);
var prevTimeStamp = (0, _react.useRef)(null);
(0, _react.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
node_modules/rc-progress/lib/hooks/useId.d.ts generated vendored Normal file
View 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;

43
node_modules/rc-progress/lib/hooks/useId.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isBrowserClient = exports.default = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var React = _interopRequireWildcard(require("react"));
var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
var uuid = 0;
/** Is client side and not jsdom */
var isBrowserClient = exports.isBrowserClient = process.env.NODE_ENV !== 'test' && (0, _canUseDom.default)();
/** 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;
}
var _default = exports.default = function _default(id) {
// Inner id for accessibility usage. Only work in client side
var _React$useState = React.useState(),
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
innerId = _React$useState2[0],
setInnerId = _React$useState2[1];
React.useEffect(function () {
setInnerId("rc_progress_".concat(getUUID()));
}, []);
return id || innerId;
};

10
node_modules/rc-progress/lib/index.d.ts generated vendored Normal file
View 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;

25
node_modules/rc-progress/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Circle", {
enumerable: true,
get: function get() {
return _Circle.default;
}
});
Object.defineProperty(exports, "Line", {
enumerable: true,
get: function get() {
return _Line.default;
}
});
exports.default = void 0;
var _Line = _interopRequireDefault(require("./Line"));
var _Circle = _interopRequireDefault(require("./Circle"));
var _default = exports.default = {
Line: _Line.default,
Circle: _Circle.default
};

26
node_modules/rc-progress/lib/interface.d.ts generated vendored Normal file
View 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';

5
node_modules/rc-progress/lib/interface.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

77
node_modules/rc-progress/package.json generated vendored Normal file
View File

@@ -0,0 +1,77 @@
{
"name": "rc-progress",
"version": "4.0.0",
"description": "progress ui component for react",
"keywords": [
"react",
"react-component",
"react-progress",
"progress"
],
"homepage": "http://github.com/react-component/progress",
"repository": {
"type": "git",
"url": "git@github.com:react-component/progress.git"
},
"bugs": {
"url": "http://github.com/react-component/progress/issues"
},
"license": "MIT",
"main": "./lib/index",
"module": "./es/index",
"files": [
"lib",
"es"
],
"scripts": {
"start": "dumi dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d dist",
"deploy": "npm run docs:build && npm run docs:deploy",
"compile": "father build",
"prepare": "dumi setup",
"gh-pages": "npm run now-build && father doc deploy",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"test": "rc-test",
"tsc": "tsc --noEmit",
"coverage": "father test --coverage",
"now-build": "npm run docs:build"
},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
},
"dependencies": {
"@babel/runtime": "^7.10.1",
"classnames": "^2.2.6",
"rc-util": "^5.16.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.0",
"@testing-library/react": "^12.1.5",
"@types/classnames": "^2.2.9",
"@types/jest": "^29.4.0",
"@types/keyv": "3.1.4",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.3",
"@umijs/fabric": "^3.0.0",
"cross-env": "^7.0.0",
"dumi": "^2.0.0",
"enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.1.2",
"eslint": "^8.57.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-unicorn": "^50.0.1",
"father": "^4.0.0",
"glob": "^8.0.1",
"np": "^10.0.1",
"prettier": "^3.1.1",
"rc-test": "^7.0.15",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"typescript": "^5.0.0"
}
}