@bento-core/about 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/babel.config.json +21 -0
  2. package/dist/aboutBodyView.js +329 -0
  3. package/dist/aboutHeaderView.js +56 -0
  4. package/dist/assets/About-ExternalLink.svg +15 -0
  5. package/dist/assets/About-Table-ExternalLink.svg +15 -0
  6. package/dist/assets/About_CRDC.png +0 -0
  7. package/dist/assets/About_CTDC_Model.png +0 -0
  8. package/dist/assets/About_DataDictionary.png +0 -0
  9. package/dist/assets/About_Developers.png +0 -0
  10. package/dist/assets/About_Purpose.png +0 -0
  11. package/dist/assets/About_RequestAccess.png +0 -0
  12. package/dist/assets/About_Resources.png +0 -0
  13. package/dist/assets/About_Support.png +0 -0
  14. package/dist/assets/Model-Buttons-Center.svg +65 -0
  15. package/dist/assets/Model-Buttons-ZoomIn.svg +66 -0
  16. package/dist/assets/Model-Buttons-ZoomOut.svg +66 -0
  17. package/dist/assets/Photo-About_SteeringCommittee.jpg +0 -0
  18. package/dist/index.js +27 -0
  19. package/dist/xoomInOutView.js +169 -0
  20. package/package.json +29 -0
  21. package/src/aboutBodyView.js +373 -0
  22. package/src/aboutHeaderView.js +42 -0
  23. package/src/assets/About-ExternalLink.svg +15 -0
  24. package/src/assets/About-Table-ExternalLink.svg +15 -0
  25. package/src/assets/About_CRDC.png +0 -0
  26. package/src/assets/About_CTDC_Model.png +0 -0
  27. package/src/assets/About_DataDictionary.png +0 -0
  28. package/src/assets/About_Developers.png +0 -0
  29. package/src/assets/About_Purpose.png +0 -0
  30. package/src/assets/About_RequestAccess.png +0 -0
  31. package/src/assets/About_Resources.png +0 -0
  32. package/src/assets/About_Support.png +0 -0
  33. package/src/assets/Model-Buttons-Center.svg +65 -0
  34. package/src/assets/Model-Buttons-ZoomIn.svg +66 -0
  35. package/src/assets/Model-Buttons-ZoomOut.svg +66 -0
  36. package/src/assets/Photo-About_SteeringCommittee.jpg +0 -0
  37. package/src/index.js +3 -0
  38. package/src/xoomInOutView.js +153 -0
@@ -0,0 +1,66 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 42 42" style="enable-background:new 0 0 42 42;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{display:none;}
7
+ .st1{display:inline;fill:#687A91;stroke:#FFFFFF;stroke-width:0.85;stroke-miterlimit:10;}
8
+ .st2{display:inline;fill:#FFFFFF;}
9
+ .st3{fill:#687A91;stroke:#FFFFFF;stroke-width:0.85;stroke-miterlimit:10;}
10
+ .st4{fill:#FFFFFF;}
11
+ .st5{display:inline;}
12
+ </style>
13
+ <g id="Layer_1" class="st0">
14
+ <circle class="st1" cx="20.9" cy="21" r="20"/>
15
+ <path class="st2" d="M32.8,31.6l-3.9-4c1.8-2,3-4.6,3-7.5C32,14,26.9,9,20.8,9c-3,0-5.9,1.2-8,3.3c-2.1,2.1-3.2,4.8-3.2,7.8
16
+ c0,6.1,5,11.1,11.2,11.1c2.3,0,4.4-0.7,6.2-1.8l4,4.1c0.3,0.3,0.6,0.4,1,0.4c0.4,0,0.7-0.1,0.9-0.4C33.3,33,33.4,32.2,32.8,31.6z
17
+ M20.8,11.7c4.7,0,8.5,3.8,8.5,8.4c0,4.6-3.8,8.4-8.5,8.4c-4.7,0-8.5-3.8-8.5-8.4C12.2,15.5,16.1,11.7,20.8,11.7z"/>
18
+ <path class="st2" d="M25.8,21.1H16c-0.4,0-0.7-0.3-0.7-0.7v0c0-0.4,0.3-0.7,0.7-0.7h9.8c0.4,0,0.7,0.3,0.7,0.7v0
19
+ C26.5,20.8,26.2,21.1,25.8,21.1z"/>
20
+ <path class="st2" d="M20.2,25.3v-9.8c0-0.4,0.3-0.7,0.7-0.7h0c0.4,0,0.7,0.3,0.7,0.7v9.8c0,0.4-0.3,0.7-0.7,0.7h0
21
+ C20.5,26,20.2,25.7,20.2,25.3z"/>
22
+ </g>
23
+ <g id="Layer_2">
24
+ <circle class="st3" cx="20.9" cy="20.9" r="20"/>
25
+ <path class="st4" d="M32.9,31.6l-3.9-4c1.8-2,3-4.6,3-7.5C32,14,27,9,20.8,9c-3,0-5.9,1.2-8,3.3c-2.1,2.1-3.2,4.8-3.2,7.8
26
+ c0,6.1,5,11.1,11.2,11.1c2.3,0,4.4-0.7,6.2-1.8l4,4.1c0.3,0.3,0.6,0.4,1,0.4c0.4,0,0.7-0.1,0.9-0.4C33.4,33,33.4,32.2,32.9,31.6z
27
+ M20.8,11.7c4.7,0,8.5,3.8,8.5,8.4c0,4.6-3.8,8.4-8.5,8.4c-4.7,0-8.5-3.8-8.5-8.4C12.3,15.5,16.1,11.7,20.8,11.7z"/>
28
+ <path class="st4" d="M25.8,21.1H16c-0.4,0-0.7-0.3-0.7-0.7l0,0c0-0.4,0.3-0.7,0.7-0.7h9.8c0.4,0,0.7,0.3,0.7,0.7l0,0
29
+ C26.5,20.8,26.2,21.1,25.8,21.1z"/>
30
+ </g>
31
+ <g id="Layer_3" class="st0">
32
+ <circle class="st1" cx="20.8" cy="21" r="20"/>
33
+ <g class="st5">
34
+ <g>
35
+ <path class="st4" d="M34.9,20.4l-1.8-1.8c-0.3-0.3-0.7-0.3-1,0c-0.3,0.3-0.3,0.7,0,1l0.5,0.5h-7c-0.3-2.1-1.9-3.7-4-4v-7l0.5,0.5
36
+ c0.1,0.1,0.3,0.2,0.5,0.2c0.2,0,0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.7,0-1L21.3,7c-0.3-0.3-0.8-0.3-1,0l-1.8,1.8c-0.3,0.3-0.3,0.7,0,1
37
+ c0.3,0.3,0.7,0.3,1,0l0.6-0.5v7c-2.1,0.3-3.7,1.9-4,4h-7l0.5-0.5c0.3-0.3,0.3-0.8,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,0.6,0,0.8c0.2,0.2,0.6,0.2,0.8,0L20.3,9v7.3l-0.1,0
56
+ c-2,0.3-3.6,1.9-3.9,3.9l0,0.1H8.9l0.7-0.7c0.1-0.1,0.2-0.3,0.2-0.5c0-0.2-0.1-0.3-0.2-0.4c-0.2-0.2-0.6-0.2-0.9,0l-1.8,1.8
57
+ c-0.2,0.2-0.2,0.6,0,0.8l1.8,1.8c0.2,0.2,0.6,0.2,0.8,0c0.1-0.1,0.2-0.3,0.2-0.4s-0.1-0.3-0.2-0.4l-0.7-0.7h7.4l0,0.1
58
+ c0.3,2,1.9,3.6,3.9,3.9l0.1,0V33l-0.7-0.7C19.4,32.2,19.3,32.1,19.1,32.1z M20.9,24.4c-1.9,0-3.5-1.6-3.5-3.5s1.6-3.5,3.5-3.5
59
+ c1.9,0,3.5,1.6,3.5,3.5S22.8,24.4,20.9,24.4z M20.9,17.8c-1.8,0-3.2,1.4-3.2,3.2s1.4,3.2,3.2,3.2c1.8,0,3.2-1.4,3.2-3.2
60
+ S22.6,17.8,20.9,17.8z"/>
61
+ </g>
62
+ </g>
63
+ </g>
64
+ <g id="Layer_4">
65
+ </g>
66
+ </svg>
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "AboutBody", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _aboutBodyView.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "AboutHeader", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _aboutHeaderView.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "xoomInOut", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _xoomInOutView.default;
22
+ }
23
+ });
24
+ var _aboutHeaderView = _interopRequireDefault(require("./aboutHeaderView"));
25
+ var _aboutBodyView = _interopRequireDefault(require("./aboutBodyView"));
26
+ var _xoomInOutView = _interopRequireDefault(require("./xoomInOutView"));
27
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _core = require("@material-ui/core");
9
+ var _reactZoomPanPinch = require("react-zoom-pan-pinch");
10
+ var _ModelButtonsCenter = _interopRequireDefault(require("./assets/Model-Buttons-Center.svg"));
11
+ var _ModelButtonsZoomIn = _interopRequireDefault(require("./assets/Model-Buttons-ZoomIn.svg"));
12
+ var _ModelButtonsZoomOut = _interopRequireDefault(require("./assets/Model-Buttons-ZoomOut.svg"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ const limitToBounds = false;
15
+ const panningEnabled = true;
16
+ const transformEnabled = true;
17
+ const pinchEnabled = true;
18
+ const limitToWrapperBounds = false;
19
+ const disabled = false;
20
+ const dbClickEnabled = true;
21
+ const lockAxisX = false;
22
+ const lockAxisY = false;
23
+ const velocityEqualToMove = false;
24
+ const enableWheel = true;
25
+ const enableTouchPadPinch = true;
26
+ const enableVelocity = true;
27
+ const disableLimitsOnWheel = true;
28
+ const ModelPage = _ref => {
29
+ let {
30
+ classes,
31
+ children
32
+ } = _ref;
33
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, {
34
+ defaultScale: 1,
35
+ options: {
36
+ limitToBounds,
37
+ transformEnabled,
38
+ disabled
39
+ },
40
+ pan: {
41
+ disabled: !panningEnabled,
42
+ limitToWrapperBounds,
43
+ lockAxisX,
44
+ lockAxisY,
45
+ velocityEqualToMove,
46
+ velocity: enableVelocity
47
+ },
48
+ pinch: {
49
+ disabled: !pinchEnabled
50
+ },
51
+ doubleClick: {
52
+ disabled: !dbClickEnabled
53
+ },
54
+ wheel: {
55
+ wheelEnabled: enableWheel,
56
+ touchPadEnabled: enableTouchPadPinch,
57
+ disableLimitsOnWheel
58
+ }
59
+ }, _ref2 => {
60
+ let {
61
+ zoomIn,
62
+ zoomOut,
63
+ resetTransform
64
+ } = _ref2;
65
+ return /*#__PURE__*/_react.default.createElement("div", {
66
+ className: classes.modelContainer
67
+ }, /*#__PURE__*/_react.default.createElement("div", {
68
+ className: classes.tools
69
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
70
+ onClick: zoomIn,
71
+ className: classes.button
72
+ }, /*#__PURE__*/_react.default.createElement("img", {
73
+ src: _ModelButtonsZoomIn.default,
74
+ alt: "Zoom In"
75
+ })), /*#__PURE__*/_react.default.createElement(_core.Button, {
76
+ onClick: zoomOut,
77
+ className: classes.button
78
+ }, /*#__PURE__*/_react.default.createElement("img", {
79
+ src: _ModelButtonsZoomOut.default,
80
+ alt: "Zoom Out"
81
+ })), /*#__PURE__*/_react.default.createElement(_core.Button, {
82
+ onClick: resetTransform,
83
+ className: classes.button
84
+ }, /*#__PURE__*/_react.default.createElement("img", {
85
+ src: _ModelButtonsCenter.default,
86
+ alt: "Center "
87
+ }))), /*#__PURE__*/_react.default.createElement("div", {
88
+ className: classes.imgSection
89
+ }, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformComponent, null, children)));
90
+ }));
91
+ };
92
+ const styles = () => ({
93
+ linkIcon: {
94
+ width: '20px',
95
+ verticalAlign: 'sub',
96
+ margin: '0px 0px 0px 2px'
97
+ },
98
+ linkIcon2: {
99
+ width: '20px',
100
+ verticalAlign: 'sub',
101
+ margin: '0px 0px 0px 0px'
102
+ },
103
+ link: {
104
+ color: '#0296C9',
105
+ fontWeight: 'bolder',
106
+ '&:hover': {
107
+ color: '#0296C9',
108
+ fontWeight: 'bolder',
109
+ textDecoration: 'none'
110
+ }
111
+ },
112
+ title: {
113
+ color: '#0B3556',
114
+ textTransform: 'uppercase',
115
+ fontWeight: 'bold'
116
+ },
117
+ button: {
118
+ color: 'white',
119
+ '& img': {
120
+ width: '40px'
121
+ }
122
+ },
123
+ container: {
124
+ maxWidth: '1440px',
125
+ margin: 'auto'
126
+ },
127
+ tool: {
128
+ margin: '20px auto'
129
+ },
130
+ schema: {
131
+ overflowX: 'hidden',
132
+ overflowY: 'hidden',
133
+ width: '100%',
134
+ margin: 'auto'
135
+ },
136
+ imgSection: {
137
+ width: '100%',
138
+ border: '2px solid #7D92AE',
139
+ borderRadius: '23px',
140
+ marginBottom: '20px',
141
+ height: 'auto',
142
+ overflow: 'hidden',
143
+ '& .react-transform-element': {
144
+ display: '-webkit-box !important'
145
+ }
146
+ },
147
+ img: {
148
+ width: '100%'
149
+ },
150
+ modelContainer: {
151
+ display: 'flex',
152
+ maxWidth: '1440px',
153
+ margin: '-67px 40px 60px 40px',
154
+ textAlign: 'center',
155
+ '@media (min-width: 1400px)': {
156
+ margin: '-67px auto 60px auto'
157
+ }
158
+ },
159
+ tools: {
160
+ maxWidth: '60px',
161
+ height: '168px',
162
+ padding: '4px',
163
+ marginTop: '100px',
164
+ background: '#7D92AE',
165
+ borderRadius: '23px 0px 0px 23px'
166
+ }
167
+ });
168
+ var _default = (0, _core.withStyles)(styles)(ModelPage);
169
+ exports.default = _default;
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@bento-core/about",
3
+ "version": "0.2.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "build": "cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "repository": "https://github.com/CBIIT/bento-frontend",
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "peerDependencies": {
15
+ "@bento-core/facet-filter": "*",
16
+ "@material-ui/core": "^4.10.0",
17
+ "clsx": "*",
18
+ "react": "^17.0.2",
19
+ "react-dom": "^17.0.0",
20
+ "react-redux": "^7.2.1",
21
+ "react-zoom-pan-pinch": "*"
22
+ },
23
+ "dependencies": {
24
+ "lodash": "^4.17.20"
25
+ },
26
+ "author": "CTOS Bento Team",
27
+ "license": "ISC",
28
+ "gitHead": "10ee9deeae6dd0f139ecb7a70afc4c96a4e33d74"
29
+ }
@@ -0,0 +1,373 @@
1
+ import React from 'react';
2
+ import { Grid, Link, withStyles } from '@material-ui/core';
3
+ import XoomInOut from './xoomInOutView';
4
+ import tableExternalIcon from './assets/About-Table-ExternalLink.svg';
5
+
6
+ const AboutBody = ({ classes, data, externalIconImage }) => {
7
+ function boldText(text) {
8
+ const boldedText = text.split('$$').map((splitedText) => {
9
+ if (splitedText != null && (/\*(.*)\*/.test(splitedText))) {
10
+ return (<span className={classes.title}>{splitedText.match(/\*(.*)\*/).pop()}</span>);
11
+ }
12
+ return splitedText;
13
+ });
14
+ return boldedText;
15
+ }
16
+ return (
17
+ <>
18
+ <div className={classes.container}>
19
+ <Grid container spacing={16} direction="row" className={classes.aboutSection}>
20
+ {data.imageLocation === 'left'
21
+ && (
22
+ <Grid item lg={3} md={3} sm={12} xs={12} className={classes.imageSection}>
23
+ {data.image}
24
+ </Grid>
25
+ )}
26
+ <Grid item lg={9} md={9} sm={12} xs={12} className={classes.contentSection}>
27
+ <span className={classes.text}>
28
+ {data.content ? data.content.map((contentObj) => (
29
+ <>
30
+ {/* Ordered List with Numbers logic */}
31
+ {contentObj.listWithNumbers && (
32
+ <div className={classes.text}>
33
+ {/* Numbered ordered list */}
34
+ <ol>
35
+ { contentObj.listWithNumbers.map((listObj) => (
36
+ listObj.listWithAlpahbets ? (
37
+ // Alphetised sub ordered list
38
+ <ol type="a">
39
+ {/* bolding text if necessary */}
40
+ { listObj.listWithAlpahbets.map((listObj1) => <li>{listObj1.includes('$$') ? boldText(listObj1) : listObj1}</li>)}
41
+ </ol>
42
+ ) : <li>{listObj.includes('$$') ? boldText(listObj) : listObj}</li>
43
+ ))}
44
+ </ol>
45
+ </div>
46
+ )}
47
+ {/* Ordered List with Alphabets logic */}
48
+ {contentObj.listWithAlpahbets && (
49
+ <div className={classes.text}>
50
+ {/* Alphabetised ordered list */}
51
+ <ol type="a">
52
+ { contentObj.listWithAlpahbets.map((listObj) => <li>{listObj.includes('$$') ? boldText(listObj) : listObj}</li>)}
53
+ </ol>
54
+ </div>
55
+ )}
56
+
57
+ {/* Paragraphs */}
58
+ {contentObj.paragraph && (
59
+ <div className={classes.text}>
60
+ { contentObj.paragraph.split('$$').map((splitedParagraph) => {
61
+ // Checking for regex ()[] pattern
62
+ if (splitedParagraph != null && ((/\[(.+)\]\((.+)\)/g.test(splitedParagraph)) || (/\((.+)\)\[(.+)\]/g.test(splitedParagraph)))) {
63
+ const title = splitedParagraph.match(/\[(.*)\]/).pop();
64
+ const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
65
+ const target = linkAttrs.find((link) => link.includes('target:'));
66
+ const url = linkAttrs.find((link) => link.includes('url:'));
67
+ const type = linkAttrs.find((link) => link.includes('type:')); // 0 : no img
68
+ const href = splitedParagraph.match(/\((.*)\)/).pop();
69
+
70
+ const link = (
71
+ <Link
72
+ title={title}
73
+ target={target ? target.replace('target:', '') : '_blank'}
74
+ rel="noreferrer"
75
+ href={url ? url.replace('url:', '') : (href && href.includes('@') ? `mailto:${href}` : href)}
76
+ color="inherit"
77
+ className={classes.link}
78
+ >
79
+ {title}
80
+ </Link>
81
+ );
82
+
83
+ return (
84
+ <>
85
+ {link}
86
+ {type ? '' : (
87
+ <img
88
+ src={externalIconImage}
89
+ // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
90
+ alt="outbounnd web site icon"
91
+ className={classes.linkIcon}
92
+ />
93
+ )}
94
+
95
+ </>
96
+ );
97
+ }
98
+ // For email
99
+ if (splitedParagraph != null && (/@(.*)@/.test(splitedParagraph))) {
100
+ return (<span className={classes.email}>{splitedParagraph.match(/@(.*)@/).pop()}</span>);
101
+ }
102
+ // For sub headings
103
+ if (splitedParagraph != null && (/#(.*)#/.test(splitedParagraph))) {
104
+ return (<div className={classes.title}>{splitedParagraph.match(/#(.*)#/).pop()}</div>);
105
+ }
106
+ // For bolding inline words
107
+ if (splitedParagraph != null && (/\*(.*)\*/.test(splitedParagraph))) {
108
+ return (<span className={classes.title}>{splitedParagraph.match(/\*(.*)\*/).pop()}</span>);
109
+ }
110
+ // For downloading things
111
+ if (splitedParagraph != null && (/{(.*)}/.test(splitedParagraph))) {
112
+ const downloadAttrs = splitedParagraph.match(/{(.*)}/).pop().split(',');
113
+ const downloadLink = downloadAttrs.find((link) => link.includes('link:'));
114
+ const downloadTitle = downloadAttrs.find((link) => link.includes('title:'));
115
+ return (
116
+ <Link
117
+ target="_blank"
118
+ className={classes.link}
119
+ href={downloadLink ? downloadLink.replace('link:', '') : ''}
120
+ >
121
+ {downloadTitle ? downloadTitle.replace('title:', '') : ''}
122
+ </Link>
123
+ );
124
+ }
125
+ return splitedParagraph;
126
+ })}
127
+ </div>
128
+ )}
129
+
130
+ {/* Table logic */}
131
+ {contentObj.table && (
132
+ <div className={classes.tableDiv}>
133
+ <table className={classes.table}>
134
+ <thead className={classes.tableHeader}>
135
+ <tr className={classes.tableBodyRow}>
136
+ <th className={classes.headerCell} aria-label="Index" />
137
+ { contentObj.table[0].head.map((rowObj) => {
138
+ let outputHTML = <th className={classes.headerCell}>{rowObj}</th>;
139
+ if (rowObj != null && (/{(.*)}/.test(rowObj))) {
140
+ const thAttrs = rowObj.match(/{(.*)}/).pop().split('$$');
141
+ const inlineStyleStr = thAttrs.find((thAttr) => thAttr.includes('style:')).replace('style:', '').replace(/'/g, '');
142
+ const inlineStyleMap = {};
143
+ inlineStyleStr.split(',').forEach((style) => {
144
+ // eslint-disable-next-line prefer-destructuring
145
+ inlineStyleMap[style.split(':')[0]] = style.split(':')[1];
146
+ });
147
+ const text = thAttrs.find((thAttr) => thAttr.includes('text:'));
148
+ outputHTML = (
149
+ <th className={classes.headerCell} style={inlineStyleMap}>
150
+ {text.replace('text:', '')}
151
+ </th>
152
+ );
153
+ }
154
+ return outputHTML;
155
+ })}
156
+ </tr>
157
+ </thead>
158
+ <tbody>
159
+ { contentObj.table[1].body.map((rowObj, index) => (
160
+ <>
161
+ <tr className={classes.tableBodyRow}>
162
+ <td className={classes.tableCell}>{index + 1}</td>
163
+ {/* eslint-disable-next-line max-len */}
164
+ { rowObj.row.map((rowValue) => {
165
+ let outputHTML = (
166
+ <td className={classes.tableCell}>
167
+ {rowValue}
168
+ </td>
169
+ );
170
+ // add inline style
171
+ if (rowValue != null && (/{(.*)}/.test(rowValue))) {
172
+ const thAttrs = rowValue.match(/{(.*)}/).pop().split('$$');
173
+ const inlineStyleStr = thAttrs.find((thAttr) => thAttr.includes('style:')).replace('style:', '').replace(/'/g, '');
174
+ const inlineStyleMap = {};
175
+ inlineStyleStr.split(',').forEach((style) => {
176
+ // eslint-disable-next-line prefer-destructuring
177
+ inlineStyleMap[style.split(':')[0]] = style.split(':')[1];
178
+ });
179
+ const text = thAttrs.find((thAttr) => thAttr.includes('text:'));
180
+ outputHTML = (
181
+ <td className={classes.tableCell} style={inlineStyleMap}>
182
+ {text.replace('text:', '')}
183
+ </td>
184
+ );
185
+ }
186
+
187
+ if (rowValue != null && ((/\[(.+)\]\((.+)\)/g.test(rowValue)) || (/\((.+)\)\[(.+)\]/g.test(rowValue)))) {
188
+ const title = rowValue.match(/\[(.*)\]/).pop();
189
+ const linkAttrs = rowValue.match(/\((.*)\)/).pop().split(' ');
190
+ const target = linkAttrs.find((link) => link.includes('target:'));
191
+ const url = linkAttrs.find((link) => link.includes('url:'));
192
+ const type = linkAttrs.find((link) => link.includes('type:')); // 0 : no img
193
+ const link = (
194
+ <Link
195
+ title={title}
196
+ target={target ? target.replace('target:', '') : '_blank'}
197
+ rel="noreferrer"
198
+ href={url ? url.replace('url:', '') : rowValue.match(/\((.*)\)/).pop()}
199
+ color="inherit"
200
+ className={classes.tableLink}
201
+ >
202
+ {title}
203
+ </Link>
204
+ );
205
+ outputHTML = (
206
+ <td className={classes.tableCell}>
207
+ {link}
208
+ {type ? '' : (
209
+ <img
210
+ src={tableExternalIcon}
211
+ alt="outbounnd web site icon"
212
+ className={classes.tablelinkIcon}
213
+ />
214
+ )}
215
+
216
+ </td>
217
+ );
218
+ }
219
+ return outputHTML;
220
+ })}
221
+ </tr>
222
+ </>
223
+ )) }
224
+ </tbody>
225
+ </table>
226
+ </div>
227
+ )}
228
+ <br />
229
+ </>
230
+ )) : ''}
231
+ </span>
232
+ </Grid>
233
+ {data.imageLocation === 'right'
234
+ && (
235
+ <Grid item lg={3} md={3} sm={12} xs={12} className={classes.imageSection}>
236
+ {data.image}
237
+ </Grid>
238
+ )}
239
+ </Grid>
240
+ </div>
241
+ {data.secondaryZoomImageTitle
242
+ && <div className={classes.secondayTitle}>{data.secondaryZoomImageTitle}</div>}
243
+ {data.secondaryImage && <XoomInOut>{data.secondaryImageData}</XoomInOut>}
244
+ </>
245
+ );
246
+ };
247
+
248
+ const styles = () => ({
249
+ container: {
250
+ margin: '16px auto 16px auto',
251
+ color: '#000000',
252
+ fontFamily: (props) => (props.data.fontFamily ? props.data.fontFamily : 'Nunito'),
253
+ fontSize: '15px',
254
+ lineHeight: '22px',
255
+ maxWidth: '1440px',
256
+ },
257
+ maxWidthContainer: {
258
+ margin: '0px auto 0px auto',
259
+ maxWidth: '1440px',
260
+ },
261
+ secondayTitle: {
262
+ display: 'block',
263
+ textAlign: 'center',
264
+ fontWeight: 'bold',
265
+ marginBottom: '70px',
266
+ color: '#033D6F',
267
+ fontSize: '28px',
268
+ fontFamily: 'Lato',
269
+ },
270
+ text: {
271
+ // height: '476px',
272
+ // width: '675px',
273
+ color: '#000000',
274
+ fontFamily: (props) => (props.data.fontFamily ? props.data.fontFamily : 'Nunito'),
275
+ fontSize: '16px',
276
+ lineHeight: (props) => (props.data.lineHeight ? props.data.lineHeight : '30px'),
277
+ },
278
+ title: (props) => ({
279
+ color: props.titleColor,
280
+ fontWeight: 'bold',
281
+ }),
282
+ email: (props) => ({
283
+ color: props.linkColor,
284
+ fontWeight: 'bold',
285
+ }),
286
+ contentSection: {
287
+ padding: (props) => (props.data.imageLocation === 'right'
288
+ ? '8px 25px 8px 0px !important' : '8px 0px 8px 25px !important'),
289
+ float: 'left',
290
+ },
291
+ imageSection: {
292
+ float: 'left',
293
+ },
294
+ aboutSection: {
295
+ padding: '60px 45px',
296
+ },
297
+ img: {
298
+ width: '100%',
299
+ },
300
+ linkIcon: {
301
+ width: '20px',
302
+ verticalAlign: 'sub',
303
+ margin: '0px 0px 0px 2px',
304
+ },
305
+ link: (props) => ({
306
+ color: props.linkColor,
307
+ '&:hover': {
308
+ color: props.linkColor,
309
+ },
310
+ }),
311
+ tableDiv: {
312
+ marginTop: '0px',
313
+ },
314
+ tablelinkIcon: {
315
+ width: '15px',
316
+ verticalAlign: 'sub',
317
+ margin: '0px 0px 0px 2px',
318
+ },
319
+ tableLink: {
320
+ fontWeight: 'bolder',
321
+ textDecoration: 'underline',
322
+ },
323
+ table: {
324
+ borderSpacing: '0',
325
+ borderCollapse: 'collapse',
326
+ fontSize: '12px',
327
+ fontWeight: 'bold',
328
+ letterSpacing: '0.025em',
329
+ lineHeight: '30px',
330
+ textAlign: 'left',
331
+ width: '100%',
332
+ },
333
+ tableHeader: {
334
+ fontFamily: (props) => (props.data.fontFamily ? props.data.fontFamily : 'Nunito'),
335
+ color: '#194563',
336
+ textTransform: 'uppercase',
337
+
338
+ },
339
+ tableBodyRow: {
340
+ borderSpacing: '0',
341
+ borderCollapse: 'collapse',
342
+ color: '#3E7AAA',
343
+ },
344
+ tableCell: {
345
+ fontFamily: (props) => (props.data.fontFamily ? props.data.fontFamily : 'Nunito'),
346
+ fontSize: '14px',
347
+ padding: '8px 15px 8px 0px',
348
+ borderBottom: '0.66px solid #087CA5',
349
+ },
350
+ headerCell: {
351
+ borderBottom: '4px solid #087CA5',
352
+ borderSpacing: '0',
353
+ borderCollapse: 'collapse',
354
+ fontWeight: 'bolder',
355
+ },
356
+ MyCasesWizardStep4: {
357
+ width: '600px',
358
+ },
359
+ });
360
+
361
+ AboutBody.defaultProps = {
362
+ classes: {},
363
+ data: {
364
+ content: [],
365
+ fontFamily: 'Nunito',
366
+ lineHeight: '30px',
367
+ },
368
+ linkColor: '#0296C9',
369
+ titleColor: '#0B3556',
370
+ externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
371
+ };
372
+
373
+ export default withStyles(styles)(AboutBody);