@mjhls/mjh-framework 1.0.104 → 1.0.105
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 +199 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +198 -0
- 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, createContext, createElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import reactDom from 'react-dom';
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
@@ -11244,6 +11244,203 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
11244
11244
|
);
|
|
11245
11245
|
};
|
|
11246
11246
|
|
|
11247
|
+
var VideoSeriesListing = function (_React$Component) {
|
|
11248
|
+
inherits(VideoSeriesListing, _React$Component);
|
|
11249
|
+
|
|
11250
|
+
function VideoSeriesListing() {
|
|
11251
|
+
var _ref;
|
|
11252
|
+
|
|
11253
|
+
var _temp, _this, _ret;
|
|
11254
|
+
|
|
11255
|
+
classCallCheck(this, VideoSeriesListing);
|
|
11256
|
+
|
|
11257
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
11258
|
+
args[_key] = arguments[_key];
|
|
11259
|
+
}
|
|
11260
|
+
|
|
11261
|
+
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || Object.getPrototypeOf(VideoSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
|
|
11262
|
+
data: _this.data,
|
|
11263
|
+
per: _this.params ? _this.params.to : 2,
|
|
11264
|
+
page: _this.props.currentPage || 1,
|
|
11265
|
+
from: _this.params ? _this.params.from : 0,
|
|
11266
|
+
to: _this.params ? _this.params.to : 2,
|
|
11267
|
+
total_pages: null,
|
|
11268
|
+
scrolling: true,
|
|
11269
|
+
query: _this.query,
|
|
11270
|
+
currentPage: _this.props.currentPage || 1
|
|
11271
|
+
}, _this.loadMore = debounce_1(function () {
|
|
11272
|
+
_this.setState(function (state) {
|
|
11273
|
+
var page = state.page,
|
|
11274
|
+
from = state.from,
|
|
11275
|
+
per = state.per,
|
|
11276
|
+
to = state.to;
|
|
11277
|
+
|
|
11278
|
+
return {
|
|
11279
|
+
page: page + 1,
|
|
11280
|
+
from: from + per,
|
|
11281
|
+
to: to + per
|
|
11282
|
+
};
|
|
11283
|
+
}, _this.loadData);
|
|
11284
|
+
}, 0), _this.loadData = function () {
|
|
11285
|
+
var _this$state = _this.state,
|
|
11286
|
+
from = _this$state.from,
|
|
11287
|
+
to = _this$state.to,
|
|
11288
|
+
data = _this$state.data,
|
|
11289
|
+
query = _this$state.query,
|
|
11290
|
+
page = _this$state.page;
|
|
11291
|
+
var client = _this.props.client;
|
|
11292
|
+
|
|
11293
|
+
_this.changePageNumber(page);
|
|
11294
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
11295
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
11296
|
+
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
11297
|
+
});client.fetch(query, params).then(function (dataArr) {
|
|
11298
|
+
if (_this.pointer && _this.pointerArray) {
|
|
11299
|
+
var pointer = _this.pointer;
|
|
11300
|
+
dataArr = dataArr[_this.pointerArray][pointer];
|
|
11301
|
+
}
|
|
11302
|
+
dataArr = dataArr.map(function (item) {
|
|
11303
|
+
return _extends({}, item, {
|
|
11304
|
+
pageNumber: page
|
|
11305
|
+
});
|
|
11306
|
+
});
|
|
11307
|
+
|
|
11308
|
+
_this.setState(function () {
|
|
11309
|
+
if (dataArr.length > 0) {
|
|
11310
|
+
return {
|
|
11311
|
+
data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
|
|
11312
|
+
scrolling: true
|
|
11313
|
+
};
|
|
11314
|
+
} else {
|
|
11315
|
+
return {
|
|
11316
|
+
scrolling: false
|
|
11317
|
+
};
|
|
11318
|
+
}
|
|
11319
|
+
});
|
|
11320
|
+
});
|
|
11321
|
+
}, _this.changePageNumber = function (pageNumber) {
|
|
11322
|
+
var _this$props = _this.props,
|
|
11323
|
+
seoPaginate = _this$props.seoPaginate,
|
|
11324
|
+
pageview = _this$props.pageview,
|
|
11325
|
+
router = _this$props.router;
|
|
11326
|
+
var currentPage = _this.state.currentPage;
|
|
11327
|
+
|
|
11328
|
+
if (seoPaginate) {
|
|
11329
|
+
var path = router.asPath;
|
|
11330
|
+
var qrIndex = path.indexOf('?');
|
|
11331
|
+
var pathname = router.pathname;
|
|
11332
|
+
var queryString = '';
|
|
11333
|
+
|
|
11334
|
+
if (qrIndex > 0) {
|
|
11335
|
+
path = path.substring(1, qrIndex);
|
|
11336
|
+
|
|
11337
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
11338
|
+
var partialQSArr = partialQS.split('&');
|
|
11339
|
+
|
|
11340
|
+
// exclude page=xxx from query string
|
|
11341
|
+
partialQSArr.map(function (item) {
|
|
11342
|
+
var itemArr = item.split('=');
|
|
11343
|
+
var key = itemArr[0];
|
|
11344
|
+
var val = itemArr[1];
|
|
11345
|
+
|
|
11346
|
+
if (key !== 'page') {
|
|
11347
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
11348
|
+
}
|
|
11349
|
+
});
|
|
11350
|
+
}
|
|
11351
|
+
|
|
11352
|
+
if (queryString.length > 0) {
|
|
11353
|
+
path += '?' + queryString;
|
|
11354
|
+
}
|
|
11355
|
+
|
|
11356
|
+
pageNumber = parseInt(pageNumber);
|
|
11357
|
+
|
|
11358
|
+
if (currentPage !== pageNumber) {
|
|
11359
|
+
lib_3.refresh();
|
|
11360
|
+
if (pageview) {
|
|
11361
|
+
_this.setState({
|
|
11362
|
+
currentPage: pageNumber
|
|
11363
|
+
}, function () {
|
|
11364
|
+
if (path[0] !== '/') {
|
|
11365
|
+
path = '/' + path;
|
|
11366
|
+
}
|
|
11367
|
+
|
|
11368
|
+
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
11369
|
+
|
|
11370
|
+
pageview(newPath);
|
|
11371
|
+
|
|
11372
|
+
router.push(pathname, newPath, {
|
|
11373
|
+
shallow: true
|
|
11374
|
+
});
|
|
11375
|
+
});
|
|
11376
|
+
}
|
|
11377
|
+
}
|
|
11378
|
+
}
|
|
11379
|
+
}, _this.renderManualPagination = function () {
|
|
11380
|
+
var currentPage = _this.state.currentPage;
|
|
11381
|
+
|
|
11382
|
+
return React__default.createElement(
|
|
11383
|
+
'div',
|
|
11384
|
+
{ className: 'd-flex justify-content-between' },
|
|
11385
|
+
currentPage && currentPage > 1 && React__default.createElement(
|
|
11386
|
+
'a',
|
|
11387
|
+
{ href: '?page=' + (currentPage - 1) },
|
|
11388
|
+
'<< Previous'
|
|
11389
|
+
),
|
|
11390
|
+
React__default.createElement(
|
|
11391
|
+
'a',
|
|
11392
|
+
{ href: '?page=' + (currentPage + 1) },
|
|
11393
|
+
'Next >>'
|
|
11394
|
+
)
|
|
11395
|
+
);
|
|
11396
|
+
}, _temp), possibleConstructorReturn(_this, _ret);
|
|
11397
|
+
}
|
|
11398
|
+
|
|
11399
|
+
createClass(VideoSeriesListing, [{
|
|
11400
|
+
key: 'render',
|
|
11401
|
+
value: function render() {
|
|
11402
|
+
return React__default.createElement(
|
|
11403
|
+
InfiniteScroll,
|
|
11404
|
+
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
11405
|
+
React__default.createElement(
|
|
11406
|
+
Container,
|
|
11407
|
+
null,
|
|
11408
|
+
this.state.data && this.state.data.map(function (docSeries, index$$1) {
|
|
11409
|
+
docSeries.body[0].videos && docSeries.body[0].videos.map(function (singleVideo, indexInner) {
|
|
11410
|
+
singleVideo.link = '/view/' + docSeries.url.current + '?seriesVid=' + (indexInner + 1);
|
|
11411
|
+
});
|
|
11412
|
+
return React__default.createElement(
|
|
11413
|
+
'div',
|
|
11414
|
+
null,
|
|
11415
|
+
React__default.createElement(
|
|
11416
|
+
'h4',
|
|
11417
|
+
{ className: 'video-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid var(--gold)' } },
|
|
11418
|
+
React__default.createElement(
|
|
11419
|
+
Link,
|
|
11420
|
+
{ href: '/case-based-peer-perspectives/' + docSeries.url.current },
|
|
11421
|
+
React__default.createElement(
|
|
11422
|
+
'a',
|
|
11423
|
+
null,
|
|
11424
|
+
docSeries.title,
|
|
11425
|
+
React__default.createElement(
|
|
11426
|
+
'span',
|
|
11427
|
+
{ style: { fontSize: '.9rem', color: 'grey', marginLeft: '1rem' } },
|
|
11428
|
+
'View Topic'
|
|
11429
|
+
)
|
|
11430
|
+
)
|
|
11431
|
+
)
|
|
11432
|
+
),
|
|
11433
|
+
React__default.createElement(YoutubeGroup, { key: index$$1, dataset: docSeries.body[0].videos })
|
|
11434
|
+
);
|
|
11435
|
+
})
|
|
11436
|
+
)
|
|
11437
|
+
);
|
|
11438
|
+
}
|
|
11439
|
+
}]);
|
|
11440
|
+
return VideoSeriesListing;
|
|
11441
|
+
}(React__default.Component);
|
|
11442
|
+
var VideoSeriesListing$1 = withRouter(VideoSeriesListing);
|
|
11443
|
+
|
|
11247
11444
|
var Column1 = function Column1(props) {
|
|
11248
11445
|
var title = props.title;
|
|
11249
11446
|
|
|
@@ -19913,5 +20110,5 @@ var Hero = function Hero(_ref) {
|
|
|
19913
20110
|
);
|
|
19914
20111
|
};
|
|
19915
20112
|
|
|
19916
|
-
export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, PageFilter, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs, Hero };
|
|
20113
|
+
export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, VideoSeriesListing$1 as VideoSeriesListing, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, PageFilter, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs, Hero };
|
|
19917
20114
|
//# sourceMappingURL=index.es.js.map
|