Skip to content

Commit 580c116

Browse files
authored
Merge pull request #2 from StratoDem/master
Update with the latest version of StratoDem:master
2 parents 9759217 + 66f5663 commit 580c116

10 files changed

+37
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 4.4.1 2021-03-16
6+
### Fixes
7+
- Fixes Stepper to allow activeStep to be changed by callbacks
8+
59
## 4.4.0 2021-02-02
610
### Adds
711
- Adds tooltip component

Peek 2018-02-22 10-49.gif

-817 KB
Binary file not shown.

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "sd-material-ui",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "material-ui components for Dash",
55
"main": "build/index.js",
6-
"author": "Michael Clawar, Eric Linden, Sreeja Keesara tech@stratodem.com",
6+
"author": "Michael Clawar, Eric Linden, Sreeja Keesara, Danny Kaminsky tech@stratodem.com",
77
"scripts": {
88
"start": "webpack-serve ./webpack.serve.config.js --open",
99
"validate-init": "python _validate_init.py",

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# dash is required to call `build:py`
22
dash
3+
pyyaml

sd_material_ui/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "sd-material-ui",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "material-ui components for Dash",
55
"main": "build/index.js",
6-
"author": "Michael Clawar, Eric Linden, Sreeja Keesara tech@stratodem.com",
6+
"author": "Michael Clawar, Eric Linden, Sreeja Keesara, Danny Kaminsky tech@stratodem.com",
77
"scripts": {
88
"start": "webpack-serve ./webpack.serve.config.js --open",
99
"validate-init": "python _validate_init.py",

sd_material_ui/sd_material_ui.dev.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sd_material_ui/sd_material_ui.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/Stepper.react.js

+5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ export default class Stepper extends Component<Props, State> {
9292
};
9393
}
9494

95+
UNSAFE_componentWillReceiveProps(nextProps: Props, nextContext: *): void {
96+
if (nextProps.activeStep !== this.state.stepIndex)
97+
this.setState({stepIndex: nextProps.activeStep});
98+
}
99+
95100
handleNext = () => {
96101
const {stepIndex} = this.state;
97102
const increased = stepIndex + 1;

usage.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,15 @@
386386

387387
html.Div([
388388
html.P([html.Strong('Sample for Stepper')]),
389-
sd_material_ui.Stepper(id='stepper', style={'background': 'inherit'}),
389+
sd_material_ui.Stepper(id='stepper',
390+
style={'background': 'inherit'},
391+
# nextButtonStyle={'display': 'None'},
392+
# backButtonStyle={'display': 'None'},
393+
# finishedButtonStyle={'display': 'None'},
394+
activeStep=0
395+
),
396+
html.Button('Add one step', id='stepper-button'),
397+
html.P(id='stepper-output')
390398
]),
391399

392400

@@ -434,6 +442,17 @@
434442
], style={'listStyleType': 'none'})
435443

436444

445+
@app.callback(
446+
[dash.dependencies.Output('stepper-output', 'children'),
447+
dash.dependencies.Output('stepper', 'activeStep')],
448+
[dash.dependencies.Input('stepper-button', 'n_clicks')],
449+
[
450+
dash.dependencies.State('stepper', 'activeStep')
451+
])
452+
def callback_stepper(n_clicks: int,
453+
step: int):
454+
return f'Step {step}', step + 1
455+
437456
@app.callback(
438457
dash.dependencies.Output('time-picker-output', 'children'),
439458
[dash.dependencies.Input('time-picker', 'value')],)

0 commit comments

Comments
 (0)