@mjhls/mjh-framework 1.0.149 → 1.0.150
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 +1 -1
- package/dist/index.es.js +123 -51
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +122 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { Component, useState, useEffect, useRef,
|
|
1
|
+
import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import reactDom from 'react-dom';
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
@@ -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
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
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
|
-
|
|
6388
|
-
{
|
|
6383
|
+
VisibilitySensor,
|
|
6384
|
+
{
|
|
6385
|
+
onChange: function onChange(isVisible) {
|
|
6386
|
+
isVisible && _this2.changePageNumber(pageNumber);
|
|
6387
|
+
} },
|
|
6389
6388
|
React__default.createElement(
|
|
6390
|
-
|
|
6391
|
-
{
|
|
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
|
|
6407
|
-
|
|
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
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
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
|
-
|
|
6418
|
-
Card.
|
|
6419
|
-
|
|
6420
|
-
|
|
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.
|
|
6427
|
-
|
|
6428
|
-
|
|
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
|
-
|
|
6435
|
-
|
|
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,
|