Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-progress

Package Overview
Dependencies
Maintainers
7
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-progress - npm Package Compare versions

Comparing version 3.5.1 to 4.0.0

17

es/Circle/index.js

@@ -8,6 +8,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";

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';
import { defaultProps, useTransitionDuration } from "../common";
import useId from "../hooks/useId";
import PtgCircle from "./PtgCircle";
import { VIEW_BOX_SIZE, getCircleStyle } from "./util";
function toArray(value) {

@@ -43,6 +43,6 @@ var mergedValue = value !== null && value !== void 0 ? value : [];

count: steps,
space: 2
gap: 2
},
stepCount = _ref.count,
stepSpace = _ref.space;
stepGap = _ref.gap;
var percentList = toArray(percent);

@@ -79,2 +79,3 @@ var strokeColorList = toArray(strokeColor);

// Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
paths[index] = elem;

@@ -94,4 +95,4 @@ },

var stroke = color && _typeof(color) === 'object' ? "url(#".concat(gradientId, ")") : undefined;
var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, stepPtg, rotateDeg, gapDegree, gapPosition, color, 'butt', strokeWidth, stepSpace);
stackPtg += (perimeterWithoutGap - circleStyleForStack.strokeDashoffset + stepSpace) * 100 / perimeterWithoutGap;
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", {

@@ -98,0 +99,0 @@ key: index,

@@ -34,2 +34,3 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";

var stroke = isGradient ? "#FFF" : undefined;
// ========================== Circle ==========================

@@ -49,2 +50,3 @@ var halfSize = size / 2;

});
// ========================== Render ==========================

@@ -51,0 +53,0 @@ if (!isGradient) {

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: any, gapPosition: ProgressProps['gapPosition'] | undefined, strokeColor: StrokeColorType, strokeLinecap: ProgressProps['strokeLinecap'], strokeWidth: any, stepSpace?: number) => {
stroke: string;
strokeDasharray: string;
strokeDashoffset: number;
transform: string;
transformOrigin: string;
transition: string;
fillOpacity: number;
};
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;

@@ -5,7 +5,10 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";

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

@@ -12,0 +15,0 @@ /* istanbul ignore if */

@@ -0,1 +1,2 @@

/// <reference types="react" />
import Line from './Line';

@@ -2,0 +3,0 @@ import Circle from './Circle';

@@ -1,3 +0,3 @@

import Line from './Line';
import Circle from './Circle';
import Line from "./Line";
import Circle from "./Circle";
export { Line, Circle };

@@ -4,0 +4,0 @@ export default {

@@ -19,3 +19,3 @@ /// <reference types="react" />

count: number;
space: number;
gap: number;
};

@@ -22,0 +22,0 @@ }

@@ -7,3 +7,3 @@ import _extends from "@babel/runtime/helpers/esm/extends";

import classNames from 'classnames';
import { useTransitionDuration, defaultProps } from './common';
import { useTransitionDuration, defaultProps } from "./common";
var Line = function Line(props) {

@@ -22,2 +22,3 @@ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),

restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
// eslint-disable-next-line no-param-reassign

@@ -78,2 +79,3 @@ delete restProps.gapPosition;

// Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
paths[index] = elem;

@@ -80,0 +82,0 @@ },

@@ -20,4 +20,4 @@ "use strict";

var _excluded = ["id", "prefixCls", "steps", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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) {

@@ -53,6 +53,6 @@ var mergedValue = value !== null && value !== void 0 ? value : [];

count: steps,
space: 2
gap: 2
},
stepCount = _ref.count,
stepSpace = _ref.space;
stepGap = _ref.gap;
var percentList = toArray(percent);

@@ -89,2 +89,3 @@ var strokeColorList = toArray(strokeColor);

// Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
paths[index] = elem;

@@ -104,4 +105,4 @@ },

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, stepSpace);
stackPtg += (perimeterWithoutGap - circleStyleForStack.strokeDashoffset + stepSpace) * 100 / perimeterWithoutGap;
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", {

@@ -143,3 +144,2 @@ key: index,

}
var _default = Circle;
exports.default = _default;
var _default = exports.default = Circle;

@@ -11,4 +11,4 @@ "use strict";

var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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) {

@@ -45,2 +45,3 @@ var bg = _ref.bg,

var stroke = isGradient ? "#FFF" : undefined;
// ========================== Circle ==========================

@@ -60,2 +61,3 @@ var halfSize = size / 2;

});
// ========================== Render ==========================

@@ -88,3 +90,2 @@ if (!isGradient) {

}
var _default = PtgCircle;
exports.default = _default;
var _default = exports.default = PtgCircle;
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: any, gapPosition: ProgressProps['gapPosition'] | undefined, strokeColor: StrokeColorType, strokeLinecap: ProgressProps['strokeLinecap'], strokeWidth: any, stepSpace?: number) => {
stroke: string;
strokeDasharray: string;
strokeDashoffset: number;
transform: string;
transformOrigin: string;
transition: string;
fillOpacity: number;
};
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;

@@ -7,5 +7,4 @@ "use strict";

exports.getCircleStyle = exports.VIEW_BOX_SIZE = void 0;
var VIEW_BOX_SIZE = 100;
exports.VIEW_BOX_SIZE = VIEW_BOX_SIZE;
var getCircleStyle = function getCircleStyle(perimeter, perimeterWithoutGap, offset, percent, rotateDeg, gapDegree, gapPosition, strokeColor, strokeLinecap, strokeWidth) {
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;

@@ -39,3 +38,2 @@ var offsetDeg = offset / 100 * 360 * ((360 - gapDegree) / 360);

};
};
exports.getCircleStyle = getCircleStyle;
};

@@ -8,3 +8,3 @@ "use strict";

var _react = require("react");
var defaultProps = {
var defaultProps = exports.defaultProps = {
percent: 0,

@@ -19,4 +19,3 @@ prefixCls: 'rc-progress',

};
exports.defaultProps = defaultProps;
var useTransitionDuration = function useTransitionDuration() {
var useTransitionDuration = exports.useTransitionDuration = function useTransitionDuration() {
var pathsRef = (0, _react.useRef)([]);

@@ -43,3 +42,2 @@ var prevTimeStamp = (0, _react.useRef)(null);

return pathsRef.current;
};
exports.useTransitionDuration = useTransitionDuration;
};

@@ -12,11 +12,13 @@ "use strict";

var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 = process.env.NODE_ENV !== 'test' && (0, _canUseDom.default)();
var isBrowserClient = exports.isBrowserClient = process.env.NODE_ENV !== 'test' && (0, _canUseDom.default)();
/** Get unique id for accessibility usage */
exports.isBrowserClient = isBrowserClient;
function getUUID() {
var retId;
// Test never reach

@@ -32,3 +34,3 @@ /* istanbul ignore if */

}
var _default = function _default(id) {
var _default = exports.default = function _default(id) {
// Inner id for accessibility usage. Only work in client side

@@ -43,3 +45,2 @@ var _React$useState = React.useState(),

return id || innerId;
};
exports.default = _default;
};

@@ -0,1 +1,2 @@

/// <reference types="react" />
import Line from './Line';

@@ -2,0 +3,0 @@ import Circle from './Circle';

@@ -22,6 +22,5 @@ "use strict";

var _Circle = _interopRequireDefault(require("./Circle"));
var _default = {
var _default = exports.default = {
Line: _Line.default,
Circle: _Circle.default
};
exports.default = _default;
};

@@ -19,3 +19,3 @@ /// <reference types="react" />

count: number;
space: number;
gap: number;
};

@@ -22,0 +22,0 @@ }

@@ -16,4 +16,4 @@ "use strict";

var _excluded = ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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) {

@@ -32,2 +32,3 @@ var _defaultProps$props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _common.defaultProps), props),

restProps = (0, _objectWithoutProperties2.default)(_defaultProps$props, _excluded);
// eslint-disable-next-line no-param-reassign

@@ -88,2 +89,3 @@ delete restProps.gapPosition;

// Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
paths[index] = elem;

@@ -98,3 +100,2 @@ },

}
var _default = Line;
exports.default = _default;
var _default = exports.default = Line;
{
"name": "rc-progress",
"version": "3.5.1",
"version": "4.0.0",
"description": "progress ui component for react",

@@ -29,9 +29,11 @@ "keywords": [

"docs:build": "dumi build",
"docs:deploy": "gh-pages -d docs-dist",
"docs:deploy": "gh-pages -d dist",
"deploy": "npm run docs:build && npm run docs:deploy",
"compile": "father build",
"gh-pages": "npm run build && father doc deploy",
"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": "father test",
"test": "rc-test",
"tsc": "tsc --noEmit",

@@ -51,24 +53,27 @@ "coverage": "father test --coverage",

"devDependencies": {
"@rc-component/father-plugin": "^1.0.0",
"@testing-library/react": "^12.1.5",
"@types/classnames": "^2.2.9",
"@types/jest": "^27.5.0",
"@types/jest": "^29.4.0",
"@types/keyv": "3.1.4",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.3",
"@umijs/fabric": "^2.0.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
"@umijs/fabric": "^3.0.0",
"cross-env": "^7.0.0",
"dumi": "^1.1.0",
"dumi": "^2.0.0",
"enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.1.2",
"eslint": "^7.1.0",
"father": "^2.29.6",
"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": "^7.2.0",
"prettier": "^2.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.0.2"
"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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc