@mjhls/mjh-framework 1.0.149 → 1.0.151

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.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.149
2
+ # mjh-framework v. 1.0.151
3
3
 
4
4
 
5
5
 
package/dist/index.es.js CHANGED
@@ -6372,68 +6372,140 @@ var GridContent = function (_React$Component) {
6372
6372
  { className: 'grid-container' },
6373
6373
  this.state.data && this.state.data.map(function (row, index$$1) {
6374
6374
  var pageNumber = row.pageNumber || _this2.state.page;
6375
- var linkHref = '' + row.url.current;
6376
- if (row.blank || _this2.checkExternalUrl(row.url.current)) {
6377
- return React__default.createElement(
6378
- React__default.Fragment,
6379
- { key: itemCounter },
6380
- React__default.createElement(
6381
- VisibilitySensor,
6382
- {
6383
- onChange: function onChange(isVisible) {
6384
- isVisible && _this2.changePageNumber(pageNumber);
6385
- } },
6375
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
6376
+ var linkHref = _this2.mapping[contentCategoryName] + '/' + row.url.current;
6377
+ if (row._type === 'feature') {
6378
+ if (row.blank || _this2.checkExternalUrl(row.url.current)) {
6379
+ return React__default.createElement(
6380
+ React__default.Fragment,
6381
+ { key: itemCounter },
6386
6382
  React__default.createElement(
6387
- 'div',
6388
- { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6383
+ VisibilitySensor,
6384
+ {
6385
+ onChange: function onChange(isVisible) {
6386
+ isVisible && _this2.changePageNumber(pageNumber);
6387
+ } },
6389
6388
  React__default.createElement(
6390
- Card,
6391
- { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6392
- (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6393
- 'a',
6394
- { href: row.url.current, target: '_blank', className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6395
- React__default.createElement(
6396
- LazyLoad,
6397
- { height: _this2.props.imageHeight },
6398
- React__default.createElement(Card.Img, {
6399
- variant: 'top',
6400
- src: _this2.renderCardImage(row, page),
6401
- alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6402
- })
6403
- )
6404
- ),
6389
+ 'div',
6390
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6405
6391
  React__default.createElement(
6406
- Card.Body,
6407
- null,
6408
- React__default.createElement(
6392
+ Card,
6393
+ { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6394
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6409
6395
  'a',
6410
- { href: row.url.current, target: '_blank' },
6396
+ { href: row.url.current, target: '_blank', className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6411
6397
  React__default.createElement(
6412
- Card.Title,
6413
- null,
6414
- row.title
6398
+ LazyLoad,
6399
+ { height: _this2.props.imageHeight },
6400
+ React__default.createElement(Card.Img, {
6401
+ variant: 'top',
6402
+ src: _this2.renderCardImage(row, page),
6403
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6404
+ })
6415
6405
  )
6416
6406
  ),
6417
- _this2.props.showPublished && row.published && React__default.createElement(
6418
- Card.Subtitle,
6419
- { style: { marginTop: 0 } },
6420
- moment(row.published).format('MMMM DD, YYYY')
6407
+ React__default.createElement(
6408
+ Card.Body,
6409
+ null,
6410
+ React__default.createElement(
6411
+ 'a',
6412
+ { href: row.url.current, target: '_blank' },
6413
+ React__default.createElement(
6414
+ Card.Title,
6415
+ null,
6416
+ row.title
6417
+ )
6418
+ ),
6419
+ _this2.props.showPublished && row.published && React__default.createElement(
6420
+ Card.Subtitle,
6421
+ { style: { marginTop: 0 } },
6422
+ moment(row.published).format('MMMM DD, YYYY')
6423
+ ),
6424
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6425
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6426
+ }),
6427
+ React__default.createElement(
6428
+ Card.Text,
6429
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6430
+ row.summary
6431
+ )
6432
+ )
6433
+ )
6434
+ )
6435
+ ),
6436
+ showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6437
+ main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6438
+ );
6439
+ } else {
6440
+ return React__default.createElement(
6441
+ React__default.Fragment,
6442
+ { key: itemCounter },
6443
+ React__default.createElement(
6444
+ VisibilitySensor,
6445
+ {
6446
+ onChange: function onChange(isVisible) {
6447
+ isVisible && _this2.changePageNumber(pageNumber);
6448
+ } },
6449
+ React__default.createElement(
6450
+ 'div',
6451
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6452
+ React__default.createElement(
6453
+ Card,
6454
+ { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6455
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6456
+ Link,
6457
+ { href: row.url.current },
6458
+ React__default.createElement(
6459
+ 'a',
6460
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6461
+ React__default.createElement(
6462
+ LazyLoad,
6463
+ { height: _this2.props.imageHeight },
6464
+ React__default.createElement(Card.Img, {
6465
+ variant: 'top',
6466
+ src: _this2.renderCardImage(row, page),
6467
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6468
+ })
6469
+ )
6470
+ )
6421
6471
  ),
6422
- _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6423
- return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6424
- }),
6425
6472
  React__default.createElement(
6426
- Card.Text,
6427
- { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6428
- row.summary
6473
+ Card.Body,
6474
+ null,
6475
+ React__default.createElement(
6476
+ Link,
6477
+ { href: row.url.current },
6478
+ React__default.createElement(
6479
+ 'a',
6480
+ null,
6481
+ React__default.createElement(
6482
+ Card.Title,
6483
+ null,
6484
+ row.title
6485
+ )
6486
+ )
6487
+ ),
6488
+ _this2.props.showPublished && row.published && React__default.createElement(
6489
+ Card.Subtitle,
6490
+ { style: { marginTop: 0 } },
6491
+ moment(row.published).format('MMMM DD, YYYY')
6492
+ ),
6493
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6494
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6495
+ }),
6496
+ React__default.createElement(
6497
+ Card.Text,
6498
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6499
+ row.summary
6500
+ )
6429
6501
  )
6430
6502
  )
6431
6503
  )
6432
- )
6433
- ),
6434
- showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6435
- main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6436
- );
6504
+ ),
6505
+ showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6506
+ main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6507
+ );
6508
+ }
6437
6509
  }
6438
6510
  return React__default.createElement(
6439
6511
  React__default.Fragment,
@@ -7913,6 +7985,10 @@ var IoIosHome = function (props) {
7913
7985
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M258.5 104.1c-1.5-1.2-3.5-1.2-5 0l-156 124.8c-.9.8-1.5 1.9-1.5 3.1v230c0 1.1.9 2 2 2h108c1.1 0 2-.9 2-2V322c0-1.1.9-2 2-2h92c1.1 0 2 .9 2 2v140c0 1.1.9 2 2 2h108c1.1 0 2-.9 2-2V232c0-1.2-.6-2.4-1.5-3.1l-156-124.8z"}},{"tag":"path","attr":{"d":"M458.7 204.2l-189-151.4C265.9 49.7 261 48 256 48s-9.9 1.7-13.7 4.8L160 119.7V77.5c0-1.1-.9-2-2-2H98c-1.1 0-2 .9-2 2v92.2l-42.7 35.1c-3.1 2.5-5.1 6.2-5.3 10.2-.2 4 1.3 7.9 4.1 10.7 2.6 2.6 6.1 4.1 9.9 4.1 3.2 0 6.3-1.1 8.8-3.1l183.9-148c.5-.4.9-.4 1.3-.4s.8.1 1.3.4l183.9 147.4c2.5 2 5.6 3.1 8.8 3.1 3.7 0 7.2-1.4 9.9-4.1 2.9-2.8 4.4-6.7 4.2-10.7-.3-4-2.2-7.7-5.4-10.2z"}}]})(props);
7914
7986
  };
7915
7987
  IoIosHome.displayName = "IoIosHome";
7988
+ var IoIosOpen = function (props) {
7989
+ return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M227.8 300.2c-5.1-5.1-5.1-13.3 0-18.4l133.7-133.7c-5.3-2.6-11.2-4.1-17.5-4.1H88c-22 0-40 18-40 40v224c0 22 18 40 40 40h256c22 0 40-18 40-40V184c0-6.3-1.5-12.2-4.1-17.5L246.2 300.2c-5.1 5.1-13.3 5.1-18.4 0z"}},{"tag":"path","attr":{"d":"M459.5 68.5C457 66 453 64 449 64h-97c-7.2-.1-13.1 5.7-13.1 12.9-.1 7.2 5.7 13.1 12.9 13.1l67.3.5-57.6 57.6c8 3.9 14.5 10.4 18.4 18.4l57.6-57.6.5 67.3c.1 7.2 5.9 13 13.1 12.9 7.2-.1 13-5.9 12.9-13.1V78c0-3.5-2-7-4.5-9.5z"}}]})(props);
7990
+ };
7991
+ IoIosOpen.displayName = "IoIosOpen";
7916
7992
  var IoMdArrowDropdown = function (props) {
7917
7993
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M128 192l128 128 128-128z"}}]})(props);
7918
7994
  };
@@ -15507,28 +15583,13 @@ var RelatedTopicsDropdown = function RelatedTopicsDropdown(_ref) {
15507
15583
  };
15508
15584
 
15509
15585
  // THIS FILE IS AUTO GENERATED
15510
- var FaWindowClose = function (props) {
15511
- return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-83.6 290.5c4.8 4.8 4.8 12.6 0 17.4l-40.5 40.5c-4.8 4.8-12.6 4.8-17.4 0L256 313.3l-66.5 67.1c-4.8 4.8-12.6 4.8-17.4 0l-40.5-40.5c-4.8-4.8-4.8-12.6 0-17.4l67.1-66.5-67.1-66.5c-4.8-4.8-4.8-12.6 0-17.4l40.5-40.5c4.8-4.8 12.6-4.8 17.4 0l66.5 67.1 66.5-67.1c4.8-4.8 12.6-4.8 17.4 0l40.5 40.5c4.8 4.8 4.8 12.6 0 17.4L313.3 256l67.1 66.5z"}}]})(props);
15586
+ var FaRegWindowClose = function (props) {
15587
+ return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm0 394c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h404c3.3 0 6 2.7 6 6v340zM356.5 194.6L295.1 256l61.4 61.4c4.6 4.6 4.6 12.1 0 16.8l-22.3 22.3c-4.6 4.6-12.1 4.6-16.8 0L256 295.1l-61.4 61.4c-4.6 4.6-12.1 4.6-16.8 0l-22.3-22.3c-4.6-4.6-4.6-12.1 0-16.8l61.4-61.4-61.4-61.4c-4.6-4.6-4.6-12.1 0-16.8l22.3-22.3c4.6-4.6 12.1-4.6 16.8 0l61.4 61.4 61.4-61.4c4.6-4.6 12.1-4.6 16.8 0l22.3 22.3c4.7 4.6 4.7 12.1 0 16.8z"}}]})(props);
15512
15588
  };
15513
- FaWindowClose.displayName = "FaWindowClose";
15589
+ FaRegWindowClose.displayName = "FaRegWindowClose";
15514
15590
 
15515
15591
  /*****UStream Component*****/
15516
- /*
15517
-
15518
- Width and Height(percent or px) prop passed is the floating window, when closed
15519
- it will take 100% of its parent element
15520
-
15521
- You can pass in another SRC for Ustream if needed
15522
-
15523
- If 'close' is passed as prop, the floating window will be removed
15524
- from DOM once close button is hit
15525
-
15526
- Example:
15527
- import { Ustream } from '@mjhls/mjh-framework';
15528
- <Ustream width={'200px'} height={'120px'} close />
15529
-
15530
- */
15531
- /************************* */
15592
+
15532
15593
  var Ustream = function Ustream(_ref) {
15533
15594
  var _ref$width = _ref.width,
15534
15595
  width = _ref$width === undefined ? '300px' : _ref$width,
@@ -15536,6 +15597,8 @@ var Ustream = function Ustream(_ref) {
15536
15597
  height = _ref$height === undefined ? '168px' : _ref$height,
15537
15598
  _ref$close = _ref.close,
15538
15599
  close = _ref$close === undefined ? false : _ref$close,
15600
+ _ref$right = _ref.right,
15601
+ right = _ref$right === undefined ? false : _ref$right,
15539
15602
  _ref$src = _ref.src,
15540
15603
  src = _ref$src === undefined ? 'https://video.ibm.com/embed/23627444?volume=0&autoplay=true' : _ref$src;
15541
15604
 
@@ -15553,11 +15616,15 @@ var Ustream = function Ustream(_ref) {
15553
15616
 
15554
15617
  useEffect(function () {
15555
15618
  try {
15556
- document.querySelector('.ustream-close').addEventListener('click', function (e) {
15557
- var container = document.getElementById('ustream-container');
15558
- if (close) {
15619
+ var container = document.getElementById('ustream-container');
15620
+
15621
+ if (close) {
15622
+ var closeBtn = document.querySelector('.ustream-close');
15623
+ closeBtn.addEventListener('click', function () {
15559
15624
  container.remove();
15560
- } else {
15625
+ });
15626
+ } else {
15627
+ document.querySelector('.ustream-minimize').addEventListener('click', function (e) {
15561
15628
  container.style.position = 'static';
15562
15629
  container.style.padding = '0 1rem';
15563
15630
  container.classList.add('closed');
@@ -15567,9 +15634,14 @@ var Ustream = function Ustream(_ref) {
15567
15634
  console.log(newHeight);
15568
15635
  console.log(ustreamContainer);
15569
15636
  setHeight(newHeight);
15570
- e.target.remove();
15571
- }
15572
- });
15637
+ document.querySelector('.ustream-minimize').remove();
15638
+ var closeBtn = document.querySelector('.ustream-close');
15639
+ closeBtn.style.display = 'block';
15640
+ closeBtn.addEventListener('click', function () {
15641
+ container.remove();
15642
+ });
15643
+ });
15644
+ }
15573
15645
  } catch (err) {}
15574
15646
  }, []);
15575
15647
 
@@ -15579,10 +15651,23 @@ var Ustream = function Ustream(_ref) {
15579
15651
  React__default.createElement(
15580
15652
  'div',
15581
15653
  { style: { position: 'relative' } },
15582
- React__default.createElement(
15654
+ close ? React__default.createElement(
15583
15655
  'div',
15584
15656
  { className: 'ustream-close' },
15585
- React__default.createElement(FaWindowClose, { style: { fontSize: '1.3rem' } })
15657
+ React__default.createElement(FaRegWindowClose, { style: { color: '#fff', fontSize: '1.3rem' } })
15658
+ ) : React__default.createElement(
15659
+ React__default.Fragment,
15660
+ null,
15661
+ React__default.createElement(
15662
+ 'div',
15663
+ { className: 'ustream-minimize' },
15664
+ React__default.createElement(IoIosOpen, { style: right ? { color: '#fff', fontSize: '1.3rem', transform: 'rotateZ(-90deg)' } : { color: '#fff', fontSize: '1.3rem' } })
15665
+ ),
15666
+ React__default.createElement(
15667
+ 'div',
15668
+ { className: 'ustream-close' },
15669
+ React__default.createElement(FaRegWindowClose, { style: { color: '#fff', fontSize: '1rem' } })
15670
+ )
15586
15671
  ),
15587
15672
  React__default.createElement('iframe', {
15588
15673
  id: 'ustream-iframe',
@@ -15590,13 +15675,12 @@ var Ustream = function Ustream(_ref) {
15590
15675
  webkitallowfullscreen: true,
15591
15676
  allowFullScreen: true,
15592
15677
  frameBorder: 'no',
15593
-
15594
15678
  style: { maxWidth: '100%', height: currentHeight, width: currentWidth } })
15595
15679
  ),
15596
15680
  React__default.createElement(
15597
15681
  'style',
15598
15682
  { jsx: 'true' },
15599
- '\n #ustream-container {\n position: fixed;\n bottom: 0;\n right: 1rem;\n z-index: 999;\n max-width: 100%;\n }\n .ustream-close {\n position: absolute;\n color: white;\n right: 0.5rem;\n top: 0.25rem;\n cursor: pointer;\n font-weight: bold;\n }\n @media screen and (max-width: 768px) {\n #ustream-container:not(.closed) {\n width: 231px !important;\n height: 130px !important;\n }\n #ustream-container:not(.closed) iframe {\n height: 130px !important;\n }\n }\n '
15683
+ '\n #ustream-container {\n position: fixed;\n bottom: 0;\n ' + (right ? 'right: 1rem;' : 'left: 1.5rem;') + '\n z-index: 999;\n max-width: 100%;\n }\n .ustream-minimize,\n .ustream-close {\n position: absolute;\n color: white;\n right: 0.5rem;\n top: 0.25rem;\n cursor: pointer;\n font-weight: bold;\n }\n .ustream-close {\n ' + (close ? 'display: block; right: .75rem; top: .5rem; ' : 'display: none; right: .5rem; top: .75rem;') + '\n }\n @media screen and (max-width: 768px) {\n #ustream-container:not(.closed) {\n width: 231px !important;\n height: 130px !important;\n }\n #ustream-container:not(.closed) iframe {\n height: 130px !important;\n }\n }\n '
15600
15684
  )
15601
15685
  );
15602
15686
  };