Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setValue(e.target.value)}
{...this.props}
/>
);
};
};
FormInputElement.contextTypes = {
displayValidationErrors: PropTypes.bool
};
export default HOC(FormInputElement);
)
}
}
ColorSelector.propTypes = {
defaultColors: PropTypes.array.isRequired
}
ColorSelector.defaultProps = {
onChange: () => {},
value: [],
defaultColors: []
}
export default hoc(ColorSelector)
<span>{errorMessage}</span>
);
}
changeValue(event) {
this.setState({ init: false });
const { setValue, type } = this.props;
const target = event.currentTarget;
if (type !== 'checkbox') {
setValue(target.value);
}
}
}
export default HOC(Input);
transitionLeaveTimeout={500}>
{errorMessage != "" ? <span>{errorMessage}</span> : null}
<input value="{this.props.getValue()" name="{this.props.name}" type="{this.props.type}">
);
}
}
export default HOC(GInput);
{ hasError ? (<p>{errorMessage}</p>) : null}
)
}
}
DevicesComponent.defaultProps = {
optionsSet: deviceSets,
onChange: () => {}
}
DevicesComponent.propTypes = {
optionsSet: PropTypes.arrayOf(PropTypes.object).isRequired
}
export default hoc(DevicesComponent)
}
}
SpecScreens.propTypes = {
screens: PropTypes.arrayOf(PropTypes.object).isRequired,
questions: PropTypes.arrayOf(PropTypes.object).isRequired,
project: PropTypes.object.isRequired,
dirtyProject: PropTypes.object.isRequired,
additionalClass: PropTypes.string
}
SpecScreens.defaultProps = {
additionalClass: '',
}
export default hoc(SpecScreens)
}
SelectDropdown.propTypes = {
onSelect : PT.func,
options : PT.arrayOf(PT.shape({
title: PT.string.isRequired,
value: PT.string.isRequired,
disabled: PT.bool,
confirm: PT.oneOfType([PT.string, PT.bool]),
toolTipMessage: PT.string,
})).isRequired,
theme : PT.string,
selectedOption : PT.object
}
export default hoc(SelectDropdown)
noOptionsMessage={() => 'No results found'}
options={selectGroupOptions}
isDisabled={questionDisabled}
/>
{ hasError && (<p>{errorMessage}</p>) }
)
}
}
SkillsQuestion.defaultProps = {
onChange: () => {}
}
export default hoc(SkillsQuestion)
}
changeValue(event) {
const hasMultiple = get(event.target.attributes, 'multiple', false);
const { setValue } = this.props;
const selected = event.target;
const values = [...selected.options].filter(option => option.selected).map(option => option.value);
if (!hasMultiple) {
setValue(values[0]);
} else {
setValue(values);
}
}
}
export default HOC(Select);
var Formsy = require('formsy-react');
var React = require('react');
require('./general-error.scss');
/*
* A special formsy-react component that only outputs
* error messages. If you want to display errors that
* don't apply to a specific field, insert one of these,
* give it a name, and apply your validation error to
* the name of the GeneralError component.
*/
module.exports = Formsy.HOC(React.createClass({
render: function () {
if (!this.props.showError()) return null;
return (
<p>
{this.props.getErrorMessage()}
</p>
);
}
}));