UNPKG

@up-group-ui/react-controls

Version:
24 lines 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var jsx_runtime_1 = require("react/jsx-runtime"); var styles_1 = require("./styles"); var UpInput_1 = require("../../Inputs/Input/UpInput"); var UpLabel = function (props) { var inline = props.inline, children = props.children, _a = props.text, text = _a === void 0 ? '' : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.required, required = _c === void 0 ? false : _c, _d = props.textAlign, textAlign = _d === void 0 ? 'left' : _d, _e = props.color, color = _e === void 0 ? '#7f8fa4' : _e, others = (0, tslib_1.__rest)(props, ["inline", "children", "text", "disabled", "required", "textAlign", "color"]); var onFocus = function (e) { e.preventDefault(); return false; }; var onClick = function (e) { e.preventDefault(); return false; }; return ((0, jsx_runtime_1.jsxs)("label", (0, tslib_1.__assign)({ className: (0, styles_1.getStyles)(props), onFocus: onFocus, onClick: onClick }, others, { children: [text && ((0, jsx_runtime_1.jsxs)("span", (0, tslib_1.__assign)({ className: "up-label-text" }, { children: [text, required && ((0, jsx_runtime_1.jsx)(UpInput_1.RequiredMark, { markStyle: { position: 'absolute', top: '4px', marginLeft: '4px', } }, void 0))] }), void 0)), children] }), void 0)); }; exports.default = UpLabel; //# sourceMappingURL=UpLabel.js.map