@mjhls/mjh-framework 1.0.620 → 1.0.621

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.
@@ -0,0 +1,196 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+ var main = require('./main-bc4db521.js');
8
+ var slicedToArray = require('./slicedToArray-8063ee51.js');
9
+ var iconBase = require('./iconBase-68959171.js');
10
+ var Button = _interopDefault(require('react-bootstrap/Button'));
11
+ var index_esm$2 = require('./index.esm-d1259b34.js');
12
+ var SocialIcons = require('./SocialIcons.js');
13
+ var Form = _interopDefault(require('react-bootstrap/Form'));
14
+ var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
15
+
16
+ var SocialSearchComponent = function SocialSearchComponent(_ref) {
17
+ var type = _ref.type,
18
+ socialIconVariant = _ref.socialIconVariant,
19
+ website = _ref.website,
20
+ navID = _ref.navID;
21
+
22
+ // Search Term
23
+ var _useState = React.useState(''),
24
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
25
+ searchKey = _useState2[0],
26
+ setSearchKey = _useState2[1];
27
+ // To calculate the position at which mobile searchbar should set.
28
+
29
+
30
+ var _useState3 = React.useState(0),
31
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
32
+ topOffset = _useState4[0],
33
+ setTopOffset = _useState4[1];
34
+
35
+ var _useState5 = React.useState(0),
36
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
37
+ rightOffset = _useState6[0],
38
+ setRightpOffset = _useState6[1];
39
+
40
+ var desktopComponent = React.useRef(null);
41
+ var mobileComponent = React.useRef(null);
42
+
43
+ React.useEffect(function () {
44
+ var navWrapper = document.getElementById(navID);
45
+ var mastNav = document.querySelector('.nav-brands');
46
+ var topOffset = 0;
47
+ if (window && window.innerWidth < 1200 && mastNav && mastNav.offsetHeight) topOffset = topOffset + mastNav.offsetHeight;
48
+ if (navWrapper && navWrapper.offsetHeight) topOffset = topOffset + navWrapper.offsetHeight;
49
+ setTopOffset(topOffset + 2);
50
+
51
+ if (desktopComponent && desktopComponent.current && desktopComponent.current.offsetWidth && desktopComponent.current.offsetLeft) {
52
+ setRightpOffset(window.innerWidth - desktopComponent.current.offsetLeft);
53
+ }
54
+ }, []);
55
+
56
+ // Search function
57
+ var submitSearch = function submitSearch(e) {
58
+ e.preventDefault();
59
+ window.location.href = '/search?searchTerm=' + searchKey;
60
+ };
61
+
62
+ // Toggling class of an element.Can't use toggle() as IE doesn't support toggle()
63
+ var toggleClass = function toggleClass(selector, type, addOn) {
64
+ if (type === 'id') {
65
+ var searchBar = document.getElementById(selector);
66
+ if (searchBar && searchBar.classList && searchBar.classList.contains(addOn)) {
67
+ searchBar.classList.remove(addOn);
68
+ } else if (searchBar && searchBar.classList) {
69
+ searchBar.classList.add(addOn);
70
+ }
71
+ } else if (type === 'class') {
72
+ var searchBtn = document.getElementsByClassName(selector)[0];
73
+ if (searchBtn && searchBtn.classList && searchBtn.classList.contains(addOn)) {
74
+ // Set overflow fix for iPhones safari browsers
75
+ if (main.main_40) {
76
+ var mainNav = document.querySelector('#navbar-ham');
77
+ if (mainNav && mainNav.style) mainNav.style.overflow = 'auto';
78
+ }
79
+ searchBtn.classList.remove(addOn);
80
+ } else if (searchBtn && searchBtn.classList) {
81
+ // Set overflow fix for iPhones safari browsers
82
+ if (main.main_40) {
83
+ var _mainNav = document.querySelector('#navbar-ham');
84
+ if (_mainNav && _mainNav.style) _mainNav.style.overflow = 'visible';
85
+ }
86
+ searchBtn.classList.add(addOn);
87
+ }
88
+ }
89
+ };
90
+
91
+ var socialSearchDesktop = function socialSearchDesktop() {
92
+ return React__default.createElement(
93
+ 'div',
94
+ { id: 'search-content-desktop', ref: desktopComponent, style: { display: 'flex' } },
95
+ React__default.createElement(
96
+ 'div',
97
+ { id: 'search-bar-desktop', style: { top: topOffset, right: rightOffset } },
98
+ React__default.createElement(
99
+ Form,
100
+ { style: { padding: '6px' }, inline: true, onSubmit: function onSubmit(e) {
101
+ return submitSearch(e);
102
+ } },
103
+ React__default.createElement(FormControl, { style: { width: '78%' }, placeholder: 'Search', type: 'text', value: searchKey, onChange: function onChange(e) {
104
+ return setSearchKey(e.target.value);
105
+ } }),
106
+ React__default.createElement(
107
+ Button,
108
+ { variant: 'primary', style: { backgroundColor: 'var(--secondary)', border: 'none', width: '20%', marginLeft: '2%' }, onClick: function onClick(e) {
109
+ return submitSearch(e);
110
+ } },
111
+ 'Search'
112
+ )
113
+ )
114
+ ),
115
+ React__default.createElement(
116
+ iconBase.IconContext.Provider,
117
+ { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '35px' } },
118
+ React__default.createElement(index_esm$2.GoSearch, {
119
+ onClick: function onClick() {
120
+ toggleClass('search-bar-desktop', 'id', 'show');
121
+ toggleClass('search-btn-desktop', 'class', 'active-search');
122
+ }
123
+ })
124
+ ),
125
+ website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
126
+ 'div',
127
+ { id: 'social-tab-desktop', style: { display: 'flex', left: '0px', position: 'relative', paddingTop: '3px', maxHeight: '35px' } },
128
+ website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
129
+ ),
130
+ React__default.createElement(
131
+ 'style',
132
+ { jsx: 'true' },
133
+ '\n #search-content-desktop .search-btn-desktop {\n padding: 5px;\n cursor: pointer;\n }\n #search-content-desktop #search-bar-desktop {\n display: none;\n background-color: var(--primary);\n position: absolute;\n width: 400px;\n border-radius: 5px;\n height: 48px;\n right: 15%;\n }\n #search-content-desktop .search-btn-desktop.active-search {\n border-radius: 5px;\n border: 1px solid var(--secondary) !important;\n }\n #search-content-desktop #search-bar-desktop.show {\n display: block !important;\n }\n '
134
+ )
135
+ );
136
+ };
137
+
138
+ var socialSearchMobile = function socialSearchMobile() {
139
+ return React__default.createElement(
140
+ 'div',
141
+ { id: 'search-content-mobile', ref: mobileComponent },
142
+ React__default.createElement(
143
+ 'div',
144
+ { id: 'search-bar-mobile', style: { top: topOffset } },
145
+ React__default.createElement(
146
+ Form,
147
+ { inline: true, style: { padding: '6px', width: '100%' }, onSubmit: function onSubmit(e) {
148
+ return submitSearch(e);
149
+ } },
150
+ React__default.createElement(FormControl, { style: { width: '78%' }, placeholder: 'Search', type: 'text', value: searchKey, onChange: function onChange(e) {
151
+ return setSearchKey(e.target.value);
152
+ } }),
153
+ React__default.createElement(
154
+ Button,
155
+ { variant: 'primary', style: { backgroundColor: 'var(--secondary)', border: 'none', width: '20%', marginLeft: '2%' }, onClick: function onClick(e) {
156
+ return submitSearch(e);
157
+ } },
158
+ 'Search'
159
+ )
160
+ )
161
+ ),
162
+ React__default.createElement(
163
+ iconBase.IconContext.Provider,
164
+ { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-mobile', size: '35px' } },
165
+ React__default.createElement(index_esm$2.GoSearch, {
166
+ onClick: function onClick() {
167
+ var navToggle = document.getElementsByClassName('navbar-toggler')[0];
168
+ if (navToggle && navToggle.classList && !navToggle.classList.contains('collapsed')) {
169
+ var nav = document.querySelectorAll('.navbar-collapse');
170
+ for (var i = 0; i < nav.length; i++) {
171
+ if (nav[i] && nav[i].classList) nav[i].classList.remove('show');
172
+ }
173
+ if (navToggle && navToggle.classList) navToggle.classList.add('collapsed');
174
+ }
175
+
176
+ toggleClass('search-bar-mobile', 'id', 'show');
177
+ toggleClass('search-btn-mobile', 'class', 'active-search');
178
+ }
179
+ })
180
+ ),
181
+ React__default.createElement(
182
+ 'style',
183
+ { jsx: 'true' },
184
+ '\n #search-content-mobile {\n display: flex;\n z-index: 999;\n }\n @media screen and (min-width: 1200px) {\n #search-content-mobile {\n display: none;\n }\n }\n #search-content-mobile .search-btn-mobile {\n padding: 5px;\n right: 4%;\n height: 35px;\n width: 35px;\n margin-top: 4px;\n cursor: pointer;\n }\n #search-content-mobile #search-bar-mobile {\n position: fixed;\n display: none;\n left: 0px;\n width: 100%;\n border-radius: 5px;\n padding: 10px;\n background-color: var(--primary);\n }\n #search-content-mobile #search-bar-mobile .form-inline {\n margin-top: 0px;\n width: 100% !important;\n }\n #search-content-mobile #search-bar-mobile .form-inline .form-control {\n width: 78%;\n border-radius: 5px;\n height: 45px;\n }\n #search-content-mobile #search-bar-mobile .form-inline .btn {\n width: 20%;\n border-radius: 5px;\n background-color: #040c5a;\n height: 45px;\n margin-left: 5px;\n padding: 1px;\n }\n #search-content-mobile .search-btn-mobile.active-search {\n border-radius: 5px;\n border: 1px solid var(--secondary);\n }\n #search-content-mobile #search-bar-mobile.show {\n display: block !important;\n }\n '
185
+ )
186
+ );
187
+ };
188
+
189
+ if (type === 'mobile') {
190
+ return socialSearchMobile();
191
+ } else if (type === 'desktop') {
192
+ return socialSearchDesktop();
193
+ }
194
+ };
195
+
196
+ exports.SocialSearchComponent = SocialSearchComponent;
@@ -56,6 +56,7 @@ require('./index.esm-d1259b34.js');
56
56
  require('./SocialIcons.js');
57
57
  require('react-bootstrap/Form');
58
58
  require('react-bootstrap/FormControl');
59
+ require('./SocialSearchComponent-5cbde5e0.js');
59
60
  var NavMagazine = require('./NavMagazine.js');
60
61
  var NavNative = require('./NavNative.js');
61
62
  require('./Search.js');
package/dist/cjs/index.js CHANGED
@@ -109,6 +109,7 @@ require('./index.esm-d1259b34.js');
109
109
  var SocialIcons = require('./SocialIcons.js');
110
110
  require('react-bootstrap/Form');
111
111
  require('react-bootstrap/FormControl');
112
+ require('./SocialSearchComponent-5cbde5e0.js');
112
113
  var NavMagazine = require('./NavMagazine.js');
113
114
  var NavNative = require('./NavNative.js');
114
115
  var Search = require('./Search.js');
@@ -4,208 +4,29 @@ import './core.get-iterator-method-66cf57ee.js';
4
4
  import './_library-528f1934.js';
5
5
  import './_iter-detect-70af34ea.js';
6
6
  import './web.dom.iterable-5c830d3d.js';
7
- import React__default, { useState, useRef, useEffect } from 'react';
7
+ import React__default, { useRef, useState, useEffect } from 'react';
8
8
  import 'prop-types';
9
9
  import Container from 'react-bootstrap/Container';
10
- import { a as main_40, m as main_39 } from './main-7255814e.js';
10
+ import { m as main_39, a as main_40 } from './main-7255814e.js';
11
11
  import { _ as _slicedToArray } from './slicedToArray-a58d7edf.js';
12
12
  import './stringify-feadff37.js';
13
13
  import './asyncToGenerator-d25aac66.js';
14
14
  import './_set-species-75f77d40.js';
15
15
  import { S as Segment } from './beam-c40d77ae.js';
16
16
  import './react-social-icons-a7d5c5c7.js';
17
- import { I as IconContext } from './iconBase-602d52fe.js';
17
+ import './iconBase-602d52fe.js';
18
18
  import { b as IoMdLogIn } from './index.esm-85cb09e6.js';
19
- import Button from 'react-bootstrap/Button';
19
+ import 'react-bootstrap/Button';
20
20
  import Nav from 'react-bootstrap/Nav';
21
21
  import Navbar from 'react-bootstrap/Navbar';
22
22
  import NavDropdown from 'react-bootstrap/NavDropdown';
23
23
  import { M as MdEmail } from './index.esm-b08f4b04.js';
24
24
  import { N as NavFooter } from './NavFooter-e27bd93b.js';
25
- import { G as GoSearch, S as SocialNavFooter } from './index.esm-73e847d2.js';
26
- import SocialIcons from './SocialIcons.js';
27
- import Form from 'react-bootstrap/Form';
28
- import FormControl from 'react-bootstrap/FormControl';
29
-
30
- var SocialSearchComponent = function SocialSearchComponent(_ref) {
31
- var type = _ref.type,
32
- socialIconVariant = _ref.socialIconVariant,
33
- website = _ref.website,
34
- navID = _ref.navID;
35
-
36
- // Search Term
37
- var _useState = useState(''),
38
- _useState2 = _slicedToArray(_useState, 2),
39
- searchKey = _useState2[0],
40
- setSearchKey = _useState2[1];
41
- // To calculate the position at which mobile searchbar should set.
42
-
43
-
44
- var _useState3 = useState(0),
45
- _useState4 = _slicedToArray(_useState3, 2),
46
- topOffset = _useState4[0],
47
- setTopOffset = _useState4[1];
48
-
49
- var _useState5 = useState(0),
50
- _useState6 = _slicedToArray(_useState5, 2),
51
- rightOffset = _useState6[0],
52
- setRightpOffset = _useState6[1];
53
-
54
- var desktopComponent = useRef(null);
55
- var mobileComponent = useRef(null);
56
-
57
- useEffect(function () {
58
- var navWrapper = document.getElementById(navID);
59
- var mastNav = document.querySelector('.nav-brands');
60
- var topOffset = 0;
61
- if (window && window.innerWidth < 1200 && mastNav && mastNav.offsetHeight) topOffset = topOffset + mastNav.offsetHeight;
62
- if (navWrapper && navWrapper.offsetHeight) topOffset = topOffset + navWrapper.offsetHeight;
63
- setTopOffset(topOffset + 2);
64
-
65
- if (desktopComponent && desktopComponent.current && desktopComponent.current.offsetWidth && desktopComponent.current.offsetLeft) {
66
- setRightpOffset(window.innerWidth - desktopComponent.current.offsetLeft);
67
- }
68
- }, []);
69
-
70
- // Search function
71
- var submitSearch = function submitSearch(e) {
72
- e.preventDefault();
73
- window.location.href = '/search?searchTerm=' + searchKey;
74
- };
75
-
76
- // Toggling class of an element.Can't use toggle() as IE doesn't support toggle()
77
- var toggleClass = function toggleClass(selector, type, addOn) {
78
- if (type === 'id') {
79
- var searchBar = document.getElementById(selector);
80
- if (searchBar && searchBar.classList && searchBar.classList.contains(addOn)) {
81
- searchBar.classList.remove(addOn);
82
- } else if (searchBar && searchBar.classList) {
83
- searchBar.classList.add(addOn);
84
- }
85
- } else if (type === 'class') {
86
- var searchBtn = document.getElementsByClassName(selector)[0];
87
- if (searchBtn && searchBtn.classList && searchBtn.classList.contains(addOn)) {
88
- // Set overflow fix for iPhones safari browsers
89
- if (main_40) {
90
- var mainNav = document.querySelector('#navbar-ham');
91
- if (mainNav && mainNav.style) mainNav.style.overflow = 'auto';
92
- }
93
- searchBtn.classList.remove(addOn);
94
- } else if (searchBtn && searchBtn.classList) {
95
- // Set overflow fix for iPhones safari browsers
96
- if (main_40) {
97
- var _mainNav = document.querySelector('#navbar-ham');
98
- if (_mainNav && _mainNav.style) _mainNav.style.overflow = 'visible';
99
- }
100
- searchBtn.classList.add(addOn);
101
- }
102
- }
103
- };
104
-
105
- var socialSearchDesktop = function socialSearchDesktop() {
106
- return React__default.createElement(
107
- 'div',
108
- { id: 'search-content-desktop', ref: desktopComponent, style: { display: 'flex' } },
109
- React__default.createElement(
110
- 'div',
111
- { id: 'search-bar-desktop', style: { top: topOffset, right: rightOffset } },
112
- React__default.createElement(
113
- Form,
114
- { style: { padding: '6px' }, inline: true, onSubmit: function onSubmit(e) {
115
- return submitSearch(e);
116
- } },
117
- React__default.createElement(FormControl, { style: { width: '78%' }, placeholder: 'Search', type: 'text', value: searchKey, onChange: function onChange(e) {
118
- return setSearchKey(e.target.value);
119
- } }),
120
- React__default.createElement(
121
- Button,
122
- { variant: 'primary', style: { backgroundColor: 'var(--secondary)', border: 'none', width: '20%', marginLeft: '2%' }, onClick: function onClick(e) {
123
- return submitSearch(e);
124
- } },
125
- 'Search'
126
- )
127
- )
128
- ),
129
- React__default.createElement(
130
- IconContext.Provider,
131
- { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '35px' } },
132
- React__default.createElement(GoSearch, {
133
- onClick: function onClick() {
134
- toggleClass('search-bar-desktop', 'id', 'show');
135
- toggleClass('search-btn-desktop', 'class', 'active-search');
136
- }
137
- })
138
- ),
139
- website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
140
- 'div',
141
- { id: 'social-tab-desktop', style: { display: 'flex', left: '0px', position: 'relative', paddingTop: '3px', maxHeight: '35px' } },
142
- website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
143
- ),
144
- React__default.createElement(
145
- 'style',
146
- { jsx: 'true' },
147
- '\n #search-content-desktop .search-btn-desktop {\n padding: 5px;\n cursor: pointer;\n }\n #search-content-desktop #search-bar-desktop {\n display: none;\n background-color: var(--primary);\n position: absolute;\n width: 400px;\n border-radius: 5px;\n height: 48px;\n right: 15%;\n }\n #search-content-desktop .search-btn-desktop.active-search {\n border-radius: 5px;\n border: 1px solid var(--secondary) !important;\n }\n #search-content-desktop #search-bar-desktop.show {\n display: block !important;\n }\n '
148
- )
149
- );
150
- };
151
-
152
- var socialSearchMobile = function socialSearchMobile() {
153
- return React__default.createElement(
154
- 'div',
155
- { id: 'search-content-mobile', ref: mobileComponent },
156
- React__default.createElement(
157
- 'div',
158
- { id: 'search-bar-mobile', style: { top: topOffset } },
159
- React__default.createElement(
160
- Form,
161
- { inline: true, style: { padding: '6px', width: '100%' }, onSubmit: function onSubmit(e) {
162
- return submitSearch(e);
163
- } },
164
- React__default.createElement(FormControl, { style: { width: '78%' }, placeholder: 'Search', type: 'text', value: searchKey, onChange: function onChange(e) {
165
- return setSearchKey(e.target.value);
166
- } }),
167
- React__default.createElement(
168
- Button,
169
- { variant: 'primary', style: { backgroundColor: 'var(--secondary)', border: 'none', width: '20%', marginLeft: '2%' }, onClick: function onClick(e) {
170
- return submitSearch(e);
171
- } },
172
- 'Search'
173
- )
174
- )
175
- ),
176
- React__default.createElement(
177
- IconContext.Provider,
178
- { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-mobile', size: '35px' } },
179
- React__default.createElement(GoSearch, {
180
- onClick: function onClick() {
181
- var navToggle = document.getElementsByClassName('navbar-toggler')[0];
182
- if (navToggle && navToggle.classList && !navToggle.classList.contains('collapsed')) {
183
- var nav = document.querySelectorAll('.navbar-collapse');
184
- for (var i = 0; i < nav.length; i++) {
185
- if (nav[i] && nav[i].classList) nav[i].classList.remove('show');
186
- }
187
- if (navToggle && navToggle.classList) navToggle.classList.add('collapsed');
188
- }
189
-
190
- toggleClass('search-bar-mobile', 'id', 'show');
191
- toggleClass('search-btn-mobile', 'class', 'active-search');
192
- }
193
- })
194
- ),
195
- React__default.createElement(
196
- 'style',
197
- { jsx: 'true' },
198
- '\n #search-content-mobile {\n display: flex;\n z-index: 999;\n }\n @media screen and (min-width: 1200px) {\n #search-content-mobile {\n display: none;\n }\n }\n #search-content-mobile .search-btn-mobile {\n padding: 5px;\n right: 4%;\n height: 35px;\n width: 35px;\n margin-top: 4px;\n cursor: pointer;\n }\n #search-content-mobile #search-bar-mobile {\n position: fixed;\n display: none;\n left: 0px;\n width: 100%;\n border-radius: 5px;\n padding: 10px;\n background-color: var(--primary);\n }\n #search-content-mobile #search-bar-mobile .form-inline {\n margin-top: 0px;\n width: 100% !important;\n }\n #search-content-mobile #search-bar-mobile .form-inline .form-control {\n width: 78%;\n border-radius: 5px;\n height: 45px;\n }\n #search-content-mobile #search-bar-mobile .form-inline .btn {\n width: 20%;\n border-radius: 5px;\n background-color: #040c5a;\n height: 45px;\n margin-left: 5px;\n padding: 1px;\n }\n #search-content-mobile .search-btn-mobile.active-search {\n border-radius: 5px;\n border: 1px solid var(--secondary);\n }\n #search-content-mobile #search-bar-mobile.show {\n display: block !important;\n }\n '
199
- )
200
- );
201
- };
202
-
203
- if (type === 'mobile') {
204
- return socialSearchMobile();
205
- } else if (type === 'desktop') {
206
- return socialSearchDesktop();
207
- }
208
- };
25
+ import { S as SocialNavFooter } from './index.esm-73e847d2.js';
26
+ import './SocialIcons.js';
27
+ import 'react-bootstrap/Form';
28
+ import 'react-bootstrap/FormControl';
29
+ import { S as SocialSearchComponent } from './SocialSearchComponent-00385695.js';
209
30
 
210
31
  var HamMagazine = function HamMagazine(props) {
211
32
  /*