UNPKG

@mikezimm/npmfunctions

Version:
159 lines 7.97 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var React = __importStar(require("react")); require('./SinglePage.css'); var SinglePage = /** @class */ (function (_super) { __extends(SinglePage, _super); /*** * .o88b. .d88b. d8b db .d8888. d888888b d8888b. db db .o88b. d888888b .d88b. d8888b. * d8P Y8 .8P Y8. 888o 88 88' YP `~~88~~' 88 `8D 88 88 d8P Y8 `~~88~~' .8P Y8. 88 `8D * 8P 88 88 88V8o 88 `8bo. 88 88oobY' 88 88 8P 88 88 88 88oobY' * 8b 88 88 88 V8o88 `Y8b. 88 88`8b 88 88 8b 88 88 88 88`8b * Y8b d8 `8b d8' 88 V888 db 8D 88 88 `88. 88b d88 Y8b d8 88 `8b d8' 88 `88. * `Y88P' `Y88P' VP V8P `8888Y' YP 88 YD ~Y8888P' `Y88P' YP `Y88P' 88 YD * * */ function SinglePage(props) { var _this = _super.call(this, props) || this; _this.state = {}; return _this; } SinglePage.prototype.componentDidMount = function () { }; /*** * d8888b. d888888b d8888b. db db d8888b. d8888b. .d8b. d888888b d88888b * 88 `8D `88' 88 `8D 88 88 88 `8D 88 `8D d8' `8b `~~88~~' 88' * 88 88 88 88 88 88 88 88oodD' 88 88 88ooo88 88 88ooooo * 88 88 88 88 88 88 88 88~~~ 88 88 88~~~88 88 88~~~~~ * 88 .8D .88. 88 .8D 88b d88 88 88 .8D 88 88 88 88. * Y8888D' Y888888P Y8888D' ~Y8888P' 88 Y8888D' YP YP YP Y88888P * * */ SinglePage.prototype.componentDidUpdate = function (prevProps) { }; /*** * d8888b. d88888b d8b db d8888b. d88888b d8888b. * 88 `8D 88' 888o 88 88 `8D 88' 88 `8D * 88oobY' 88ooooo 88V8o 88 88 88 88ooooo 88oobY' * 88`8b 88~~~~~ 88 V8o88 88 88 88~~~~~ 88`8b * 88 `88. 88. 88 V888 88 .8D 88. 88 `88. * 88 YD Y88888P VP V8P Y8888D' Y88888P 88 YD * * */ SinglePage.prototype.render = function () { if (this.props.allLoaded && this.props.showInfo) { console.log('SinglePage.tsx', this.props, this.state); if (!this.props.content) { console.log('infoPages.tsx return null'); return (React.createElement("div", null, "Oops! There is no content available for this tab.")); } else { /*** * d888888b db db d888888b .d8888. d8888b. .d8b. d888b d88888b * `~~88~~' 88 88 `88' 88' YP 88 `8D d8' `8b 88' Y8b 88' * 88 88ooo88 88 `8bo. 88oodD' 88ooo88 88 88ooooo * 88 88~~~88 88 `Y8b. 88~~~ 88~~~88 88 ooo 88~~~~~ * 88 88 88 .88. db 8D 88 88 88 88. ~8~ 88. * YP YP YP Y888888P `8888Y' 88 YP YP Y888P Y88888P * * */ var thisTable = null; var propsTable = this.props.content.table; if (propsTable && propsTable.rows.length > 0) { var heading = propsTable.heading ? React.createElement("h2", null, " ", propsTable.heading, " ") : null; var tableHeaders = propsTable.headers.map(function (header) { return React.createElement("th", null, header); }); var tableRows = propsTable.rows.map(function (row) { var cells = row.map(function (cell) { var style = null; if (cell['style']) { style = cell['style']; } return React.createElement("td", { style: style }, cell['style'] ? cell['info'] : cell, " "); }); return React.createElement("tr", null, cells); }); thisTable = React.createElement("div", null, heading, React.createElement("table", { className: 'single-page-info-table' }, tableHeaders, tableRows)); } /*** * d8888b. d88888b d888888b db db d8888b. d8b db * 88 `8D 88' `~~88~~' 88 88 88 `8D 888o 88 * 88oobY' 88ooooo 88 88 88 88oobY' 88V8o 88 * 88`8b 88~~~~~ 88 88 88 88`8b 88 V8o88 * 88 `88. 88. 88 88b d88 88 `88. 88 V888 * 88 YD Y88888P YP ~Y8888P' 88 YD VP V8P * * */ return (React.createElement("div", { className: 'single-page-info-pane', style: { paddingTop: '10px' } }, this.props.content.header, this.props.content.html1, thisTable, this.props.content.html2, this.props.content.footer)); } } else { console.log('infoPages.tsx return null'); return (React.createElement("div", null, " ", null, " ")); } }; //End Public Render return SinglePage; }(React.Component)); exports.default = SinglePage; //# sourceMappingURL=SinglePage.js.map