spc-vertical-stepper-nav
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -57,3 +57,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
React.createElement("div", null, | ||
React.createElement("div", { style: circleStyles }, isActive ? React.createElement("i", { className: "fa fa-check" }) : '')), | ||
React.createElement("div", { style: circleStyles }, isActive ? (React.createElement("i", { className: "fa fa-check", style: { position: 'relative', bottom: '2px' } })) : (''))), | ||
isDesktop ? React.createElement("div", { style: { paddingBottom: 2 } }, stepContent()) : '')); | ||
@@ -97,7 +97,14 @@ }; | ||
}; | ||
var checkIsActive = function (steps, index) { | ||
var _a; | ||
if (index !== steps.length) { | ||
return (_a = steps[index + 1].isActive) !== null && _a !== void 0 ? _a : false; | ||
} | ||
return false; | ||
}; | ||
var StepperNav = function (props) { | ||
return (React.createElement("nav", { style: props.isDesktop ? {} : __assign({}, displayFlex) }, props.steps.map(function (_a, index) { | ||
var stepContent = _a.stepContent, stepStateColor = _a.stepStateColor, onClickHandler = _a.onClickHandler, stepStatusCircleSize = _a.stepStatusCircleSize, isActive = _a.isActive, currentPage = _a.currentPage; | ||
var stepContent = _a.stepContent, stepStateColor = _a.stepStateColor, onClickHandler = _a.onClickHandler, stepStatusCircleSize = _a.stepStatusCircleSize, currentPage = _a.currentPage; | ||
return (React.createElement("div", { style: props.isDesktop ? {} : __assign({}, displayFlex), key: index }, | ||
React.createElement(Step, { stepContent: stepContent, statusColor: stepStateColor, onClickHandler: onClickHandler, statusCircleSize: stepStatusCircleSize, isDesktop: props.isDesktop, isActive: isActive, isCurrentPage: currentPage === index }), | ||
React.createElement(Step, { stepContent: stepContent, statusColor: stepStateColor, onClickHandler: onClickHandler, statusCircleSize: stepStatusCircleSize, isDesktop: props.isDesktop, isActive: checkIsActive(props.steps, index), isCurrentPage: currentPage === index }), | ||
index !== props.steps.length - 1 && (React.createElement("div", { style: { | ||
@@ -104,0 +111,0 @@ padding: props.isDesktop |
{ | ||
"name": "spc-vertical-stepper-nav", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "An easy to use vertical stepper component for your React projects! Currently W.I.P. Contributions/Feedback accepted!", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
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
19894
148