UNPKG

react-cohort-graph-2

Version:

Cohort Analysis Graph with ReactJS. Updated by Mikhail Monchak

149 lines (122 loc) 5.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.scrollableTablePart = exports.scrollableTableContent = exports.fixedTablePart = exports.headerLabel = exports.headerValue = exports.tableCell = exports.tableBody = exports.tableHeading = exports.tableRow = exports.table = exports.wrapper = exports.DEFAULT_BORDER = exports.DEFAULT_SHADE_COLOR = exports.DEFAULT_HEADER_CELL_COLOR = exports.DEFAULT_KEY_CELL_COLOR = exports.DEFAULT_BODY_CELL_COLOR = void 0; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Created by jyothi on 5/6/17. */ var DEFAULT_BODY_CELL_COLOR = "#F5F5F5"; exports.DEFAULT_BODY_CELL_COLOR = DEFAULT_BODY_CELL_COLOR; var DEFAULT_KEY_CELL_COLOR = "#F6F6F6"; exports.DEFAULT_KEY_CELL_COLOR = DEFAULT_KEY_CELL_COLOR; var DEFAULT_HEADER_CELL_COLOR = "#F5F5F5"; exports.DEFAULT_HEADER_CELL_COLOR = DEFAULT_HEADER_CELL_COLOR; var DEFAULT_SHADE_COLOR = "#3f83a3"; exports.DEFAULT_SHADE_COLOR = DEFAULT_SHADE_COLOR; var DEFAULT_BORDER = "1px solid #F1F1F1"; exports.DEFAULT_BORDER = DEFAULT_BORDER; var wrapper = function wrapper() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ width: "100%", padding: 0, margin: 0 }, custom); }; exports.wrapper = wrapper; var table = function table() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ display: 'table', width: "100%", borderCollapse: 'collapse', textAlign: 'center', borderLeft: DEFAULT_BORDER }, custom); }; exports.table = table; var tableRow = function tableRow() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ display: 'table-row' }, custom); }; exports.tableRow = tableRow; var tableHeading = function tableHeading() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ display: 'table-header-group', fontWeight: 'bold', padding: '15px 30px', borderBottom: DEFAULT_BORDER, borderTop: DEFAULT_BORDER }, custom); }; exports.tableHeading = tableHeading; var tableBody = function tableBody() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ display: 'table-row-group' }, custom); }; exports.tableBody = tableBody; var tableCell = function tableCell() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ display: 'table-cell', padding: '5px 10px', borderBottom: '1px solid #DDD', borderRight: DEFAULT_BORDER, minWidth: '60px', whiteSpace: 'nowrap' }, custom); }; exports.tableCell = tableCell; var headerValue = function headerValue() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ fontSize: '12px' }, custom); }; exports.headerValue = headerValue; var headerLabel = function headerLabel() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ fontSize: '16px', padding: '0', margin: '0' }, custom); }; exports.headerLabel = headerLabel; var fixedTablePart = function fixedTablePart() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ display: 'table-cell', minWidth: '200px' }, custom); }; exports.fixedTablePart = fixedTablePart; var scrollableTableContent = function scrollableTableContent() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ position: 'relative', display: 'block' }, custom); }; exports.scrollableTableContent = scrollableTableContent; var scrollableTablePart = function scrollableTablePart() { var custom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return { display: 'table-cell', overflowX: 'auto', whiteSpace: 'nowrap', width: "100%", minWidth: 60, custom: custom }; }; exports.scrollableTablePart = scrollableTablePart;