react-super-responsive-table
Version:
react-super-responsive-table converts your table data to a user-friendly list in mobile view.
24 lines (23 loc) • 1.15 kB
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import React from 'react';
import allowed from '../utils/allowed';
function TdInner(props) {
var headers = props.headers, children = props.children, columnKey = props.columnKey, className = props.className, colSpan = props.colSpan;
var classes = "".concat(className || '', " pivoted");
if (colSpan) {
return React.createElement("td", __assign({ "data-testid": "td" }, allowed(props)));
}
return (React.createElement("td", __assign({ "data-testid": "td" }, allowed(props), { className: classes }),
React.createElement("div", { "data-testid": "td-before", className: "tdBefore" }, headers[columnKey]), children !== null && children !== void 0 ? children : React.createElement("div", null, "\u00A0")));
}
export default TdInner;