@alma/widgets 3.2.4 → 3.3.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.
Files changed (37) hide show
  1. package/dist/raw/widgets.css +14 -14
  2. package/dist/raw/widgets.js +25 -17
  3. package/dist/raw/widgets.js.map +1 -1
  4. package/dist/raw/widgets.m.js +25 -17
  5. package/dist/raw/widgets.m.js.map +1 -1
  6. package/dist/raw/widgets.modern.js +27 -15
  7. package/dist/raw/widgets.modern.js.map +1 -1
  8. package/dist/raw/widgets.umd.js +25 -17
  9. package/dist/raw/widgets.umd.js.map +1 -1
  10. package/dist/types/Widgets/EligibilityModal/ModalContainer.d.ts +1 -1
  11. package/dist/types/Widgets/EligibilityModal/index.d.ts +2 -2
  12. package/dist/types/Widgets/PaymentPlans/index.d.ts +2 -1
  13. package/dist/types/components/Modal/index.d.ts +2 -2
  14. package/dist/types/types.d.ts +3 -0
  15. package/dist/types/widgets_controller.d.ts +2 -1
  16. package/dist/widgets.css +5 -5
  17. package/dist/widgets.js +1 -1
  18. package/dist/widgets.js.map +1 -1
  19. package/dist/widgets.m.js +1 -1
  20. package/dist/widgets.m.js.map +1 -1
  21. package/dist/widgets.modern.js +1 -1
  22. package/dist/widgets.modern.js.map +1 -1
  23. package/dist/widgets.umd.js +1 -1
  24. package/dist/widgets.umd.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/assets/fonts/ArgentCF-DemiBold.eot +0 -0
  27. package/dist/assets/fonts/ArgentCF-DemiBold.ttf +0 -0
  28. package/dist/assets/fonts/ArgentCF-DemiBold.woff +0 -0
  29. package/dist/assets/fonts/ArgentCF-DemiBold.woff2 +0 -0
  30. package/dist/assets/fonts/Venn-Bold.eot +0 -0
  31. package/dist/assets/fonts/Venn-Bold.ttf +0 -0
  32. package/dist/assets/fonts/Venn-Bold.woff +0 -0
  33. package/dist/assets/fonts/Venn-Bold.woff2 +0 -0
  34. package/dist/assets/fonts/Venn-Regular.eot +0 -0
  35. package/dist/assets/fonts/Venn-Regular.ttf +0 -0
  36. package/dist/assets/fonts/Venn-Regular.woff +0 -0
  37. package/dist/assets/fonts/Venn-Regular.woff2 +0 -0
@@ -2000,17 +2000,17 @@ var messagesIT = {
2000
2000
 
2001
2001
  var messagesNL = {
2002
2002
  "credit-features.credit-cost-display": "{creditCost} (gemiddeld rente percentage {taegPercentage})",
2003
- "credit-features.information": "Een lening bindt je en moet worden terugbetaald. Ga na of u kunt terugbetalen voordat u zich vastlegt.",
2004
- "credit-features.total-credit-cost": "Waarvan kosten van krediet",
2003
+ "credit-features.information": "Een lening is bindend en moet worden terugbetaald. Ga na of je het kunt terugbetalen voordat je jezelf vastlegt.",
2004
+ "credit-features.total-credit-cost": "Waarvan kredietkosten",
2005
2005
  "eligibility-modal.bullet-1": "Kies <strong>Alma</strong> bij het afrekenen.",
2006
- "eligibility-modal.bullet-2": "Laat ons u begeleiden en uw betaling valideren in <strong>2 minuten.</strong>",
2007
- "eligibility-modal.bullet-3": "<strong>Houd de controle op</strong> door uw deadlines in uw eigen tempo vooruit of achteruit te schuiven.",
2006
+ "eligibility-modal.bullet-2": "Laat ons je begeleiden en jouw betaling valideren in <strong>2 minuten.</strong>",
2007
+ "eligibility-modal.bullet-3": "<strong>Behoudt de controle</strong> door jouw deadlines op je eigen tempo vooruit of achteruit te schuiven.",
2008
2008
  "eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
2009
2009
  "eligibility-modal.p1x-bullet-1": "Kies <strong>Alma - 1X</strong> bij het afrekenen.",
2010
- "eligibility-modal.p1x-bullet-2": "Vul uw <strong>creditcardgegevens in.</strong>",
2011
- "eligibility-modal.p1x-bullet-3": "<strong>De validatie </strong> van uw betaling is onmiddellijk!",
2012
- "eligibility-modal.title-deferred-plan": "Betaal in termijnen of later per creditcard met Alma.",
2013
- "eligibility-modal.title-normal": "Betaal in termijnen met een creditcard bij Alma.",
2010
+ "eligibility-modal.p1x-bullet-2": "Vul jouw <strong>creditcardgegevens </strong> in.",
2011
+ "eligibility-modal.p1x-bullet-3": "<strong>De bevestiging </strong> van jouw betaling is onmiddellijk!",
2012
+ "eligibility-modal.title-deferred-plan": "Betaal in termijnen of later via iDEAL of per creditcard met Alma.",
2013
+ "eligibility-modal.title-normal": "Betaal in termijnen met iDEAL of creditcard bij Alma.",
2014
2014
  "installments.today": "Tegenwoordig",
2015
2015
  "installments.total-amount": "Totaal",
2016
2016
  "installments.total-fees": "Waarvan kosten (incl. BTW)",
@@ -2215,7 +2215,8 @@ const useFetchEligibility = (purchaseAmount, {
2215
2215
  billing_address,
2216
2216
  shipping_address
2217
2217
  }, {
2218
- Authorization: `Alma-Merchant-Auth ${merchantId}`
2218
+ Authorization: `Alma-Merchant-Auth ${merchantId}`,
2219
+ 'X-Alma-Agent': 'Alma Widget'
2219
2220
  }).then(res => {
2220
2221
  setEligibility(res);
2221
2222
  setStatus(apiStatus.SUCCESS);
@@ -3107,7 +3108,8 @@ const PaymentPlanWidget = ({
3107
3108
  customerBillingCountry,
3108
3109
  customerShippingCountry,
3109
3110
  transitionDelay,
3110
- hideBorder: _hideBorder = false
3111
+ hideBorder: _hideBorder = false,
3112
+ onModalClose
3111
3113
  }) => {
3112
3114
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry);
3113
3115
  const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
@@ -3123,7 +3125,10 @@ const PaymentPlanWidget = ({
3123
3125
 
3124
3126
  const openModal = () => setIsOpen(true);
3125
3127
 
3126
- const closeModal = () => setIsOpen(false);
3128
+ const closeModal = event => {
3129
+ setIsOpen(false);
3130
+ onModalClose && onModalClose(event);
3131
+ };
3127
3132
 
3128
3133
  const eligiblePlanKeys = eligibilityPlans.reduce((acc, plan, index) => plan.eligible ? [...acc, index] : acc, []);
3129
3134
  /**
@@ -3255,7 +3260,8 @@ class WidgetsController {
3255
3260
  customerBillingCountry,
3256
3261
  customerShippingCountry,
3257
3262
  locale = Locale.en,
3258
- cards
3263
+ cards,
3264
+ onModalClose
3259
3265
  } = options;
3260
3266
 
3261
3267
  if (containerDiv) {
@@ -3272,7 +3278,8 @@ class WidgetsController {
3272
3278
  customerBillingCountry: customerBillingCountry,
3273
3279
  customerShippingCountry: customerShippingCountry,
3274
3280
  transitionDelay: transitionDelay,
3275
- hideBorder: hideBorder
3281
+ hideBorder: hideBorder,
3282
+ onModalClose: onModalClose
3276
3283
  })), document.querySelector(container));
3277
3284
  }
3278
3285
  }
@@ -3286,10 +3293,15 @@ class WidgetsController {
3286
3293
  locale = Locale.en,
3287
3294
  customerBillingCountry,
3288
3295
  customerShippingCountry,
3289
- cards
3296
+ cards,
3297
+ onClose
3290
3298
  } = options;
3291
3299
 
3292
- const close = () => containerDiv && unmountComponentAtNode(containerDiv);
3300
+ const close = event => {
3301
+ if (!containerDiv) return;
3302
+ unmountComponentAtNode(containerDiv);
3303
+ onClose && onClose(event);
3304
+ };
3293
3305
 
3294
3306
  const renderModal = () => {
3295
3307
  render( /*#__PURE__*/React.createElement(Provider, {