@alma/widgets 2.8.3 → 2.10.0
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/raw/widgets.css +4 -0
- package/dist/raw/widgets.js +16 -5
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +16 -5
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +13 -5
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +16 -5
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/HideBorder.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/index.d.ts +1 -0
- package/dist/types/hooks/useButtonAnimation.d.ts +2 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/widgets.css +1 -1
- package/dist/widgets.js +1 -1
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.m.js +1 -1
- package/dist/widgets.m.js.map +1 -1
- package/dist/widgets.modern.js +1 -1
- package/dist/widgets.modern.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/raw/widgets.css
CHANGED
package/dist/raw/widgets.js
CHANGED
|
@@ -2946,11 +2946,12 @@ var useButtonAnimation = function useButtonAnimation(iterateValues, transitionDe
|
|
|
2946
2946
|
setUpdate = _useState2[1];
|
|
2947
2947
|
|
|
2948
2948
|
React.useEffect(function () {
|
|
2949
|
+
var timeout;
|
|
2949
2950
|
var isMounted = true;
|
|
2950
2951
|
|
|
2951
2952
|
if (iterateValues.length !== 0) {
|
|
2952
2953
|
if (!iterateValues.includes(current) && update) setCurrent(iterateValues[0]);
|
|
2953
|
-
setTimeout(function () {
|
|
2954
|
+
timeout = setTimeout(function () {
|
|
2954
2955
|
if (update && isMounted) {
|
|
2955
2956
|
setCurrent(iterateValues[iterateValues.includes(current) ? (iterateValues.indexOf(current) + 1) % iterateValues.length : 0]);
|
|
2956
2957
|
}
|
|
@@ -2959,6 +2960,7 @@ var useButtonAnimation = function useButtonAnimation(iterateValues, transitionDe
|
|
|
2959
2960
|
|
|
2960
2961
|
return function () {
|
|
2961
2962
|
isMounted = false;
|
|
2963
|
+
clearTimeout(timeout);
|
|
2962
2964
|
};
|
|
2963
2965
|
}, [iterateValues, current]);
|
|
2964
2966
|
return {
|
|
@@ -3025,7 +3027,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
3025
3027
|
activeOption: prefix$1 + '-active-option'
|
|
3026
3028
|
};
|
|
3027
3029
|
|
|
3028
|
-
var s$c = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","polychrome":"_2icEF","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
3030
|
+
var s$c = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","polychrome":"_2icEF","notEligible":"_3O1bg","hideBorder":"_3_qcn","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
3029
3031
|
|
|
3030
3032
|
var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
|
|
3031
3033
|
var DEFAULT_TRANSITION_TIME = 5500;
|
|
@@ -3040,7 +3042,9 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
3040
3042
|
purchaseAmount = _ref.purchaseAmount,
|
|
3041
3043
|
suggestedPaymentPlan = _ref.suggestedPaymentPlan,
|
|
3042
3044
|
cards = _ref.cards,
|
|
3043
|
-
transitionDelay = _ref.transitionDelay
|
|
3045
|
+
transitionDelay = _ref.transitionDelay,
|
|
3046
|
+
_ref$hideBorder = _ref.hideBorder,
|
|
3047
|
+
hideBorder = _ref$hideBorder === void 0 ? false : _ref$hideBorder;
|
|
3044
3048
|
|
|
3045
3049
|
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
3046
3050
|
eligibilityPlans = _useFetchEligibility[0],
|
|
@@ -3138,7 +3142,7 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
3138
3142
|
|
|
3139
3143
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
3140
3144
|
onClick: handleOpenModal,
|
|
3141
|
-
className: cx(s$c.widgetButton, (_cx = {}, _cx[s$c.clickable] = eligiblePlans.length > 0, _cx[s$c.unClickable] = eligiblePlans.length === 0, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
|
|
3145
|
+
className: cx(s$c.widgetButton, (_cx = {}, _cx[s$c.clickable] = eligiblePlans.length > 0, _cx[s$c.unClickable] = eligiblePlans.length === 0, _cx[s$c.hideBorder] = hideBorder, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
|
|
3142
3146
|
"data-testid": "widget-button"
|
|
3143
3147
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3144
3148
|
className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
|
|
@@ -3156,7 +3160,11 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
3156
3160
|
onMouseEnter: function onMouseEnter() {
|
|
3157
3161
|
return onHover(key);
|
|
3158
3162
|
},
|
|
3163
|
+
onTouchStart: function onTouchStart() {
|
|
3164
|
+
return onHover(key);
|
|
3165
|
+
},
|
|
3159
3166
|
onMouseOut: onLeave,
|
|
3167
|
+
onTouchEnd: onLeave,
|
|
3160
3168
|
className: cx(s$c.plan, (_cx2 = {}, _cx2[cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = isCurrent, _cx2[s$c.polychrome] = !monochrome && isCurrent, _cx2[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
|
|
3161
3169
|
}, paymentPlanShorthandName(eligibilityPlan));
|
|
3162
3170
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3192,6 +3200,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
3192
3200
|
plans = options.plans,
|
|
3193
3201
|
transitionDelay = options.transitionDelay,
|
|
3194
3202
|
hideIfNotEligible = options.hideIfNotEligible,
|
|
3203
|
+
_options$hideBorder = options.hideBorder,
|
|
3204
|
+
hideBorder = _options$hideBorder === void 0 ? false : _options$hideBorder,
|
|
3195
3205
|
_options$monochrome = options.monochrome,
|
|
3196
3206
|
monochrome = _options$monochrome === void 0 ? true : _options$monochrome,
|
|
3197
3207
|
suggestedPaymentPlan = options.suggestedPaymentPlan,
|
|
@@ -3210,7 +3220,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
3210
3220
|
purchaseAmount: purchaseAmount,
|
|
3211
3221
|
suggestedPaymentPlan: suggestedPaymentPlan,
|
|
3212
3222
|
cards: cards,
|
|
3213
|
-
transitionDelay: transitionDelay
|
|
3223
|
+
transitionDelay: transitionDelay,
|
|
3224
|
+
hideBorder: hideBorder
|
|
3214
3225
|
})), document.querySelector(container));
|
|
3215
3226
|
}
|
|
3216
3227
|
}
|