@bonlineza/luxity-lib 2.34.1 → 2.34.2
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/Accordion.js +76 -116
- package/AddInterest.js +434 -768
- package/BrandSelector.js +176 -336
- package/Checkbox.js +68 -101
- package/CheckboxButton.js +79 -124
- package/CommunicationPreferenceOptionsRenderer.js +107 -125
- package/CommunicationPreferenceSection.js +114 -134
- package/CommunicationPreferences.js +443 -339
- package/CountryCodeSelect.js +7 -10
- package/CurrencyInputFormatter.js +29 -56
- package/CurrencySelect.js +188 -19
- package/GALink.js +6 -16
- package/GenderSelector.js +88 -142
- package/GraphQLDropdownSelector.js +505 -939
- package/GraphQLMultiSelector.js +141 -274
- package/IconHeader.js +11 -25
- package/IconWrapper.js +3 -7
- package/InterestCatSelector.js +34 -74
- package/InterestItem.js +103 -187
- package/Interests.js +485 -890
- package/InterestsSubheading.js +5 -10
- package/InvertedTextButton.js +27 -63
- package/LuxityAppSideNav.js +18 -21
- package/LuxityDesktopHeader.js +360 -211
- package/LuxityFooter.js +464 -260
- package/LuxityGraphQLDropdownSelector.js +519 -969
- package/LuxityGraphQLMultiselector.js +167 -321
- package/LuxityMobileHeader.js +221 -278
- package/LuxityPageReady.js +74 -136
- package/LuxitySideNav.js +134 -155
- package/MaterialSelector.js +525 -976
- package/ModelSelector.js +525 -976
- package/NotificationDropDown.js +111 -209
- package/Notify.js +0 -1
- package/OutlinePrimaryButton.js +26 -58
- package/PriceRangeSelector.js +168 -281
- package/PrimaryButton.js +26 -58
- package/RadioButtons.js +114 -140
- package/RangeSlider.js +152 -242
- package/RareStepFooter.js +27 -41
- package/RareStepHeader.js +139 -190
- package/ReactSelectWrapper.js +0 -1
- package/SecondaryButton.js +26 -58
- package/ShoeSizeRangeSelector.js +162 -260
- package/ShoeSizeSelector.js +158 -263
- package/SimpleErrorBoundary.js +59 -106
- package/StyleSelector.js +176 -336
- package/TextButton.js +26 -58
- package/Tooltip.js +17 -39
- package/Tracking.js +0 -1
- package/WrapperButton.js +20 -43
- package/build/bundle.css +1 -1
- package/build/bundle.js +1298 -1695
- package/package.json +1 -1
- package/svg/Accessories.js +6 -13
- package/svg/Account.js +6 -13
- package/svg/Add.js +6 -13
- package/svg/ArrowRight.js +6 -13
- package/svg/Bags.js +6 -13
- package/svg/BurgerMenu.js +6 -13
- package/svg/Calendar.js +6 -13
- package/svg/CalendarCircled.js +6 -13
- package/svg/CheckCircled.js +6 -13
- package/svg/Close.js +6 -13
- package/svg/Clothing.js +6 -13
- package/svg/Dot.js +6 -13
- package/svg/Edit.js +6 -13
- package/svg/Eye.js +6 -13
- package/svg/FileAttach.js +6 -13
- package/svg/FileAttachCircled.js +6 -13
- package/svg/LightBulb.js +6 -13
- package/svg/Logo.js +6 -13
- package/svg/LuxityMenu.js +6 -13
- package/svg/Minus.js +6 -13
- package/svg/MobileAvatar.js +6 -13
- package/svg/MyOrder.js +6 -13
- package/svg/MyPayment.js +6 -13
- package/svg/MyProfile.js +8 -14
- package/svg/MySale.js +6 -13
- package/svg/Notification.js +6 -13
- package/svg/PointerDown.js +6 -13
- package/svg/Search.js +6 -13
- package/svg/Shoes.js +6 -13
- package/svg/SvgWrapper.js +3 -7
- package/svg/Trash.js +6 -13
- package/svg/Watches.js +6 -13
package/CountryCodeSelect.js
CHANGED
|
@@ -6578,7 +6578,6 @@
|
|
|
6578
6578
|
var ReactSelectWrapper = function ReactSelectWrapper(props) {
|
|
6579
6579
|
return /*#__PURE__*/React__default.createElement(index$1, props);
|
|
6580
6580
|
};
|
|
6581
|
-
|
|
6582
6581
|
ReactSelectWrapper.defaultProps = {
|
|
6583
6582
|
isMulti: false,
|
|
6584
6583
|
isSearchable: false,
|
|
@@ -6607,16 +6606,15 @@
|
|
|
6607
6606
|
};
|
|
6608
6607
|
});
|
|
6609
6608
|
};
|
|
6610
|
-
|
|
6611
6609
|
var CountryCodeSelect = function CountryCodeSelect(_ref) {
|
|
6612
6610
|
var countryData = _ref.countryData,
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6611
|
+
className = _ref.className,
|
|
6612
|
+
classNamePrefix = _ref.classNamePrefix,
|
|
6613
|
+
defaultCountryCode = _ref.defaultCountryCode,
|
|
6614
|
+
onChange = _ref.onChange,
|
|
6615
|
+
isSearchable = _ref.isSearchable,
|
|
6616
|
+
name = _ref.name,
|
|
6617
|
+
renderNoData = _ref.renderNoData;
|
|
6620
6618
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, countryData.length ? /*#__PURE__*/React__default.createElement(ReactSelectWrapper, {
|
|
6621
6619
|
name: name,
|
|
6622
6620
|
className: className,
|
|
@@ -6629,7 +6627,6 @@
|
|
|
6629
6627
|
isSearchable: isSearchable
|
|
6630
6628
|
}) : renderNoData());
|
|
6631
6629
|
};
|
|
6632
|
-
|
|
6633
6630
|
CountryCodeSelect.defaultProps = {
|
|
6634
6631
|
isSearchable: true,
|
|
6635
6632
|
defaultCountryCode: 'ZA',
|
|
@@ -7,56 +7,33 @@
|
|
|
7
7
|
React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;
|
|
8
8
|
|
|
9
9
|
function _extends() {
|
|
10
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
11
|
-
for (var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
for (var key in source) {
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
16
|
-
target[key] = source[key];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
10
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
11
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
12
|
+
var t = arguments[e];
|
|
13
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
return _extends.apply(this, arguments);
|
|
15
|
+
return n;
|
|
16
|
+
}, _extends.apply(null, arguments);
|
|
24
17
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
key = sourceKeys[i];
|
|
34
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
35
|
-
target[key] = source[key];
|
|
18
|
+
function _objectWithoutProperties(e, t) {
|
|
19
|
+
if (null == e) return {};
|
|
20
|
+
var o,
|
|
21
|
+
r,
|
|
22
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
23
|
+
if (Object.getOwnPropertySymbols) {
|
|
24
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
25
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
36
26
|
}
|
|
37
|
-
|
|
38
|
-
return target;
|
|
27
|
+
return i;
|
|
39
28
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var key, i;
|
|
47
|
-
|
|
48
|
-
if (Object.getOwnPropertySymbols) {
|
|
49
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
50
|
-
|
|
51
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
52
|
-
key = sourceSymbolKeys[i];
|
|
53
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
54
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
55
|
-
target[key] = source[key];
|
|
56
|
-
}
|
|
29
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
30
|
+
if (null == r) return {};
|
|
31
|
+
var t = {};
|
|
32
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
33
|
+
if (e.includes(n)) continue;
|
|
34
|
+
t[n] = r[n];
|
|
57
35
|
}
|
|
58
|
-
|
|
59
|
-
return target;
|
|
36
|
+
return t;
|
|
60
37
|
}
|
|
61
38
|
|
|
62
39
|
var _excluded = ["value", "onChange", "prefix", "allowNegativeValue", "groupSeparator", "decimalSeparator"];
|
|
@@ -64,31 +41,28 @@
|
|
|
64
41
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
65
42
|
return value.replace(/\D/g, '');
|
|
66
43
|
};
|
|
44
|
+
|
|
67
45
|
/**
|
|
68
46
|
* Currency Input which formats the value to a specific format
|
|
69
47
|
*/
|
|
70
|
-
|
|
71
48
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
72
49
|
var value = _ref.value,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
50
|
+
onChange = _ref.onChange,
|
|
51
|
+
prefix = _ref.prefix,
|
|
52
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
53
|
+
groupSeparator = _ref.groupSeparator,
|
|
54
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
55
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
80
56
|
var handleValueChange = function handleValueChange(event) {
|
|
81
57
|
var inputValue = event.target.value;
|
|
82
58
|
var unmaskedValue = unMask(inputValue);
|
|
83
59
|
onChange(unmaskedValue);
|
|
84
60
|
};
|
|
85
|
-
|
|
86
61
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
87
62
|
var numericValue = Number(originalValue);
|
|
88
63
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
89
64
|
return prefix + formattedValue;
|
|
90
65
|
};
|
|
91
|
-
|
|
92
66
|
var formattedValue = formatCurrency(value);
|
|
93
67
|
return /*#__PURE__*/React.createElement("input", _extends({}, rest, {
|
|
94
68
|
type: "text",
|
|
@@ -96,7 +70,6 @@
|
|
|
96
70
|
onChange: handleValueChange
|
|
97
71
|
}));
|
|
98
72
|
};
|
|
99
|
-
|
|
100
73
|
CurrencyInputFormatter.defaultProps = {
|
|
101
74
|
value: '',
|
|
102
75
|
prefix: 'R',
|
package/CurrencySelect.js
CHANGED
|
@@ -1,47 +1,216 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['react'], factory) :
|
|
4
|
-
(global = global || self, global.CurrencySelect = factory(global.React));
|
|
5
|
-
}(this, (function (React) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('styled-components')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['react', 'styled-components'], factory) :
|
|
4
|
+
(global = global || self, global.CurrencySelect = factory(global.React, global.styled));
|
|
5
|
+
}(this, (function (React, styled) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
var React__default = 'default' in React ? React['default'] : React;
|
|
8
|
+
var styled__default = 'default' in styled ? styled['default'] : styled;
|
|
9
|
+
|
|
10
|
+
function _extends() {
|
|
11
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
12
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
13
|
+
var t = arguments[e];
|
|
14
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
15
|
+
}
|
|
16
|
+
return n;
|
|
17
|
+
}, _extends.apply(null, arguments);
|
|
18
|
+
}
|
|
19
|
+
function _taggedTemplateLiteral(e, t) {
|
|
20
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
21
|
+
raw: {
|
|
22
|
+
value: Object.freeze(t)
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
28
|
+
|
|
29
|
+
/* position relative is required for the Body element to be positioned correctly */
|
|
30
|
+
var relativeInlineStyle = styled.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
31
|
+
var topMiddleBodyStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
32
|
+
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
33
|
+
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props.apexWidth, props.apexWidth, props.theme.colors.base);
|
|
34
|
+
};
|
|
35
|
+
var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
|
|
36
|
+
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.bodyWidth);
|
|
37
|
+
};
|
|
38
|
+
var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
|
|
39
|
+
return styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /*Top Arrow*/\n bottom: 100%; /* At the top of the tooltip */\n top: initial;\n left: 50%;\n border-style: solid;\n border-color: transparent transparent ", " transparent;\n"])), props.theme.colors.base);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _templateObject$1;
|
|
43
|
+
var getBodyStyle = function getBodyStyle() {
|
|
44
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
45
|
+
var _props$toolTipPositio = props.toolTipPosition,
|
|
46
|
+
toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
|
|
47
|
+
switch (toolTipPosition) {
|
|
48
|
+
case 'top':
|
|
49
|
+
return topMiddleBodyStyle;
|
|
50
|
+
case 'bottom':
|
|
51
|
+
return getBottomMiddleBodyStyle(props);
|
|
52
|
+
default:
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var getAfterStyling = function getAfterStyling() {
|
|
57
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
58
|
+
var toolTipPosition = props.toolTipPosition;
|
|
59
|
+
switch (toolTipPosition) {
|
|
60
|
+
case 'top':
|
|
61
|
+
return getTopMiddleArrowAfterStyle(props);
|
|
62
|
+
case 'bottom':
|
|
63
|
+
return getBottomMiddleArrowAfterStyle(props);
|
|
64
|
+
default:
|
|
65
|
+
return '';
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var Body = styled__default.span(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
69
|
+
return props.bodyWidth;
|
|
70
|
+
}, function (props) {
|
|
71
|
+
return props.theme.colors.base || 'black';
|
|
72
|
+
}, function (props) {
|
|
73
|
+
return getBodyStyle(props);
|
|
74
|
+
}, function (props) {
|
|
75
|
+
return getAfterStyling(props);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
var _templateObject$2;
|
|
79
|
+
var Container = styled__default.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n ", ";\n cursor: pointer;\n &:hover ", " {\n opacity: 1;\n visibility: visible;\n }\n"])), relativeInlineStyle, Body);
|
|
80
|
+
|
|
81
|
+
var theme = {
|
|
82
|
+
breakpoints: ['40em', '52em', '64em'],
|
|
83
|
+
space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
|
|
84
|
+
fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
|
|
85
|
+
marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
|
|
86
|
+
letterSpacings: ['-0.5px', '0px', '+0.5px'],
|
|
87
|
+
radii: ['0px', '2px', '4px', '8px'],
|
|
88
|
+
borderRadius: '6px',
|
|
89
|
+
colors: {
|
|
90
|
+
primary: '#000',
|
|
91
|
+
base: '#4e4949',
|
|
92
|
+
baseLt: '#817c7c',
|
|
93
|
+
borderColor: '#d8d8d8',
|
|
94
|
+
ntrlMin: '#fff',
|
|
95
|
+
ntrlMinTen: '#e6e6e6',
|
|
96
|
+
gray: '#efefef',
|
|
97
|
+
darkerGray: '#454141'
|
|
98
|
+
},
|
|
99
|
+
rareStepColors: {
|
|
100
|
+
primary: '#202b58',
|
|
101
|
+
secondary: '#ef5c2d',
|
|
102
|
+
ntrlMin: '#ffffff',
|
|
103
|
+
ntrl40: '#f4f4f4',
|
|
104
|
+
ntrl50: '#808080',
|
|
105
|
+
ntrl60: '#e8e8e8',
|
|
106
|
+
ntrl70: '#252525',
|
|
107
|
+
ntrlMax: '#000000'
|
|
108
|
+
},
|
|
109
|
+
rareStepFontWeights: {
|
|
110
|
+
normal: 400,
|
|
111
|
+
medium: 500,
|
|
112
|
+
semiBold: 600,
|
|
113
|
+
bold: 700
|
|
114
|
+
},
|
|
115
|
+
rareStepFontSize: {
|
|
116
|
+
h1: '36px',
|
|
117
|
+
h2: '30px',
|
|
118
|
+
h3: '24px',
|
|
119
|
+
h4: '20px',
|
|
120
|
+
h5: '16px',
|
|
121
|
+
h6: '14px',
|
|
122
|
+
footerTitle: '16px'
|
|
123
|
+
},
|
|
124
|
+
rareStepPageSizes: {
|
|
125
|
+
mobile: '500px',
|
|
126
|
+
tablet: '768px',
|
|
127
|
+
desktop: '992px',
|
|
128
|
+
screenl: '1280px',
|
|
129
|
+
screenxl: '1680px',
|
|
130
|
+
screenxxl: '1920px',
|
|
131
|
+
container: '1600px'
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var themed = (function (Component) {
|
|
136
|
+
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
137
|
+
return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
|
|
138
|
+
theme: theme
|
|
139
|
+
}, /*#__PURE__*/React__default.createElement(Component, _extends({}, props, {
|
|
140
|
+
ref: ref
|
|
141
|
+
})));
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
var Tooltip = function Tooltip(_ref) {
|
|
146
|
+
var children = _ref.children,
|
|
147
|
+
toolTipText = _ref.toolTipText,
|
|
148
|
+
toolTipPosition = _ref.toolTipPosition,
|
|
149
|
+
bodyWidth = _ref.bodyWidth,
|
|
150
|
+
apexWidth = _ref.apexWidth,
|
|
151
|
+
containerClassName = _ref.containerClassName,
|
|
152
|
+
bodyClassName = _ref.bodyClassName;
|
|
153
|
+
return /*#__PURE__*/React__default.createElement(Container, {
|
|
154
|
+
className: containerClassName
|
|
155
|
+
}, children, /*#__PURE__*/React__default.createElement(Body, {
|
|
156
|
+
toolTipPosition: toolTipPosition,
|
|
157
|
+
bodyWidth: bodyWidth,
|
|
158
|
+
apexWidth: apexWidth,
|
|
159
|
+
className: bodyClassName
|
|
160
|
+
}, toolTipText));
|
|
161
|
+
};
|
|
162
|
+
Tooltip.defaultProps = {
|
|
163
|
+
children: null,
|
|
164
|
+
toolTipText: '',
|
|
165
|
+
toolTipPosition: 'top',
|
|
166
|
+
bodyWidth: '8em',
|
|
167
|
+
apexWidth: '5px',
|
|
168
|
+
containerClassName: '',
|
|
169
|
+
bodyClassName: ''
|
|
170
|
+
};
|
|
171
|
+
var Tooltip$1 = themed(Tooltip);
|
|
8
172
|
|
|
9
173
|
var CurrencySelect = function CurrencySelect(_ref) {
|
|
10
174
|
var currency = _ref.currency,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
175
|
+
currencyOptions = _ref.currencyOptions,
|
|
176
|
+
onCurrencyChange = _ref.onCurrencyChange,
|
|
177
|
+
_ref$isCurrencySelect = _ref.isCurrencySelectionDisabled,
|
|
178
|
+
isCurrencySelectionDisabled = _ref$isCurrencySelect === void 0 ? false : _ref$isCurrencySelect,
|
|
179
|
+
_ref$tooltipContent = _ref.tooltipContent,
|
|
180
|
+
tooltipContent = _ref$tooltipContent === void 0 ? '' : _ref$tooltipContent;
|
|
14
181
|
if (!currencyOptions || currencyOptions.length === 0) {
|
|
15
182
|
return null;
|
|
16
183
|
}
|
|
17
|
-
|
|
18
184
|
var selectedOption = currencyOptions.find(function (opt) {
|
|
19
185
|
return opt.value === currency;
|
|
20
186
|
});
|
|
21
|
-
|
|
22
187
|
if (!selectedOption) {
|
|
23
188
|
return null;
|
|
24
189
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
190
|
+
return /*#__PURE__*/React__default.createElement(Tooltip$1, {
|
|
191
|
+
toolTipText: isCurrencySelectionDisabled ? tooltipContent : '',
|
|
192
|
+
toolTipPosition: "bottom",
|
|
193
|
+
bodyWidth: "160px"
|
|
194
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
195
|
+
className: "currency-select-container ".concat(isCurrencySelectionDisabled ? 'disabled' : '')
|
|
196
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
29
197
|
className: "currency-flag"
|
|
30
|
-
}, /*#__PURE__*/
|
|
198
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
31
199
|
src: selectedOption.flagSrc,
|
|
32
200
|
alt: "".concat(currency, " flag")
|
|
33
|
-
})), /*#__PURE__*/
|
|
201
|
+
})), /*#__PURE__*/React__default.createElement("select", {
|
|
34
202
|
value: currency,
|
|
35
203
|
onChange: function onChange(e) {
|
|
36
204
|
return onCurrencyChange(e.target.value);
|
|
37
205
|
},
|
|
38
|
-
className: "currency-select"
|
|
206
|
+
className: "currency-select",
|
|
207
|
+
disabled: isCurrencySelectionDisabled
|
|
39
208
|
}, currencyOptions.map(function (option) {
|
|
40
|
-
return /*#__PURE__*/
|
|
209
|
+
return /*#__PURE__*/React__default.createElement("option", {
|
|
41
210
|
key: option.value,
|
|
42
211
|
value: option.value
|
|
43
212
|
}, option.value, " (", option.symbol, ")");
|
|
44
|
-
})));
|
|
213
|
+
}))));
|
|
45
214
|
};
|
|
46
215
|
|
|
47
216
|
return CurrencySelect;
|
package/GALink.js
CHANGED
|
@@ -7,20 +7,13 @@
|
|
|
7
7
|
React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;
|
|
8
8
|
|
|
9
9
|
function _extends() {
|
|
10
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
11
|
-
for (var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
for (var key in source) {
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
16
|
-
target[key] = source[key];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
10
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
11
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
12
|
+
var t = arguments[e];
|
|
13
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
return _extends.apply(this, arguments);
|
|
15
|
+
return n;
|
|
16
|
+
}, _extends.apply(null, arguments);
|
|
24
17
|
}
|
|
25
18
|
|
|
26
19
|
var Event = function Event(instance, track) {
|
|
@@ -28,7 +21,6 @@
|
|
|
28
21
|
var action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
29
22
|
var label = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
|
|
30
23
|
var value = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
|
|
31
|
-
|
|
32
24
|
if (track) {
|
|
33
25
|
instance.event({
|
|
34
26
|
category: category,
|
|
@@ -42,12 +34,10 @@
|
|
|
42
34
|
var GALink = function GALink(props) {
|
|
43
35
|
var gaOnClick = function gaOnClick(event) {
|
|
44
36
|
Event(props.instance, props.track, 'Link', "Click on ".concat(props.href), props.label);
|
|
45
|
-
|
|
46
37
|
if (typeof props.onClick === 'function') {
|
|
47
38
|
props.onClick(event);
|
|
48
39
|
}
|
|
49
40
|
};
|
|
50
|
-
|
|
51
41
|
return /*#__PURE__*/React.createElement("a", _extends({
|
|
52
42
|
href: "/"
|
|
53
43
|
}, props, {
|