@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/dist/index.js CHANGED
@@ -6379,68 +6379,140 @@ var GridContent = function (_React$Component) {
6379
6379
  { className: 'grid-container' },
6380
6380
  this.state.data && this.state.data.map(function (row, index$$1) {
6381
6381
  var pageNumber = row.pageNumber || _this2.state.page;
6382
- var linkHref = '' + row.url.current;
6383
- if (row.blank || _this2.checkExternalUrl(row.url.current)) {
6384
- return React__default.createElement(
6385
- React__default.Fragment,
6386
- { key: itemCounter },
6387
- React__default.createElement(
6388
- VisibilitySensor,
6389
- {
6390
- onChange: function onChange(isVisible) {
6391
- isVisible && _this2.changePageNumber(pageNumber);
6392
- } },
6382
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
6383
+ var linkHref = _this2.mapping[contentCategoryName] + '/' + row.url.current;
6384
+ if (row._type === 'feature') {
6385
+ if (row.blank || _this2.checkExternalUrl(row.url.current)) {
6386
+ return React__default.createElement(
6387
+ React__default.Fragment,
6388
+ { key: itemCounter },
6393
6389
  React__default.createElement(
6394
- 'div',
6395
- { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6390
+ VisibilitySensor,
6391
+ {
6392
+ onChange: function onChange(isVisible) {
6393
+ isVisible && _this2.changePageNumber(pageNumber);
6394
+ } },
6396
6395
  React__default.createElement(
6397
- Card,
6398
- { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6399
- (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6400
- 'a',
6401
- { href: row.url.current, target: '_blank', className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6402
- React__default.createElement(
6403
- LazyLoad,
6404
- { height: _this2.props.imageHeight },
6405
- React__default.createElement(Card.Img, {
6406
- variant: 'top',
6407
- src: _this2.renderCardImage(row, page),
6408
- alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6409
- })
6410
- )
6411
- ),
6396
+ 'div',
6397
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6412
6398
  React__default.createElement(
6413
- Card.Body,
6414
- null,
6415
- React__default.createElement(
6399
+ Card,
6400
+ { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6401
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6416
6402
  'a',
6417
- { href: row.url.current, target: '_blank' },
6403
+ { href: row.url.current, target: '_blank', className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6418
6404
  React__default.createElement(
6419
- Card.Title,
6420
- null,
6421
- row.title
6405
+ LazyLoad,
6406
+ { height: _this2.props.imageHeight },
6407
+ React__default.createElement(Card.Img, {
6408
+ variant: 'top',
6409
+ src: _this2.renderCardImage(row, page),
6410
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6411
+ })
6422
6412
  )
6423
6413
  ),
6424
- _this2.props.showPublished && row.published && React__default.createElement(
6425
- Card.Subtitle,
6426
- { style: { marginTop: 0 } },
6427
- moment(row.published).format('MMMM DD, YYYY')
6414
+ React__default.createElement(
6415
+ Card.Body,
6416
+ null,
6417
+ React__default.createElement(
6418
+ 'a',
6419
+ { href: row.url.current, target: '_blank' },
6420
+ React__default.createElement(
6421
+ Card.Title,
6422
+ null,
6423
+ row.title
6424
+ )
6425
+ ),
6426
+ _this2.props.showPublished && row.published && React__default.createElement(
6427
+ Card.Subtitle,
6428
+ { style: { marginTop: 0 } },
6429
+ moment(row.published).format('MMMM DD, YYYY')
6430
+ ),
6431
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6432
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6433
+ }),
6434
+ React__default.createElement(
6435
+ Card.Text,
6436
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6437
+ row.summary
6438
+ )
6439
+ )
6440
+ )
6441
+ )
6442
+ ),
6443
+ showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6444
+ main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6445
+ );
6446
+ } else {
6447
+ return React__default.createElement(
6448
+ React__default.Fragment,
6449
+ { key: itemCounter },
6450
+ React__default.createElement(
6451
+ VisibilitySensor,
6452
+ {
6453
+ onChange: function onChange(isVisible) {
6454
+ isVisible && _this2.changePageNumber(pageNumber);
6455
+ } },
6456
+ React__default.createElement(
6457
+ 'div',
6458
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6459
+ React__default.createElement(
6460
+ Card,
6461
+ { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6462
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6463
+ Link,
6464
+ { href: row.url.current },
6465
+ React__default.createElement(
6466
+ 'a',
6467
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6468
+ React__default.createElement(
6469
+ LazyLoad,
6470
+ { height: _this2.props.imageHeight },
6471
+ React__default.createElement(Card.Img, {
6472
+ variant: 'top',
6473
+ src: _this2.renderCardImage(row, page),
6474
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6475
+ })
6476
+ )
6477
+ )
6428
6478
  ),
6429
- _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6430
- return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6431
- }),
6432
6479
  React__default.createElement(
6433
- Card.Text,
6434
- { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6435
- row.summary
6480
+ Card.Body,
6481
+ null,
6482
+ React__default.createElement(
6483
+ Link,
6484
+ { href: row.url.current },
6485
+ React__default.createElement(
6486
+ 'a',
6487
+ null,
6488
+ React__default.createElement(
6489
+ Card.Title,
6490
+ null,
6491
+ row.title
6492
+ )
6493
+ )
6494
+ ),
6495
+ _this2.props.showPublished && row.published && React__default.createElement(
6496
+ Card.Subtitle,
6497
+ { style: { marginTop: 0 } },
6498
+ moment(row.published).format('MMMM DD, YYYY')
6499
+ ),
6500
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6501
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6502
+ }),
6503
+ React__default.createElement(
6504
+ Card.Text,
6505
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6506
+ row.summary
6507
+ )
6436
6508
  )
6437
6509
  )
6438
6510
  )
6439
- )
6440
- ),
6441
- showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6442
- main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6443
- );
6511
+ ),
6512
+ showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6513
+ main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6514
+ );
6515
+ }
6444
6516
  }
6445
6517
  return React__default.createElement(
6446
6518
  React__default.Fragment,
@@ -7920,6 +7992,10 @@ var IoIosHome = function (props) {
7920
7992
  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);
7921
7993
  };
7922
7994
  IoIosHome.displayName = "IoIosHome";
7995
+ var IoIosOpen = function (props) {
7996
+ 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);
7997
+ };
7998
+ IoIosOpen.displayName = "IoIosOpen";
7923
7999
  var IoMdArrowDropdown = function (props) {
7924
8000
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M128 192l128 128 128-128z"}}]})(props);
7925
8001
  };
@@ -15514,28 +15590,13 @@ var RelatedTopicsDropdown = function RelatedTopicsDropdown(_ref) {
15514
15590
  };
15515
15591
 
15516
15592
  // THIS FILE IS AUTO GENERATED
15517
- var FaWindowClose = function (props) {
15518
- 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);
15593
+ var FaRegWindowClose = function (props) {
15594
+ 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);
15519
15595
  };
15520
- FaWindowClose.displayName = "FaWindowClose";
15596
+ FaRegWindowClose.displayName = "FaRegWindowClose";
15521
15597
 
15522
15598
  /*****UStream Component*****/
15523
- /*
15524
-
15525
- Width and Height(percent or px) prop passed is the floating window, when closed
15526
- it will take 100% of its parent element
15527
-
15528
- You can pass in another SRC for Ustream if needed
15529
-
15530
- If 'close' is passed as prop, the floating window will be removed
15531
- from DOM once close button is hit
15532
-
15533
- Example:
15534
- import { Ustream } from '@mjhls/mjh-framework';
15535
- <Ustream width={'200px'} height={'120px'} close />
15536
-
15537
- */
15538
- /************************* */
15599
+
15539
15600
  var Ustream = function Ustream(_ref) {
15540
15601
  var _ref$width = _ref.width,
15541
15602
  width = _ref$width === undefined ? '300px' : _ref$width,
@@ -15543,6 +15604,8 @@ var Ustream = function Ustream(_ref) {
15543
15604
  height = _ref$height === undefined ? '168px' : _ref$height,
15544
15605
  _ref$close = _ref.close,
15545
15606
  close = _ref$close === undefined ? false : _ref$close,
15607
+ _ref$right = _ref.right,
15608
+ right = _ref$right === undefined ? false : _ref$right,
15546
15609
  _ref$src = _ref.src,
15547
15610
  src = _ref$src === undefined ? 'https://video.ibm.com/embed/23627444?volume=0&autoplay=true' : _ref$src;
15548
15611
 
@@ -15560,11 +15623,15 @@ var Ustream = function Ustream(_ref) {
15560
15623
 
15561
15624
  React.useEffect(function () {
15562
15625
  try {
15563
- document.querySelector('.ustream-close').addEventListener('click', function (e) {
15564
- var container = document.getElementById('ustream-container');
15565
- if (close) {
15626
+ var container = document.getElementById('ustream-container');
15627
+
15628
+ if (close) {
15629
+ var closeBtn = document.querySelector('.ustream-close');
15630
+ closeBtn.addEventListener('click', function () {
15566
15631
  container.remove();
15567
- } else {
15632
+ });
15633
+ } else {
15634
+ document.querySelector('.ustream-minimize').addEventListener('click', function (e) {
15568
15635
  container.style.position = 'static';
15569
15636
  container.style.padding = '0 1rem';
15570
15637
  container.classList.add('closed');
@@ -15574,9 +15641,14 @@ var Ustream = function Ustream(_ref) {
15574
15641
  console.log(newHeight);
15575
15642
  console.log(ustreamContainer);
15576
15643
  setHeight(newHeight);
15577
- e.target.remove();
15578
- }
15579
- });
15644
+ document.querySelector('.ustream-minimize').remove();
15645
+ var closeBtn = document.querySelector('.ustream-close');
15646
+ closeBtn.style.display = 'block';
15647
+ closeBtn.addEventListener('click', function () {
15648
+ container.remove();
15649
+ });
15650
+ });
15651
+ }
15580
15652
  } catch (err) {}
15581
15653
  }, []);
15582
15654
 
@@ -15586,10 +15658,23 @@ var Ustream = function Ustream(_ref) {
15586
15658
  React__default.createElement(
15587
15659
  'div',
15588
15660
  { style: { position: 'relative' } },
15589
- React__default.createElement(
15661
+ close ? React__default.createElement(
15590
15662
  'div',
15591
15663
  { className: 'ustream-close' },
15592
- React__default.createElement(FaWindowClose, { style: { fontSize: '1.3rem' } })
15664
+ React__default.createElement(FaRegWindowClose, { style: { color: '#fff', fontSize: '1.3rem' } })
15665
+ ) : React__default.createElement(
15666
+ React__default.Fragment,
15667
+ null,
15668
+ React__default.createElement(
15669
+ 'div',
15670
+ { className: 'ustream-minimize' },
15671
+ React__default.createElement(IoIosOpen, { style: right ? { color: '#fff', fontSize: '1.3rem', transform: 'rotateZ(-90deg)' } : { color: '#fff', fontSize: '1.3rem' } })
15672
+ ),
15673
+ React__default.createElement(
15674
+ 'div',
15675
+ { className: 'ustream-close' },
15676
+ React__default.createElement(FaRegWindowClose, { style: { color: '#fff', fontSize: '1rem' } })
15677
+ )
15593
15678
  ),
15594
15679
  React__default.createElement('iframe', {
15595
15680
  id: 'ustream-iframe',
@@ -15597,13 +15682,12 @@ var Ustream = function Ustream(_ref) {
15597
15682
  webkitallowfullscreen: true,
15598
15683
  allowFullScreen: true,
15599
15684
  frameBorder: 'no',
15600
-
15601
15685
  style: { maxWidth: '100%', height: currentHeight, width: currentWidth } })
15602
15686
  ),
15603
15687
  React__default.createElement(
15604
15688
  'style',
15605
15689
  { jsx: 'true' },
15606
- '\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 '
15690
+ '\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 '
15607
15691
  )
15608
15692
  );
15609
15693
  };