UNPKG

@tdb/util

Version:
45 lines 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var common_1 = require("../common"); var constants_1 = require("./constants"); var Editor = (function (_super) { tslib_1.__extends(Editor, _super); function Editor() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.inputRef = function (ref) { return (_this.input = ref); }; return _this; } Editor.prototype.render = function () { var _a = this.props.fontSize, fontSize = _a === void 0 ? constants_1.DEFAULTS.FONT_SIZE : _a; var styles = { input: common_1.css({ fontSize: fontSize, }), }; return (common_1.React.createElement("div", tslib_1.__assign({}, STYLES.base), common_1.React.createElement("input", tslib_1.__assign({ ref: this.inputRef }, common_1.css(STYLES.input, styles.input))))); }; return Editor; }(common_1.React.PureComponent)); exports.Editor = Editor; var STYLES = { base: common_1.css({ position: 'relative', boxSizing: 'border-box', display: 'inline-block', background: 'white', border: "solid 1px " + common_1.color.format(-0.15), borderRadius: 1, boxShadow: "0 1px 3px 0 " + common_1.color.format(-0.1), }), input: common_1.css({ position: 'relative', border: 'none', width: '100%', outline: 'none', background: 'transparent', fontFamily: constants_1.FONT_FAMILY, }), }; //# sourceMappingURL=Editor.js.map