sws-frontend
Version:
sws frontend project
22 lines (21 loc) • 916 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
Base wrapper for all fields.
Adds a label, comment, and an error message.
If the error is defined, the field has a red hale and the error replaces the comment.
*/
var React = require("react");
var bootstrap_1 = require("../commons/bootstrap");
require("./field.scss");
exports.Field = function (p) {
var className = p.className || "field";
var label = p.noLabel ? false : true;
return React.createElement(bootstrap_1.FormGroup, { className: className, controlId: p.name, validationState: p.validation },
label &&
React.createElement(bootstrap_1.ControlLabel, { className: "field-label" }, p.name),
p.children,
React.createElement(bootstrap_1.HelpBlock, { className: "field-comment" }, p.comment));
};
exports.default = exports.Field;
//# sourceMappingURL=field.js.map