jiro-ui
Version:
A Mithril.js UI library based from construct-ui
23 lines (22 loc) • 989 B
JavaScript
import { __assign, __rest } from "tslib";
import m from 'mithril';
import classnames from 'classnames';
import { Classes } from '../../_shared';
import { FormLabel } from './FormLabel';
import { Col } from '../grid';
var FormGroup = /** @class */ (function () {
function FormGroup() {
}
FormGroup.prototype.view = function (_a) {
var attrs = _a.attrs, children = _a.children;
var className = attrs.class, content = attrs.content, disabled = attrs.disabled, label = attrs.label, _b = attrs.span, span = _b === void 0 ? 12 : _b, htmlAttrs = __rest(attrs, ["class", "content", "disabled", "label", "span"]);
var classes = classnames(Classes.FORM_GROUP, disabled && Classes.DISABLED, className);
var innerContent = [
label && m(FormLabel, label),
content || children
];
return m(Col, __assign({ class: classes, span: span }, htmlAttrs), innerContent);
};
return FormGroup;
}());
export { FormGroup };