Repository URL to install this package:
|
Version:
0.9.6 ▾
|
ui-component-library
/
dist
/
components
/
atoms
/
Placeholder
/
TextPlaceholder
/
TextPlaceholder.js
|
|---|
"use strict";
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const Vector_1 = __importDefault(require("atoms/Vector"));
const deps_1 = require("../deps");
class TextPlaceholder extends react_1.default.PureComponent {
render() {
let _a = this.props, { fill, width, height, nowrap, style, viewBox } = _a, remainingProps = __rest(_a, ["fill", "width", "height", "nowrap", "style", "viewBox"]);
width = deps_1.stripMeasurement(width);
height = deps_1.stripMeasurement(height);
viewBox = `0 0 ${width} ${height}`;
const attributes = Object.assign({ width,
height,
viewBox }, remainingProps);
const path = (react_1.default.createElement("rect", { style: style, width: width, height: height, d: "M0 0h600v24H0z", fill: fill, fillRule: "evenodd" }));
if (nowrap === true) {
return react_1.default.createElement(react_1.default.Fragment, { key: "text" }, path);
}
else {
return (react_1.default.createElement(Vector_1.default, Object.assign({ key: "text" }, attributes), path));
}
}
}
TextPlaceholder.defaultProps = {
fill: '#D8D8D8',
viewBox: '0 0 100% 24',
width: '100%',
height: '24px',
};
exports.TextPlaceholder = TextPlaceholder;
exports.default = TextPlaceholder;
//# sourceMappingURL=TextPlaceholder.js.map