UNPKG

ldx-widgets

Version:

widgets

49 lines (42 loc) 1.65 kB
(function() { var GridFormAddButton, React, button, createClass, div, h3, label, ref; React = require('react'); createClass = require('create-react-class'); ref = require('react-dom-factories'), div = ref.div, h3 = ref.h3, label = ref.label, button = ref.button; GridFormAddButton = function(props) { var className, disabled, formLabel, handleClick, inputColumnClass, labelColumnClass, tabIndex, title, type; handleClick = props.handleClick, formLabel = props.formLabel, tabIndex = props.tabIndex, labelColumnClass = props.labelColumnClass, className = props.className, inputColumnClass = props.inputColumnClass, type = props.type, title = props.title, disabled = props.disabled; if (formLabel != null) { return div({ className: className || 'grid grid-pad' }, [ div({ key: 'label', className: labelColumnClass || 'col-3-12' }, label({ className: 'form-label' }, formLabel)), div({ key: 'button', className: inputColumnClass || 'col-9-12' }, button({ className: "btn-plus-minus " + (type || 'plus') + " large", onClick: handleClick, tabIndex: tabIndex || -1, title: title, disabled: disabled })) ]); } else { return div({ className: inputColumnClass || 'col-9-12' }, button({ className: "btn-plus-minus " + (type || 'plus') + " large", onClick: handleClick, tabIndex: tabIndex || -1, title: title, disabled: disabled })); } }; module.exports = GridFormAddButton; }).call(this);