@alma/widgets 2.4.0 → 2.6.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 +13 -2
- package/dist/raw/widgets.js +72 -47
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +72 -47
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +67 -45
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +72 -47
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +3 -1
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +3 -1
- package/dist/types/Widgets/EligibilityModal/ModalContainer.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/components/Title/index.d.ts +3 -1
- package/dist/types/Widgets/EligibilityModal/modal.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/Basics.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/Credit.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/HideWidget.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/LanguageCheck.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/LaunchModal.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/WithoutPlans.test.d.ts +1 -0
- package/dist/types/test/fixtures.d.ts +1 -0
- package/dist/types/utils/index.test.d.ts +1 -0
- package/dist/widgets.css +2 -2
- 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
|
@@ -1815,8 +1815,9 @@ var messagesDE = {
|
|
|
1815
1815
|
"eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
|
|
1816
1816
|
"eligibility-modal.credit-cost": "Davon Kreditkosten",
|
|
1817
1817
|
"eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
|
|
1818
|
-
"eligibility-modal.no-eligibility": "Ups, die Simulation
|
|
1819
|
-
"eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted>
|
|
1818
|
+
"eligibility-modal.no-eligibility": "Ups, die Simulation hat anscheinend nicht funktioniert.",
|
|
1819
|
+
"eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
|
|
1820
|
+
"eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
|
|
1820
1821
|
"eligibility-modal.total": "Insgesamt",
|
|
1821
1822
|
"installments.today": "Heutzutage",
|
|
1822
1823
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
@@ -1838,7 +1839,8 @@ var messagesEN = {
|
|
|
1838
1839
|
"eligibility-modal.credit-cost": "Of which cost of credit",
|
|
1839
1840
|
"eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
|
|
1840
1841
|
"eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
|
|
1841
|
-
"eligibility-modal.title": "<highlighted>Pay in installments</highlighted>
|
|
1842
|
+
"eligibility-modal.title": "<highlighted>Pay in installments</highlighted> by credit card with Alma.",
|
|
1843
|
+
"eligibility-modal.title-deferred": "<highlighted>Pay in installments</highlighted> or later by credit card with Alma.",
|
|
1842
1844
|
"eligibility-modal.total": "Total",
|
|
1843
1845
|
"installments.today": "Today",
|
|
1844
1846
|
"payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
|
|
@@ -1860,7 +1862,8 @@ var messagesES = {
|
|
|
1860
1862
|
"eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
|
|
1861
1863
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
|
|
1862
1864
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1863
|
-
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted>
|
|
1865
|
+
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta de crédito con Alma.",
|
|
1866
|
+
"eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
|
|
1864
1867
|
"eligibility-modal.total": "Total",
|
|
1865
1868
|
"installments.today": "Hoy",
|
|
1866
1869
|
"payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
|
|
@@ -1881,8 +1884,9 @@ var messagesFR = {
|
|
|
1881
1884
|
"eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
|
|
1882
1885
|
"eligibility-modal.credit-cost": "Dont coût du crédit",
|
|
1883
1886
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
|
|
1884
|
-
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'
|
|
1885
|
-
"eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted>
|
|
1887
|
+
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
|
|
1888
|
+
"eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
|
|
1889
|
+
"eligibility-modal.title-deferred": "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
|
|
1886
1890
|
"eligibility-modal.total": "Total",
|
|
1887
1891
|
"installments.today": "Aujourd'hui",
|
|
1888
1892
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
@@ -1904,7 +1908,8 @@ var messagesIT = {
|
|
|
1904
1908
|
"eligibility-modal.credit-cost": "Di cui commissioni",
|
|
1905
1909
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
|
|
1906
1910
|
"eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
|
|
1907
|
-
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted>
|
|
1911
|
+
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con carta di credito con Alma.",
|
|
1912
|
+
"eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
|
|
1908
1913
|
"eligibility-modal.total": "Totale",
|
|
1909
1914
|
"installments.today": "Oggi",
|
|
1910
1915
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
@@ -1926,7 +1931,8 @@ var messagesNL = {
|
|
|
1926
1931
|
"eligibility-modal.credit-cost": "Waarvan kosten van krediet",
|
|
1927
1932
|
"eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
|
|
1928
1933
|
"eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
|
|
1929
|
-
"eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted>
|
|
1934
|
+
"eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
|
|
1935
|
+
"eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
|
|
1930
1936
|
"eligibility-modal.total": "Totaal",
|
|
1931
1937
|
"installments.today": "Tegenwoordig",
|
|
1932
1938
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
@@ -2148,7 +2154,8 @@ const STATIC_CUSTOMISATION_CLASSES = {
|
|
|
2148
2154
|
closeButton: prefix + '-close-button',
|
|
2149
2155
|
scheduleDetails: prefix + '-schedule-details',
|
|
2150
2156
|
scheduleTotal: prefix + '-schedule-total',
|
|
2151
|
-
scheduleCredit: prefix + '-schedule-credit'
|
|
2157
|
+
scheduleCredit: prefix + '-schedule-credit',
|
|
2158
|
+
summary: prefix + '-summary'
|
|
2152
2159
|
};
|
|
2153
2160
|
|
|
2154
2161
|
const _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
|
|
@@ -2340,7 +2347,7 @@ const EligibilityPlansButtons = ({
|
|
|
2340
2347
|
onClick: () => setCurrentPlanIndex(index)
|
|
2341
2348
|
}, paymentPlanShorthandName(eligibilityPlan))));
|
|
2342
2349
|
|
|
2343
|
-
var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","creditCost":"_1ZIgu","creditMessage":"_1BUr8"};
|
|
2350
|
+
var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary":"_65ZpD","creditCost":"_1ZIgu","creditCostAmount":"_tUTZp","creditMessage":"_1BUr8"};
|
|
2344
2351
|
|
|
2345
2352
|
const Schedule = ({
|
|
2346
2353
|
currentPlan
|
|
@@ -2351,9 +2358,27 @@ const Schedule = ({
|
|
|
2351
2358
|
const customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
|
|
2352
2359
|
const isCredit = currentPlan && currentPlan.installments_count > 4;
|
|
2353
2360
|
const intl = useIntl();
|
|
2354
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2361
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2355
2362
|
className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
|
|
2356
2363
|
"data-testid": "modal-installments-element"
|
|
2364
|
+
}, ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map((installment, index) => /*#__PURE__*/React.createElement("div", {
|
|
2365
|
+
className: s$3.scheduleLine,
|
|
2366
|
+
key: index
|
|
2367
|
+
}, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2368
|
+
id: "installments.today",
|
|
2369
|
+
defaultMessage: "Aujourd'hui"
|
|
2370
|
+
}) : /*#__PURE__*/React.createElement(FormattedDate, {
|
|
2371
|
+
value: installment.due_date * 1000,
|
|
2372
|
+
day: "numeric",
|
|
2373
|
+
month: "long",
|
|
2374
|
+
year: "numeric"
|
|
2375
|
+
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
2376
|
+
value: priceFromCents(installment.total_amount),
|
|
2377
|
+
style: "currency",
|
|
2378
|
+
currency: "EUR"
|
|
2379
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
2380
|
+
className: cx(s$3.summary, STATIC_CUSTOMISATION_CLASSES.summary),
|
|
2381
|
+
"data-testid": "modal-summary"
|
|
2357
2382
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2358
2383
|
className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
|
|
2359
2384
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2371,7 +2396,9 @@ const Schedule = ({
|
|
|
2371
2396
|
})) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2372
2397
|
id: "eligibility-modal.cost",
|
|
2373
2398
|
defaultMessage: "Dont frais"
|
|
2374
|
-
})), /*#__PURE__*/React.createElement("span",
|
|
2399
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
2400
|
+
className: s$3.creditCostAmount
|
|
2401
|
+
}, isCredit ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2375
2402
|
id: "eligibility-modal.credit-cost-amount",
|
|
2376
2403
|
defaultMessage: "{creditCost} (TAEG {TAEG})",
|
|
2377
2404
|
values: {
|
|
@@ -2388,27 +2415,12 @@ const Schedule = ({
|
|
|
2388
2415
|
value: customerFees,
|
|
2389
2416
|
style: "currency",
|
|
2390
2417
|
currency: "EUR"
|
|
2391
|
-
}))),
|
|
2392
|
-
className: s$3.scheduleLine,
|
|
2393
|
-
key: index
|
|
2394
|
-
}, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2395
|
-
id: "installments.today",
|
|
2396
|
-
defaultMessage: "Aujourd'hui"
|
|
2397
|
-
}) : /*#__PURE__*/React.createElement(FormattedDate, {
|
|
2398
|
-
value: installment.due_date * 1000,
|
|
2399
|
-
day: "numeric",
|
|
2400
|
-
month: "long",
|
|
2401
|
-
year: "numeric"
|
|
2402
|
-
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
2403
|
-
value: priceFromCents(installment.total_amount),
|
|
2404
|
-
style: "currency",
|
|
2405
|
-
currency: "EUR"
|
|
2406
|
-
})))), isCredit && /*#__PURE__*/React.createElement("p", {
|
|
2418
|
+
}))), isCredit && /*#__PURE__*/React.createElement("p", {
|
|
2407
2419
|
className: s$3.creditMessage
|
|
2408
2420
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2409
2421
|
id: "eligibility-modal.credit-commitment",
|
|
2410
2422
|
defaultMessage: "Un cr\u00E9dit vous engage et doit \u00EAtre rembours\u00E9. V\u00E9rifiez vos capacit\u00E9s de remboursement\n avant de vous engager."
|
|
2411
|
-
})));
|
|
2423
|
+
}))));
|
|
2412
2424
|
};
|
|
2413
2425
|
|
|
2414
2426
|
var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
@@ -2496,27 +2508,38 @@ const Logo = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2496
2508
|
|
|
2497
2509
|
var s$6 = {"title":"_3ERx-"};
|
|
2498
2510
|
|
|
2499
|
-
const Title = (
|
|
2511
|
+
const Title = ({
|
|
2512
|
+
isSomePlanDeferred
|
|
2513
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
2500
2514
|
className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
|
|
2501
2515
|
"data-testid": "modal-title-element"
|
|
2502
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2503
|
-
id:
|
|
2516
|
+
}, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2517
|
+
id: 'eligibility-modal.title-deferred',
|
|
2504
2518
|
defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
|
|
2505
2519
|
values: {
|
|
2506
2520
|
highlighted: (...chunks) => /*#__PURE__*/React.createElement("span", null, chunks)
|
|
2507
2521
|
}
|
|
2522
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2523
|
+
id: 'eligibility-modal.title',
|
|
2524
|
+
defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
|
|
2525
|
+
values: {
|
|
2526
|
+
highlighted: (...chunks) => /*#__PURE__*/React.createElement("span", null, chunks)
|
|
2527
|
+
}
|
|
2508
2528
|
}));
|
|
2509
2529
|
|
|
2510
2530
|
var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
|
|
2511
2531
|
|
|
2512
2532
|
const DesktopModal = ({
|
|
2513
|
-
children
|
|
2533
|
+
children,
|
|
2534
|
+
isSomePlanDeferred
|
|
2514
2535
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2515
2536
|
className: s$7.container,
|
|
2516
2537
|
"data-testid": "modal-container"
|
|
2517
2538
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2518
2539
|
className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2519
|
-
}, /*#__PURE__*/React.createElement(Title,
|
|
2540
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
2541
|
+
isSomePlanDeferred: isSomePlanDeferred
|
|
2542
|
+
}), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
|
|
2520
2543
|
className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
|
|
2521
2544
|
}, children));
|
|
2522
2545
|
|
|
@@ -2525,11 +2548,14 @@ var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
|
|
|
2525
2548
|
var s$9 = {"container":"_2G7Ch"};
|
|
2526
2549
|
|
|
2527
2550
|
const MobileModal = ({
|
|
2528
|
-
children
|
|
2551
|
+
children,
|
|
2552
|
+
isSomePlanDeferred
|
|
2529
2553
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2530
2554
|
className: s$9.container,
|
|
2531
2555
|
"data-testid": "modal-container"
|
|
2532
|
-
}, /*#__PURE__*/React.createElement(Title,
|
|
2556
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
2557
|
+
isSomePlanDeferred: isSomePlanDeferred
|
|
2558
|
+
}), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
|
|
2533
2559
|
|
|
2534
2560
|
const EligibilityModal = ({
|
|
2535
2561
|
initialPlanIndex,
|
|
@@ -2544,25 +2570,21 @@ const EligibilityModal = ({
|
|
|
2544
2570
|
const ModalComponent = isBigScreen ? DesktopModal : MobileModal;
|
|
2545
2571
|
const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
|
|
2546
2572
|
const currentPlan = eligiblePlans[currentPlanIndex];
|
|
2547
|
-
const
|
|
2548
|
-
eligibilityPlans: eligiblePlans,
|
|
2549
|
-
currentPlanIndex,
|
|
2550
|
-
setCurrentPlanIndex,
|
|
2551
|
-
currentPlan,
|
|
2552
|
-
status
|
|
2553
|
-
};
|
|
2573
|
+
const isSomePlanDeferred = eligibilityPlans.some(plan => plan.deferred_days > 0 || plan.deferred_months > 0);
|
|
2554
2574
|
return /*#__PURE__*/React.createElement(ControlledModal, {
|
|
2555
2575
|
onClose: onClose,
|
|
2556
2576
|
ariaHideApp: false,
|
|
2557
2577
|
scrollable: true,
|
|
2558
2578
|
isOpen: true
|
|
2559
|
-
}, /*#__PURE__*/React.createElement(ModalComponent,
|
|
2579
|
+
}, /*#__PURE__*/React.createElement(ModalComponent, {
|
|
2580
|
+
isSomePlanDeferred: isSomePlanDeferred
|
|
2581
|
+
}, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
|
|
2560
2582
|
className: s$8.loader
|
|
2561
2583
|
}, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
2562
2584
|
className: s$8.noEligibility
|
|
2563
2585
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2564
2586
|
id: "eligibility-modal.no-eligibility",
|
|
2565
|
-
defaultMessage: "Oups, il semblerait que la simulation n'
|
|
2587
|
+
defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\u00E9."
|
|
2566
2588
|
})), status === apiStatus.SUCCESS && eligiblePlans.length >= 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EligibilityPlansButtons, {
|
|
2567
2589
|
eligibilityPlans: eligiblePlans,
|
|
2568
2590
|
currentPlanIndex: currentPlanIndex,
|