* feat(Download ScreenShot Dialog) - UI part of it * feat(Download ScreenShot Dialog) - UI part of it * feat(Download ScreenShot Dialog) - Missing Annotations showing controls * feat(Download ScreenShot Dialog) - Missing Annotations showing controls * feat(Download ScreenShot Dialog) - Partial Pull Request - Not ready to Prod yet. * feat(Download ScreenShot Dialog) - UI - v2 * feat(Download ScreenShot Dialog) - UI - v3 * feat(Download ScreenShot Dialog) - Resizing tool * feat(Download ScreenShot Dialog) - Resizing tool * feat(Download ScreenShot Dialog) - Removing hardcoded CSS left * feat(Download ScreenShot Dialog) - Bugfixes * feat(Download ScreenShot Dialog) - Bugfixes - Escape closes the modal * feat(Download ScreenShot Dialog) - Bugfixes - Responsive issues * WIP: Refactoring DownloadDialog * WIP: Refactoring DownloadDialog * Align label and hide background canvas * Add constantes and remove code not used * Reset state on close modal * Extract cornerstone to connect * Fix modal zindex and add custom canvas classname * CR Update: Add proptypes and fix useeffect warning * CR Update: Refactor hooks, styles and imports * CR Update: Remove important from css * CR Update: Update core utils test of index
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
import './Select.css';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
class Select extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
static propTypes = {
|
|
options: PropTypes.arrayOf(
|
|
PropTypes.shape({
|
|
key: PropTypes.string.isRequired,
|
|
value: PropTypes.string.isRequired,
|
|
})
|
|
),
|
|
value: PropTypes.string,
|
|
onChange: PropTypes.func,
|
|
};
|
|
|
|
handleChange = event => {
|
|
const value = event.target.value;
|
|
this.setState({ value });
|
|
if (this.props.onChange) this.props.onChange(value);
|
|
};
|
|
|
|
render() {
|
|
return (
|
|
<div className="select-ohif-container">
|
|
<label className="select-ohif-label" htmlFor={this.id}>
|
|
{this.props.label}
|
|
<select
|
|
className="form-control select-ohif"
|
|
{...this.props}
|
|
>
|
|
{this.props.options.map(({ key, value }) => {
|
|
return (
|
|
<option key={key} value={value}>
|
|
{key}
|
|
</option>
|
|
);
|
|
})}
|
|
</select>
|
|
</label>
|
|
|
|
</div>
|
|
|
|
);
|
|
}
|
|
}
|
|
|
|
export { Select };
|