@mjhls/mjh-framework 1.0.1070 → 1.0.1071

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.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AlgoliaSearch.js +73 -105
  3. package/dist/cjs/ArticleProgramLandingPage.js +1 -1
  4. package/dist/cjs/AuthWrapper.js +19 -89
  5. package/dist/cjs/ExternalResources.js +1 -1
  6. package/dist/cjs/HorizontalArticleListing.js +1 -1
  7. package/dist/cjs/{ImageSlider-d65bc9c8.js → ImageSlider-984a697b.js} +116 -156
  8. package/dist/cjs/IssueLanding.js +1 -1
  9. package/dist/cjs/{MediaSeriesCard-2e65fe95.js → MediaSeriesCard-55eab36c.js} +1 -1
  10. package/dist/cjs/MediaSeriesLanding.js +4 -4
  11. package/dist/cjs/MediaSeriesLandingPaginated.js +4 -4
  12. package/dist/cjs/PartnerDetailListing.js +3 -2
  13. package/dist/cjs/PartnerDetailListingPaginated.js +3 -2
  14. package/dist/cjs/PodcastsLanding.js +2 -2
  15. package/dist/cjs/TaxonomyDescription.js +1 -1
  16. package/dist/cjs/{Tooltip-02a841b5.js → Tooltip-96fe6ef6.js} +34 -86
  17. package/dist/cjs/VideoProgramLandingPage.js +1 -1
  18. package/dist/cjs/View.js +1 -1
  19. package/dist/cjs/defineProperty-e0fb52c5.js +73 -0
  20. package/dist/cjs/getSerializers.js +1 -1
  21. package/dist/cjs/{index-4e9a219e.js → index-4c260728.js} +162 -110
  22. package/dist/cjs/{index-9ec837cc.js → index-50be6759.js} +25 -9
  23. package/dist/cjs/index.js +5 -3
  24. package/dist/cjs/typeof-1358762e.js +33 -0
  25. package/dist/esm/AlgoliaSearch.js +72 -104
  26. package/dist/esm/ArticleProgramLandingPage.js +1 -1
  27. package/dist/esm/AuthWrapper.js +16 -86
  28. package/dist/esm/ExternalResources.js +1 -1
  29. package/dist/esm/HorizontalArticleListing.js +1 -1
  30. package/dist/esm/{ImageSlider-da225417.js → ImageSlider-497e9c88.js} +117 -157
  31. package/dist/esm/IssueLanding.js +1 -1
  32. package/dist/esm/{MediaSeriesCard-27cce8ea.js → MediaSeriesCard-c0cc5c10.js} +1 -1
  33. package/dist/esm/MediaSeriesLanding.js +4 -4
  34. package/dist/esm/MediaSeriesLandingPaginated.js +4 -4
  35. package/dist/esm/PartnerDetailListing.js +3 -2
  36. package/dist/esm/PartnerDetailListingPaginated.js +3 -2
  37. package/dist/esm/PodcastsLanding.js +2 -2
  38. package/dist/esm/TaxonomyDescription.js +1 -1
  39. package/dist/esm/{Tooltip-7a093cd4.js → Tooltip-bc98d17e.js} +192 -244
  40. package/dist/esm/VideoProgramLandingPage.js +1 -1
  41. package/dist/esm/View.js +1 -1
  42. package/dist/esm/defineProperty-23a8f8cd.js +68 -0
  43. package/dist/esm/getSerializers.js +1 -1
  44. package/dist/esm/{index-0ce54f8a.js → index-98ca9cec.js} +25 -10
  45. package/dist/esm/{index-1fd45cc5.js → index-aef9aa6f.js} +163 -111
  46. package/dist/esm/index.js +5 -3
  47. package/dist/esm/typeof-2f07d0e8.js +30 -0
  48. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { B as BlockContent } from './BlockContent-1e73bd2c.js';
5
5
  import Col from 'react-bootstrap/Col';
6
6
  import Form from 'react-bootstrap/Form';
7
7
  import Button from 'react-bootstrap/Button';
8
- import { g as getSerializers } from './index-1fd45cc5.js';
8
+ import { g as getSerializers } from './index-aef9aa6f.js';
9
9
  import VideoSeriesListing from './VideoSeriesListing.js';
10
10
  import './_commonjsHelpers-0c4b6f40.js';
11
11
  import './core.get-iterator-method-ea258bb1.js';
package/dist/esm/View.js CHANGED
@@ -15,7 +15,7 @@ import FormControl from 'react-bootstrap/FormControl';
15
15
  import Button from 'react-bootstrap/Button';
16
16
  import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
17
17
  import SocialShare from './SocialShare.js';
18
- import { r as renderAuthor, g as getSerializers } from './index-1fd45cc5.js';
18
+ import { r as renderAuthor, g as getSerializers } from './index-aef9aa6f.js';
19
19
  import DFPAdSlot from './AdSlot.js';
20
20
  import { S as SeriesSlider } from './SeriesSlider-a6b1d617.js';
21
21
  import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-5a281334.js';
@@ -0,0 +1,68 @@
1
+ import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
+
3
+ var asyncToGenerator = createCommonjsModule(function (module) {
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
5
+ try {
6
+ var info = gen[key](arg);
7
+ var value = info.value;
8
+ } catch (error) {
9
+ reject(error);
10
+ return;
11
+ }
12
+
13
+ if (info.done) {
14
+ resolve(value);
15
+ } else {
16
+ Promise.resolve(value).then(_next, _throw);
17
+ }
18
+ }
19
+
20
+ function _asyncToGenerator(fn) {
21
+ return function () {
22
+ var self = this,
23
+ args = arguments;
24
+ return new Promise(function (resolve, reject) {
25
+ var gen = fn.apply(self, args);
26
+
27
+ function _next(value) {
28
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
29
+ }
30
+
31
+ function _throw(err) {
32
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
33
+ }
34
+
35
+ _next(undefined);
36
+ });
37
+ };
38
+ }
39
+
40
+ module.exports = _asyncToGenerator;
41
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
42
+ });
43
+
44
+ var _asyncToGenerator = unwrapExports(asyncToGenerator);
45
+
46
+ var defineProperty = createCommonjsModule(function (module) {
47
+ function _defineProperty(obj, key, value) {
48
+ if (key in obj) {
49
+ Object.defineProperty(obj, key, {
50
+ value: value,
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true
54
+ });
55
+ } else {
56
+ obj[key] = value;
57
+ }
58
+
59
+ return obj;
60
+ }
61
+
62
+ module.exports = _defineProperty;
63
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
64
+ });
65
+
66
+ var _defineProperty = unwrapExports(defineProperty);
67
+
68
+ export { _asyncToGenerator as _, _defineProperty as a, asyncToGenerator as b, defineProperty as d };
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
- export { g as default } from './index-1fd45cc5.js';
2
+ export { g as default } from './index-aef9aa6f.js';
3
3
  import './BlockContent-1e73bd2c.js';
4
4
  import './entities-6d9154b4.js';
5
5
  import './slicedToArray-6ebcbfea.js';
@@ -33,9 +33,18 @@ function _objectWithoutPropertiesLoose(source, excluded) {
33
33
  return target;
34
34
  }
35
35
 
36
+ function _setPrototypeOf(o, p) {
37
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
38
+ o.__proto__ = p;
39
+ return o;
40
+ };
41
+
42
+ return _setPrototypeOf(o, p);
43
+ }
44
+
36
45
  var classnames = createCommonjsModule(function (module) {
37
46
  /*!
38
- Copyright (c) 2017 Jed Watson.
47
+ Copyright (c) 2018 Jed Watson.
39
48
  Licensed under the MIT License (MIT), see
40
49
  http://jedwatson.github.io/classnames
41
50
  */
@@ -45,7 +54,7 @@ var classnames = createCommonjsModule(function (module) {
45
54
 
46
55
  var hasOwn = {}.hasOwnProperty;
47
56
 
48
- function classNames () {
57
+ function classNames() {
49
58
  var classes = [];
50
59
 
51
60
  for (var i = 0; i < arguments.length; i++) {
@@ -56,16 +65,22 @@ var classnames = createCommonjsModule(function (module) {
56
65
 
57
66
  if (argType === 'string' || argType === 'number') {
58
67
  classes.push(arg);
59
- } else if (Array.isArray(arg) && arg.length) {
60
- var inner = classNames.apply(null, arg);
61
- if (inner) {
62
- classes.push(inner);
68
+ } else if (Array.isArray(arg)) {
69
+ if (arg.length) {
70
+ var inner = classNames.apply(null, arg);
71
+ if (inner) {
72
+ classes.push(inner);
73
+ }
63
74
  }
64
75
  } else if (argType === 'object') {
65
- for (var key in arg) {
66
- if (hasOwn.call(arg, key) && arg[key]) {
67
- classes.push(key);
76
+ if (arg.toString === Object.prototype.toString) {
77
+ for (var key in arg) {
78
+ if (hasOwn.call(arg, key) && arg[key]) {
79
+ classes.push(key);
80
+ }
68
81
  }
82
+ } else {
83
+ classes.push(arg.toString());
69
84
  }
70
85
  }
71
86
  }
@@ -82,4 +97,4 @@ var classnames = createCommonjsModule(function (module) {
82
97
  }());
83
98
  });
84
99
 
85
- export { _objectWithoutPropertiesLoose as _, _extends as a, classnames as c };
100
+ export { _objectWithoutPropertiesLoose as _, _setPrototypeOf as a, _extends as b, classnames as c };
@@ -28,7 +28,7 @@ import ReactGA from 'react-ga';
28
28
  import GroupDeck from './GroupDeck.js';
29
29
  import { m as moment } from './moment-bc12cb97.js';
30
30
  import SocialShare from './SocialShare.js';
31
- import { a as _Array$from, _ as _toConsumableArray } from './toConsumableArray-f7074d7c.js';
31
+ import { _ as _toConsumableArray, a as _Array$from } from './toConsumableArray-f7074d7c.js';
32
32
  import Pagination from 'react-bootstrap/Pagination';
33
33
  import { h as html_decode_1 } from './entities-6d9154b4.js';
34
34
  import DFPAdSlot from './AdSlot.js';
@@ -8689,12 +8689,18 @@ var Poll$1 = function Poll(_ref) {
8689
8689
  showAnswer = _useState4[0],
8690
8690
  setShowAnswer = _useState4[1];
8691
8691
 
8692
+ var _useState5 = useState(false),
8693
+ _useState6 = _slicedToArray(_useState5, 2),
8694
+ showBorders = _useState6[0],
8695
+ setShowBorders = _useState6[1];
8696
+
8692
8697
  var choices = node.choices,
8693
8698
  question = node.question,
8694
8699
  response = node.response,
8695
8700
  _node$showResults = node.showResults,
8696
- showResults = _node$showResults === undefined ? false : _node$showResults;
8701
+ showResults = _node$showResults === undefined ? '' : _node$showResults;
8697
8702
 
8703
+ var inputRef = useRef([]);
8698
8704
 
8699
8705
  var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
8700
8706
  e.preventDefault();
@@ -8703,7 +8709,8 @@ var Poll$1 = function Poll(_ref) {
8703
8709
  };
8704
8710
  useEffect(function () {
8705
8711
  if (showResults) {
8706
- setShowAnswer(showResults);
8712
+ setShowAnswer(true);
8713
+ setSelectedChoice(showResults);
8707
8714
  }
8708
8715
  }, [showResults]);
8709
8716
 
@@ -8715,9 +8722,32 @@ var Poll$1 = function Poll(_ref) {
8715
8722
  return acc;
8716
8723
  }
8717
8724
  }, 0);
8725
+
8726
+ useEffect(function () {
8727
+ var tempArray = choices.filter(function (choice) {
8728
+ if (choice.hasOwnProperty('choiceAnswer')) {
8729
+ return choice;
8730
+ }
8731
+ });
8732
+ setShowBorders(tempArray.length > 0);
8733
+ }, [choices]);
8734
+
8735
+ function checkChoice(key) {
8736
+ return key === selectedChoice;
8737
+ }
8738
+
8739
+ var userChoiceSelection = function userChoiceSelection(e) {
8740
+ if (inputRef.current[e.currentTarget.dataset['index']].checked) {
8741
+ inputRef.current[e.currentTarget.dataset['index']].checked = false;
8742
+ } else {
8743
+ inputRef.current[e.currentTarget.dataset['index']].checked = true;
8744
+ setSelectedChoice(inputRef.current[e.currentTarget.dataset['index']].value);
8745
+ }
8746
+ };
8747
+
8718
8748
  return React__default.createElement(
8719
- React__default.Fragment,
8720
- null,
8749
+ 'div',
8750
+ { className: 'pollHolder mb-3' },
8721
8751
  question && React__default.createElement(
8722
8752
  'p',
8723
8753
  { className: 'font-weight-bold' },
@@ -8725,78 +8755,74 @@ var Poll$1 = function Poll(_ref) {
8725
8755
  ),
8726
8756
  !showAnswer && choices && choices.length > 0 && React__default.createElement(
8727
8757
  'form',
8728
- { onSubmit: function onSubmit(e) {
8758
+ { className: 'formPoll', onSubmit: function onSubmit(e) {
8729
8759
  return onSubmitPoll(e);
8730
8760
  } },
8731
- choices && choices.map(function (choice) {
8761
+ choices && choices.map(function (choice, index) {
8732
8762
  return React__default.createElement(
8733
8763
  'div',
8734
- { key: choice._key },
8764
+ { key: choice._key, 'data-index': index, onClick: function onClick(e) {
8765
+ return userChoiceSelection(e);
8766
+ } },
8735
8767
  React__default.createElement(
8736
8768
  'label',
8737
8769
  { className: 'pl-2' },
8738
- React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
8739
- return setSelectedChoice(e.target.value);
8740
- } }),
8770
+ React__default.createElement('input', { ref: function ref(el) {
8771
+ return inputRef.current[index] = el;
8772
+ }, type: 'radio', id: 'male', name: choice._type, value: choice._key }),
8741
8773
  ' ' + choice.choiceText
8742
8774
  )
8743
8775
  );
8744
8776
  }),
8745
8777
  React__default.createElement(
8746
8778
  Button$1,
8747
- { disabled: !selectedChoice, type: 'submit' },
8779
+ { disabled: !selectedChoice, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
8748
8780
  'Vote'
8749
8781
  )
8750
8782
  ),
8751
- React__default.createElement(
8783
+ showAnswer && React__default.createElement(
8752
8784
  'div',
8753
- { className: 'progress-container' },
8785
+ { className: 'progress-container mb-3' },
8754
8786
  showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
8755
8787
  var percentage = choicesTotalCount && choicesTotalCount > 0 ? choice.choiceCount ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0 : 0;
8756
8788
  return React__default.createElement(
8757
8789
  'div',
8758
- { key: choice._key, className: 'mb-3' },
8790
+ {
8791
+ key: choice._key,
8792
+ style: { border: showBorders ? choice.choiceAnswer === true ? '2px solid limegreen' : checkChoice(choice._key) ? '2px solid red' : '' : '' },
8793
+ className: 'mb-3' },
8759
8794
  React__default.createElement(
8760
8795
  'div',
8761
8796
  { className: 'correct-answer' },
8797
+ React__default.createElement(ProgressBar, { now: percentage }),
8762
8798
  React__default.createElement(
8763
8799
  'div',
8764
8800
  null,
8765
8801
  choice.choiceText
8766
8802
  ),
8767
- choice.choiceAnswer === true && React__default.createElement(
8803
+ React__default.createElement(
8768
8804
  'div',
8769
- null,
8770
- React__default.createElement(
8771
- 'span',
8772
- { style: { color: 'limegreen' } },
8773
- 'Correct!'
8774
- )
8805
+ { className: 'float-right' },
8806
+ percentage,
8807
+ '% (',
8808
+ choice.choiceCount ? choice.choiceCount : 0,
8809
+ ' Votes)'
8775
8810
  )
8776
- ),
8777
- React__default.createElement(ProgressBar, { now: percentage }),
8778
- React__default.createElement(
8779
- 'span',
8780
- { className: 'float-right' },
8781
- percentage,
8782
- '% (',
8783
- choice.choiceCount ? choice.choiceCount : 0,
8784
- ' Votes)'
8785
8811
  )
8786
8812
  );
8787
- })
8788
- ),
8789
- showAnswer && React__default.createElement(
8790
- 'h4',
8791
- { className: 'text-center small p-3' },
8792
- 'Total Votes: ',
8793
- choicesTotalCount
8813
+ }),
8814
+ showAnswer && React__default.createElement(
8815
+ 'h4',
8816
+ { className: 'text-center small p-3' },
8817
+ 'Total Votes: ',
8818
+ choicesTotalCount
8819
+ )
8794
8820
  ),
8795
8821
  showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers }),
8796
8822
  React__default.createElement(
8797
8823
  'style',
8798
8824
  { jsx: 'true' },
8799
- '\n .correct-answer {\n display: flex;\n justify-content: space-between;\n }\n .progress-bar {\n color: #fff;\n }\n '
8825
+ '\n .formPoll > div {\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n border-radius: 5px;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem 0;\n text-align: left;\n margin: 0.5rem 0;\n cursor: pointer;\n }\n .formPoll > div:hover {\n background-color: #cbcbcb;\n }\n .formPoll > div > label {\n pointer-events: none;\n margin-bottom: 0;\n }\n .pollHolder {\n background-color: #eaeaea;\n padding: 1rem;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n }\n .progress-container > div {\n position: relative;\n font-weight: bold;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n }\n .correct-answer {\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n background-color: darkgrey;\n border-radius: 5px;\n }\n .float-right {\n z-index: 2;\n padding-right: 1rem;\n color: #fff;\n }\n .progress {\n align-self: flex-start;\n display: contents;\n border-radius: 5px;\n }\n .progress-bar {\n width: 33%;\n height: 100%;\n position: absolute;\n border-radius: 5px 0 0 5px;\n background-color: var(--primary);\n }\n .correct-answer > div:nth-child(2) {\n z-index: 1;\n color: white;\n padding-left: 0.5rem;\n max-width: 75%;\n }\n '
8800
8826
  )
8801
8827
  );
8802
8828
  };
@@ -8810,62 +8836,75 @@ var Poll = function Poll(_ref) {
8810
8836
  _ref.showVotes;
8811
8837
  var getSerializers = _ref.getSerializers;
8812
8838
 
8813
- var _useState = useState(null),
8839
+ var _useState = useState([]),
8814
8840
  _useState2 = _slicedToArray(_useState, 2),
8815
8841
  selectedChoice = _useState2[0],
8816
8842
  setSelectedChoice = _useState2[1];
8817
8843
 
8818
- var _useState3 = useState(false),
8844
+ var _useState3 = useState(true),
8819
8845
  _useState4 = _slicedToArray(_useState3, 2),
8820
- showAnswer = _useState4[0],
8821
- setShowAnswer = _useState4[1];
8846
+ disableVote = _useState4[0],
8847
+ setDisableVote = _useState4[1];
8848
+
8849
+ var _useState5 = useState(false),
8850
+ _useState6 = _slicedToArray(_useState5, 2),
8851
+ showAnswer = _useState6[0],
8852
+ setShowAnswer = _useState6[1];
8853
+
8854
+ var _useState7 = useState(false),
8855
+ _useState8 = _slicedToArray(_useState7, 2),
8856
+ showBorders = _useState8[0],
8857
+ setShowBorders = _useState8[1];
8822
8858
 
8823
8859
  var choices = node.choices,
8824
8860
  question = node.question,
8825
8861
  response = node.response,
8826
8862
  _node$showResults = node.showResults,
8827
- showResults = _node$showResults === undefined ? false : _node$showResults;
8863
+ showResults = _node$showResults === undefined ? '' : _node$showResults;
8828
8864
 
8865
+ var inputRef = useRef([]);
8829
8866
 
8830
- var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
8867
+ var onSubmitPoll = function onSubmitPoll(e) {
8831
8868
  e.preventDefault();
8832
- var selections = [];
8833
- var _iteratorNormalCompletion = true;
8834
- var _didIteratorError = false;
8835
- var _iteratorError = undefined;
8836
-
8837
- try {
8838
- for (var _iterator = _getIterator(_Object$values(e.currentTarget)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
8839
- var input = _step.value;
8840
-
8841
- if (input.nodeName === 'INPUT' && input.checked) {
8842
- selections.push(input.value);
8843
- }
8844
- }
8845
- } catch (err) {
8846
- _didIteratorError = true;
8847
- _iteratorError = err;
8848
- } finally {
8849
- try {
8850
- if (!_iteratorNormalCompletion && _iterator.return) {
8851
- _iterator.return();
8852
- }
8853
- } finally {
8854
- if (_didIteratorError) {
8855
- throw _iteratorError;
8856
- }
8857
- }
8858
- }
8859
-
8860
- onVote(node._key, selections.join(','));
8869
+ // const selections = []
8870
+ // for (let input of Object.values(e.currentTarget)) {
8871
+ // if (input.nodeName === 'INPUT' && input.checked) {
8872
+ // selections.push(input.value)
8873
+ // }
8874
+ // }
8875
+ onVote(node._key, selectedChoice.toString());
8861
8876
  //setShowAnswer(true)
8862
8877
  };
8863
8878
  useEffect(function () {
8864
8879
  if (showResults) {
8865
- setShowAnswer(showResults);
8880
+ setShowAnswer(true);
8881
+ setSelectedChoice(showResults.split(','));
8866
8882
  }
8867
8883
  }, [showResults]);
8868
8884
 
8885
+ useEffect(function () {
8886
+ if (selectedChoice.length > 0) {
8887
+ setDisableVote(false);
8888
+ } else {
8889
+ setDisableVote(true);
8890
+ }
8891
+ }, [selectedChoice]);
8892
+
8893
+ useEffect(function () {
8894
+ var tempArray = choices.filter(function (choice) {
8895
+ if (choice.hasOwnProperty('choiceAnswer')) {
8896
+ return choice;
8897
+ }
8898
+ });
8899
+ setShowBorders(tempArray.length > 0);
8900
+ }, [choices]);
8901
+
8902
+ function checkChoice(key) {
8903
+ return selectedChoice.find(function (value) {
8904
+ return value === key;
8905
+ });
8906
+ }
8907
+
8869
8908
  var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
8870
8909
  if (choice.choiceCount) {
8871
8910
  acc = acc + parseInt(choice.choiceCount);
@@ -8874,9 +8913,26 @@ var Poll = function Poll(_ref) {
8874
8913
  return acc;
8875
8914
  }
8876
8915
  }, 0);
8916
+
8917
+ var userChoiceSelection = function userChoiceSelection(e) {
8918
+ if (inputRef.current[e.currentTarget.dataset['index']].checked) {
8919
+ inputRef.current[e.currentTarget.dataset['index']].checked = false;
8920
+ var updateChoices = selectedChoice.filter(function (choice) {
8921
+ if (inputRef.current[e.currentTarget.dataset['index']].value !== choice) {
8922
+ return choice;
8923
+ }
8924
+ });
8925
+ setSelectedChoice(updateChoices);
8926
+ } else {
8927
+ inputRef.current[e.currentTarget.dataset['index']].checked = true;
8928
+
8929
+ setSelectedChoice([inputRef.current[e.currentTarget.dataset['index']].value].concat(_toConsumableArray(selectedChoice)));
8930
+ }
8931
+ };
8932
+
8877
8933
  return React__default.createElement(
8878
- React__default.Fragment,
8879
- null,
8934
+ 'div',
8935
+ { className: 'pollHolder mb-3' },
8880
8936
  question && React__default.createElement(
8881
8937
  'p',
8882
8938
  { className: 'font-weight-bold' },
@@ -8884,78 +8940,74 @@ var Poll = function Poll(_ref) {
8884
8940
  ),
8885
8941
  !showAnswer && choices && choices.length > 0 && React__default.createElement(
8886
8942
  'form',
8887
- { onSubmit: function onSubmit(e) {
8943
+ { className: 'multiChoicePoll', onSubmit: function onSubmit(e) {
8888
8944
  return onSubmitPoll(e);
8889
8945
  } },
8890
- choices && choices.map(function (choice) {
8946
+ choices && choices.map(function (choice, index) {
8891
8947
  return React__default.createElement(
8892
8948
  'div',
8893
- { key: choice._key },
8949
+ { key: choice._key, 'data-index': index, onClick: function onClick(e) {
8950
+ return userChoiceSelection(e);
8951
+ } },
8894
8952
  React__default.createElement(
8895
8953
  'label',
8896
8954
  { className: 'pl-2' },
8897
- React__default.createElement('input', { type: 'checkbox', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
8898
- return setSelectedChoice(e.target.value);
8899
- } }),
8955
+ React__default.createElement('input', { ref: function ref(el) {
8956
+ return inputRef.current[index] = el;
8957
+ }, type: 'checkbox', id: 'male', name: choice._type, value: choice._key }),
8900
8958
  ' ' + choice.choiceText
8901
8959
  )
8902
8960
  );
8903
8961
  }),
8904
8962
  React__default.createElement(
8905
8963
  Button$1,
8906
- { disabled: !selectedChoice, type: 'submit' },
8964
+ { disabled: disableVote, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
8907
8965
  'Vote'
8908
8966
  )
8909
8967
  ),
8910
- React__default.createElement(
8968
+ showAnswer && React__default.createElement(
8911
8969
  'div',
8912
- { className: 'progress-container' },
8970
+ { className: 'progress-container mb-3' },
8913
8971
  showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
8914
8972
  var percentage = choicesTotalCount && choicesTotalCount > 0 ? choice.choiceCount ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0 : 0;
8915
8973
  return React__default.createElement(
8916
8974
  'div',
8917
- { key: choice._key, className: 'mb-3' },
8975
+ {
8976
+ key: choice._key,
8977
+ style: { border: showBorders ? choice.choiceAnswer === true ? '2px solid limegreen' : checkChoice(choice._key) ? '2px solid red' : '' : '' },
8978
+ className: 'mb-3' },
8918
8979
  React__default.createElement(
8919
8980
  'div',
8920
8981
  { className: 'correct-answer' },
8982
+ React__default.createElement(ProgressBar, { now: percentage }),
8921
8983
  React__default.createElement(
8922
8984
  'div',
8923
8985
  null,
8924
8986
  choice.choiceText
8925
8987
  ),
8926
- choice.choiceAnswer === true && React__default.createElement(
8988
+ React__default.createElement(
8927
8989
  'div',
8928
- null,
8929
- React__default.createElement(
8930
- 'span',
8931
- { style: { color: 'limegreen' } },
8932
- 'Correct!'
8933
- )
8990
+ { className: 'float-right' },
8991
+ percentage,
8992
+ '% (',
8993
+ choice.choiceCount ? choice.choiceCount : 0,
8994
+ ' Votes)'
8934
8995
  )
8935
- ),
8936
- React__default.createElement(ProgressBar, { now: percentage }),
8937
- React__default.createElement(
8938
- 'span',
8939
- { className: 'float-right' },
8940
- percentage,
8941
- '% (',
8942
- choice.choiceCount ? choice.choiceCount : 0,
8943
- ' Votes)'
8944
8996
  )
8945
8997
  );
8946
- })
8947
- ),
8948
- showAnswer && React__default.createElement(
8949
- 'h4',
8950
- { className: 'text-center small p-3' },
8951
- 'Total Votes: ',
8952
- choicesTotalCount
8998
+ }),
8999
+ showAnswer && React__default.createElement(
9000
+ 'h4',
9001
+ { className: 'text-center small p-3' },
9002
+ 'Total Votes: ',
9003
+ choicesTotalCount
9004
+ )
8953
9005
  ),
8954
9006
  showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers }),
8955
9007
  React__default.createElement(
8956
9008
  'style',
8957
9009
  { jsx: 'true' },
8958
- '\n .correct-answer {\n width: 100%;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5rem;\n }\n .progress-bar {\n color: #fff;\n }\n '
9010
+ '\n .multiChoicePoll > div {\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n border-radius: 5px;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem 0;\n text-align: left;\n margin: 0.5rem 0;\n cursor: pointer;\n }\n .multiChoicePoll > div:hover {\n background-color: #cbcbcb;\n }\n .multiChoicePoll > div > label {\n pointer-events: none;\n margin-bottom: 0;\n }\n .pollHolder {\n background-color: #eaeaea;\n padding: 1rem;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n }\n .progress-container > div {\n position: relative;\n font-weight: bold;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n }\n .correct-answer {\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n background-color: darkgrey;\n border-radius: 5px;\n }\n .float-right {\n z-index: 2;\n padding-right: 1rem;\n color: #fff;\n }\n .progress {\n align-self: flex-start;\n display: contents;\n border-radius: 5px;\n }\n .progress-bar {\n width: 33%;\n height: 100%;\n position: absolute;\n border-radius: 5px 0 0 5px;\n background-color: var(--primary);\n }\n .correct-answer > div:nth-child(2) {\n z-index: 1;\n color: white;\n padding-left: 0.5rem;\n max-width: 75%;\n }\n '
8959
9011
  )
8960
9012
  );
8961
9013
  };
package/dist/esm/index.js CHANGED
@@ -87,7 +87,7 @@ export { default as VerticalHero } from './VerticalHero.js';
87
87
  export { default as YahooHero } from './YahooHero.js';
88
88
  export { default as GridHero } from './GridHero.js';
89
89
  export { default as ConferenceArticleCard } from './ConferenceArticleCard.js';
90
- export { g as getSerializers } from './index-1fd45cc5.js';
90
+ export { g as getSerializers } from './index-aef9aa6f.js';
91
91
  export { default as Beam } from './Beam.js';
92
92
  export { default as Segment } from './Segment.js';
93
93
  export { default as KMTracker } from './KMTracker.js';
@@ -153,7 +153,8 @@ import './_object-to-array-b61d5965.js';
153
153
  import 'react-bootstrap/Spinner';
154
154
  import 'react-bootstrap/Form';
155
155
  import './js.cookie-6874175c.js';
156
- import './index-0ce54f8a.js';
156
+ import './typeof-2f07d0e8.js';
157
+ import './index-98ca9cec.js';
157
158
  import './ConferenceBanner-8792ebd2.js';
158
159
  import 'next/head';
159
160
  import '@mjhls/mjh-framework/dist/cjs/urlFor';
@@ -189,7 +190,8 @@ import './SeriesSlider-a6b1d617.js';
189
190
  import './style-inject.es-1f59c1d0.js';
190
191
  import 'disqus-react';
191
192
  import 'react-twitter-embed';
192
- import './ImageSlider-da225417.js';
193
+ import './ImageSlider-497e9c88.js';
194
+ import './defineProperty-23a8f8cd.js';
193
195
  import './VideoSeriesCard.js';
194
196
 
195
197
  //Feature query to be used
@@ -0,0 +1,30 @@
1
+ import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
+
3
+ var _typeof_1 = createCommonjsModule(function (module) {
4
+ function _typeof(obj) {
5
+ "@babel/helpers - typeof";
6
+
7
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
8
+ module.exports = _typeof = function _typeof(obj) {
9
+ return typeof obj;
10
+ };
11
+
12
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
13
+ } else {
14
+ module.exports = _typeof = function _typeof(obj) {
15
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
16
+ };
17
+
18
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
19
+ }
20
+
21
+ return _typeof(obj);
22
+ }
23
+
24
+ module.exports = _typeof;
25
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
26
+ });
27
+
28
+ var _typeof = unwrapExports(_typeof_1);
29
+
30
+ export { _typeof as _, _typeof_1 as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.1070",
3
+ "version": "1.0.1071",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",