@mjhls/mjh-framework 1.0.93 → 1.0.95

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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
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';
@@ -7,9 +7,9 @@ import Col from 'react-bootstrap/Col';
7
7
  import Card from 'react-bootstrap/Card';
8
8
  import moment from 'moment';
9
9
  import Link from 'next/link';
10
- import { withRouter, useRouter } from 'next/router';
10
+ import Router, { withRouter, useRouter } from 'next/router';
11
11
  import Media from 'react-bootstrap/Media';
12
- import { Media as Media$1, Container as Container$1, Figure, Carousel, Table } from 'react-bootstrap';
12
+ import { Media as Media$1, Container as Container$1, Spinner, Figure, Carousel, Table } from 'react-bootstrap';
13
13
  import ListGroup from 'react-bootstrap/ListGroup';
14
14
  import Head from 'next/head';
15
15
  import Accordion from 'react-bootstrap/Accordion';
@@ -22,6 +22,7 @@ import Nav from 'react-bootstrap/Nav';
22
22
  import Navbar from 'react-bootstrap/Navbar';
23
23
  import NavDropdown from 'react-bootstrap/NavDropdown';
24
24
  import Carousel$1 from 'react-bootstrap/Carousel';
25
+ import Breadcrumb from 'react-bootstrap/Breadcrumb';
25
26
 
26
27
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
27
28
 
@@ -3972,8 +3973,7 @@ var DeckContent = function (_React$Component) {
3972
3973
  }
3973
3974
 
3974
3975
  var pageNumber = row.pageNumber || _this.state.page;
3975
- var contentCategoryName = row.contentCategory ? row.contentCategory.name : 'Articles';
3976
-
3976
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
3977
3977
  return React__default.createElement(
3978
3978
  VisibilitySensor,
3979
3979
  {
@@ -5150,66 +5150,62 @@ var GridContent = function (_React$Component) {
5150
5150
  return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = GridContent.__proto__ || Object.getPrototypeOf(GridContent)).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.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
5151
5151
  data: _this.data,
5152
5152
  per: _this.params ? _this.params.to : 2,
5153
- page: 1,
5153
+ page: _this.props.currentPage || 1,
5154
5154
  from: _this.params ? _this.params.from : 0,
5155
5155
  to: _this.params ? _this.params.to : 2,
5156
5156
  total_pages: null,
5157
5157
  scrolling: true,
5158
- query: _this.query
5159
- }, _this.loadMore = function () {
5160
- setTimeout(function () {
5161
- _this.setState(function (state, props) {
5162
- return {
5163
- page: state.page + 1,
5164
- from: state.from + state.per,
5165
- to: state.to + state.per
5166
- };
5167
- }, _this.loadData);
5168
- }, 10);
5169
- }, _this.loadData = function () {
5158
+ query: _this.query,
5159
+ currentPage: _this.props.currentPage || 1
5160
+ }, _this.loadMore = debounce_1(function () {
5161
+ _this.setState(function (state) {
5162
+ var page = state.page,
5163
+ from = state.from,
5164
+ per = state.per,
5165
+ to = state.to;
5166
+
5167
+ return {
5168
+ page: page + 1,
5169
+ from: from + per,
5170
+ to: to + per
5171
+ };
5172
+ }, _this.loadData);
5173
+ }, 0), _this.loadData = function () {
5170
5174
  var _this$state = _this.state,
5171
5175
  from = _this$state.from,
5172
5176
  to = _this$state.to,
5173
5177
  data = _this$state.data,
5174
- query = _this$state.query;
5178
+ query = _this$state.query,
5179
+ page = _this$state.page;
5175
5180
  var client = _this.props.client;
5176
5181
 
5177
5182
 
5178
5183
  var params = _extends({}, _this.params, { from: from, to: to
5179
5184
  // const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
5180
-
5181
- });if (_this.pointer && _this.pointerArray) {
5182
- var pointer = _this.pointer;
5183
- client.fetch(query, params).then(function (dataArr) {
5184
- _this.setState(function (state, props) {
5185
- if (dataArr[_this.pointerArray][pointer].length > 0) {
5186
- return {
5187
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr[_this.pointerArray][pointer])),
5188
- scrolling: true
5189
- };
5190
- } else {
5191
- return {
5192
- scrolling: false
5193
- };
5194
- }
5185
+ });client.fetch(query, params).then(function (dataArr) {
5186
+ if (_this.pointer && _this.pointerArray) {
5187
+ var pointer = _this.pointer;
5188
+ dataArr = dataArr[_this.pointerArray][pointer];
5189
+ }
5190
+ dataArr = dataArr.map(function (item) {
5191
+ return _extends({}, item, {
5192
+ pageNumber: page
5195
5193
  });
5196
5194
  });
5197
- } else {
5198
- client.fetch(query, params).then(function (dataArr) {
5199
- _this.setState(function (state, props) {
5200
- if (dataArr.length > 0) {
5201
- return {
5202
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5203
- scrolling: true
5204
- };
5205
- } else {
5206
- return {
5207
- scrolling: false
5208
- };
5209
- }
5210
- });
5195
+
5196
+ _this.setState(function () {
5197
+ if (dataArr.length > 0) {
5198
+ return {
5199
+ data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5200
+ scrolling: true
5201
+ };
5202
+ } else {
5203
+ return {
5204
+ scrolling: false
5205
+ };
5206
+ }
5211
5207
  });
5212
- }
5208
+ });
5213
5209
  }, _this.urlFor = function (source) {
5214
5210
  var client = _this.props.client;
5215
5211
 
@@ -5279,6 +5275,23 @@ var GridContent = function (_React$Component) {
5279
5275
  }
5280
5276
  }
5281
5277
  }
5278
+ }, _this.renderManualPagination = function () {
5279
+ var currentPage = _this.state.currentPage;
5280
+
5281
+ return React__default.createElement(
5282
+ 'div',
5283
+ { className: 'd-flex justify-content-between' },
5284
+ currentPage && currentPage > 1 && React__default.createElement(
5285
+ 'a',
5286
+ { href: '?page=' + (currentPage - 1) },
5287
+ '<< Previous'
5288
+ ),
5289
+ React__default.createElement(
5290
+ 'a',
5291
+ { href: '?page=' + (currentPage + 1) },
5292
+ 'Next >>'
5293
+ )
5294
+ );
5282
5295
  }, _temp), possibleConstructorReturn(_this, _ret);
5283
5296
  }
5284
5297
 
@@ -5329,7 +5342,7 @@ var GridContent = function (_React$Component) {
5329
5342
  ),
5330
5343
  _this2.props.showPublished && row.published && React__default.createElement(
5331
5344
  Card.Subtitle,
5332
- null,
5345
+ { style: { marginTop: 0 } },
5333
5346
  moment(row.published).format('MMMM DD, YYYY')
5334
5347
  ),
5335
5348
  React__default.createElement(
@@ -5352,7 +5365,7 @@ var GridContent = function (_React$Component) {
5352
5365
  { className: 'grid-container' },
5353
5366
  this.state.data && this.state.data.map(function (row, index$$1) {
5354
5367
  var pageNumber = row.pageNumber || _this2.state.page;
5355
- var contentCategoryName = row.contentCategory ? row.contentCategory.name : 'Articles';
5368
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
5356
5369
  return React__default.createElement(
5357
5370
  VisibilitySensor,
5358
5371
  {
@@ -5389,6 +5402,11 @@ var GridContent = function (_React$Component) {
5389
5402
  null,
5390
5403
  row.title
5391
5404
  ),
5405
+ _this2.props.showPublished && row.published && React__default.createElement(
5406
+ Card.Subtitle,
5407
+ { style: { marginTop: 0 } },
5408
+ moment(row.published).format('MMMM DD, YYYY')
5409
+ ),
5392
5410
  React__default.createElement(
5393
5411
  Card.Text,
5394
5412
  { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
@@ -5454,6 +5472,11 @@ var GridContent = function (_React$Component) {
5454
5472
  'End of data'
5455
5473
  )
5456
5474
  )
5475
+ ),
5476
+ React__default.createElement(
5477
+ 'noscript',
5478
+ null,
5479
+ this.renderManualPagination()
5457
5480
  )
5458
5481
  )
5459
5482
  );
@@ -5478,74 +5501,151 @@ var DeckQueue = function (_React$Component) {
5478
5501
  args[_key] = arguments[_key];
5479
5502
  }
5480
5503
 
5481
- return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || Object.getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.state = {
5504
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || Object.getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
5482
5505
  data: _this.data,
5483
5506
  per: _this.params ? _this.params.to : 2,
5484
- page: 1,
5507
+ page: _this.props.currentPage || 1,
5485
5508
  from: _this.params ? _this.params.from : 0,
5486
5509
  to: _this.params ? _this.params.to : 2,
5487
5510
  total_pages: null,
5488
5511
  scrolling: true,
5489
- query: _this.query
5490
- }, _this.loadMore = function () {
5491
- setTimeout(function () {
5492
- _this.setState(function (state, props) {
5493
- return {
5494
- page: state.page + 1,
5495
- from: state.from + state.per,
5496
- to: state.to + state.per
5497
- };
5498
- }, _this.loadData);
5499
- }, 10);
5500
- }, _this.loadData = function () {
5512
+ query: _this.query,
5513
+ currentPage: _this.props.currentPage || 1
5514
+ }, _this.loadMore = debounce_1(function () {
5515
+ _this.setState(function (state) {
5516
+ var page = state.page,
5517
+ from = state.from,
5518
+ per = state.per,
5519
+ to = state.to;
5520
+
5521
+ return {
5522
+ page: page + 1,
5523
+ from: from + per,
5524
+ to: to + per
5525
+ };
5526
+ }, _this.loadData);
5527
+ }, 0), _this.loadData = function () {
5501
5528
  var _this$state = _this.state,
5502
5529
  from = _this$state.from,
5503
5530
  to = _this$state.to,
5504
5531
  data = _this$state.data,
5505
- query = _this$state.query;
5532
+ query = _this$state.query,
5533
+ page = _this$state.page;
5506
5534
  var client = _this.props.client;
5507
5535
 
5508
5536
 
5509
5537
  var params = _extends({}, _this.params, { from: from, to: to
5510
5538
  // const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
5511
-
5512
- });if (_this.pointer && _this.pointerArray) {
5513
- var pointer = _this.pointer;
5514
- client.fetch(query, params).then(function (dataArr) {
5515
- _this.setState(function (state, props) {
5516
- if (dataArr[_this.pointerArray][pointer].length > 0) {
5517
- return {
5518
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr[_this.pointerArray][pointer])),
5519
- scrolling: true
5520
- };
5521
- } else {
5522
- return {
5523
- scrolling: false
5524
- };
5525
- }
5539
+ });client.fetch(query, params).then(function (dataArr) {
5540
+ if (_this.pointer && _this.pointerArray) {
5541
+ var pointer = _this.pointer;
5542
+ dataArr = dataArr[_this.pointerArray][pointer];
5543
+ }
5544
+ dataArr = dataArr.map(function (item) {
5545
+ return _extends({}, item, {
5546
+ pageNumber: page
5526
5547
  });
5527
5548
  });
5528
- } else {
5529
- client.fetch(query, params).then(function (dataArr) {
5530
- _this.setState(function (state, props) {
5531
- if (dataArr.length > 0) {
5532
- return {
5533
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5534
- scrolling: true
5535
- };
5536
- } else {
5537
- return {
5538
- scrolling: false
5539
- };
5540
- }
5541
- });
5549
+
5550
+ _this.setState(function () {
5551
+ if (dataArr.length > 0) {
5552
+ return {
5553
+ data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5554
+ scrolling: true
5555
+ };
5556
+ } else {
5557
+ return {
5558
+ scrolling: false
5559
+ };
5560
+ }
5542
5561
  });
5543
- }
5562
+ });
5544
5563
  }, _this.urlFor = function (source) {
5545
5564
  var client = _this.props.client;
5546
5565
 
5547
5566
  var builder = imageUrlBuilder(client);
5548
5567
  return builder.image(source);
5568
+ }, _this.renderCardImage = function (row, page) {
5569
+ if (row.thumbnail) {
5570
+ return _this.urlFor(row.thumbnail).url();
5571
+ } else {
5572
+ return _this.defaultImage;
5573
+ }
5574
+ }, _this.changePageNumber = function (pageNumber) {
5575
+ var _this$props = _this.props,
5576
+ seoPaginate = _this$props.seoPaginate,
5577
+ pageview = _this$props.pageview,
5578
+ router = _this$props.router;
5579
+ var currentPage = _this.state.currentPage;
5580
+
5581
+ if (seoPaginate) {
5582
+ var path = router.asPath;
5583
+ var qrIndex = path.indexOf('?');
5584
+ var pathname = router.pathname;
5585
+ var queryString = '';
5586
+
5587
+ if (qrIndex > 0) {
5588
+ path = path.substring(1, qrIndex);
5589
+
5590
+ var partialQS = router.asPath.substring(qrIndex + 1);
5591
+ var partialQSArr = partialQS.split('&');
5592
+
5593
+ // exclude page=xxx from query string
5594
+ partialQSArr.map(function (item) {
5595
+ var itemArr = item.split('=');
5596
+ var key = itemArr[0];
5597
+ var val = itemArr[1];
5598
+
5599
+ if (key !== 'page') {
5600
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
5601
+ }
5602
+ });
5603
+ }
5604
+
5605
+ if (queryString.length > 0) {
5606
+ path += '?' + queryString;
5607
+ }
5608
+
5609
+ pageNumber = parseInt(pageNumber);
5610
+
5611
+ if (currentPage !== pageNumber) {
5612
+ lib_3.refresh();
5613
+ if (pageview) {
5614
+ _this.setState({
5615
+ currentPage: pageNumber
5616
+ }, function () {
5617
+ if (path[0] !== '/') {
5618
+ path = '/' + path;
5619
+ }
5620
+
5621
+ var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
5622
+
5623
+ pageview(newPath);
5624
+
5625
+ router.push(pathname, newPath, {
5626
+ shallow: true
5627
+ });
5628
+ });
5629
+ }
5630
+ }
5631
+ }
5632
+ }, _this.renderManualPagination = function () {
5633
+ var currentPage = _this.state.currentPage;
5634
+
5635
+ return React__default.createElement(
5636
+ 'div',
5637
+ { className: 'd-flex justify-content-between' },
5638
+ currentPage && currentPage > 1 && React__default.createElement(
5639
+ 'a',
5640
+ { href: '?page=' + (currentPage - 1) },
5641
+ '<< Previous'
5642
+ ),
5643
+ React__default.createElement(
5644
+ 'a',
5645
+ { href: '?page=' + (currentPage + 1) },
5646
+ 'Next >>'
5647
+ )
5648
+ );
5549
5649
  }, _temp), possibleConstructorReturn(_this, _ret);
5550
5650
  }
5551
5651
 
@@ -5560,64 +5660,73 @@ var DeckQueue = function (_React$Component) {
5560
5660
  return React__default.createElement(
5561
5661
  Row,
5562
5662
  null,
5563
- this.state.data && this.state.data.map(function (row, index) {
5663
+ this.state.data && this.state.data.map(function (row, index$$1) {
5664
+ var pageNumber = row.pageNumber || _this2.state.page;
5564
5665
  // const thumbnailURL = get(row, 'thumbnail.asset.url', this.props.defaultImage)
5565
5666
  var thumbnailURL = row.thumbnail ? _this2.urlFor(row.thumbnail).url() : _this2.props.defaultImage;
5566
5667
  return React__default.createElement(
5567
- Col,
5568
- { key: index, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
5668
+ VisibilitySensor,
5669
+ {
5670
+ key: index$$1,
5671
+ onChange: function onChange(isVisible) {
5672
+ isVisible && _this2.changePageNumber(pageNumber);
5673
+ } },
5569
5674
  React__default.createElement(
5570
- Card,
5571
- { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
5675
+ Col,
5676
+ { md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
5572
5677
  React__default.createElement(
5573
- Row,
5574
- { style: { flexDirection: mode } },
5575
- React__default.createElement(
5576
- Col,
5577
- { md: 12, lg: 4 },
5578
- React__default.createElement(
5579
- Link,
5580
- { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5581
- React__default.createElement(Card.Img, { variant: 'top', src: thumbnailURL })
5582
- )
5583
- ),
5678
+ Card,
5679
+ { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
5584
5680
  React__default.createElement(
5585
- Col,
5586
- null,
5681
+ Row,
5682
+ { style: { flexDirection: mode } },
5587
5683
  React__default.createElement(
5588
- Card.Body,
5589
- { style: { padding: '20px' } },
5590
- row.title && React__default.createElement(
5684
+ Col,
5685
+ { md: 12, lg: 4 },
5686
+ React__default.createElement(
5591
5687
  Link,
5592
5688
  { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5593
- React__default.createElement(
5594
- Card.Title,
5595
- null,
5596
- row.title
5597
- )
5598
- ),
5599
- _this2.props.showPublished && row.published && React__default.createElement(
5600
- Card.Subtitle,
5601
- null,
5602
- moment(row.published).format('MMMM DD, YYYY')
5603
- ),
5604
- _this2.props.showRecent && row.recent && row.recent.title && React__default.createElement(
5605
- Card.Subtitle,
5606
- null,
5607
- 'Recent : ',
5608
- React__default.createElement(
5689
+ React__default.createElement(Card.Img, { variant: 'top', src: thumbnailURL })
5690
+ )
5691
+ ),
5692
+ React__default.createElement(
5693
+ Col,
5694
+ null,
5695
+ React__default.createElement(
5696
+ Card.Body,
5697
+ { style: { padding: '20px' } },
5698
+ row.title && React__default.createElement(
5609
5699
  Link,
5610
- { href: 'view/' + row.recent.url.current },
5611
- row.recent.title
5612
- )
5613
- ),
5614
- row.summary && React__default.createElement(
5615
- Link,
5616
- { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5617
- React__default.createElement(
5618
- Card.Text,
5700
+ { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5701
+ React__default.createElement(
5702
+ Card.Title,
5703
+ null,
5704
+ row.title
5705
+ )
5706
+ ),
5707
+ _this2.props.showPublished && row.published && React__default.createElement(
5708
+ Card.Subtitle,
5619
5709
  null,
5620
- row.summary
5710
+ moment(row.published).format('MMMM DD, YYYY')
5711
+ ),
5712
+ _this2.props.showRecent && row.recent && row.recent.title && React__default.createElement(
5713
+ Card.Subtitle,
5714
+ null,
5715
+ 'Recent : ',
5716
+ React__default.createElement(
5717
+ Link,
5718
+ { href: 'view/' + row.recent.url.current },
5719
+ row.recent.title
5720
+ )
5721
+ ),
5722
+ row.summary && React__default.createElement(
5723
+ Link,
5724
+ { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5725
+ React__default.createElement(
5726
+ Card.Text,
5727
+ null,
5728
+ row.summary
5729
+ )
5621
5730
  )
5622
5731
  )
5623
5732
  )
@@ -5679,6 +5788,11 @@ var DeckQueue = function (_React$Component) {
5679
5788
  'End of data'
5680
5789
  )
5681
5790
  )
5791
+ ),
5792
+ React__default.createElement(
5793
+ 'noscript',
5794
+ null,
5795
+ this.renderManualPagination()
5682
5796
  )
5683
5797
  )
5684
5798
  );
@@ -5687,6 +5801,8 @@ var DeckQueue = function (_React$Component) {
5687
5801
  return DeckQueue;
5688
5802
  }(React__default.Component);
5689
5803
 
5804
+ var Queue = withRouter(DeckQueue);
5805
+
5690
5806
  var ThumbnailCard = function ThumbnailCard(_ref) {
5691
5807
  var size = _ref.size,
5692
5808
  mediaData = _ref.mediaData,
@@ -7021,12 +7137,25 @@ var Search = function Search(_ref) {
7021
7137
  searchKey = _useState2[0],
7022
7138
  setSearchKey = _useState2[1];
7023
7139
 
7024
- var handleSearch = function handleSearch(value) {
7025
- router.push({
7026
- pathname: '/search',
7027
- query: { searchTerm: value }
7140
+ var _useState3 = useState(false),
7141
+ _useState4 = slicedToArray(_useState3, 2),
7142
+ activesearch = _useState4[0],
7143
+ setActivesearch = _useState4[1];
7144
+
7145
+ useEffect(function () {
7146
+ if (activesearch) {
7147
+ router.push({
7148
+ pathname: '/search',
7149
+ query: { searchTerm: searchKey }
7150
+ });
7151
+ }
7152
+ }, [activesearch]);
7153
+
7154
+ useEffect(function () {
7155
+ Router.events.on('routeChangeComplete', function () {
7156
+ return setActivesearch(false);
7028
7157
  });
7029
- };
7158
+ });
7030
7159
 
7031
7160
  return React__default.createElement(
7032
7161
  Form,
@@ -7034,16 +7163,17 @@ var Search = function Search(_ref) {
7034
7163
  inline: true,
7035
7164
  onSubmit: function onSubmit(e) {
7036
7165
  e.preventDefault();
7037
- handleSearch(searchKey);
7166
+ setActivesearch(true);
7038
7167
  } },
7168
+ activesearch && React__default.createElement(Spinner, { className: 'active-loader mr-3', animation: 'border', variant: 'light' }),
7039
7169
  React__default.createElement(FormControl, { type: 'text', placeholder: placeholder, className: 'mr-sm-2', value: searchKey, onChange: function onChange(e) {
7040
7170
  return setSearchKey(e.target.value);
7041
7171
  } }),
7042
7172
  React__default.createElement(
7043
7173
  Button,
7044
7174
  { variant: 'secondary', onClick: function onClick() {
7045
- return handleSearch(searchKey);
7046
- } },
7175
+ return setActivesearch(true);
7176
+ }, disabled: activesearch },
7047
7177
  btnText
7048
7178
  )
7049
7179
  );
@@ -7172,6 +7302,11 @@ var NavMagazine = function NavMagazine(props) {
7172
7302
  React__default.createElement(Search, null)
7173
7303
  )
7174
7304
  )
7305
+ ),
7306
+ React__default.createElement(
7307
+ 'style',
7308
+ { jsx: true },
7309
+ '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n '
7175
7310
  )
7176
7311
  );
7177
7312
  };
@@ -7243,6 +7378,11 @@ var NavNative = function NavNative(props) {
7243
7378
  React__default.createElement(Search, null)
7244
7379
  )
7245
7380
  )
7381
+ ),
7382
+ React__default.createElement(
7383
+ 'style',
7384
+ { jsx: true },
7385
+ '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n '
7246
7386
  )
7247
7387
  );
7248
7388
  };
@@ -7316,6 +7456,11 @@ var NavNormal = function NavNormal(props) {
7316
7456
  ),
7317
7457
  React__default.createElement(Search, null)
7318
7458
  )
7459
+ ),
7460
+ React__default.createElement(
7461
+ 'style',
7462
+ { jsx: true },
7463
+ '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n '
7319
7464
  )
7320
7465
  );
7321
7466
  };
@@ -7421,7 +7566,7 @@ var NavDvm = function NavDvm(props) {
7421
7566
  React__default.createElement(
7422
7567
  'style',
7423
7568
  { jsx: 'true' },
7424
- '\n .mobile-logo{\n display: none;\n position: absolute;\n left: 50%;\n top: 0;\n height: 40px;\n transform: translateX(-50%);\n }\n .mobile-logo img{\n height: 100%;\n }\n @media screen and (max-width: 1199px){\n .mobile-logo{\n display: block;\n }\n .top-nav{\n display: none;\n }\n }\n '
7569
+ '\n .mobile-logo{\n display: none;\n position: absolute;\n left: 50%;\n top: 0;\n height: 40px;\n transform: translateX(-50%);\n }\n .mobile-logo img{\n height: 100%;\n }\n @media screen and (max-width: 1199px){\n .mobile-logo{\n display: block;\n }\n .top-nav{\n display: none;\n }\n }\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n \n '
7425
7570
  )
7426
7571
  );
7427
7572
  };
@@ -8495,7 +8640,7 @@ var urlFor$1 = function urlFor(source, builder) {
8495
8640
  var onChangeSlide = function onChangeSlide(selectedIndex, pageview, setCarouselIndex, asPath) {
8496
8641
  setCarouselIndex(selectedIndex);
8497
8642
  lib_3.refresh();
8498
- pageview(asPath);
8643
+ if (pageview) pageview(asPath);
8499
8644
  };
8500
8645
 
8501
8646
  var Slideshow = function Slideshow(_ref) {
@@ -8514,7 +8659,7 @@ var Slideshow = function Slideshow(_ref) {
8514
8659
 
8515
8660
  return React__default.createElement(
8516
8661
  'div',
8517
- { style: { marginTop: '1em', marginBottom: '1em' } },
8662
+ { className: 'mt-3 mb-3' },
8518
8663
  React__default.createElement(
8519
8664
  Carousel,
8520
8665
  { activeIndex: carouselIndex, onSelect: function onSelect(selectedIndex, e) {
@@ -8524,7 +8669,12 @@ var Slideshow = function Slideshow(_ref) {
8524
8669
  return React__default.createElement(
8525
8670
  Carousel.Item,
8526
8671
  { key: slide._key },
8527
- React__default.createElement('img', { src: urlFor$1(slide.asset, builder).url(), style: { width: '100%' } })
8672
+ React__default.createElement('img', { src: slide.asset && urlFor$1(slide.asset, builder).url(), alt: slide.alt && slide.alt, style: { width: '100%' } }),
8673
+ slide.caption && React__default.createElement(
8674
+ 'p',
8675
+ { className: 'p-2' },
8676
+ slide.caption
8677
+ )
8528
8678
  );
8529
8679
  })
8530
8680
  )
@@ -12072,7 +12222,7 @@ var Sidebar = function Sidebar(_ref) {
12072
12222
 
12073
12223
  return React__default.createElement(
12074
12224
  'article',
12075
- { className: 'sidebar', style: { background: '#eee', marginRight: '10%', marginLeft: '1rem', width: '40%', padding: '1rem 0 0' } },
12225
+ { className: 'sidebar', style: { background: '#eee' } },
12076
12226
  React__default.createElement(
12077
12227
  'div',
12078
12228
  null,
@@ -12082,6 +12232,11 @@ var Sidebar = function Sidebar(_ref) {
12082
12232
  caption
12083
12233
  ),
12084
12234
  React__default.createElement(BlockContent, { blocks: content })
12235
+ ),
12236
+ React__default.createElement(
12237
+ 'style',
12238
+ { jsx: true },
12239
+ '\n .sidebar {\n width: 40%;\n padding: 1rem 0 0;\n margin-left: 1rem;\n margin-right: 10%;\n }\n @media screen and (max-width: 991px) {\n .sidebar {\n width: unset;\n padding: 1.25rem;\n margin-left: 1rem;\n margin-right: 1rem;\n }\n }\n '
12085
12240
  )
12086
12241
  );
12087
12242
  };
@@ -12185,7 +12340,7 @@ var Audio = function Audio(_ref) {
12185
12340
  { className: 'd-block text-center mb-3' },
12186
12341
  React__default.createElement(
12187
12342
  'audio',
12188
- { controls: true },
12343
+ { controls: true, controlsList: 'nodownload' },
12189
12344
  React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/ogg' }),
12190
12345
  React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/mpeg' }),
12191
12346
  'Your browser does not support the audio element.'
@@ -12512,5 +12667,49 @@ var Feature = function Feature(props) {
12512
12667
  );
12513
12668
  };
12514
12669
 
12515
- export { ContentCard as DeckContent, GridContent$1 as GridContent, DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature };
12670
+ var Breadcrumbs = function Breadcrumbs() {
12671
+ // To be used on landing pages eg. /news/[url]
12672
+ var _useState = useState(''),
12673
+ _useState2 = slicedToArray(_useState, 2),
12674
+ parentPath = _useState2[0],
12675
+ setParentPath = _useState2[1];
12676
+
12677
+ var _useState3 = useState(''),
12678
+ _useState4 = slicedToArray(_useState3, 2),
12679
+ currentPath = _useState4[0],
12680
+ setCurrentPath = _useState4[1];
12681
+
12682
+ useEffect(function () {
12683
+ var parsedUrl = window.location.href.split('/');
12684
+ setCurrentPath(parsedUrl[parsedUrl.length - 1]);
12685
+ setParentPath(parsedUrl[parsedUrl.length - 2]);
12686
+ });
12687
+
12688
+ return React__default.createElement(
12689
+ Breadcrumb,
12690
+ null,
12691
+ React__default.createElement(
12692
+ Breadcrumb.Item,
12693
+ { href: '/' },
12694
+ 'home'
12695
+ ),
12696
+ React__default.createElement(
12697
+ Breadcrumb.Item,
12698
+ { href: '/' + parentPath },
12699
+ parentPath
12700
+ ),
12701
+ React__default.createElement(
12702
+ Breadcrumb.Item,
12703
+ { active: true },
12704
+ currentPath
12705
+ ),
12706
+ React__default.createElement(
12707
+ 'style',
12708
+ { jsx: true },
12709
+ '\n ol.breadcrumb {\n background: transparent;\n padding-left: 0.25rem;\n }\n '
12710
+ )
12711
+ );
12712
+ };
12713
+
12714
+ export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs };
12516
12715
  //# sourceMappingURL=index.es.js.map