Skip to content

Commit

Permalink
fix changelog conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
chriddyp committed Nov 19, 2017
1 parent d3e06b2 commit 5405cd8
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 56 deletions.
30 changes: 29 additions & 1 deletion packages/dash-core-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,37 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.15.0] - 2017-11-19
### :sweat_smile: Added
- The `Interval` component has a new property: `n_intervals`. This is an
integer that increases every time that the interval passes. This allows you
to use the `Interval` component without using the `events=[Event(...)]` pattern
inside the callback.

This is similar to the `n_clicks` property of the `dash_html_components`
components.
This was the last use case for `events=[Event(...)]` inside the
`dash_core_components` library. Ultimately, we may be able to deprecate this
pattern.

### Changed
- The `dash_core_components.Input(type='number')` component actually converts
the values to floats or integers, instead of passing the numbers back as strings.
https://github.com/plotly/dash-core-components/pull/100
Big thanks to community contributor @Madhu94!

### Fixed
- The `disable_click` property in the `dcc.Upload` component now works.
https://github.com/plotly/dash-core-components/pull/106.
Big thanks to community contributor @Akronix!
- Several properties in several components had the wrong `propTypes`.
This has been fixed, improving the documentation for the Dash python classes
(and removing warnings in JS development).
Big thanks to community contributor @Akronix!

## [0.14.0] - 2017-10-17
### :sparkles: Added
- An `Upload` component! :tada:
- An `Upload` component! :tada: See [https://plot.ly/dash/dash-core-components/upload](https://plot.ly/dash/dash-core-components/upload) for docs.

## [0.13.0] - 2017-10-05
### Added
Expand Down
112 changes: 65 additions & 47 deletions packages/dash-core-components/dash_core_components/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@
},
"options": {
"type": {
"name": "shape",
"name": "arrayOf",
"value": {
"label": {
"name": "string",
"description": "The checkbox's label",
"required": false
},
"name": "shape",
"value": {
"name": "string",
"description": "The value of the checkbox. This value\ncorresponds to the items specified in the\n`values` property.",
"required": false
},
"disabled": {
"name": "bool",
"description": "If true, this checkbox is disabled and can't be clicked on.",
"required": false
"label": {
"name": "string",
"description": "The checkbox's label",
"required": false
},
"value": {
"name": "string",
"description": "The value of the checkbox. This value\ncorresponds to the items specified in the\n`values` property.",
"required": false
},
"disabled": {
"name": "bool",
"description": "If true, this checkbox is disabled and can't be clicked on.",
"required": false
}
}
}
},
Expand Down Expand Up @@ -747,22 +750,25 @@
},
"options": {
"type": {
"name": "shape",
"name": "arrayOf",
"value": {
"label": {
"name": "string",
"description": "The checkbox's label",
"required": false
},
"name": "shape",
"value": {
"name": "string",
"description": "The value of the checkbox. This value\ncorresponds to the items specified in the\n`values` property.",
"required": false
},
"disabled": {
"name": "bool",
"description": "If true, this checkbox is disabled and can't be clicked on.",
"required": false
"label": {
"name": "string",
"description": "The checkbox's label",
"required": false
},
"value": {
"name": "string",
"description": "The value of the checkbox. This value\ncorresponds to the items specified in the\n`values` property.",
"required": false
},
"disabled": {
"name": "bool",
"description": "If true, this checkbox is disabled and can't be clicked on.",
"required": false
}
}
}
},
Expand Down Expand Up @@ -1594,18 +1600,27 @@
"required": false,
"description": "If True, the interval will no longer trigger\nan event."
},
"n_intervals": {
"type": {
"name": "number"
},
"required": false,
"description": "Number of times the interval has passed",
"defaultValue": {
"value": "0",
"computed": false
}
},
"fireEvent": {
"type": {
"name": "custom",
"raw": "PropTypes.function"
"name": "func"
},
"required": false,
"description": "Dash assigned callback"
},
"setProps": {
"type": {
"name": "custom",
"raw": "PropTypes.function"
"name": "func"
},
"required": false,
"description": "Dash assigned callback"
Expand Down Expand Up @@ -1776,22 +1791,25 @@
},
"options": {
"type": {
"name": "shape",
"name": "arrayOf",
"value": {
"label": {
"name": "string",
"description": "The radio item's label",
"required": false
},
"name": "shape",
"value": {
"name": "string",
"description": "The value of the radio item. This value\ncorresponds to the items specified in the\n`values` property.",
"required": false
},
"disabled": {
"name": "bool",
"description": "If true, this radio item is disabled and can't be clicked on.",
"required": false
"label": {
"name": "string",
"description": "The radio item's label",
"required": false
},
"value": {
"name": "string",
"description": "The value of the radio item. This value\ncorresponds to the items specified in the\n`values` property.",
"required": false
},
"disabled": {
"name": "bool",
"description": "If true, this radio item is disabled and can't be clicked on.",
"required": false
}
}
}
},
Expand Down Expand Up @@ -2310,7 +2328,7 @@
},
"startingLineNumber": {
"type": {
"name": "bool"
"name": "number"
},
"required": false,
"description": "if showLineNumbers is enabled the line numbering will start from here."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__version__ = '0.14.0'

__version__ = '0.15.0'
2 changes: 1 addition & 1 deletion packages/dash-core-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "0.14.0",
"version": "0.15.0",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand Down
20 changes: 15 additions & 5 deletions packages/dash-core-components/src/components/Interval.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,28 @@ export default class Interval extends Component {
}

setInterval(props) {
const {interval, fireEvent} = props;
const {interval, fireEvent, setProps} = props;
this.setState({
intervalId: window.setInterval(function intervalFunction(){
intervalId: window.setInterval(() => {
if (fireEvent && !props.disabled) {
fireEvent({event: 'interval'});
}
if (setProps && !props.disabled) {
setProps({n_intervals: this.props.n_intervals + 1})
}
}, interval)
});
}

componentDidMount() {
if (this.props.fireEvent) {
if (this.props.fireEvent || this.props.setProps) {
this.setInterval(this.props);
}
}

componentWillReceiveProps(nextProps) {
if (!this.props.fireEvent && nextProps.fireEvent) {
if ((!this.props.fireEvent && nextProps.fireEvent) ||
(!this.props.setProps && nextProps.setProps)) {
this.setInterval(nextProps);
} else if (
this.props.interval !== nextProps.interval &&
Expand Down Expand Up @@ -65,6 +69,11 @@ Interval.propTypes = {
*/
disabled: PropTypes.bool,

/**
* Number of times the interval has passed
*/
n_intervals: PropTypes.number,

/**
* Dash assigned callback
*/
Expand All @@ -79,5 +88,6 @@ Interval.propTypes = {
};

Interval.defaultProps = {
interval: 1000
interval: 1000,
n_intervals: 0
};

0 comments on commit 5405cd8

Please sign in to comment.