@alma/widgets 2.11.0 → 2.12.1

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/README.md CHANGED
@@ -33,21 +33,6 @@
33
33
  widgets.add(Alma.Widgets.PaymentPlans, {
34
34
  container: '#alma-widget',
35
35
  purchaseAmount: 45000,
36
- locale: 'fr',
37
- hideIfNotEligible: false,
38
- plans: [
39
- {
40
- installmentsCount: 1,
41
- deferredDays: 30,
42
- minAmount: 5000,
43
- maxAmount: 50000,
44
- },
45
- {
46
- installmentsCount: 3,
47
- minAmount: 5000,
48
- maxAmount: 50000,
49
- },
50
- ],
51
36
  })
52
37
  })()
53
38
  </script>
@@ -486,7 +486,7 @@
486
486
  }
487
487
 
488
488
  ._2G7Ch {
489
- height: 100%;
489
+ height: 100vh;
490
490
  display: flex;
491
491
  flex-direction: column;
492
492
  }
@@ -1534,6 +1534,7 @@ var Locale;
1534
1534
  Locale["it"] = "it";
1535
1535
  Locale["es"] = "es";
1536
1536
  Locale["nl"] = "nl";
1537
+ Locale["pt"] = "pt";
1537
1538
  Locale["nl-NL"] = "nl-NL";
1538
1539
  Locale["nl-BE"] = "nl-BE";
1539
1540
  })(Locale || (Locale = {}));
@@ -1547,6 +1548,7 @@ function priceFromCents(cents) {
1547
1548
  function formatCents(cents) {
1548
1549
  return String(priceFromCents(cents)).replace('.', ',');
1549
1550
  }
1551
+ var desktopWidth = 800;
1550
1552
 
1551
1553
  /* eslint-disable */
1552
1554
 
@@ -1876,7 +1878,7 @@ if (!''.trim) String.prototype.trim = function () {
1876
1878
  var messagesDE = {
1877
1879
  "eligibility-modal.bullet-1": "Wählen Sie an der Kasse <strong>Alma</strong> .",
1878
1880
  "eligibility-modal.bullet-2": "Füllen Sie die <strong>angeforderten</strong> Informationen aus.",
1879
- "eligibility-modal.bullet-3": "Die Bestätigung Ihrer Zahlung <strong>sofort</strong> !",
1881
+ "eligibility-modal.bullet-3": "Die Bestätigung Ihrer Zahlung erfolgt <strong>sofort</strong> !",
1880
1882
  "eligibility-modal.cost": "Davon Kosten",
1881
1883
  "eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
1882
1884
  "eligibility-modal.credit-cost": "Davon Kreditkosten",
@@ -1899,7 +1901,7 @@ var messagesDE = {
1899
1901
  var messagesEN = {
1900
1902
  "eligibility-modal.bullet-1": "Choose <strong>Alma</strong> at checkout.",
1901
1903
  "eligibility-modal.bullet-2": "Fill in the <strong>information</strong> requested.",
1902
- "eligibility-modal.bullet-3": "Validation of your payment <strong>instantaneous</strong>!",
1904
+ "eligibility-modal.bullet-3": "The validation of your payment is <strong>instantaneous</strong> !",
1903
1905
  "eligibility-modal.cost": "Of which costs",
1904
1906
  "eligibility-modal.credit-commitment": "A loan commits you and must be repaid. Check your ability to repay before committing yourself.",
1905
1907
  "eligibility-modal.credit-cost": "Of which cost of credit",
@@ -1922,7 +1924,7 @@ var messagesEN = {
1922
1924
  var messagesES = {
1923
1925
  "eligibility-modal.bullet-1": "Elige <strong>Alma</strong> como método de pago.",
1924
1926
  "eligibility-modal.bullet-2": "Completa la <strong>información</strong> solicitada.",
1925
- "eligibility-modal.bullet-3": "¡Validación <strong>inmediata</strong> de tu pago!",
1927
+ "eligibility-modal.bullet-3": "¡La validación de su pago es <strong>instantánea</strong> !",
1926
1928
  "eligibility-modal.cost": "Gastos (incl. en el total)",
1927
1929
  "eligibility-modal.credit-commitment": "Un préstamo te compromete y debe ser devuelto. Comprueba tu capacidad financiera antes de comprometerte.",
1928
1930
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
@@ -1945,7 +1947,7 @@ var messagesES = {
1945
1947
  var messagesFR = {
1946
1948
  "eligibility-modal.bullet-1": "Choisissez <strong>Alma</strong> au moment du paiement.",
1947
1949
  "eligibility-modal.bullet-2": "Renseignez les <strong>informations</strong> demandées.",
1948
- "eligibility-modal.bullet-3": "La validation de votre paiement <strong>instantanée</strong> !",
1950
+ "eligibility-modal.bullet-3": "La validation de votre paiement est <strong>instantanée</strong> !",
1949
1951
  "eligibility-modal.cost": "Dont frais",
1950
1952
  "eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
1951
1953
  "eligibility-modal.credit-cost": "Dont coût du crédit",
@@ -1968,7 +1970,7 @@ var messagesFR = {
1968
1970
  var messagesIT = {
1969
1971
  "eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
1970
1972
  "eligibility-modal.bullet-2": "Compila le informazioni <strong></strong> richieste.",
1971
- "eligibility-modal.bullet-3": "Convalida del tuo pagamento <strong>istantanea</strong>!",
1973
+ "eligibility-modal.bullet-3": "La convalida del pagamento è <strong>istantanea</strong> !",
1972
1974
  "eligibility-modal.cost": "Di cui commissioni",
1973
1975
  "eligibility-modal.credit-commitment": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua capacità di rimborso prima di impegnarti.",
1974
1976
  "eligibility-modal.credit-cost": "Di cui commissioni",
@@ -1991,24 +1993,47 @@ var messagesIT = {
1991
1993
  var messagesNL = {
1992
1994
  "eligibility-modal.bullet-1": "Kies <strong>Alma</strong> bij het afrekenen.",
1993
1995
  "eligibility-modal.bullet-2": "Vul de <strong>gevraagde informatie</strong> in.",
1994
- "eligibility-modal.bullet-3": "Onmiddelijke validatie van uw betaling ",
1996
+ "eligibility-modal.bullet-3": "De validatie van uw betaling is <strong>onmiddellijk</strong> !",
1995
1997
  "eligibility-modal.cost": "Waarvan kosten",
1996
1998
  "eligibility-modal.credit-commitment": "Een lening bindt je en moet worden terugbetaald. Ga na of u kunt terugbetalen voordat u zich vastlegt.",
1997
1999
  "eligibility-modal.credit-cost": "Waarvan kosten van krediet",
1998
- "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
2000
+ "eligibility-modal.credit-cost-amount": "{creditCost} (gemiddeld rente percentage {TAEG})",
1999
2001
  "eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
2000
- "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
2001
- "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
2002
+ "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met bank- en kredietkaart bij Alma.",
2003
+ "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per bank- en kredietkaart met Alma.",
2002
2004
  "eligibility-modal.total": "Totaal",
2003
2005
  "installments.today": "Tegenwoordig",
2004
- "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
2006
+ "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2005
2007
  "payment-plan-strings.default-message": "Betaal in termijnen met Alma",
2006
2008
  "payment-plan-strings.deferred": "{totalAmount} te betalen op {dueDate}",
2007
2009
  "payment-plan-strings.ineligible-greater-than-max": "Tot {maxAmount}",
2008
2010
  "payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
2009
2011
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2010
2012
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2011
- "payment-plan-strings.no-fee": "(gratis)"
2013
+ "payment-plan-strings.no-fee": "(zonder kosten)"
2014
+ };
2015
+
2016
+ var messagesPT = {
2017
+ "eligibility-modal.bullet-1": "Escolha a <strong>Alma</strong> no checkout.",
2018
+ "eligibility-modal.bullet-2": "Preencha os <strong>dados</strong> solicitados.",
2019
+ "eligibility-modal.bullet-3": "A validação do seu pagamento é <strong>instantaneamente</strong> !",
2020
+ "eligibility-modal.cost": "Incluindo encargos",
2021
+ "eligibility-modal.credit-commitment": "Um crédito é um compromisso e deve ser reembolsado. Verifique a sua capacidade de pagar antes de se comprometer.",
2022
+ "eligibility-modal.credit-cost": "Incluindo custo do crédito",
2023
+ "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
2024
+ "eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
2025
+ "eligibility-modal.title": "<highlighted>Pague em prestações</highlighted> com cartão bancário através da Alma.",
2026
+ "eligibility-modal.title-deferred": "<highlighted>Pague em prestações</highlighted> ou mais tarde com cartão bancário através da Alma.",
2027
+ "eligibility-modal.total": "Total",
2028
+ "installments.today": "Hoje",
2029
+ "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2030
+ "payment-plan-strings.default-message": "Pague em prestações através da Alma",
2031
+ "payment-plan-strings.deferred": "{totalAmount} a pagar em {dueDate}",
2032
+ "payment-plan-strings.ineligible-greater-than-max": "Até {maxAmount}",
2033
+ "payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
2034
+ "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2035
+ "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2036
+ "payment-plan-strings.no-fee": "(sem encargos)"
2012
2037
  };
2013
2038
 
2014
2039
  var getTranslationsByLocale = function getTranslationsByLocale(locale) {
@@ -2025,6 +2050,9 @@ var getTranslationsByLocale = function getTranslationsByLocale(locale) {
2025
2050
  case Locale.de:
2026
2051
  return messagesDE;
2027
2052
 
2053
+ case Locale.pt:
2054
+ return messagesPT;
2055
+
2028
2056
  case Locale.nl:
2029
2057
  case Locale['nl-BE']:
2030
2058
  case Locale['nl-NL']:
@@ -2226,7 +2254,10 @@ var prefix = 'alma-eligibility-modal';
2226
2254
  */
2227
2255
 
2228
2256
  var STATIC_CUSTOMISATION_CLASSES = {
2257
+ desktopModal: prefix + '-desktop-modal',
2258
+ mobileModal: prefix + '-mobile-modal',
2229
2259
  leftSide: prefix + '-left-side',
2260
+ bullet: prefix + '-bullet',
2230
2261
  rightSide: prefix + '-right-side',
2231
2262
  title: prefix + '-title',
2232
2263
  info: prefix + '-info',
@@ -2441,11 +2472,11 @@ var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary
2441
2472
 
2442
2473
  var Schedule = function Schedule(_ref) {
2443
2474
  var currentPlan = _ref.currentPlan;
2444
- var total = currentPlan && priceFromCents(currentPlan.purchase_amount + currentPlan.customer_total_cost_amount);
2445
- var creditCost = currentPlan ? priceFromCents(currentPlan.customer_total_cost_amount) : 0;
2475
+ var total = priceFromCents(currentPlan.purchase_amount + currentPlan.customer_total_cost_amount);
2476
+ var creditCost = priceFromCents(currentPlan.customer_total_cost_amount);
2446
2477
  var TAEG = (currentPlan == null ? void 0 : currentPlan.annual_interest_rate) && currentPlan.annual_interest_rate / 10000;
2447
- var customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
2448
- var isCredit = currentPlan && currentPlan.installments_count > 4;
2478
+ var customerFees = priceFromCents(currentPlan.customer_total_cost_amount);
2479
+ var isCredit = currentPlan.installments_count > 4;
2449
2480
  var intl = reactIntl.useIntl();
2450
2481
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
2451
2482
  className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
@@ -2694,7 +2725,7 @@ var Info = function Info() {
2694
2725
  }, /*#__PURE__*/React__default.createElement("div", {
2695
2726
  className: s$5.listItem
2696
2727
  }, /*#__PURE__*/React__default.createElement("div", {
2697
- className: s$5.bullet
2728
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2698
2729
  }, "1"), /*#__PURE__*/React__default.createElement("div", {
2699
2730
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2700
2731
  }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
@@ -2708,7 +2739,7 @@ var Info = function Info() {
2708
2739
  }))), /*#__PURE__*/React__default.createElement("div", {
2709
2740
  className: s$5.listItem
2710
2741
  }, /*#__PURE__*/React__default.createElement("div", {
2711
- className: s$5.bullet
2742
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2712
2743
  }, "2"), /*#__PURE__*/React__default.createElement("div", {
2713
2744
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2714
2745
  }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
@@ -2722,12 +2753,12 @@ var Info = function Info() {
2722
2753
  }))), /*#__PURE__*/React__default.createElement("div", {
2723
2754
  className: s$5.listItem
2724
2755
  }, /*#__PURE__*/React__default.createElement("div", {
2725
- className: s$5.bullet
2756
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2726
2757
  }, "3"), /*#__PURE__*/React__default.createElement("div", {
2727
2758
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2728
2759
  }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2729
2760
  id: "eligibility-modal.bullet-3",
2730
- defaultMessage: "La validation de votre paiement <strong>instantan\xE9e</strong> !",
2761
+ defaultMessage: "La validation de votre paiement est <strong>instantan\xE9e</strong> !",
2731
2762
  values: {
2732
2763
  strong: function strong() {
2733
2764
  return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
@@ -2821,7 +2852,7 @@ var DesktopModal = function DesktopModal(_ref) {
2821
2852
  isSomePlanDeferred = _ref.isSomePlanDeferred,
2822
2853
  cards = _ref.cards;
2823
2854
  return /*#__PURE__*/React__default.createElement("div", {
2824
- className: s$8.container,
2855
+ className: cx(s$8.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
2825
2856
  "data-testid": "modal-container"
2826
2857
  }, /*#__PURE__*/React__default.createElement("div", {
2827
2858
  className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
@@ -2843,7 +2874,7 @@ var MobileModal = function MobileModal(_ref) {
2843
2874
  isSomePlanDeferred = _ref.isSomePlanDeferred,
2844
2875
  cards = _ref.cards;
2845
2876
  return /*#__PURE__*/React__default.createElement("div", {
2846
- className: s$a.container,
2877
+ className: cx(s$a.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
2847
2878
  "data-testid": "modal-container"
2848
2879
  }, /*#__PURE__*/React__default.createElement(Title, {
2849
2880
  isSomePlanDeferred: isSomePlanDeferred
@@ -2864,7 +2895,7 @@ var EligibilityModal = function EligibilityModal(_ref) {
2864
2895
  setCurrentPlanIndex = _useState[1];
2865
2896
 
2866
2897
  var isBigScreen = reactResponsive.useMediaQuery({
2867
- minWidth: 800
2898
+ minWidth: desktopWidth
2868
2899
  });
2869
2900
  var ModalComponent = isBigScreen ? DesktopModal : MobileModal;
2870
2901
  var eligiblePlans = eligibilityPlans.filter(function (plan) {