ldx-widgets
Version:
widgets
39 lines (35 loc) • 1.06 kB
text/coffeescript
React = require 'react'
createClass = require 'create-react-class'
{div, h3, label, button} = React.DOM
GridFormAddButton = (props) ->
{handleClick, formLabel, tabIndex, labelColumnClass, className, inputColumnClass, type, title, disabled} = props
if formLabel?
div {
className: className or 'grid grid-pad'
}, [
div {
key: 'label'
className: labelColumnClass or 'col-3-12'
}, label {className: 'form-label'}, formLabel
div {
key: 'button'
className: inputColumnClass or 'col-9-12'
}, button {
className: "btn-plus-minus #{type or 'plus'} large"
onClick: handleClick
tabIndex: tabIndex or -1
title: title
disabled: disabled
}
]
else
div {
className: inputColumnClass or 'col-9-12'
}, button {
className: "btn-plus-minus #{type or 'plus'} large"
onClick: handleClick
tabIndex: tabIndex or -1
title: title
disabled: disabled
}
module.exports = GridFormAddButton