diff --git a/README.md b/README.md index 7b6e027..a7748cf 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ For example: | goToStep | `function` | `integer` : `goToStep(3)` | | goToStep | `function` | `string` : `goToStep('step3')` | | goToNamedStep | `function` | `string` : `goToNamedStep('contact')` | +| stepProps | `function` | `string` : `stepProps(3)` | --- diff --git a/package-lock.json b/package-lock.json index 2f8b3ef..cae9e25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "requires": true, "packages": { "": { - "version": "5.3.7", + "version": "5.3.11", "license": "MIT", "devDependencies": { "@babel/core": "^7.8.4", @@ -2030,6 +2030,7 @@ "jest-resolve": "^25.5.1", "jest-util": "^25.5.0", "jest-worker": "^25.5.0", + "node-notifier": "^6.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^3.1.0", @@ -4251,6 +4252,7 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -6281,7 +6283,8 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1" + "optionator": "^0.8.1", + "source-map": "~0.6.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -10035,6 +10038,7 @@ "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", + "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-serializer": "^25.5.0", "jest-util": "^25.5.0", @@ -11294,6 +11298,9 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, + "dependencies": { + "graceful-fs": "^4.1.6" + }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -11367,6 +11374,13 @@ "dev": true, "dependencies": { "copy-anything": "^2.0.1", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "native-request": "^1.0.5", + "source-map": "~0.6.0", "tslib": "^1.10.0" }, "bin": { @@ -17644,8 +17658,10 @@ "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", "dev": true, "dependencies": { + "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.1" }, "optionalDependencies": { "chokidar": "^3.4.1", @@ -17681,6 +17697,7 @@ "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", + "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", diff --git a/src/index.js b/src/index.js index 022bca6..9fad91b 100644 --- a/src/index.js +++ b/src/index.js @@ -142,6 +142,9 @@ export default class StepWizard extends PureComponent { getSteps = () => React.Children.toArray(this.props.children); + /** return props of a step */ + stepProps = step => this.getSteps()[step - 1]?.props; + /** Go to first step */ firstStep = () => this.goToStep(1) @@ -186,6 +189,7 @@ export default class StepWizard extends PureComponent { const props = { currentStep: this.currentStep, totalSteps: this.totalSteps, + stepProps: this.stepProps, /** Functions */ nextStep: this.nextStep, previousStep: this.previousStep,