@bento-core/about 1.0.0 → 1.0.1-testProject.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.
@@ -7,7 +7,6 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _core = require("@material-ui/core");
9
9
  var _xoomInOutView = _interopRequireDefault(require("./xoomInOutView"));
10
- var _AboutTableExternalLink = _interopRequireDefault(require("./assets/About-Table-ExternalLink.svg"));
11
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
11
  const AboutBody = _ref => {
13
12
  let {
@@ -56,7 +55,9 @@ const AboutBody = _ref => {
56
55
  // Alphetised sub ordered list
57
56
  _react.default.createElement("ol", {
58
57
  type: "a"
59
- }, listObj.listWithAlpahbets.map(listObj1 => /*#__PURE__*/_react.default.createElement("li", null, listObj1.includes('$$') ? boldText(listObj1) : listObj1))) : /*#__PURE__*/_react.default.createElement("li", null, listObj.includes('$$') ? boldText(listObj) : listObj)))), contentObj.listWithAlpahbets && /*#__PURE__*/_react.default.createElement("div", {
58
+ }, listObj.listWithAlpahbets.map(listObj1 => /*#__PURE__*/_react.default.createElement("li", null, listObj1.includes('$$') ? boldText(listObj1) : listObj1))) : /*#__PURE__*/_react.default.createElement("li", null, listObj.includes('$$') ? boldText(listObj) : listObj)))), contentObj.listWithBullets && /*#__PURE__*/_react.default.createElement("div", {
59
+ className: classes.text
60
+ }, /*#__PURE__*/_react.default.createElement("ul", null, contentObj.listWithBullets.map(listObj => /*#__PURE__*/_react.default.createElement("li", null, listObj.includes('$$') ? boldText(listObj) : listObj)))), contentObj.listWithAlpahbets && /*#__PURE__*/_react.default.createElement("div", {
60
61
  className: classes.text
61
62
  }, /*#__PURE__*/_react.default.createElement("ol", {
62
63
  type: "a"
@@ -69,7 +70,6 @@ const AboutBody = _ref => {
69
70
  const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
70
71
  const target = linkAttrs.find(link => link.includes('target:'));
71
72
  const url = linkAttrs.find(link => link.includes('url:'));
72
- const type = linkAttrs.find(link => link.includes('type:')); // 0 : no img
73
73
  const href = splitedParagraph.match(/\((.*)\)/).pop();
74
74
  const link = /*#__PURE__*/_react.default.createElement(_core.Link, {
75
75
  title: title,
@@ -79,7 +79,7 @@ const AboutBody = _ref => {
79
79
  color: "inherit",
80
80
  className: classes.link
81
81
  }, title);
82
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, type ? '' : /*#__PURE__*/_react.default.createElement("img", {
82
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, href.includes('@') || !href.includes('http') ? '' : /*#__PURE__*/_react.default.createElement("img", {
83
83
  src: externalIconImage
84
84
  // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
85
85
  ,
@@ -187,13 +187,46 @@ const AboutBody = _ref => {
187
187
  outputHTML = /*#__PURE__*/_react.default.createElement("td", {
188
188
  className: classes.tableCell
189
189
  }, link, type ? '' : /*#__PURE__*/_react.default.createElement("img", {
190
- src: _AboutTableExternalLink.default,
190
+ src: externalIconImage,
191
191
  alt: "outbounnd web site icon",
192
192
  className: classes.tablelinkIcon
193
193
  }));
194
194
  }
195
195
  return outputHTML;
196
- }))))))), /*#__PURE__*/_react.default.createElement("br", null))) : '')), data.imageLocation === 'right' && /*#__PURE__*/_react.default.createElement(_core.Grid, {
196
+ }))))))), /*#__PURE__*/_react.default.createElement("br", null))) : ''), data.downloadableContentTitle && /*#__PURE__*/_react.default.createElement("div", {
197
+ className: classes.downloadableContentContainer
198
+ }, /*#__PURE__*/_react.default.createElement("div", {
199
+ className: classes.downloadableContentTitle
200
+ }, data.downloadableContentTitle), /*#__PURE__*/_react.default.createElement("span", {
201
+ className: classes.text
202
+ }, data.downloadableContent ? data.downloadableContent.map(contentObj => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, contentObj.paragraph && /*#__PURE__*/_react.default.createElement("div", {
203
+ className: classes.text
204
+ }, contentObj.paragraph.split('$$').map(splitedParagraph => {
205
+ // Checking for regex ()[] pattern
206
+ if (splitedParagraph != null && (/\[(.+)\]\((.+)\)/g.test(splitedParagraph) || /\((.+)\)\[(.+)\]/g.test(splitedParagraph))) {
207
+ const title = splitedParagraph.match(/\[(.*)\]/).pop();
208
+ const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
209
+ const target = linkAttrs.find(link => link.includes('target:'));
210
+ const url = linkAttrs.find(link => link.includes('url:'));
211
+ const href = splitedParagraph.match(/\((.*)\)/).pop();
212
+ const link = /*#__PURE__*/_react.default.createElement(_core.Link, {
213
+ title: title,
214
+ target: target ? target.replace('target:', '') : '_blank',
215
+ rel: "noreferrer",
216
+ href: url ? url.replace('url:', '') : href && href.includes('@') ? "mailto:".concat(href) : href,
217
+ color: "inherit",
218
+ className: classes.link
219
+ }, title);
220
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, href.includes('@') || !href.includes('http') ? '' : /*#__PURE__*/_react.default.createElement("img", {
221
+ src: externalIconImage
222
+ // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
223
+ ,
224
+ alt: "outbounnd web site icon",
225
+ className: classes.linkIcon
226
+ }));
227
+ }
228
+ return splitedParagraph;
229
+ })))) : ''))), data.imageLocation === 'right' && /*#__PURE__*/_react.default.createElement(_core.Grid, {
197
230
  item: true,
198
231
  lg: 3,
199
232
  md: 3,
@@ -213,6 +246,9 @@ const styles = () => ({
213
246
  lineHeight: '22px',
214
247
  maxWidth: '1440px'
215
248
  },
249
+ tabbedParag: {
250
+ paddingLeft: '40px'
251
+ },
216
252
  maxWidthContainer: {
217
253
  margin: '0px auto 0px auto',
218
254
  maxWidth: '1440px'
@@ -236,32 +272,35 @@ const styles = () => ({
236
272
  },
237
273
  title: props => ({
238
274
  color: props.titleColor,
239
- fontWeight: 'bold'
275
+ fontWeight: '500',
276
+ fontSize: '24px'
240
277
  }),
241
278
  email: props => ({
242
279
  color: props.linkColor,
243
280
  fontWeight: 'bold'
244
281
  }),
245
282
  contentSection: {
246
- padding: props => props.data.imageLocation === 'right' ? '8px 25px 8px 0px !important' : '8px 0px 8px 25px !important',
247
- float: 'left'
283
+ padding: props => props.data.imageLocation === 'right' ? '8px 25px 8px 25px !important' : '8px 0px 8px 25px !important',
284
+ float: 'left',
285
+ background: 'white'
248
286
  },
249
287
  imageSection: {
250
288
  float: 'left'
251
289
  },
252
290
  aboutSection: {
253
- padding: '60px 45px'
291
+ padding: '0px 45px'
254
292
  },
255
293
  img: {
256
294
  width: '100%'
257
295
  },
258
296
  linkIcon: {
259
- width: '20px',
297
+ width: '0.8em',
260
298
  verticalAlign: 'sub',
261
- margin: '0px 0px 0px 2px'
299
+ margin: '0px 0px 2px 4px'
262
300
  },
263
301
  link: props => ({
264
302
  color: props.linkColor,
303
+ fontWeight: '600',
265
304
  '&:hover': {
266
305
  color: props.linkColor
267
306
  }
@@ -283,7 +322,6 @@ const styles = () => ({
283
322
  borderCollapse: 'collapse',
284
323
  fontSize: '12px',
285
324
  fontWeight: 'bold',
286
- letterSpacing: '0.025em',
287
325
  lineHeight: '30px',
288
326
  textAlign: 'left',
289
327
  width: '100%'
@@ -312,6 +350,19 @@ const styles = () => ({
312
350
  },
313
351
  MyCasesWizardStep4: {
314
352
  width: '600px'
353
+ },
354
+ downloadableContentContainer: {
355
+ background: '#ebebeb',
356
+ padding: '32px',
357
+ borderRadius: '8px'
358
+ },
359
+ downloadableContentTitle: {
360
+ fontWeight: 'bold',
361
+ marginBottom: '20px',
362
+ color: '#1280AE',
363
+ fontSize: '20px',
364
+ fontFamily: 'Lato',
365
+ letterSpacing: '0.025em'
315
366
  }
316
367
  });
317
368
  AboutBody.defaultProps = {
@@ -7,6 +7,11 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _core = require("@material-ui/core");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
15
  const AboutHeader = _ref => {
11
16
  let {
12
17
  classes,
@@ -29,13 +34,13 @@ const styles = () => ({
29
34
  header: {
30
35
  padding: '45px'
31
36
  },
32
- container: props => ({
37
+ container: props => _objectSpread({
33
38
  background: props.background
34
- }),
35
- whitePadding: {
36
- height: '6px',
37
- background: 'white'
38
- },
39
+ }, props.container),
40
+ whitePadding: props => _objectSpread({
41
+ height: props.background,
42
+ background: props.background
43
+ }, props.whitePadding),
39
44
  titleBody: {
40
45
  textAlign: 'center'
41
46
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/about",
3
- "version": "1.0.0",
3
+ "version": "1.0.1-testProject.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  },
27
27
  "author": "CTOS Bento Team",
28
28
  "license": "ISC",
29
- "gitHead": "4493c4a5fa666211345fea022ec06841a323d446"
29
+ "gitHead": "1809e1d1607e3eaa4b1ff9f0f0e56da7b2c3525a"
30
30
  }
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Grid, Link, withStyles } from '@material-ui/core';
3
3
  import XoomInOut from './xoomInOutView';
4
- import tableExternalIcon from './assets/About-Table-ExternalLink.svg';
5
4
 
6
- const AboutBody = ({ classes, data, externalIconImage }) => {
5
+ const AboutBody = ({
6
+ classes, data, externalIconImage,
7
+ }) => {
7
8
  function boldText(text) {
8
9
  const boldedText = text.split('$$').map((splitedText) => {
9
10
  if (splitedText != null && (/\*(.*)\*/.test(splitedText))) {
@@ -44,6 +45,14 @@ const AboutBody = ({ classes, data, externalIconImage }) => {
44
45
  </ol>
45
46
  </div>
46
47
  )}
48
+ {contentObj.listWithBullets && (
49
+ <div className={classes.text}>
50
+ {/* Alphabetised ordered list */}
51
+ <ul>
52
+ { contentObj.listWithBullets.map((listObj) => <li>{listObj.includes('$$') ? boldText(listObj) : listObj}</li>)}
53
+ </ul>
54
+ </div>
55
+ )}
47
56
  {/* Ordered List with Alphabets logic */}
48
57
  {contentObj.listWithAlpahbets && (
49
58
  <div className={classes.text}>
@@ -64,7 +73,6 @@ const AboutBody = ({ classes, data, externalIconImage }) => {
64
73
  const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
65
74
  const target = linkAttrs.find((link) => link.includes('target:'));
66
75
  const url = linkAttrs.find((link) => link.includes('url:'));
67
- const type = linkAttrs.find((link) => link.includes('type:')); // 0 : no img
68
76
  const href = splitedParagraph.match(/\((.*)\)/).pop();
69
77
 
70
78
  const link = (
@@ -83,7 +91,7 @@ const AboutBody = ({ classes, data, externalIconImage }) => {
83
91
  return (
84
92
  <>
85
93
  {link}
86
- {type ? '' : (
94
+ {href.includes('@') || !href.includes('http') ? '' : (
87
95
  <img
88
96
  src={externalIconImage}
89
97
  // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
@@ -207,7 +215,7 @@ const AboutBody = ({ classes, data, externalIconImage }) => {
207
215
  {link}
208
216
  {type ? '' : (
209
217
  <img
210
- src={tableExternalIcon}
218
+ src={externalIconImage}
211
219
  alt="outbounnd web site icon"
212
220
  className={classes.tablelinkIcon}
213
221
  />
@@ -229,6 +237,65 @@ const AboutBody = ({ classes, data, externalIconImage }) => {
229
237
  </>
230
238
  )) : ''}
231
239
  </span>
240
+ {data.downloadableContentTitle
241
+ && (
242
+ <div className={classes.downloadableContentContainer}>
243
+ <div className={classes.downloadableContentTitle}>{data.downloadableContentTitle}</div>
244
+ <span className={classes.text}>
245
+ {data.downloadableContent ? data.downloadableContent.map((contentObj) => (
246
+ <>
247
+ {/* Ordered List with Numbers logic */}
248
+
249
+ {/* Paragraphs */}
250
+ {contentObj.paragraph && (
251
+ <div className={classes.text}>
252
+ { contentObj.paragraph.split('$$').map((splitedParagraph) => {
253
+ // Checking for regex ()[] pattern
254
+ if (splitedParagraph != null && ((/\[(.+)\]\((.+)\)/g.test(splitedParagraph)) || (/\((.+)\)\[(.+)\]/g.test(splitedParagraph)))) {
255
+ const title = splitedParagraph.match(/\[(.*)\]/).pop();
256
+ const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
257
+ const target = linkAttrs.find((link) => link.includes('target:'));
258
+ const url = linkAttrs.find((link) => link.includes('url:'));
259
+ const href = splitedParagraph.match(/\((.*)\)/).pop();
260
+
261
+ const link = (
262
+ <Link
263
+ title={title}
264
+ target={target ? target.replace('target:', '') : '_blank'}
265
+ rel="noreferrer"
266
+ href={url ? url.replace('url:', '') : (href && href.includes('@') ? `mailto:${href}` : href)}
267
+ color="inherit"
268
+ className={classes.link}
269
+ >
270
+ {title}
271
+ </Link>
272
+ );
273
+
274
+ return (
275
+ <>
276
+ {link}
277
+ {href.includes('@') || !href.includes('http') ? '' : (
278
+ <img
279
+ src={externalIconImage}
280
+ // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
281
+ alt="outbounnd web site icon"
282
+ className={classes.linkIcon}
283
+ />
284
+ )}
285
+
286
+ </>
287
+ );
288
+ }
289
+
290
+ return splitedParagraph;
291
+ })}
292
+ </div>
293
+ )}
294
+ </>
295
+ )) : ''}
296
+ </span>
297
+ </div>
298
+ )}
232
299
  </Grid>
233
300
  {data.imageLocation === 'right'
234
301
  && (
@@ -254,6 +321,9 @@ const styles = () => ({
254
321
  lineHeight: '22px',
255
322
  maxWidth: '1440px',
256
323
  },
324
+ tabbedParag: {
325
+ paddingLeft: '40px',
326
+ },
257
327
  maxWidthContainer: {
258
328
  margin: '0px auto 0px auto',
259
329
  maxWidth: '1440px',
@@ -277,7 +347,8 @@ const styles = () => ({
277
347
  },
278
348
  title: (props) => ({
279
349
  color: props.titleColor,
280
- fontWeight: 'bold',
350
+ fontWeight: '500',
351
+ fontSize: '24px',
281
352
  }),
282
353
  email: (props) => ({
283
354
  color: props.linkColor,
@@ -285,25 +356,27 @@ const styles = () => ({
285
356
  }),
286
357
  contentSection: {
287
358
  padding: (props) => (props.data.imageLocation === 'right'
288
- ? '8px 25px 8px 0px !important' : '8px 0px 8px 25px !important'),
359
+ ? '8px 25px 8px 25px !important' : '8px 0px 8px 25px !important'),
289
360
  float: 'left',
361
+ background: 'white',
290
362
  },
291
363
  imageSection: {
292
364
  float: 'left',
293
365
  },
294
366
  aboutSection: {
295
- padding: '60px 45px',
367
+ padding: '0px 45px',
296
368
  },
297
369
  img: {
298
370
  width: '100%',
299
371
  },
300
372
  linkIcon: {
301
- width: '20px',
373
+ width: '0.8em',
302
374
  verticalAlign: 'sub',
303
- margin: '0px 0px 0px 2px',
375
+ margin: '0px 0px 2px 4px',
304
376
  },
305
377
  link: (props) => ({
306
378
  color: props.linkColor,
379
+ fontWeight: '600',
307
380
  '&:hover': {
308
381
  color: props.linkColor,
309
382
  },
@@ -325,7 +398,6 @@ const styles = () => ({
325
398
  borderCollapse: 'collapse',
326
399
  fontSize: '12px',
327
400
  fontWeight: 'bold',
328
- letterSpacing: '0.025em',
329
401
  lineHeight: '30px',
330
402
  textAlign: 'left',
331
403
  width: '100%',
@@ -356,6 +428,19 @@ const styles = () => ({
356
428
  MyCasesWizardStep4: {
357
429
  width: '600px',
358
430
  },
431
+ downloadableContentContainer: {
432
+ background: '#ebebeb',
433
+ padding: '32px',
434
+ borderRadius: '8px',
435
+ },
436
+ downloadableContentTitle: {
437
+ fontWeight: 'bold',
438
+ marginBottom: '20px',
439
+ color: '#1280AE',
440
+ fontSize: '20px',
441
+ fontFamily: 'Lato',
442
+ letterSpacing: '0.025em',
443
+ },
359
444
  });
360
445
 
361
446
  AboutBody.defaultProps = {
@@ -16,11 +16,13 @@ const styles = () => ({
16
16
  },
17
17
  container: (props) => ({
18
18
  background: props.background,
19
+ ...props.container,
20
+ }),
21
+ whitePadding: (props) => ({
22
+ height: props.background,
23
+ background: props.background,
24
+ ...props.whitePadding,
19
25
  }),
20
- whitePadding: {
21
- height: '6px',
22
- background: 'white',
23
- },
24
26
  titleBody: {
25
27
  textAlign: 'center',
26
28
  },