rc-progress
Advanced tools
Comparing version 3.1.4 to 3.2.0
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["id", "prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"]; | ||
import * as React from 'react'; | ||
import classNames from 'classnames'; | ||
import { useTransitionDuration, defaultProps } from './common'; | ||
var gradientSeed = 0; | ||
import useId from './hooks/useId'; | ||
@@ -13,4 +15,5 @@ function stripPercentToNumber(percent) { | ||
function toArray(symArray) { | ||
return Array.isArray(symArray) ? symArray : [symArray]; | ||
function toArray(value) { | ||
var mergedValue = value !== null && value !== void 0 ? value : []; | ||
return Array.isArray(mergedValue) ? mergedValue : [mergedValue]; | ||
} | ||
@@ -66,3 +69,4 @@ | ||
var Circle = function Circle(_ref) { | ||
var prefixCls = _ref.prefixCls, | ||
var id = _ref.id, | ||
prefixCls = _ref.prefixCls, | ||
strokeWidth = _ref.strokeWidth, | ||
@@ -78,8 +82,6 @@ trailWidth = _ref.trailWidth, | ||
percent = _ref.percent, | ||
restProps = _objectWithoutProperties(_ref, ["prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"]); | ||
restProps = _objectWithoutProperties(_ref, _excluded); | ||
var gradientId = React.useMemo(function () { | ||
gradientSeed += 1; | ||
return gradientSeed; | ||
}, []); | ||
var mergedId = useId(id); | ||
var gradientId = "".concat(mergedId, "-gradient"); | ||
@@ -93,3 +95,3 @@ var _getPathStyles = getPathStyles(0, 100, trailColor, strokeWidth, gapDegree, gapPosition), | ||
var gradient = strokeColorList.find(function (color) { | ||
return Object.prototype.toString.call(color) === '[object Object]'; | ||
return color && _typeof(color) === 'object'; | ||
}); | ||
@@ -105,3 +107,3 @@ | ||
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1]; | ||
var stroke = Object.prototype.toString.call(color) === '[object Object]' ? "url(#".concat(prefixCls, "-gradient-").concat(gradientId, ")") : ''; | ||
var stroke = color && _typeof(color) === 'object' ? "url(#".concat(gradientId, ")") : ''; | ||
var pathStyles = getPathStyles(stackPtg, ptg, color, strokeWidth, gapDegree, gapPosition); | ||
@@ -127,5 +129,6 @@ stackPtg += ptg; | ||
viewBox: "0 0 100 100", | ||
style: style | ||
style: style, | ||
id: id | ||
}, restProps), gradient && /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", { | ||
id: "".concat(prefixCls, "-gradient-").concat(gradientId), | ||
id: gradientId, | ||
x1: "100%", | ||
@@ -132,0 +135,0 @@ y1: "0%", |
@@ -1,4 +0,3 @@ | ||
/// <reference types="react" /> | ||
import { ProgressProps } from './interface'; | ||
export declare const defaultProps: Partial<ProgressProps>; | ||
export declare const useTransitionDuration: (percentList: number[]) => import("react").MutableRefObject<undefined>[][]; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import Line from './Line'; | ||
@@ -3,0 +2,0 @@ import Circle from './Circle'; |
@@ -1,3 +0,4 @@ | ||
import * as React from 'react'; | ||
/// <reference types="react" /> | ||
export interface ProgressProps { | ||
id?: string; | ||
strokeWidth?: number; | ||
@@ -16,4 +17,4 @@ trailWidth?: number; | ||
} | ||
export declare type StrokeColorType = string | string[] | object; | ||
export declare type StrokeColorType = string | string[] | Record<string, string>; | ||
export declare type GapPositionType = 'top' | 'right' | 'bottom' | 'left'; | ||
export declare type StrokeLinecapType = 'round' | 'butt' | 'square'; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
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'; | ||
@@ -19,3 +20,3 @@ import classNames from 'classnames'; | ||
transition = _ref.transition, | ||
restProps = _objectWithoutProperties(_ref, ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"]); | ||
restProps = _objectWithoutProperties(_ref, _excluded); | ||
@@ -22,0 +23,0 @@ // eslint-disable-next-line no-param-reassign |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -16,2 +16,4 @@ value: true | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
@@ -25,4 +27,6 @@ | ||
var gradientSeed = 0; | ||
var _useId = _interopRequireDefault(require("./hooks/useId")); | ||
var _excluded = ["id", "prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"]; | ||
function stripPercentToNumber(percent) { | ||
@@ -32,4 +36,5 @@ return +percent.replace('%', ''); | ||
function toArray(symArray) { | ||
return Array.isArray(symArray) ? symArray : [symArray]; | ||
function toArray(value) { | ||
var mergedValue = value !== null && value !== void 0 ? value : []; | ||
return Array.isArray(mergedValue) ? mergedValue : [mergedValue]; | ||
} | ||
@@ -85,3 +90,4 @@ | ||
var Circle = function Circle(_ref) { | ||
var prefixCls = _ref.prefixCls, | ||
var id = _ref.id, | ||
prefixCls = _ref.prefixCls, | ||
strokeWidth = _ref.strokeWidth, | ||
@@ -97,7 +103,5 @@ trailWidth = _ref.trailWidth, | ||
percent = _ref.percent, | ||
restProps = (0, _objectWithoutProperties2.default)(_ref, ["prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"]); | ||
var gradientId = React.useMemo(function () { | ||
gradientSeed += 1; | ||
return gradientSeed; | ||
}, []); | ||
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); | ||
var mergedId = (0, _useId.default)(id); | ||
var gradientId = "".concat(mergedId, "-gradient"); | ||
@@ -111,3 +115,3 @@ var _getPathStyles = getPathStyles(0, 100, trailColor, strokeWidth, gapDegree, gapPosition), | ||
var gradient = strokeColorList.find(function (color) { | ||
return Object.prototype.toString.call(color) === '[object Object]'; | ||
return color && (0, _typeof2.default)(color) === 'object'; | ||
}); | ||
@@ -123,3 +127,3 @@ | ||
var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1]; | ||
var stroke = Object.prototype.toString.call(color) === '[object Object]' ? "url(#".concat(prefixCls, "-gradient-").concat(gradientId, ")") : ''; | ||
var stroke = color && (0, _typeof2.default)(color) === 'object' ? "url(#".concat(gradientId, ")") : ''; | ||
var pathStyles = getPathStyles(stackPtg, ptg, color, strokeWidth, gapDegree, gapPosition); | ||
@@ -145,5 +149,6 @@ stackPtg += ptg; | ||
viewBox: "0 0 100 100", | ||
style: style | ||
style: style, | ||
id: id | ||
}, restProps), gradient && /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", { | ||
id: "".concat(prefixCls, "-gradient-").concat(gradientId), | ||
id: gradientId, | ||
x1: "100%", | ||
@@ -150,0 +155,0 @@ y1: "0%", |
@@ -1,4 +0,3 @@ | ||
/// <reference types="react" /> | ||
import { ProgressProps } from './interface'; | ||
export declare const defaultProps: Partial<ProgressProps>; | ||
export declare const useTransitionDuration: (percentList: number[]) => import("react").MutableRefObject<undefined>[][]; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import Line from './Line'; | ||
@@ -3,0 +2,0 @@ import Circle from './Circle'; |
@@ -8,12 +8,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "Line", { | ||
Object.defineProperty(exports, "Circle", { | ||
enumerable: true, | ||
get: function get() { | ||
return _Line.default; | ||
return _Circle.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "Circle", { | ||
Object.defineProperty(exports, "Line", { | ||
enumerable: true, | ||
get: function get() { | ||
return _Circle.default; | ||
return _Line.default; | ||
} | ||
@@ -20,0 +20,0 @@ }); |
@@ -1,3 +0,4 @@ | ||
import * as React from 'react'; | ||
/// <reference types="react" /> | ||
export interface ProgressProps { | ||
id?: string; | ||
strokeWidth?: number; | ||
@@ -16,4 +17,4 @@ trailWidth?: number; | ||
} | ||
export declare type StrokeColorType = string | string[] | object; | ||
export declare type StrokeColorType = string | string[] | Record<string, string>; | ||
export declare type GapPositionType = 'top' | 'right' | 'bottom' | 'left'; | ||
export declare type StrokeLinecapType = 'round' | 'butt' | 'square'; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -24,2 +24,4 @@ value: true | ||
var _excluded = ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"]; | ||
var Line = function Line(_ref) { | ||
@@ -36,3 +38,3 @@ var className = _ref.className, | ||
transition = _ref.transition, | ||
restProps = (0, _objectWithoutProperties2.default)(_ref, ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"]); | ||
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); | ||
// eslint-disable-next-line no-param-reassign | ||
@@ -39,0 +41,0 @@ delete restProps.gapPosition; |
{ | ||
"name": "rc-progress", | ||
"version": "3.1.4", | ||
"version": "3.2.0", | ||
"description": "progress ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37142
28
711
2