@adyen/adyen-web 6.0.0-beta.0 → 6.0.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 (691) hide show
  1. package/README.md +123 -182
  2. package/dist/cjs/adyen.css +15 -11
  3. package/dist/cjs/adyen.css.map +1 -1
  4. package/dist/cjs/index.cjs +2 -2
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/index.d.cts +834 -847
  7. package/dist/es/adyen.css +15 -11
  8. package/dist/es/adyen.css.map +1 -1
  9. package/dist/es/components/ANCV/ANCV.js +1 -1
  10. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  11. package/dist/es/components/Ach/Ach.js +1 -1
  12. package/dist/es/components/Ach/Ach.js.map +1 -1
  13. package/dist/es/components/Ach/components/AchInput/AchInput.js +1 -1
  14. package/dist/es/components/Ach/components/AchInput/AchInput.js.map +1 -1
  15. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  16. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  17. package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  18. package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  19. package/dist/es/components/AmazonPay/components/SignOutButton.js.map +1 -1
  20. package/dist/es/components/ApplePay/ApplePayService.js.map +1 -1
  21. package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
  22. package/dist/es/components/Card/Card.js +1 -1
  23. package/dist/es/components/Card/Card.js.map +1 -1
  24. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  25. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  26. package/dist/es/components/Card/components/CardInput/components/CVC.js +1 -1
  27. package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
  28. package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  29. package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
  30. package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  31. package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
  32. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  33. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  34. package/dist/es/components/Card/components/CardInput/components/{IframeLabelAlternative.js → FieldLabelAlternative.js} +1 -1
  35. package/dist/es/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  36. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  37. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  38. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  39. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  40. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  41. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  42. package/dist/es/components/Card/components/CardInput/handlers.js.map +1 -1
  43. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  44. package/dist/es/components/Card/components/CardInput/utils.js +1 -1
  45. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  46. package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  47. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  48. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  49. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  50. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  51. package/dist/es/components/Donation/components/CampaignContent.js +1 -1
  52. package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
  53. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  54. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  55. package/dist/es/components/Donation/components/FixedAmounts.js +2 -0
  56. package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -0
  57. package/dist/es/components/Donation/components/Roundup.js +2 -0
  58. package/dist/es/components/Donation/components/Roundup.js.map +1 -0
  59. package/dist/es/components/Donation/components/utils.js +2 -0
  60. package/dist/es/components/Donation/components/utils.js.map +1 -0
  61. package/dist/es/components/Dropin/Dropin.js +1 -1
  62. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  63. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  64. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  65. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  66. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  67. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  68. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  69. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  70. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  71. package/dist/es/components/Dropin/elements/createElements.js +1 -1
  72. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  73. package/dist/es/components/Dropin/elements/filters.js +1 -1
  74. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  75. package/dist/es/components/Giftcard/Giftcard.js +1 -1
  76. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  77. package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
  78. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  79. package/dist/es/components/Giftcard/components/GiftcardNumberField.js +1 -1
  80. package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  81. package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
  82. package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  83. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  84. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  85. package/dist/es/components/GooglePay/GooglePayService.js.map +1 -1
  86. package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
  87. package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
  88. package/dist/es/components/GooglePay/requests.js.map +1 -1
  89. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  90. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  91. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  92. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  93. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  94. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  95. package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
  96. package/dist/es/components/PayPal/Paypal.js +1 -1
  97. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  98. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  99. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  100. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  101. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  102. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  103. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  104. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  105. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  106. package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
  107. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  108. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  109. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  110. package/dist/es/components/UPI/UPI.js +1 -1
  111. package/dist/es/components/UPI/UPI.js.map +1 -1
  112. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  113. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  114. package/dist/es/components/UPI/components/UPIComponent/constants.js +2 -0
  115. package/dist/es/components/UPI/components/UPIComponent/constants.js.map +1 -0
  116. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  117. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  118. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  119. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  120. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  121. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  122. package/dist/es/components/UPI/components/VpaInput/VpaInput.js +1 -1
  123. package/dist/es/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  124. package/dist/es/components/components-name-map.js +1 -1
  125. package/dist/es/components/components-name-map.js.map +1 -1
  126. package/dist/es/components/internal/Address/components/AddressSearch.js +1 -1
  127. package/dist/es/components/internal/Address/components/AddressSearch.js.map +1 -1
  128. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  129. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  130. package/dist/es/components/internal/Await/Await.js +1 -1
  131. package/dist/es/components/internal/Await/Await.js.map +1 -1
  132. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  133. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  134. package/dist/es/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
  135. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
  136. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  137. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  138. package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js +1 -1
  139. package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  140. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  141. package/dist/es/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
  142. package/dist/es/components/internal/Countdown/index.js +1 -1
  143. package/dist/es/components/internal/Countdown/index.js.map +1 -1
  144. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  145. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  146. package/dist/es/components/internal/ExpandButton/ExpandButton.js +2 -0
  147. package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  148. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  149. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  150. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  151. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  152. package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
  153. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  154. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  155. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  156. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  157. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  158. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  159. package/dist/es/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  160. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  161. package/dist/es/components/internal/Modal/Modal.js.map +1 -1
  162. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  163. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  164. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  165. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  166. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  167. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  168. package/dist/es/components/internal/SecuredFields/SFP/defaultProps.js +1 -1
  169. package/dist/es/components/internal/SecuredFields/SFP/defaultProps.js.map +1 -1
  170. package/dist/es/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
  171. package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js +1 -1
  172. package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
  173. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js +1 -1
  174. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js.map +1 -1
  175. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  176. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  177. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  178. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  179. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js +1 -1
  180. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  181. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  182. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  183. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  184. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  185. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  186. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  187. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  188. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  189. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  190. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js +1 -1
  191. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js.map +1 -1
  192. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  193. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  194. package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +1 -1
  195. package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
  196. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  197. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  198. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  199. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  200. package/dist/es/components/internal/SecuredFields/lib/utilities/dom.js +1 -1
  201. package/dist/es/components/internal/SecuredFields/lib/utilities/dom.js.map +1 -1
  202. package/dist/es/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  203. package/dist/es/components/internal/SecuredFields/utils.js +1 -1
  204. package/dist/es/components/internal/SecuredFields/utils.js.map +1 -1
  205. package/dist/es/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js +1 -1
  206. package/dist/es/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js.map +1 -1
  207. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  208. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  209. package/dist/es/components/tx-variants.js +1 -1
  210. package/dist/es/components/tx-variants.js.map +1 -1
  211. package/dist/es/core/Analytics/Analytics.js +1 -1
  212. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  213. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  214. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  215. package/dist/es/core/Analytics/utils.js +1 -1
  216. package/dist/es/core/Analytics/utils.js.map +1 -1
  217. package/dist/es/core/Environment/Environment.js +1 -1
  218. package/dist/es/core/Environment/Environment.js.map +1 -1
  219. package/dist/es/core/Environment/constants.js +1 -1
  220. package/dist/es/core/Environment/constants.js.map +1 -1
  221. package/dist/es/core/RiskModule/RiskModule.js +1 -1
  222. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  223. package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  224. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  225. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  226. package/dist/es/core/Services/get-translations.js +1 -1
  227. package/dist/es/core/Services/get-translations.js.map +1 -1
  228. package/dist/es/core/Services/http.js.map +1 -1
  229. package/dist/es/core/config.js +1 -1
  230. package/dist/es/core/config.js.map +1 -1
  231. package/dist/es/core/core.js +1 -1
  232. package/dist/es/core/core.js.map +1 -1
  233. package/dist/es/core/utils.js +1 -1
  234. package/dist/es/core/utils.js.map +1 -1
  235. package/dist/es/external/preact/dist/preact.js +1 -1
  236. package/dist/es/external/preact/dist/preact.js.map +1 -1
  237. package/dist/es/external/preact/hooks/dist/hooks.js +1 -1
  238. package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
  239. package/dist/es/index.d.ts +834 -847
  240. package/dist/es/language/constants.js +1 -1
  241. package/dist/es/language/constants.js.map +1 -1
  242. package/dist/es/utils/amount-util.js.map +1 -1
  243. package/dist/es/utils/browserInfo.js +1 -1
  244. package/dist/es/utils/browserInfo.js.map +1 -1
  245. package/dist/es/utils/commonUtils.js +2 -0
  246. package/dist/es/utils/commonUtils.js.map +1 -0
  247. package/dist/es/utils/listenerUtils.js +2 -0
  248. package/dist/es/utils/listenerUtils.js.map +1 -0
  249. package/dist/es/utils/regex.js.map +1 -1
  250. package/dist/es-legacy/adyen.css +15 -11
  251. package/dist/es-legacy/adyen.css.map +1 -1
  252. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  253. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  254. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  255. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  256. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  257. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  258. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  259. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  260. package/dist/es-legacy/components/Address/Address.js +1 -1
  261. package/dist/es-legacy/components/Address/Address.js.map +1 -1
  262. package/dist/es-legacy/components/Affirm/Affirm.js +1 -1
  263. package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
  264. package/dist/es-legacy/components/AfterPay/AfterPay.js +1 -1
  265. package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
  266. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
  267. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  268. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  269. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  270. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js +1 -1
  271. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  272. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  273. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  274. package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js.map +1 -1
  275. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  276. package/dist/es-legacy/components/AmazonPay/utils.js.map +1 -1
  277. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  278. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  279. package/dist/es-legacy/components/ApplePay/ApplePayService.js.map +1 -1
  280. package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
  281. package/dist/es-legacy/components/Atome/Atome.js +1 -1
  282. package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
  283. package/dist/es-legacy/components/Atome/config.js +1 -1
  284. package/dist/es-legacy/components/Atome/config.js.map +1 -1
  285. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  286. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  287. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  288. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  289. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js +1 -1
  290. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
  291. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js +1 -1
  292. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
  293. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  294. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  295. package/dist/es-legacy/components/Boleto/Boleto.js +1 -1
  296. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  297. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  298. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  299. package/dist/es-legacy/components/Card/Bancontact.js +1 -1
  300. package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
  301. package/dist/es-legacy/components/Card/Card.js +1 -1
  302. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  303. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  304. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  305. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js +1 -1
  306. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
  307. package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  308. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
  309. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  310. package/dist/es-legacy/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
  311. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  312. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  313. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js +2 -0
  314. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  315. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  316. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  317. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  318. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  319. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  320. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  321. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  322. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  323. package/dist/es-legacy/components/Card/components/CardInput/handlers.js.map +1 -1
  324. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  325. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  326. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  327. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  328. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  329. package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  330. package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
  331. package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
  332. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  333. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  334. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  335. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  336. package/dist/es-legacy/components/Doku/Doku.js +1 -1
  337. package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
  338. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  339. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  340. package/dist/es-legacy/components/Donation/components/CampaignContent.js +1 -1
  341. package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
  342. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  343. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  344. package/dist/es-legacy/components/Donation/components/FixedAmounts.js +2 -0
  345. package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -0
  346. package/dist/es-legacy/components/Donation/components/Roundup.js +2 -0
  347. package/dist/es-legacy/components/Donation/components/Roundup.js.map +1 -0
  348. package/dist/es-legacy/components/Donation/components/utils.js +2 -0
  349. package/dist/es-legacy/components/Donation/components/utils.js.map +1 -0
  350. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  351. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  352. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  353. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  354. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  355. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  356. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  357. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  358. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  359. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  360. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  361. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  362. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  363. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  364. package/dist/es-legacy/components/Dropin/elements/createElements.js +1 -1
  365. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  366. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js +1 -1
  367. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  368. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js +1 -1
  369. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  370. package/dist/es-legacy/components/Dropin/elements/filters.js +1 -1
  371. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  372. package/dist/es-legacy/components/EPS/index.js +1 -1
  373. package/dist/es-legacy/components/EPS/index.js.map +1 -1
  374. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  375. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  376. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js +1 -1
  377. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
  378. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js +1 -1
  379. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
  380. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js +1 -1
  381. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
  382. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js +1 -1
  383. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
  384. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js +1 -1
  385. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
  386. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  387. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  388. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  389. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  390. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js +1 -1
  391. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
  392. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js +1 -1
  393. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  394. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
  395. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  396. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  397. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  398. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  399. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  400. package/dist/es-legacy/components/GooglePay/GooglePayService.js.map +1 -1
  401. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js +1 -1
  402. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
  403. package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
  404. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  405. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  406. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  407. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  408. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  409. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  410. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  411. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  412. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  413. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  414. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js +1 -1
  415. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
  416. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  417. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  418. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js +1 -1
  419. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
  420. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  421. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  422. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  423. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  424. package/dist/es-legacy/components/OnlineBankingIN/index.js +1 -1
  425. package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
  426. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
  427. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
  428. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  429. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  430. package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
  431. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  432. package/dist/es-legacy/components/PayByBank/PayByBank.js +1 -1
  433. package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
  434. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  435. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  436. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  437. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  438. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  439. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  440. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
  441. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  442. package/dist/es-legacy/components/PayU/PayuCashcard.js +1 -1
  443. package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
  444. package/dist/es-legacy/components/PayU/PayuNetBanking.js +1 -1
  445. package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
  446. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
  447. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
  448. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  449. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  450. package/dist/es-legacy/components/RatePay/RatePay.js +1 -1
  451. package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
  452. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js +1 -1
  453. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
  454. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  455. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  456. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  457. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  458. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  459. package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
  460. package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
  461. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  462. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  463. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  464. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  465. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  466. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  467. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  468. package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
  469. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  470. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  471. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  472. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  473. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  474. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  475. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  476. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  477. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  478. package/dist/es-legacy/components/Twint/Twint.js +1 -1
  479. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  480. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  481. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  482. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  483. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  484. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js +2 -0
  485. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js.map +1 -0
  486. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  487. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  488. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  489. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  490. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  491. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  492. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js +1 -1
  493. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  494. package/dist/es-legacy/components/WalletIN/index.js +1 -1
  495. package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
  496. package/dist/es-legacy/components/components-name-map.js +1 -1
  497. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  498. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  499. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  500. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  501. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  502. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  503. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  504. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  505. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  506. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js +1 -1
  507. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js.map +1 -1
  508. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  509. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  510. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  511. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  512. package/dist/es-legacy/components/internal/Await/Await.js +1 -1
  513. package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
  514. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  515. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  516. package/dist/es-legacy/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
  517. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
  518. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  519. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  520. package/dist/es-legacy/components/internal/ClickToPay/errors/TimeoutError.js +1 -1
  521. package/dist/es-legacy/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  522. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  523. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  524. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  525. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  526. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
  527. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  528. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  529. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  530. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  531. package/dist/es-legacy/components/internal/Countdown/index.js +1 -1
  532. package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
  533. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  534. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  535. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +2 -0
  536. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  537. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  538. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  539. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  540. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  541. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  542. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  543. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  544. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  545. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
  546. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  547. package/dist/es-legacy/components/internal/FormFields/InputEmail.js +1 -1
  548. package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
  549. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js +1 -1
  550. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js.map +1 -1
  551. package/dist/es-legacy/components/internal/FormFields/InputText.js +1 -1
  552. package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
  553. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  554. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  555. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  556. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  557. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  558. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  559. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  560. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  561. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  562. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  563. package/dist/es-legacy/components/internal/Img/Img.js +1 -1
  564. package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
  565. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js +1 -1
  566. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
  567. package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
  568. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  569. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  570. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  571. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  572. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  573. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  574. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +1 -1
  575. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +1 -1
  576. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  577. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  578. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  579. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  580. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  581. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  582. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  583. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  584. package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.js +1 -1
  585. package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.js.map +1 -1
  586. package/dist/es-legacy/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
  587. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/CSF.js +1 -1
  588. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
  589. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js +1 -1
  590. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js.map +1 -1
  591. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  592. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  593. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  594. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  595. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  596. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  597. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js +1 -1
  598. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  599. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  600. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  601. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  602. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  603. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  604. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  605. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  606. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  607. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  608. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js +1 -1
  609. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js.map +1 -1
  610. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  611. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  612. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +1 -1
  613. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
  614. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  615. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  616. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
  617. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
  618. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  619. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  620. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/dom.js +1 -1
  621. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/dom.js.map +1 -1
  622. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  623. package/dist/es-legacy/components/internal/SecuredFields/utils.js +1 -1
  624. package/dist/es-legacy/components/internal/SecuredFields/utils.js.map +1 -1
  625. package/dist/es-legacy/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js +1 -1
  626. package/dist/es-legacy/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js.map +1 -1
  627. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  628. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  629. package/dist/es-legacy/components/tx-variants.js +1 -1
  630. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  631. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  632. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  633. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  634. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  635. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  636. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  637. package/dist/es-legacy/core/Context/Resources.js +1 -1
  638. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  639. package/dist/es-legacy/core/Environment/Environment.js +1 -1
  640. package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
  641. package/dist/es-legacy/core/Environment/constants.js +1 -1
  642. package/dist/es-legacy/core/Environment/constants.js.map +1 -1
  643. package/dist/es-legacy/core/Errors/SRPanel.js +1 -1
  644. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  645. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  646. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  647. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  648. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  649. package/dist/es-legacy/core/ProcessResponse/process-response.js +1 -1
  650. package/dist/es-legacy/core/ProcessResponse/process-response.js.map +1 -1
  651. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  652. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  653. package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  654. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  655. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  656. package/dist/es-legacy/core/Services/get-translations.js +1 -1
  657. package/dist/es-legacy/core/Services/get-translations.js.map +1 -1
  658. package/dist/es-legacy/core/Services/http.js +1 -1
  659. package/dist/es-legacy/core/Services/http.js.map +1 -1
  660. package/dist/es-legacy/core/config.js +1 -1
  661. package/dist/es-legacy/core/config.js.map +1 -1
  662. package/dist/es-legacy/core/core.js +1 -1
  663. package/dist/es-legacy/core/core.js.map +1 -1
  664. package/dist/es-legacy/core/core.registry.js +1 -1
  665. package/dist/es-legacy/core/core.registry.js.map +1 -1
  666. package/dist/es-legacy/core/utils.js +1 -1
  667. package/dist/es-legacy/core/utils.js.map +1 -1
  668. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  669. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  670. package/dist/es-legacy/external/preact/hooks/dist/hooks.js +1 -1
  671. package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
  672. package/dist/es-legacy/language/constants.js +1 -1
  673. package/dist/es-legacy/language/constants.js.map +1 -1
  674. package/dist/es-legacy/utils/amount-util.js.map +1 -1
  675. package/dist/es-legacy/utils/browserInfo.js +1 -1
  676. package/dist/es-legacy/utils/browserInfo.js.map +1 -1
  677. package/dist/es-legacy/utils/commonUtils.js +2 -0
  678. package/dist/es-legacy/utils/commonUtils.js.map +1 -0
  679. package/dist/es-legacy/utils/listenerUtils.js +2 -0
  680. package/dist/es-legacy/utils/listenerUtils.js.map +1 -0
  681. package/dist/es-legacy/utils/regex.js.map +1 -1
  682. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  683. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  684. package/package.json +22 -18
  685. package/dist/es/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  686. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  687. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
  688. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js +0 -2
  689. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  690. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  691. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandButton.js","sources":["../../../../../src/components/internal/ExpandButton/ExpandButton.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { ComponentChildren, h } from 'preact';\nimport './ExpandButton.scss';\n\ninterface ExpandButton {\n buttonId: string;\n isSelected: boolean;\n expandContentId: string;\n children?: ComponentChildren;\n showRadioButton?: boolean;\n classNameModifiers?: string[];\n}\n\nfunction ExpandButton({ buttonId, showRadioButton, isSelected, expandContentId, children, classNameModifiers = [] }: Readonly<ExpandButton>) {\n return (\n // See discussion: https://github.com/w3c/aria/issues/1404\n // eslint-disable-next-line jsx-a11y/role-supports-aria-props\n <button\n className={classNames(\n 'adyen-checkout__payment-method__header__title',\n ...classNameModifiers.map(modifier => `adyen-checkout-expand-button--${modifier}`)\n )}\n id={buttonId}\n role={'radio'}\n aria-checked={isSelected}\n aria-expanded={isSelected}\n aria-controls={expandContentId}\n type=\"button\"\n >\n {showRadioButton && (\n <span\n className={classNames({\n 'adyen-checkout__payment-method__radio': true,\n 'adyen-checkout__payment-method__radio--selected': isSelected\n })}\n aria-hidden=\"true\"\n />\n )}\n {children}\n </button>\n );\n}\n\nexport default ExpandButton;\n"],"names":["ExpandButton","buttonId","showRadioButton","isSelected","expandContentId","children","classNameModifiers","h","button","className","classNames","map","modifier","id","role","aria-checked","aria-expanded","aria-controls","type","span","aria-hidden"],"mappings":"6HAaA,SAASA,GAAaC,SAAEA,EAAQC,gBAAEA,EAAeC,WAAEA,EAAUC,gBAAEA,EAAeC,SAAEA,EAAQC,mBAAEA,EAAqB,KAC3G,OAGIC,EAACC,SAAAA,CACGC,UAAWC,EACP,mDACGJ,EAAmBK,KAAIC,GAAY,iCAAiCA,OAE3EC,GAAIZ,EACJa,KAAM,QACNC,eAAcZ,EACda,gBAAeb,EACfc,gBAAeb,EACfc,KAAK,UAEJhB,GACGK,EAACY,OAAAA,CACGV,UAAWC,EAAW,CAClB,yCAAyC,EACzC,kDAAmDP,IAEvDiB,cAAY,SAGnBf,EAGb"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import o from"../Field/Field.js";import a from"../Checkbox/Checkbox.js";function r({errorMessage:r,label:s,onChange:c,i18n:n,...t}){return e(o,{classNameModifiers:["consentCheckbox"],errorMessage:r,i18n:n,name:"consentCheckbox",useLabelElement:!1,label:n.get("creditCard.holderName")},e(a,{name:"consentCheckbox",classNameModifiers:[...t.classNameModifiers??=[],"consentCheckbox"],onInput:c,value:t?.data?.consentCheckbox,label:s,checked:t.checked}))}export{r as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import o from"../Field/Field.js";import s from"../Checkbox/Checkbox.js";function a({errorMessage:a,label:n,onChange:c,i18n:r,...t}){return e(o,{classNameModifiers:["consentCheckbox"],errorMessage:a,i18n:r,name:"consentCheckbox",useLabelElement:!1},e(s,{name:"consentCheckbox",classNameModifiers:[...t.classNameModifiers??=[],"consentCheckbox"],onInput:c,value:t?.data?.consentCheckbox,label:n,checked:t.checked}))}export{a as default};
2
2
  //# sourceMappingURL=ConsentCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsentCheckbox.js","sources":["../../../../../../src/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Field from '../Field';\nimport Checkbox from '../Checkbox';\n\nexport default function ConsentCheckbox({ errorMessage, label, onChange, i18n, ...props }) {\n return (\n <Field\n classNameModifiers={['consentCheckbox']}\n errorMessage={errorMessage}\n i18n={i18n}\n name={'consentCheckbox'}\n useLabelElement={false}\n label={i18n.get('creditCard.holderName')}\n >\n <Checkbox\n name={'consentCheckbox'}\n classNameModifiers={[...(props.classNameModifiers ??= []), 'consentCheckbox']}\n onInput={onChange}\n value={props?.data?.consentCheckbox}\n label={label}\n checked={props.checked}\n />\n </Field>\n );\n}\n"],"names":["ConsentCheckbox","errorMessage","label","onChange","i18n","props","h","Field","classNameModifiers","name","useLabelElement","get","Checkbox","onInput","value","data","consentCheckbox","checked"],"mappings":"mJAIe,SAASA,GAAgBC,aAAEA,EAAYC,MAAEA,EAAKC,SAAEA,EAAQC,KAAEA,KAASC,IAC9E,OACIC,EAACC,EAAAA,CACGC,mBAAoB,CAAC,mBACrBP,aAAcA,EACdG,KAAMA,EACNK,KAAM,kBACNC,iBAAiB,EACjBR,MAAOE,EAAKO,IAAI,0BAEhBL,EAACM,EAAAA,CACGH,KAAM,kBACND,mBAAoB,IAAKH,EAAMG,qBAAuB,GAAK,mBAC3DK,QAASV,EACTW,MAAOT,GAAOU,MAAMC,gBACpBd,MAAOA,EACPe,QAASZ,EAAMY,UAI/B"}
1
+ {"version":3,"file":"ConsentCheckbox.js","sources":["../../../../../../src/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Field from '../Field';\nimport Checkbox from '../Checkbox';\n\nexport default function ConsentCheckbox({ errorMessage, label, onChange, i18n, ...props }) {\n return (\n <Field classNameModifiers={['consentCheckbox']} errorMessage={errorMessage} i18n={i18n} name={'consentCheckbox'} useLabelElement={false}>\n <Checkbox\n name={'consentCheckbox'}\n classNameModifiers={[...(props.classNameModifiers ??= []), 'consentCheckbox']}\n onInput={onChange}\n value={props?.data?.consentCheckbox}\n label={label}\n checked={props.checked}\n />\n </Field>\n );\n}\n"],"names":["ConsentCheckbox","errorMessage","label","onChange","i18n","props","h","Field","classNameModifiers","name","useLabelElement","Checkbox","onInput","value","data","consentCheckbox","checked"],"mappings":"mJAIe,SAASA,GAAgBC,aAAEA,EAAYC,MAAEA,EAAKC,SAAEA,EAAQC,KAAEA,KAASC,IAC9E,OACIC,EAACC,EAAAA,CAAMC,mBAAoB,CAAC,mBAAoBP,aAAcA,EAAcG,KAAMA,EAAMK,KAAM,kBAAmBC,iBAAiB,GAC9HJ,EAACK,EAAAA,CACGF,KAAM,kBACND,mBAAoB,IAAKH,EAAMG,qBAAuB,GAAK,mBAC3DI,QAAST,EACTU,MAAOR,GAAOS,MAAMC,gBACpBb,MAAOA,EACPc,QAASX,EAAMW,UAI/B"}
@@ -1,2 +1,2 @@
1
- import e from"../../../../external/classnames/index.js";import{createElement as a,Fragment as n,toChildArray as t,cloneElement as l}from"../../../../external/preact/dist/preact.js";import o from"../../Spinner/Spinner.js";import i from"../../Icon/Icon.js";import{ARIA_ERROR_SUFFIX as r,ARIA_CONTEXT_SUFFIX as d}from"../../../../core/Errors/constants.js";import{useRef as s,useState as c,useCallback as u}from"../../../../external/preact/hooks/dist/hooks.js";import{getUniqueId as m}from"../../../../utils/idGenerator.js";import{PREFIX as p}from"../../Icon/constants.js";const h=h=>{const{children:_,className:f,classNameModifiers:y,dir:k,disabled:b,readOnly:x,errorMessage:v,helper:E,inputWrapperModifiers:N,isLoading:F,isValid:g,label:L,labelEndAdornment:$,name:j,onBlur:w,onFieldBlur:I,onFocus:A,onFocusField:S,showValidIcon:T,useLabelElement:C,showErrorElement:M,showContextualElement:V,contextualText:q,filled:B,focused:H,i18n:R,contextVisibleToScreenReader:W,renderAlternativeToLabel:z}=h,G=W??!0,O=M&&"string"==typeof v&&v.length>0,P=V&&!O&&q?.length>0,D=s(m(`adyen-checkout-${j}`)),[J,K]=c(!1),[Q,U]=c(!1);null!=H&&K(!!H),null!=B&&U(!!B);const X=u((e=>{K(!0),A?.(e)}),[A]),Y=u((e=>{K(!1),w?.(e),I?.(e)}),[w,I]),Z=u((()=>a(n,null,"string"==typeof L&&a("span",{className:e({"adyen-checkout__label__text":!0,"adyen-checkout__label__text--error":v}),"data-id":j},L),"function"==typeof L&&L(),$&&a("span",{className:"adyen-checkout__label-adornment--end"},$),E&&a("span",{className:"adyen-checkout__helper-text"},E))),[L,v,$,E]),ee=u((()=>{const s=a("span",{className:e({"adyen-checkout-contextual-text--error":!0,"adyen-checkout-contextual-text--hidden":!O}),...G&&{id:`${D.current}${r}`},"aria-hidden":G?null:"true"},v),c=a("span",{className:e({"adyen-checkout-contextual-text":!0,"adyen-checkout-contextual-text--hidden":!P}),...G&&{id:`${D.current}${d}`},"aria-hidden":G?null:"true"},q);return a(n,null,a("div",{className:e(["adyen-checkout__input-wrapper",...N.map((e=>`adyen-checkout__input-wrapper--${e}`))]),dir:k},t(_).map((e=>{const a={isValid:g,onFocusHandler:X,onBlurHandler:Y,isInvalid:!!v,...j&&{uniqueId:D.current},showErrorElement:M};return l(e,a)})),F&&a("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--loading"},a(o,{size:"small"})),g&&!1!==T&&a("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--valid"},a(i,{type:`${p}checkmark`,alt:R?.get("field.valid")})),v&&a("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--invalid"},a(i,{type:`${p}field_error`,alt:R?.get("error.title")}))),s,c)}),[_,v,q,F,g,X,Y]),ae=u((({onFocusField:n,focused:t,filled:l,disabled:o,name:i,uniqueId:r,useLabelElement:d,isSecuredField:s,children:c,renderAlternativeToLabel:u})=>{const m={onClick:n,className:e({"adyen-checkout__label":!0,"adyen-checkout__label--focused":t,"adyen-checkout__label--filled":l,"adyen-checkout__label--disabled":o})};return d?a("label",{...m,...!s&&{htmlFor:i&&r}},c):u(m,c,r)}),[]);return a("div",{className:e("adyen-checkout__field",f,y.map((e=>`adyen-checkout__field--${e}`)),{"adyen-checkout__field--error":v,"adyen-checkout__field--valid":g,"adyen-checkout__field--inactive":x||b})},a(ae,{onFocusField:S,name:j,disabled:b,filled:Q,focused:J,useLabelElement:C,uniqueId:D.current,isSecuredField:!G,renderAlternativeToLabel:z},Z()),ee())};h.defaultProps={className:"",classNameModifiers:[],inputWrapperModifiers:[],useLabelElement:!0,showErrorElement:!0,showContextualElement:!0,renderAlternativeToLabel:()=>null};export{h as default};
1
+ import e from"../../../../external/classnames/index.js";import{createElement as a,Fragment as n,toChildArray as t,cloneElement as l}from"../../../../external/preact/dist/preact.js";import o from"../../Spinner/Spinner.js";import i from"../../Icon/Icon.js";import{ARIA_ERROR_SUFFIX as r,ARIA_CONTEXT_SUFFIX as d}from"../../../../core/Errors/constants.js";import{useRef as s,useState as c,useCallback as u}from"../../../../external/preact/hooks/dist/hooks.js";import{getUniqueId as m}from"../../../../utils/idGenerator.js";import{PREFIX as p}from"../../Icon/constants.js";const h=h=>{const{children:_,className:f,classNameModifiers:y,dir:k,disabled:b,readOnly:x,errorMessage:v,helper:E,inputWrapperModifiers:N,isLoading:F,isValid:g,label:L,labelEndAdornment:$,name:j,onBlur:w,onFieldBlur:I,onFocus:A,onFocusField:S,showValidIcon:T,useLabelElement:C,showErrorElement:M,showContextualElement:V,contextualText:q,filled:B,focused:H,i18n:R,contextVisibleToScreenReader:W,renderAlternativeToLabel:z}=h,G=W??!0,O=M&&"string"==typeof v&&v.length>0,P=V&&!O&&q?.length>0,D=s(m(`adyen-checkout-${j}`)),[J,K]=c(!1),[Q,U]=c(!1);null!=H&&K(!!H),null!=B&&U(!!B);const X=u((e=>{K(!0),A?.(e)}),[A]),Y=u((e=>{K(!1),w?.(e),I?.(e)}),[w,I]),Z=u((()=>a(n,null,"string"==typeof L&&a("span",{className:e({"adyen-checkout__label__text":!0,"adyen-checkout__label__text--error":v}),"data-id":j},L),"function"==typeof L&&L(),$&&a("span",{className:"adyen-checkout__label-adornment--end"},$),E&&a("span",{className:"adyen-checkout__helper-text"},E))),[L,v,$,E]),ee=u((()=>{const s=a("span",{className:e({"adyen-checkout-contextual-text--error":!0,"adyen-checkout-contextual-text--hidden":!O}),...G&&{id:`${D.current}${r}`},"aria-hidden":G?null:"true"},v),c=a("span",{className:e({"adyen-checkout-contextual-text":!0,"adyen-checkout-contextual-text--hidden":!P}),...G&&{id:`${D.current}${d}`},"aria-hidden":G?null:"true"},q);return a(n,null,a("div",{className:e(["adyen-checkout__input-wrapper",...N.map((e=>`adyen-checkout__input-wrapper--${e}`))]),dir:k},t(_).map((e=>{const a={isValid:g,onFocusHandler:X,onBlurHandler:Y,isInvalid:!!v,...j&&{uniqueId:D.current},showErrorElement:M};return l(e,a)})),F&&a("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--loading"},a(o,{size:"small"})),g&&!1!==T&&a("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--valid"},a(i,{type:`${p}checkmark`,alt:R?.get("field.valid")})),v&&a("span",{className:"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--invalid"},a(i,{type:`${p}field_error`,alt:R?.get("error.title")}))),s,c)}),[_,v,q,F,g,X,Y]),ae=u((({onFocusField:n,focused:t,filled:l,disabled:o,name:i,uniqueId:r,useLabelElement:d,isSecuredField:s,children:c,renderAlternativeToLabel:u})=>{const m={onClick:n,className:e({"adyen-checkout__label":!0,"adyen-checkout__label--focused":t,"adyen-checkout__label--filled":l,"adyen-checkout__label--disabled":o})};return d?a("label",{...m,...!s&&i&&{htmlFor:r}},c):u(m,c,r)}),[]);return a("div",{className:e("adyen-checkout__field",f,y.map((e=>`adyen-checkout__field--${e}`)),{"adyen-checkout__field--error":v,"adyen-checkout__field--valid":g,"adyen-checkout__field--inactive":x||b})},a(ae,{onFocusField:S,name:j,disabled:b,filled:Q,focused:J,useLabelElement:C,uniqueId:D.current,isSecuredField:!G,renderAlternativeToLabel:z},Z()),ee())};h.defaultProps={className:"",classNameModifiers:[],inputWrapperModifiers:[],useLabelElement:!0,showErrorElement:!0,showContextualElement:!0,renderAlternativeToLabel:()=>null};export{h as default};
2
2
  //# sourceMappingURL=Field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../../../../src/components/internal/FormFields/Field/Field.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { cloneElement, ComponentChild, Fragment, FunctionalComponent, h, toChildArray, VNode } from 'preact';\nimport Spinner from '../../Spinner';\nimport Icon from '../../Icon';\nimport { ARIA_CONTEXT_SUFFIX, ARIA_ERROR_SUFFIX } from '../../../../core/Errors/constants';\nimport { useCallback, useRef, useState } from 'preact/hooks';\nimport { getUniqueId } from '../../../../utils/idGenerator';\nimport { FieldProps } from './types';\nimport './Field.scss';\nimport { PREFIX } from '../../Icon/constants';\n\nconst Field: FunctionalComponent<FieldProps> = props => {\n //\n const {\n children,\n className,\n classNameModifiers,\n dir,\n disabled,\n readOnly,\n errorMessage,\n helper,\n inputWrapperModifiers,\n isLoading,\n isValid,\n label,\n labelEndAdornment,\n name,\n onBlur,\n onFieldBlur,\n onFocus,\n // onFocusField is a securedField related function that allows a label click to set focus on a securedField (equates to CardInput setFocusOn)\n // TODO should rename it to make its purpose clear => setFocusOnSecuredField\n onFocusField,\n showValidIcon,\n useLabelElement,\n showErrorElement,\n showContextualElement,\n contextualText,\n // Redeclare prop names to avoid internal clashes\n filled: propsFilled,\n focused: propsFocused,\n i18n,\n contextVisibleToScreenReader,\n renderAlternativeToLabel\n } = props;\n\n // Controls whether any error element has an aria-hidden=\"true\" attr (which means it is the error for a securedField)\n // or whether it has an id attr that can be pointed to by an aria-describedby attr on an input element\n const contextVisibleToSR = contextVisibleToScreenReader ?? true;\n const showError = showErrorElement && typeof errorMessage === 'string' && errorMessage.length > 0;\n const showContext = showContextualElement && !showError && contextualText?.length > 0;\n\n const uniqueId = useRef(getUniqueId(`adyen-checkout-${name}`));\n const [focused, setFocused] = useState(false);\n const [filled, setFilled] = useState(false);\n\n // The means by which focussed/filled is set for securedFields\n if (propsFocused != null) setFocused(!!propsFocused);\n if (propsFilled != null) setFilled(!!propsFilled);\n\n // The means by which focussed/filled is set for other fields - this function is passed down to them and triggered\n const onFocusHandler = useCallback(\n (event: h.JSX.TargetedEvent<HTMLInputElement>) => {\n setFocused(true);\n onFocus?.(event);\n },\n [onFocus]\n );\n\n const onBlurHandler = useCallback(\n (event: h.JSX.TargetedEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n // When we also need to fire a specific function when a field blurs // TODO - what is the use case?\n onFieldBlur?.(event);\n },\n [onBlur, onFieldBlur]\n );\n\n const renderLabelOrAlternativeContents = useCallback(() => {\n return (\n <Fragment>\n {typeof label === 'string' && (\n <span\n className={classNames({\n 'adyen-checkout__label__text': true,\n 'adyen-checkout__label__text--error': errorMessage\n })}\n data-id={name}\n >\n {label}\n </span>\n )}\n\n {/*TODO - in what scenario is label a function? */}\n {/*@ts-ignore - function is callable*/}\n {typeof label === 'function' && label()}\n\n {labelEndAdornment && <span className=\"adyen-checkout__label-adornment--end\">{labelEndAdornment}</span>}\n\n {helper && <span className={'adyen-checkout__helper-text'}>{helper}</span>}\n </Fragment>\n );\n }, [label, errorMessage, labelEndAdornment, helper]);\n\n const renderInputRelatedElements = useCallback(() => {\n const errorElem = (\n <span\n className={classNames({ 'adyen-checkout-contextual-text--error': true, 'adyen-checkout-contextual-text--hidden': !showError })}\n {...(contextVisibleToSR && { id: `${uniqueId.current}${ARIA_ERROR_SUFFIX}` })}\n aria-hidden={contextVisibleToSR ? null : 'true'}\n >\n {errorMessage}\n </span>\n );\n const contextualElem = (\n <span\n className={classNames({ 'adyen-checkout-contextual-text': true, 'adyen-checkout-contextual-text--hidden': !showContext })}\n {...(contextVisibleToSR && { id: `${uniqueId.current}${ARIA_CONTEXT_SUFFIX}` })}\n aria-hidden={contextVisibleToSR ? null : 'true'}\n >\n {contextualText}\n </span>\n );\n\n return (\n <Fragment>\n <div\n className={classNames([\n 'adyen-checkout__input-wrapper',\n ...inputWrapperModifiers.map(m => `adyen-checkout__input-wrapper--${m}`)\n ])}\n dir={dir}\n >\n {toChildArray(children).map((child: ComponentChild): ComponentChild => {\n const childProps = {\n isValid,\n onFocusHandler,\n onBlurHandler,\n isInvalid: !!errorMessage,\n ...(name && { uniqueId: uniqueId.current }),\n showErrorElement: showErrorElement\n };\n return cloneElement(child as VNode, childProps);\n })}\n\n {isLoading && (\n <span className=\"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--loading\">\n <Spinner size=\"small\" />\n </span>\n )}\n\n {isValid && showValidIcon !== false && (\n <span className=\"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--valid\">\n <Icon type={`${PREFIX}checkmark`} alt={i18n?.get('field.valid')} />\n </span>\n )}\n\n {errorMessage && (\n <span className=\"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--invalid\">\n <Icon type={`${PREFIX}field_error`} alt={i18n?.get('error.title')} />\n </span>\n )}\n </div>\n {errorElem}\n {contextualElem}\n </Fragment>\n );\n }, [children, errorMessage, contextualText, isLoading, isValid, onFocusHandler, onBlurHandler]);\n\n const LabelOrAlternative = useCallback(\n ({ onFocusField, focused, filled, disabled, name, uniqueId, useLabelElement, isSecuredField, children, renderAlternativeToLabel }) => {\n const defaultWrapperProps = {\n onClick: onFocusField,\n className: classNames({\n 'adyen-checkout__label': true,\n 'adyen-checkout__label--focused': focused,\n 'adyen-checkout__label--filled': filled,\n 'adyen-checkout__label--disabled': disabled\n })\n };\n\n return useLabelElement ? (\n // if contextVisibleToSR is true then we are NOT dealing with the label for a securedField... so give it a `for` attribute\n <label {...defaultWrapperProps} {...(!isSecuredField && { htmlFor: name && uniqueId })}>\n {children}\n </label>\n ) : (\n renderAlternativeToLabel(defaultWrapperProps, children, uniqueId) // defaults to null\n\n // Example usage:\n // const alternativeLabelContent = (defaultWrapperProps, children, uniqueId) => {\n // return (\n // <div {...defaultWrapperProps} role={'label'} htmlFor={uniqueId}>\n // {children}\n // </div>\n // );\n // };\n // <Field name={'myField'} useLabelElement={false} renderAlternativeToLabel={alternativeLabelContent}>\n );\n },\n []\n );\n\n /**\n * RENDER\n */\n return (\n <div\n className={classNames(\n 'adyen-checkout__field',\n className,\n classNameModifiers.map(m => `adyen-checkout__field--${m}`),\n {\n 'adyen-checkout__field--error': errorMessage,\n 'adyen-checkout__field--valid': isValid,\n 'adyen-checkout__field--inactive': readOnly || disabled\n }\n )}\n >\n <LabelOrAlternative\n onFocusField={onFocusField}\n name={name}\n disabled={disabled}\n filled={filled}\n focused={focused}\n useLabelElement={useLabelElement}\n uniqueId={uniqueId.current}\n isSecuredField={!contextVisibleToSR}\n renderAlternativeToLabel={renderAlternativeToLabel}\n >\n {renderLabelOrAlternativeContents()}\n </LabelOrAlternative>\n {renderInputRelatedElements()}\n </div>\n );\n};\n\nField.defaultProps = {\n className: '',\n classNameModifiers: [],\n inputWrapperModifiers: [],\n useLabelElement: true,\n showErrorElement: true,\n showContextualElement: true,\n renderAlternativeToLabel: () => null\n};\n\nexport default Field;\n"],"names":["Field","props","children","className","classNameModifiers","dir","disabled","readOnly","errorMessage","helper","inputWrapperModifiers","isLoading","isValid","label","labelEndAdornment","name","onBlur","onFieldBlur","onFocus","onFocusField","showValidIcon","useLabelElement","showErrorElement","showContextualElement","contextualText","filled","propsFilled","focused","propsFocused","i18n","contextVisibleToScreenReader","renderAlternativeToLabel","contextVisibleToSR","showError","length","showContext","uniqueId","useRef","getUniqueId","setFocused","useState","setFilled","onFocusHandler","useCallback","event","onBlurHandler","renderLabelOrAlternativeContents","h","Fragment","span","classNames","data-id","renderInputRelatedElements","errorElem","id","current","ARIA_ERROR_SUFFIX","aria-hidden","contextualElem","ARIA_CONTEXT_SUFFIX","div","map","m","toChildArray","child","childProps","isInvalid","cloneElement","Spinner","size","Icon","type","PREFIX","alt","get","LabelOrAlternative","isSecuredField","defaultWrapperProps","onClick","htmlFor","defaultProps"],"mappings":"yjBAWA,MAAMA,EAAyCC,IAE3C,MAAMC,SACFA,EAAQC,UACRA,EAASC,mBACTA,EAAkBC,IAClBA,EAAGC,SACHA,EAAQC,SACRA,EAAQC,aACRA,EAAYC,OACZA,EAAMC,sBACNA,EAAqBC,UACrBA,EAASC,QACTA,EAAOC,MACPA,EAAKC,kBACLA,EAAiBC,KACjBA,EAAIC,OACJA,EAAMC,YACNA,EAAWC,QACXA,EAAOC,aAGPA,EAAYC,cACZA,EAAaC,gBACbA,EAAeC,iBACfA,EAAgBC,sBAChBA,EAAqBC,eACrBA,EAEAC,OAAQC,EACRC,QAASC,EAAYC,KACrBA,EAAIC,6BACJA,EAA4BC,yBAC5BA,GACA9B,EAIE+B,EAAqBF,IAAgC,EACrDG,EAAYX,GAA4C,iBAAjBd,GAA6BA,EAAa0B,OAAS,EAC1FC,EAAcZ,IAA0BU,GAAaT,GAAgBU,OAAS,EAE9EE,EAAWC,EAAOC,EAAY,kBAAkBvB,OAC/CY,EAASY,GAAcC,GAAS,IAChCf,EAAQgB,GAAaD,GAAS,GAGjB,MAAhBZ,GAAsBW,IAAaX,GACpB,MAAfF,GAAqBe,IAAYf,GAGrC,MAAMgB,EAAiBC,GAClBC,IACGL,GAAW,GACXrB,IAAU0B,EAAAA,GAEd,CAAC1B,IAGC2B,EAAgBF,GACjBC,IACGL,GAAW,GACXvB,IAAS4B,GAET3B,IAAc2B,EAAAA,GAElB,CAAC5B,EAAQC,IAGP6B,EAAmCH,GAAY,IAE7CI,EAACC,EAA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,EAACuB,EAAAA,CAAKC,KAAM,GAAGC,eAAqBC,IAAK5C,GAAM6C,IAAI,mBAI9DrB,EACAK,EAAAA,GAGV,CAACxD,EAAUM,EAAcgB,EAAgBb,EAAWC,EAAS8B,EAAgBG,IAE1E8B,GAAqBhC,GACvB,EAAGxB,eAAcQ,UAASF,SAAQnB,WAAUS,OAAMqB,WAAUf,kBAAiBuD,iBAAgB1E,WAAU6B,+BACnG,MAAM8C,EAAsB,CACxBC,QAAS3D,EACThB,UAAW+C,EAAW,CAClB,yBAAyB,EACzB,iCAAkCvB,EAClC,gCAAiCF,EACjC,kCAAmCnB,KAI3C,OAAOe,EAEH0B,EAAClC,QAAAA,IAAUgE,MAA2BD,GAAkB,CAAEG,QAAShE,GAAQqB,IACtElC,GAGL6B,EAAyB8C,EAAqB3E,EAAUkC,KAahE,IAMJ,OACIW,EAACa,MAAAA,CACGzD,UAAW+C,EACP,wBACA/C,EACAC,EAAmByD,KAAIC,GAAK,0BAA0BA,MACtD,CACI,+BAAgCtD,EAChC,+BAAgCI,EAChC,kCAAmCL,GAAYD,KAIvDyC,EAAC4B,GAAAA,CACGxD,aAAcA,EACdJ,KAAMA,EACNT,SAAUA,EACVmB,OAAQA,EACRE,QAASA,EACTN,gBAAiBA,EACjBe,SAAUA,EAASmB,QACnBqB,gBAAiB5C,EACjBD,yBAA0BA,GAEzBe,KAEJM,KAAAA,EAKbpD,EAAMgF,aAAe,CACjB7E,UAAW,GACXC,mBAAoB,GACpBM,sBAAuB,GACvBW,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,EACvBQ,yBAA0B,IAAM"}
1
+ {"version":3,"file":"Field.js","sources":["../../../../../../src/components/internal/FormFields/Field/Field.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { cloneElement, ComponentChild, Fragment, FunctionalComponent, h, toChildArray, VNode } from 'preact';\nimport Spinner from '../../Spinner';\nimport Icon from '../../Icon';\nimport { ARIA_CONTEXT_SUFFIX, ARIA_ERROR_SUFFIX } from '../../../../core/Errors/constants';\nimport { useCallback, useRef, useState } from 'preact/hooks';\nimport { getUniqueId } from '../../../../utils/idGenerator';\nimport { FieldProps } from './types';\nimport './Field.scss';\nimport { PREFIX } from '../../Icon/constants';\n\nconst Field: FunctionalComponent<FieldProps> = props => {\n //\n const {\n children,\n className,\n classNameModifiers,\n dir,\n disabled,\n readOnly,\n errorMessage,\n helper,\n inputWrapperModifiers,\n isLoading,\n isValid,\n label,\n labelEndAdornment,\n name,\n onBlur,\n onFieldBlur,\n onFocus,\n // onFocusField is a securedField related function that allows a label click to set focus on a securedField (equates to CardInput setFocusOn)\n // TODO should rename it to make its purpose clear => setFocusOnSecuredField\n onFocusField,\n showValidIcon,\n useLabelElement,\n showErrorElement,\n showContextualElement,\n contextualText,\n // Redeclare prop names to avoid internal clashes\n filled: propsFilled,\n focused: propsFocused,\n i18n,\n contextVisibleToScreenReader,\n renderAlternativeToLabel\n } = props;\n\n // Controls whether any error element has an aria-hidden=\"true\" attr (which means it is the error for a securedField)\n // or whether it has an id attr that can be pointed to by an aria-describedby attr on an input element\n const contextVisibleToSR = contextVisibleToScreenReader ?? true;\n const showError = showErrorElement && typeof errorMessage === 'string' && errorMessage.length > 0;\n const showContext = showContextualElement && !showError && contextualText?.length > 0;\n\n const uniqueId = useRef(getUniqueId(`adyen-checkout-${name}`));\n const [focused, setFocused] = useState(false);\n const [filled, setFilled] = useState(false);\n\n // The means by which focussed/filled is set for securedFields\n if (propsFocused != null) setFocused(!!propsFocused);\n if (propsFilled != null) setFilled(!!propsFilled);\n\n // The means by which focussed/filled is set for other fields - this function is passed down to them and triggered\n const onFocusHandler = useCallback(\n (event: h.JSX.TargetedEvent<HTMLInputElement>) => {\n setFocused(true);\n onFocus?.(event);\n },\n [onFocus]\n );\n\n const onBlurHandler = useCallback(\n (event: h.JSX.TargetedEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n // When we also need to fire a specific function when a field blurs // TODO - what is the use case?\n onFieldBlur?.(event);\n },\n [onBlur, onFieldBlur]\n );\n\n const renderLabelOrAlternativeContents = useCallback(() => {\n return (\n <Fragment>\n {typeof label === 'string' && (\n <span\n className={classNames({\n 'adyen-checkout__label__text': true,\n 'adyen-checkout__label__text--error': errorMessage\n })}\n data-id={name}\n >\n {label}\n </span>\n )}\n\n {/*TODO - in what scenario is label a function? */}\n {/*@ts-ignore - function is callable*/}\n {typeof label === 'function' && label()}\n\n {labelEndAdornment && <span className=\"adyen-checkout__label-adornment--end\">{labelEndAdornment}</span>}\n\n {helper && <span className={'adyen-checkout__helper-text'}>{helper}</span>}\n </Fragment>\n );\n }, [label, errorMessage, labelEndAdornment, helper]);\n\n const renderInputRelatedElements = useCallback(() => {\n const errorElem = (\n <span\n className={classNames({ 'adyen-checkout-contextual-text--error': true, 'adyen-checkout-contextual-text--hidden': !showError })}\n {...(contextVisibleToSR && { id: `${uniqueId.current}${ARIA_ERROR_SUFFIX}` })}\n aria-hidden={contextVisibleToSR ? null : 'true'}\n >\n {errorMessage}\n </span>\n );\n const contextualElem = (\n <span\n className={classNames({ 'adyen-checkout-contextual-text': true, 'adyen-checkout-contextual-text--hidden': !showContext })}\n {...(contextVisibleToSR && { id: `${uniqueId.current}${ARIA_CONTEXT_SUFFIX}` })}\n aria-hidden={contextVisibleToSR ? null : 'true'}\n >\n {contextualText}\n </span>\n );\n\n return (\n <Fragment>\n <div\n className={classNames([\n 'adyen-checkout__input-wrapper',\n ...inputWrapperModifiers.map(m => `adyen-checkout__input-wrapper--${m}`)\n ])}\n dir={dir}\n >\n {toChildArray(children).map((child: ComponentChild): ComponentChild => {\n const childProps = {\n isValid,\n onFocusHandler,\n onBlurHandler,\n isInvalid: !!errorMessage,\n ...(name && { uniqueId: uniqueId.current }),\n showErrorElement: showErrorElement\n };\n return cloneElement(child as VNode, childProps);\n })}\n\n {isLoading && (\n <span className=\"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--loading\">\n <Spinner size=\"small\" />\n </span>\n )}\n\n {isValid && showValidIcon !== false && (\n <span className=\"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--valid\">\n <Icon type={`${PREFIX}checkmark`} alt={i18n?.get('field.valid')} />\n </span>\n )}\n\n {errorMessage && (\n <span className=\"adyen-checkout-input__inline-validation adyen-checkout-input__inline-validation--invalid\">\n <Icon type={`${PREFIX}field_error`} alt={i18n?.get('error.title')} />\n </span>\n )}\n </div>\n {errorElem}\n {contextualElem}\n </Fragment>\n );\n }, [children, errorMessage, contextualText, isLoading, isValid, onFocusHandler, onBlurHandler]);\n\n /**\n * Use cases:\n * - Not all form controls want/need a label e.g. many checkboxes describe what they are in their own markup and don't need the wrapping Field to also generate a labelling element\n * - securedFields *can't* have a label (screen-reader's can make the association, over different browser contexts, between the label and the input)\n */\n const LabelOrAlternative = useCallback(\n ({ onFocusField, focused, filled, disabled, name, uniqueId, useLabelElement, isSecuredField, children, renderAlternativeToLabel }) => {\n const defaultWrapperProps = {\n onClick: onFocusField,\n className: classNames({\n 'adyen-checkout__label': true,\n 'adyen-checkout__label--focused': focused,\n 'adyen-checkout__label--filled': filled,\n 'adyen-checkout__label--disabled': disabled\n })\n };\n\n return useLabelElement ? (\n // if we are NOT dealing with the label for a securedField... we can give it a `for` attribute\n <label {...defaultWrapperProps} {...(!isSecuredField && name && { htmlFor: uniqueId })}>\n {children}\n </label>\n ) : (\n renderAlternativeToLabel(defaultWrapperProps, children, uniqueId) // defaults to null\n\n // Example usage:\n // const alternativeLabelContent = (defaultWrapperProps, children, uniqueId) => {\n // return (\n // <div {...defaultWrapperProps} role={'label'} htmlFor={uniqueId}>\n // {children}\n // </div>\n // );\n // };\n // <Field name={'myField'} useLabelElement={false} renderAlternativeToLabel={alternativeLabelContent}>\n );\n },\n []\n );\n\n /**\n * RENDER\n */\n return (\n <div\n className={classNames(\n 'adyen-checkout__field',\n className,\n classNameModifiers.map(m => `adyen-checkout__field--${m}`),\n {\n 'adyen-checkout__field--error': errorMessage,\n 'adyen-checkout__field--valid': isValid,\n 'adyen-checkout__field--inactive': readOnly || disabled\n }\n )}\n >\n <LabelOrAlternative\n onFocusField={onFocusField}\n name={name}\n disabled={disabled}\n filled={filled}\n focused={focused}\n useLabelElement={useLabelElement}\n uniqueId={uniqueId.current}\n isSecuredField={!contextVisibleToSR}\n renderAlternativeToLabel={renderAlternativeToLabel}\n >\n {renderLabelOrAlternativeContents()}\n </LabelOrAlternative>\n {renderInputRelatedElements()}\n </div>\n );\n};\n\nField.defaultProps = {\n className: '',\n classNameModifiers: [],\n inputWrapperModifiers: [],\n useLabelElement: true,\n showErrorElement: true,\n showContextualElement: true,\n renderAlternativeToLabel: () => null\n};\n\nexport default Field;\n"],"names":["Field","props","children","className","classNameModifiers","dir","disabled","readOnly","errorMessage","helper","inputWrapperModifiers","isLoading","isValid","label","labelEndAdornment","name","onBlur","onFieldBlur","onFocus","onFocusField","showValidIcon","useLabelElement","showErrorElement","showContextualElement","contextualText","filled","propsFilled","focused","propsFocused","i18n","contextVisibleToScreenReader","renderAlternativeToLabel","contextVisibleToSR","showError","length","showContext","uniqueId","useRef","getUniqueId","setFocused","useState","setFilled","onFocusHandler","useCallback","event","onBlurHandler","renderLabelOrAlternativeContents","h","Fragment","span","classNames","data-id","renderInputRelatedElements","errorElem","id","current","ARIA_ERROR_SUFFIX","aria-hidden","contextualElem","ARIA_CONTEXT_SUFFIX","div","map","m","toChildArray","child","childProps","isInvalid","cloneElement","Spinner","size","Icon","type","PREFIX","alt","get","LabelOrAlternative","isSecuredField","defaultWrapperProps","onClick","htmlFor","defaultProps"],"mappings":"yjBAWA,MAAMA,EAAyCC,IAE3C,MAAMC,SACFA,EAAQC,UACRA,EAASC,mBACTA,EAAkBC,IAClBA,EAAGC,SACHA,EAAQC,SACRA,EAAQC,aACRA,EAAYC,OACZA,EAAMC,sBACNA,EAAqBC,UACrBA,EAASC,QACTA,EAAOC,MACPA,EAAKC,kBACLA,EAAiBC,KACjBA,EAAIC,OACJA,EAAMC,YACNA,EAAWC,QACXA,E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,EACP,wBACA/C,EACAC,EAAmByD,KAAIC,GAAK,0BAA0BA,MACtD,CACI,+BAAgCtD,EAChC,+BAAgCI,EAChC,kCAAmCL,GAAYD,KAIvDyC,EAAC4B,GAAAA,CACGxD,aAAcA,EACdJ,KAAMA,EACNT,SAAUA,EACVmB,OAAQA,EACRE,QAASA,EACTN,gBAAiBA,EACjBe,SAAUA,EAASmB,QACnBqB,gBAAiB5C,EACjBD,yBAA0BA,GAEzBe,KAEJM,KAAAA,EAKbpD,EAAMgF,aAAe,CACjB7E,UAAW,GACXC,mBAAoB,GACpBM,sBAAuB,GACvBW,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,EACvBQ,yBAA0B,IAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputBase.js","sources":["../../../../../src/components/internal/FormFields/InputBase.tsx"],"sourcesContent":["import { h, RefCallback } from 'preact';\nimport { useCallback } from 'preact/hooks';\nimport classNames from 'classnames';\nimport { ARIA_CONTEXT_SUFFIX, ARIA_ERROR_SUFFIX } from '../../../core/Errors/constants';\nimport Language from '../../../language';\nimport './FormFields.scss';\n\nexport interface InputBaseProps extends h.JSX.HTMLAttributes {\n classNameModifiers?: string[];\n isInvalid?: boolean;\n isValid?: boolean;\n readonly?: boolean;\n uniqueId?: string;\n disabled?: boolean;\n className?: string;\n placeholder?: string;\n value?: string;\n name?: string;\n checked?: boolean;\n setRef?: RefCallback<HTMLInputElement>;\n trimOnBlur?: boolean;\n i18n?: Language;\n label?: string;\n onBlurHandler?: h.JSX.GenericEventHandler<HTMLInputElement>;\n onFocusHandler?: h.JSX.GenericEventHandler<HTMLInputElement>;\n maxlength?: number | null;\n addContextualElement?: boolean;\n}\n\nexport default function InputBase({ setRef, ...props }: InputBaseProps) {\n const { autoCorrect, classNameModifiers, isInvalid, isValid, readonly = null, spellCheck, type, uniqueId, disabled } = props;\n const className = props.className as string;\n\n /**\n * To avoid confusion with misplaced/misdirected onChange handlers - InputBase only accepts onInput, onBlur & onFocus handlers.\n * The first 2 being the means by which we expect useForm--handleChangeFor validation functionality to be applied.\n */\n if (Object.prototype.hasOwnProperty.call(props, 'onChange')) {\n console.error('Error: Form fields that rely on InputBase may not have an onChange property');\n }\n\n const handleInput = useCallback(\n (event: h.JSX.TargetedInputEvent<HTMLInputElement>) => {\n props.onInput(event);\n },\n [props.onInput]\n );\n\n const handleKeyPress = useCallback(\n (event: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) => {\n if (props?.onKeyPress) props.onKeyPress(event);\n },\n [props?.onKeyPress]\n );\n\n const handleKeyUp = useCallback(\n (event: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) => {\n if (props?.onKeyUp) props.onKeyUp(event);\n },\n [props?.onKeyUp]\n );\n\n const handleBlur = useCallback(\n (event: h.JSX.TargetedFocusEvent<HTMLInputElement>) => {\n props?.onBlurHandler?.(event); // From Field component\n\n if (props.trimOnBlur) {\n (event.target as HTMLInputElement).value = (event.target as HTMLInputElement).value.trim(); // needed to trim trailing spaces in field (leading spaces can be done via formatting)\n }\n\n props?.onBlur?.(event);\n },\n [props.onBlur, props.onBlurHandler]\n );\n\n const handleFocus = useCallback(\n (event: h.JSX.TargetedEvent<HTMLInputElement>) => {\n props?.onFocusHandler?.(event); // From Field component\n },\n [props.onFocusHandler]\n );\n\n const inputClassNames = classNames(\n 'adyen-checkout__input',\n [`adyen-checkout__input--${type}`],\n className,\n {\n 'adyen-checkout__input--invalid': isInvalid,\n 'adyen-checkout__input--valid': isValid\n },\n classNameModifiers.map(m => `adyen-checkout__input--${m}`)\n );\n\n // Don't spread classNameModifiers etc to input element (it ends up as an attribute on the element itself)\n const { classNameModifiers: cnm, uniqueId: uid, isInvalid: iiv, isValid: iv, addContextualElement: ace, ...newProps } = props;\n\n return (\n <input\n id={uniqueId}\n {...newProps}\n aria-required={newProps.required}\n type={type}\n className={inputClassNames}\n readOnly={readonly}\n spellCheck={spellCheck}\n autoCorrect={autoCorrect}\n aria-describedby={`${uniqueId}${isInvalid ? ARIA_ERROR_SUFFIX : ARIA_CONTEXT_SUFFIX}`}\n aria-invalid={isInvalid}\n onInput={handleInput}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyPress={handleKeyPress}\n disabled={disabled}\n ref={setRef}\n />\n );\n}\n\nInputBase.defaultProps = {\n type: 'text',\n classNameModifiers: []\n};\n"],"names":["InputBase","setRef","props","autoCorrect","classNameModifiers","isInvalid","isValid","readonly","spellCheck","type","uniqueId","disabled","className","Object","prototype","hasOwnProperty","call","console","error","handleInput","useCallback","event","onInput","handleKeyPress","onKeyPress","handleKeyUp","onKeyUp","handleBlur","onBlurHandler","trimOnBlur","target","value","trim","onBlur","handleFocus","onFocusHandler","inputClassNames","classNames","map","m","cnm","uid","iiv","iv","addContextualElement","ace","newProps","h","input","id","aria-required","required","readOnly","aria-describedby","ARIA_ERROR_SUFFIX","ARIA_CONTEXT_SUFFIX","aria-invalid","onFocus","ref","defaultProps"],"mappings":"uSA6Be,SAASA,GAAUC,OAAEA,KAAWC,IAC3C,MAAMC,YAAEA,EAAWC,mBAAEA,EAAkBC,UAAEA,EAASC,QAAEA,EAAOC,SAAEA,EAAW,KAAIC,WAAEA,EAAUC,KAAEA,EAAIC,SAAEA,EAAQC,SAAEA,GAAaT,EACjHU,EAAYV,EAAMU,UAMpBC,OAAOC,UAAUC,eAAeC,KAAKd,EAAO,aAC5Ce,QAAQC,MAAM,+EAGlB,MAAMC,EAAcC,GACfC,IACGnB,EAAMoB,QAAQD,EAAAA,GAElB,CAACnB,EAAMoB,UAGLC,EAAiBH,GAClBC,IACOnB,GAAOsB,YAAYtB,EAAMsB,WAAWH,EAAAA,GAE5C,CAACnB,GAAOsB,aAGNC,EAAcL,GACfC,IACOnB,GAAOwB,SAASxB,EAAMwB,QAAQL,EAAAA,GAEtC,CAACnB,GAAOwB,UAGNC,EAAaP,GACdC,IACGnB,GAAO0B,gBAAgBP,GAEnBnB,EAAM2B,aACLR,EAAMS,OAA4BC,MAAQV,EAAOS,OAA4BC,MAAMC,QAGxF9B,GAAO+B,SAASZ,EAAAA,GAEpB,CAACnB,EAAM+B,OAAQ/B,EAAM0B,gBAGnBM,EAAcd,GACfC,IACGnB,GAAOiC,iBAAiBd,KAE5B,CAACnB,EAAMiC,iBAGLC,EAAkBC,EACpB,wBACA,CAAC,0BAA0B5B,KAC3BG,EACA,CACI,iCAAkCP,EAClC,+BAAgCC,GAEpCF,EAAmBkC,KAAIC,GAAK,0BAA0BA,QAIlDnC,mBAAoBoC,EAAK9B,SAAU+B,EAAKpC,UAAWqC,EAAKpC,QAASqC,EAAIC,qBAAsBC,KAAQC,GAAa5C,EAExH,OACI6C,EAACC,QAAAA,CACGC,GAAIvC,KACAoC,EACJI,gBAAeJ,EAASK,SACxB1C,KAAMA,EACNG,UAAWwB,EACXgB,SAAU7C,EACVC,WAAYA,EACZL,YAAaA,EACbkD,mBAAkB,GAAG3C,IAAWL,EAAYiD,EAAoBC,IAChEC,eAAcnD,EACdiB,QAASH,EACTc,OAAQN,EACR8B,QAASvB,EACTR,QAASD,EACTD,WAAYD,EACZZ,SAAUA,EACV+C,IAAKzD,GAGjB,CAEAD,EAAU2D,aAAe,CACrBlD,KAAM,OACNL,mBAAoB"}
1
+ {"version":3,"file":"InputBase.js","sources":["../../../../../src/components/internal/FormFields/InputBase.tsx"],"sourcesContent":["import { h, RefCallback } from 'preact';\nimport { useCallback } from 'preact/hooks';\nimport classNames from 'classnames';\nimport { ARIA_CONTEXT_SUFFIX, ARIA_ERROR_SUFFIX } from '../../../core/Errors/constants';\nimport Language from '../../../language';\nimport './FormFields.scss';\n\nexport interface InputBaseProps extends h.JSX.HTMLAttributes {\n classNameModifiers?: string[];\n isInvalid?: boolean;\n isValid?: boolean;\n readonly?: boolean;\n uniqueId?: string;\n disabled?: boolean;\n className?: string;\n placeholder?: string;\n value?: string;\n name?: string;\n checked?: boolean;\n setRef?: RefCallback<HTMLInputElement>;\n trimOnBlur?: boolean;\n i18n?: Language;\n label?: string;\n onBlurHandler?: h.JSX.GenericEventHandler<HTMLInputElement>;\n onFocusHandler?: h.JSX.GenericEventHandler<HTMLInputElement>;\n maxlength?: number | null;\n addContextualElement?: boolean;\n type?: string;\n}\n\nexport default function InputBase({ setRef, ...props }: InputBaseProps) {\n const { autoCorrect, classNameModifiers, isInvalid, isValid, readonly = null, spellCheck, type, uniqueId, disabled } = props;\n const className = props.className;\n\n /**\n * To avoid confusion with misplaced/misdirected onChange handlers - InputBase only accepts onInput, onBlur & onFocus handlers.\n * The first 2 being the means by which we expect useForm--handleChangeFor validation functionality to be applied.\n */\n if (Object.prototype.hasOwnProperty.call(props, 'onChange')) {\n console.error('Error: Form fields that rely on InputBase may not have an onChange property');\n }\n\n const handleInput = useCallback(\n (event: h.JSX.TargetedInputEvent<HTMLInputElement>) => {\n props.onInput(event);\n },\n [props.onInput]\n );\n\n const handleKeyPress = useCallback(\n (event: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) => {\n if (props?.onKeyPress) props.onKeyPress(event);\n },\n [props?.onKeyPress]\n );\n\n const handleKeyUp = useCallback(\n (event: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) => {\n if (props?.onKeyUp) props.onKeyUp(event);\n },\n [props?.onKeyUp]\n );\n\n const handleBlur = useCallback(\n (event: h.JSX.TargetedFocusEvent<HTMLInputElement>) => {\n props?.onBlurHandler?.(event); // From Field component\n\n if (props.trimOnBlur) {\n (event.target as HTMLInputElement).value = (event.target as HTMLInputElement).value.trim(); // needed to trim trailing spaces in field (leading spaces can be done via formatting)\n }\n\n props?.onBlur?.(event);\n },\n [props.onBlur, props.onBlurHandler]\n );\n\n const handleFocus = useCallback(\n (event: h.JSX.TargetedEvent<HTMLInputElement>) => {\n props?.onFocusHandler?.(event); // From Field component\n },\n [props.onFocusHandler]\n );\n\n const inputClassNames = classNames(\n 'adyen-checkout__input',\n [`adyen-checkout__input--${type}`],\n className,\n {\n 'adyen-checkout__input--invalid': isInvalid,\n 'adyen-checkout__input--valid': isValid\n },\n classNameModifiers.map(m => `adyen-checkout__input--${m}`)\n );\n\n // Don't spread classNameModifiers etc to input element (it ends up as an attribute on the element itself)\n const { classNameModifiers: cnm, uniqueId: uid, isInvalid: iiv, isValid: iv, addContextualElement: ace, ...newProps } = props;\n\n return (\n <input\n id={uniqueId}\n {...newProps}\n aria-required={newProps.required}\n type={type}\n className={inputClassNames}\n readOnly={readonly}\n spellCheck={spellCheck}\n autoCorrect={autoCorrect}\n aria-describedby={`${uniqueId}${isInvalid ? ARIA_ERROR_SUFFIX : ARIA_CONTEXT_SUFFIX}`}\n aria-invalid={isInvalid}\n onInput={handleInput}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyPress={handleKeyPress}\n disabled={disabled}\n ref={setRef}\n />\n );\n}\n\nInputBase.defaultProps = {\n type: 'text',\n classNameModifiers: []\n};\n"],"names":["InputBase","setRef","props","autoCorrect","classNameModifiers","isInvalid","isValid","readonly","spellCheck","type","uniqueId","disabled","className","Object","prototype","hasOwnProperty","call","console","error","handleInput","useCallback","event","onInput","handleKeyPress","onKeyPress","handleKeyUp","onKeyUp","handleBlur","onBlurHandler","trimOnBlur","target","value","trim","onBlur","handleFocus","onFocusHandler","inputClassNames","classNames","map","m","cnm","uid","iiv","iv","addContextualElement","ace","newProps","h","input","id","aria-required","required","readOnly","aria-describedby","ARIA_ERROR_SUFFIX","ARIA_CONTEXT_SUFFIX","aria-invalid","onFocus","ref","defaultProps"],"mappings":"uSA8Be,SAASA,GAAUC,OAAEA,KAAWC,IAC3C,MAAMC,YAAEA,EAAWC,mBAAEA,EAAkBC,UAAEA,EAASC,QAAEA,EAAOC,SAAEA,EAAW,KAAIC,WAAEA,EAAUC,KAAEA,EAAIC,SAAEA,EAAQC,SAAEA,GAAaT,EACjHU,EAAYV,EAAMU,UAMpBC,OAAOC,UAAUC,eAAeC,KAAKd,EAAO,aAC5Ce,QAAQC,MAAM,+EAGlB,MAAMC,EAAcC,GACfC,IACGnB,EAAMoB,QAAQD,EAAAA,GAElB,CAACnB,EAAMoB,UAGLC,EAAiBH,GAClBC,IACOnB,GAAOsB,YAAYtB,EAAMsB,WAAWH,EAAAA,GAE5C,CAACnB,GAAOsB,aAGNC,EAAcL,GACfC,IACOnB,GAAOwB,SAASxB,EAAMwB,QAAQL,EAAAA,GAEtC,CAACnB,GAAOwB,UAGNC,EAAaP,GACdC,IACGnB,GAAO0B,gBAAgBP,GAEnBnB,EAAM2B,aACLR,EAAMS,OAA4BC,MAAQV,EAAOS,OAA4BC,MAAMC,QAGxF9B,GAAO+B,SAASZ,EAAAA,GAEpB,CAACnB,EAAM+B,OAAQ/B,EAAM0B,gBAGnBM,EAAcd,GACfC,IACGnB,GAAOiC,iBAAiBd,KAE5B,CAACnB,EAAMiC,iBAGLC,EAAkBC,EACpB,wBACA,CAAC,0BAA0B5B,KAC3BG,EACA,CACI,iCAAkCP,EAClC,+BAAgCC,GAEpCF,EAAmBkC,KAAIC,GAAK,0BAA0BA,QAIlDnC,mBAAoBoC,EAAK9B,SAAU+B,EAAKpC,UAAWqC,EAAKpC,QAASqC,EAAIC,qBAAsBC,KAAQC,GAAa5C,EAExH,OACI6C,EAACC,QAAAA,CACGC,GAAIvC,KACAoC,EACJI,gBAAeJ,EAASK,SACxB1C,KAAMA,EACNG,UAAWwB,EACXgB,SAAU7C,EACVC,WAAYA,EACZL,YAAaA,EACbkD,mBAAkB,GAAG3C,IAAWL,EAAYiD,EAAoBC,IAChEC,eAAcnD,EACdiB,QAASH,EACTc,OAAQN,EACR8B,QAASvB,EACTR,QAASD,EACTD,WAAYD,EACZZ,SAAUA,EACV+C,IAAKzD,GAGjB,CAEAD,EAAU2D,aAAe,CACrBlD,KAAM,OACNL,mBAAoB"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import a from"../../../../external/classnames/index.js";import{getUniqueId as r}from"../../../../utils/idGenerator.js";import{useCoreContext as t}from"../../../../core/Context/CoreProvider.js";function o(o){const{items:n,name:i,onChange:s,value:c,isInvalid:d,uniqueId:l}=o,{i18n:_}=t(),u=l?.replace(/[0-9]/g,"").substring(0,l.lastIndexOf("-"));return e("div",{className:"adyen-checkout__radio_group"},n.map((t=>{const n=r(u);return e("div",{key:t.id,className:"adyen-checkout__radio_group__input-wrapper"},e("input",{id:n,type:"radio",checked:c===t.id,className:"adyen-checkout__radio_group__input",name:i,onChange:s,onClick:s,value:t.id}),e("label",{className:a(["adyen-checkout__label__text","adyen-checkout__radio_group__label",o.className,{"adyen-checkout__radio_group__label--invalid":d}]),htmlFor:n},_.get(t.name)))})))}o.defaultProps={onChange:()=>{},items:[]};export{o as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import a from"../../../../external/classnames/index.js";import{getUniqueId as r}from"../../../../utils/idGenerator.js";import{useCoreContext as o}from"../../../../core/Context/CoreProvider.js";function t(t){const{items:i,name:n,onChange:l,value:d,isInvalid:s,uniqueId:c,ariaLabel:_}=t,{i18n:u}=o(),m=c?.replace(/[0-9]/g,"").substring(0,c.lastIndexOf("-"));return e("div",{className:"adyen-checkout__radio_group",role:"radiogroup",..._&&{"aria-label":_}},i.map((o=>{const i=r(m);return e("div",{key:o.id,className:"adyen-checkout__radio_group__input-wrapper"},e("input",{id:i,type:"radio",checked:d===o.id,className:"adyen-checkout__radio_group__input",name:n,onChange:l,onClick:l,value:o.id}),e("label",{className:a(["adyen-checkout__label__text","adyen-checkout__radio_group__label",t.className,{"adyen-checkout__radio_group__label--invalid":s}]),htmlFor:i},u.get(o.name)))})))}t.defaultProps={onChange:()=>{},items:[]};export{t as default};
2
2
  //# sourceMappingURL=RadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../../../../../src/components/internal/FormFields/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import { h } from 'preact';\nimport cx from 'classnames';\nimport './RadioGroup.scss';\nimport { RadioGroupProps } from './types';\nimport { getUniqueId } from '../../../../utils/idGenerator';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\n\nexport default function RadioGroup(props: RadioGroupProps) {\n const { items, name, onChange, value, isInvalid, uniqueId } = props;\n\n const { i18n } = useCoreContext();\n const uniqueIdBase = uniqueId?.replace(/[0-9]/g, '').substring(0, uniqueId.lastIndexOf('-'));\n\n return (\n <div className=\"adyen-checkout__radio_group\">\n {items.map(item => {\n const uniqueId = getUniqueId(uniqueIdBase);\n return (\n <div key={item.id} className=\"adyen-checkout__radio_group__input-wrapper\">\n <input\n id={uniqueId}\n type=\"radio\"\n checked={value === item.id}\n className=\"adyen-checkout__radio_group__input\"\n name={name}\n onChange={onChange}\n onClick={onChange}\n value={item.id}\n />\n <label\n className={cx([\n 'adyen-checkout__label__text',\n 'adyen-checkout__radio_group__label',\n props.className,\n { 'adyen-checkout__radio_group__label--invalid': isInvalid }\n ])}\n htmlFor={uniqueId}\n >\n {i18n.get(item.name)}\n </label>\n </div>\n );\n })}\n </div>\n );\n}\n\nRadioGroup.defaultProps = {\n onChange: () => {},\n items: []\n};\n"],"names":["RadioGroup","props","items","name","onChange","value","isInvalid","uniqueId","i18n","useCoreContext","uniqueIdBase","replace","substring","lastIndexOf","h","div","className","map","item","getUniqueId","key","id","input","type","checked","onClick","label","cx","htmlFor","get","defaultProps"],"mappings":"4QAOe,SAASA,EAAWC,GAC/B,MAAMC,MAAEA,EAAKC,KAAEA,EAAIC,SAAEA,EAAQC,MAAEA,EAAKC,UAAEA,EAASC,SAAEA,GAAaN,GAExDO,KAAEA,GAASC,IACXC,EAAeH,GAAUI,QAAQ,SAAU,IAAIC,UAAU,EAAGL,EAASM,YAAY,MAEvF,OACIC,EAACC,MAAAA,CAAIC,UAAU,+BACVd,EAAMe,KAAIC,IACP,MAAMX,EAAWY,EAAYT,GAC7B,OACII,EAACC,MAAAA,CAAIK,IAAKF,EAAKG,GAAIL,UAAU,8CACzBF,EAACQ,QAAAA,CACGD,GAAId,EACJgB,KAAK,QACLC,QAASnB,IAAUa,EAAKG,GACxBL,UAAU,qCACVb,KAAMA,EACNC,SAAUA,EACVqB,QAASrB,EACTC,MAAOa,EAAKG,KAEhBP,EAACY,QAAAA,CACGV,UAAWW,EAAG,CACV,8BACA,qCACA1B,EAAMe,UACN,CAAE,8CAA+CV,KAErDsB,QAASrB,GAERC,EAAKqB,IAAIX,EAAKf,OAAI,IAO/C,CAEAH,EAAW8B,aAAe,CACtB1B,SAAU,OACVF,MAAO"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../../../../../src/components/internal/FormFields/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import { h } from 'preact';\nimport cx from 'classnames';\nimport './RadioGroup.scss';\nimport { RadioGroupProps } from './types';\nimport { getUniqueId } from '../../../../utils/idGenerator';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\n\nexport default function RadioGroup(props: RadioGroupProps) {\n const { items, name, onChange, value, isInvalid, uniqueId, ariaLabel } = props;\n\n const { i18n } = useCoreContext();\n const uniqueIdBase = uniqueId?.replace(/[0-9]/g, '').substring(0, uniqueId.lastIndexOf('-'));\n\n return (\n <div className=\"adyen-checkout__radio_group\" role={'radiogroup'} {...(ariaLabel && { ['aria-label']: ariaLabel })}>\n {items.map(item => {\n const uniqueId = getUniqueId(uniqueIdBase);\n return (\n <div key={item.id} className=\"adyen-checkout__radio_group__input-wrapper\">\n <input\n id={uniqueId}\n type=\"radio\"\n checked={value === item.id}\n className=\"adyen-checkout__radio_group__input\"\n name={name}\n onChange={onChange}\n onClick={onChange}\n value={item.id}\n />\n <label\n className={cx([\n 'adyen-checkout__label__text',\n 'adyen-checkout__radio_group__label',\n props.className,\n { 'adyen-checkout__radio_group__label--invalid': isInvalid }\n ])}\n htmlFor={uniqueId}\n >\n {i18n.get(item.name)}\n </label>\n </div>\n );\n })}\n </div>\n );\n}\n\nRadioGroup.defaultProps = {\n onChange: () => {},\n items: []\n};\n"],"names":["RadioGroup","props","items","name","onChange","value","isInvalid","uniqueId","ariaLabel","i18n","useCoreContext","uniqueIdBase","replace","substring","lastIndexOf","h","div","className","role","map","item","getUniqueId","key","id","input","type","checked","onClick","label","cx","htmlFor","get","defaultProps"],"mappings":"4QAOe,SAASA,EAAWC,GAC/B,MAAMC,MAAEA,EAAKC,KAAEA,EAAIC,SAAEA,EAAQC,MAAEA,EAAKC,UAAEA,EAASC,SAAEA,EAAQC,UAAEA,GAAcP,GAEnEQ,KAAEA,GAASC,IACXC,EAAeJ,GAAUK,QAAQ,SAAU,IAAIC,UAAU,EAAGN,EAASO,YAAY,MAEvF,OACIC,EAACC,MAAAA,CAAIC,UAAU,8BAA8BC,KAAM,gBAAmBV,GAAa,CAAE,aAAgBA,IAChGN,EAAMiB,KAAIC,IACP,MAAMb,EAAWc,EAAYV,GAC7B,OACII,EAACC,MAAAA,CAAIM,IAAKF,EAAKG,GAAIN,UAAU,8CACzBF,EAACS,QAAAA,CACGD,GAAIhB,EACJkB,KAAK,QACLC,QAASrB,IAAUe,EAAKG,GACxBN,UAAU,qCACVd,KAAMA,EACNC,SAAUA,EACVuB,QAASvB,EACTC,MAAOe,EAAKG,KAEhBR,EAACa,QAAAA,CACGX,UAAWY,EAAG,CACV,8BACA,qCACA5B,EAAMgB,UACN,CAAE,8CAA+CX,KAErDwB,QAASvB,GAERE,EAAKsB,IAAIX,EAAKjB,OAAI,IAO/C,CAEAH,EAAWgC,aAAe,CACtB5B,SAAU,OACVF,MAAO"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useRef as t,useState as n,useMemo as r,useEffect as s}from"../../../../external/preact/hooks/dist/hooks.js";import l from"../../../../external/classnames/index.js";import o from"./components/SelectButton.js";import a from"./components/SelectList.js";import i from"../../../../utils/uuid.js";import{keys as c}from"./constants.js";import{ARIA_ERROR_SUFFIX as u,ARIA_CONTEXT_SUFFIX as d}from"../../../../core/Errors/constants.js";import{simulateFocusScroll as m}from"../utils.js";function f({items:f=[],className:p="",classNameModifiers:g=[],filterable:h=!0,readonly:v=!1,onChange:b=(()=>{}),onInput:y,selectedValue:k,name:w,isInvalid:I,isValid:L,placeholder:D,uniqueId:j,disabled:x,disableTextFilter:E,clearOnSelect:T,blurOnClose:B,onListToggle:C}){const N=t(null),S=t(null),$=t(null),M=t(null),[R,_]=n(null),[P,V]=n(!1),A=r((()=>`select-${i()}`),[]),F=f.find((e=>e.id===k))||{},[H,K]=n(),[O,U]=n(F),q=F,z=E?f:f.filter((e=>!R||e.name.toLowerCase().includes(R.toLowerCase()))),G=j?`${j}${I?u:d}`:null,J=e=>{if(!e)return;const t=document.getElementById(`listItem-${e.id}`);m(t)},Q=()=>{B&&N.current.blur(),V(!1)},W=()=>{V(!0)},X=e=>{const t=e.currentTarget.getAttribute("data-value");return z.find((e=>e.id==t))},Y=e=>{let t;e.preventDefault(),t=e.currentTarget instanceof HTMLElement&&"option"===e.currentTarget.getAttribute("role")?X(e):O.id&&z.some((e=>e.id===O.id))?O:R?z[0]:{id:k},t&&!t.disabled&&(b({target:{value:t.id,name:w}}),T&&K(null),Q())},Z=e=>{switch(e.key){case c.space:case c.enter:Y(e);break;case c.arrowDown:e.preventDefault(),(()=>{if(!z||z.length<1)return;const e=z.findIndex((e=>e===O))+1,t=e<z.length?e:0,n=z[t];J(n),U(n)})();break;case c.arrowUp:e.preventDefault(),(()=>{if(!z||z.length<1)return;const e=z.findIndex((e=>e===O))-1,t=e<0?z.length-1:e,n=z[t];J(n),U(n)})()}};return s((()=>{P?K(null):_(null)}),[P]),s((()=>{P&&h&&N.current&&N.current.focus(),C?.(P)}),[P]),s((()=>{function e(e){(e.composedPath?!e.composedPath().includes(S.current):!S.current.contains(e.target))&&Q()}return document.addEventListener("click",e,!1),()=>{document.removeEventListener("click",e,!1)}}),[S]),e("div",{className:l(["adyen-checkout__dropdown",p,...g.map((e=>`adyen-checkout__dropdown--${e}`))]),ref:S},e(o,{inputText:H,id:j??null,active:O,selected:q,filterInputRef:N,filterable:h,isInvalid:I,isValid:L,onButtonKeyDown:e=>{e.key===c.enter&&h&&P&&R?Y(e):e.key===c.escape?Q():![c.arrowUp,c.arrowDown,c.enter].includes(e.key)&&(e.key!==c.space||h&&P)?(e.shiftKey&&e.key===c.tab||e.key===c.tab)&&Q():(e.preventDefault(),P?Z(e):W())},onFocus:W,onInput:e=>{const t=e.target.value;K(t),_(t),y&&y(t)},placeholder:D,readonly:v,selectListId:A,showList:P,toggleButtonRef:$,toggleList:e=>{e.preventDefault(),P?(K(q.name),Q()):(K(null),W())},disabled:x,ariaDescribedBy:G}),e(a,{active:O,filteredItems:z,onHover:e=>{e.preventDefault();const t=X(e);U(t)},onSelect:Y,selected:q,selectListId:A,selectListRef:M,showList:P}))}f.defaultProps={className:"",classNameModifiers:[],filterable:!0,items:[],readonly:!1,onChange:()=>{}};export{f as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useRef as t,useState as n,useMemo as r,useEffect as s}from"../../../../external/preact/hooks/dist/hooks.js";import l from"../../../../external/classnames/index.js";import o from"./components/SelectButton.js";import a from"./components/SelectList.js";import i from"../../../../utils/uuid.js";import{keys as c}from"./constants.js";import{ARIA_ERROR_SUFFIX as u,ARIA_CONTEXT_SUFFIX as d}from"../../../../core/Errors/constants.js";import{simulateFocusScroll as m}from"../utils.js";function f({items:f=[],className:p="",classNameModifiers:g=[],filterable:h=!0,readonly:v=!1,onChange:b=()=>{},onInput:w,selectedValue:y,name:k,isInvalid:I,isValid:L,placeholder:D,uniqueId:j,disabled:x,disableTextFilter:B,clearOnSelect:E,blurOnClose:T,onListToggle:C,allowIdOnButton:N=!1}){const S=t(null),$=t(null),M=t(null),O=t(null),[R,_]=n(null),[P,V]=n(!1),A=r((()=>`select-${i()}`),[]),F=f.find((e=>e.id===y))||{},[H,K]=n(),[U,q]=n(F),z=F,G=B?f:f.filter((e=>!R||e.name.toLowerCase().includes(R.toLowerCase()))),J=j?`${j}${I?u:d}`:null,Q=e=>{if(!e)return;const t=document.getElementById(`listItem-${e.id}`);m(t)},W=()=>{T&&S.current.blur(),V(!1)},X=()=>{V(!0)},Y=e=>{const t=e.currentTarget.getAttribute("data-value");return G.find((e=>e.id==t))},Z=e=>{let t;e.preventDefault(),t=e.currentTarget instanceof HTMLElement&&"option"===e.currentTarget.getAttribute("role")?Y(e):U.id&&G.some((e=>e.id===U.id))?U:R?G[0]:{id:y},t&&!t.disabled&&(b({target:{value:t.id,name:k}}),E&&K(null),W())},ee=e=>{switch(e.key){case c.space:case c.enter:Z(e);break;case c.arrowDown:e.preventDefault(),(()=>{if(!G||G.length<1)return;const e=G.findIndex((e=>e===U))+1,t=e<G.length?e:0,n=G[t];Q(n),q(n)})();break;case c.arrowUp:e.preventDefault(),(()=>{if(!G||G.length<1)return;const e=G.findIndex((e=>e===U))-1,t=e<0?G.length-1:e,n=G[t];Q(n),q(n)})()}};return s((()=>{P?K(null):_(null)}),[P]),s((()=>{P&&h&&S.current&&S.current.focus(),C?.(P)}),[P]),s((()=>{function e(e){(e.composedPath?!e.composedPath().includes($.current):!$.current.contains(e.target))&&W()}return document.addEventListener("click",e,!1),()=>{document.removeEventListener("click",e,!1)}}),[$]),e("div",{className:l(["adyen-checkout__dropdown",p,...g.map((e=>`adyen-checkout__dropdown--${e}`))]),ref:$},e(o,{inputText:H,id:j??null,active:U,selected:z,filterInputRef:S,filterable:h,isInvalid:I,isValid:L,onButtonKeyDown:e=>{e.key===c.enter&&h&&P&&R?Z(e):e.key===c.escape?W():![c.arrowUp,c.arrowDown,c.enter].includes(e.key)&&(e.key!==c.space||h&&P)?(e.shiftKey&&e.key===c.tab||e.key===c.tab)&&W():(e.preventDefault(),P?ee(e):X())},onFocus:X,onInput:e=>{const t=e.target.value;K(t),_(t),w&&w(t)},placeholder:D,readonly:v,selectListId:A,showList:P,toggleButtonRef:M,toggleList:e=>{e.preventDefault(),P?(K(z.name),W()):(K(null),X())},disabled:x,ariaDescribedBy:J,allowIdOnButton:N}),e(a,{active:U,filteredItems:G,onHover:e=>{e.preventDefault();const t=Y(e);q(t)},onSelect:Z,selected:z,selectListId:A,selectListRef:O,showList:P}))}f.defaultProps={className:"",classNameModifiers:[],filterable:!0,items:[],readonly:!1,onChange:()=>{}};export{f as default};
2
2
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../../../../src/components/internal/FormFields/Select/Select.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport cx from 'classnames';\nimport SelectButton from './components/SelectButton';\nimport SelectList from './components/SelectList';\nimport uuid from '../../../../utils/uuid';\nimport { keys } from './constants';\nimport { SelectItem, SelectProps } from './types';\nimport './Select.scss';\nimport { ARIA_CONTEXT_SUFFIX, ARIA_ERROR_SUFFIX } from '../../../../core/Errors/constants';\nimport { simulateFocusScroll } from '../utils';\n\nfunction Select({\n items = [],\n className = '',\n classNameModifiers = [],\n filterable = true,\n readonly = false,\n onChange = () => {},\n onInput,\n selectedValue,\n name,\n isInvalid,\n isValid,\n placeholder,\n uniqueId,\n disabled,\n disableTextFilter,\n clearOnSelect,\n blurOnClose,\n onListToggle\n}: SelectProps) {\n const filterInputRef = useRef(null);\n const selectContainerRef = useRef(null);\n const toggleButtonRef = useRef(null);\n const selectListRef = useRef(null);\n const [textFilter, setTextFilter] = useState<string>(null);\n const [showList, setShowList] = useState<boolean>(false);\n const selectListId: string = useMemo(() => `select-${uuid()}`, []);\n\n const active: SelectItem = items.find(i => i.id === selectedValue) || ({} as SelectItem);\n\n const [inputText, setInputText] = useState<string>();\n\n const [activeOption, setActiveOption] = useState<SelectItem>(active);\n\n const selectedOption = active;\n\n const filteredItems = disableTextFilter ? items : items.filter(item => !textFilter || item.name.toLowerCase().includes(textFilter.toLowerCase()));\n\n const suffix = isInvalid ? ARIA_ERROR_SUFFIX : ARIA_CONTEXT_SUFFIX;\n const ariaDescribedBy = uniqueId ? `${uniqueId}${suffix}` : null;\n\n const setNextActive = () => {\n if (!filteredItems || filteredItems.length < 1) return;\n const possibleNextIndex = filteredItems.findIndex(listItem => listItem === activeOption) + 1;\n const nextIndex = possibleNextIndex < filteredItems.length ? possibleNextIndex : 0;\n const nextItem = filteredItems[nextIndex];\n scrollToItem(nextItem);\n setActiveOption(nextItem);\n };\n\n const setPreviousActive = () => {\n if (!filteredItems || filteredItems.length < 1) return;\n const possibleNextIndex = filteredItems.findIndex(listItem => listItem === activeOption) - 1;\n const nextIndex = possibleNextIndex < 0 ? filteredItems.length - 1 : possibleNextIndex;\n const nextItem = filteredItems[nextIndex];\n scrollToItem(nextItem);\n setActiveOption(nextItem);\n };\n\n const scrollToItem = (item: SelectItem) => {\n if (!item) return;\n const nextElement = document.getElementById(`listItem-${item.id}`);\n simulateFocusScroll(nextElement);\n };\n\n /**\n * Closes the selectList, empties the text filter and focuses the button element\n */\n const closeList = () => {\n //blurs the field when the list is closed, makes for a better UX for most users, needs more testing\n blurOnClose && filterInputRef.current.blur();\n setShowList(false);\n };\n\n const openList = () => {\n setShowList(true);\n };\n\n const extractItemFromEvent = (e: Event): SelectItem => {\n const value = (e.currentTarget as HTMLInputElement).getAttribute('data-value') as string;\n return filteredItems.find(listItem => listItem.id == value);\n };\n\n /**\n * Closes the select list and fires an onChange\n * @param e - Event\n */\n const handleSelect = (e: Event) => {\n e.preventDefault();\n\n // We use a local variable here since writing and if statement is cleaner then a long ternary\n let valueToEmit;\n\n if (e.currentTarget instanceof HTMLElement && e.currentTarget.getAttribute('role') === 'option') {\n // This is the main scenario when clicking and item in the list\n // Item comes from the event\n valueToEmit = extractItemFromEvent(e);\n } else if (activeOption.id && filteredItems.some(item => item.id === activeOption.id)) {\n // This is the scenario where a user is using the keyboard to navigate\n // In the case item comes from the visually select item\n valueToEmit = activeOption;\n } else {\n // This is the scenario the user didn't select anything\n if (textFilter) {\n // if we filtering for something then select the first option\n valueToEmit = filteredItems[0];\n } else {\n // This will happen when we want to keep an already chosen option\n // If no active option we should just emit again with the value that was already selected\n valueToEmit = { id: selectedValue };\n }\n }\n\n if (valueToEmit && !valueToEmit.disabled) {\n onChange({ target: { value: valueToEmit.id, name: name } });\n\n if (clearOnSelect) setInputText(null);\n\n closeList();\n }\n };\n\n /**\n * Handles hovering and directions\n * @param e - Event\n */\n const handleHover = (e: Event) => {\n e.preventDefault();\n const item = extractItemFromEvent(e);\n setActiveOption(item);\n };\n\n /**\n * Handle keyDown events on the selectList button\n * Responsible for opening and closing the list\n * @param e - KeyboardEvent\n */\n const handleButtonKeyDown = (e: KeyboardEvent) => {\n if (e.key === keys.enter && filterable && showList && textFilter) {\n handleSelect(e);\n } else if (e.key === keys.escape) {\n // When user has focused Select button but not yet moved into Select list - close list and keep focus on the Select Button re. a11y guidelines\n // https://w3c.github.io/aria-practices/examples/disclosure/disclosure-navigation.html\n closeList();\n } else if ([keys.arrowUp, keys.arrowDown, keys.enter].includes(e.key) || (e.key === keys.space && (!filterable || !showList))) {\n e.preventDefault();\n if (!showList) {\n openList();\n } else {\n handleNavigationKeys(e);\n }\n } else if (e.shiftKey && e.key === keys.tab) {\n // Shift-Tab out of Select - close list re. a11y guidelines (above)\n closeList();\n } else if (e.key === keys.tab) {\n closeList();\n }\n };\n\n /**\n * Handles movement with navigation keys and enter\n * Navigates through the list, or select an element, or focus the filter input, or close the menu.\n * @param e - KeyDownEvent\n */\n const handleNavigationKeys = (e: KeyboardEvent) => {\n switch (e.key) {\n case keys.space:\n case keys.enter:\n handleSelect(e);\n break;\n case keys.arrowDown:\n e.preventDefault();\n setNextActive();\n break;\n case keys.arrowUp:\n e.preventDefault();\n setPreviousActive();\n break;\n default:\n }\n };\n\n /**\n * Updates the state with the current text filter value\n * @param e - KeyboardEvent\n */\n const handleTextFilter = (e: KeyboardEvent) => {\n const value: string = (e.target as HTMLInputElement).value;\n setInputText(value);\n setTextFilter(value);\n if (onInput) {\n onInput(value);\n }\n };\n\n /**\n * Toggles the selectList and focuses in either the filter input or in the selectList button\n * @param e - Event\n */\n const toggleList = (e: Event) => {\n e.preventDefault();\n if (!showList) {\n setInputText(null);\n openList();\n } else {\n setInputText(selectedOption.name);\n closeList();\n }\n };\n\n useEffect(() => {\n if (showList) {\n setInputText(null);\n } else {\n setTextFilter(null);\n }\n }, [showList]);\n\n /**\n * Focus on the input if filterable\n */\n useEffect(() => {\n if (showList && filterable && filterInputRef.current) {\n filterInputRef.current.focus();\n }\n onListToggle?.(showList);\n }, [showList]);\n\n useEffect(() => {\n /**\n * Close the select list when clicking outside the list\n * @param e - MouseEvent\n */\n function handleClickOutside(e: MouseEvent) {\n // use composedPath so it can also check when inside a web component\n // if composedPath is not available fallback to e.target\n const clickIsOutside = e.composedPath\n ? !e.composedPath().includes(selectContainerRef.current)\n : !selectContainerRef.current.contains(e.target);\n if (clickIsOutside) {\n closeList();\n }\n }\n\n document.addEventListener('click', handleClickOutside, false);\n\n return () => {\n document.removeEventListener('click', handleClickOutside, false);\n };\n }, [selectContainerRef]);\n\n return (\n <div\n className={cx(['adyen-checkout__dropdown', className, ...classNameModifiers.map(m => `adyen-checkout__dropdown--${m}`)])}\n ref={selectContainerRef}\n >\n <SelectButton\n inputText={inputText}\n id={uniqueId ?? null}\n active={activeOption}\n selected={selectedOption}\n filterInputRef={filterInputRef}\n filterable={filterable}\n isInvalid={isInvalid}\n isValid={isValid}\n onButtonKeyDown={handleButtonKeyDown}\n onFocus={openList}\n onInput={handleTextFilter}\n placeholder={placeholder}\n readonly={readonly}\n selectListId={selectListId}\n showList={showList}\n toggleButtonRef={toggleButtonRef}\n toggleList={toggleList}\n disabled={disabled}\n ariaDescribedBy={ariaDescribedBy}\n />\n <SelectList\n active={activeOption}\n filteredItems={filteredItems}\n onHover={handleHover}\n onSelect={handleSelect}\n selected={selectedOption}\n selectListId={selectListId}\n selectListRef={selectListRef}\n showList={showList}\n />\n </div>\n );\n}\n\nSelect.defaultProps = {\n className: '',\n classNameModifiers: [],\n filterable: true,\n items: [],\n readonly: false,\n onChange: () => {}\n};\n\nexport default Select;\n"],"names":["Select","items","className","classNameModifiers","filterable","readonly","onChange","onInput","selectedValue","name","isInvalid","isValid","placeholder","uniqueId","disabled","disableTextFilter","clearOnSelect","blurOnClose","onListToggle","filterInputRef","useRef","selectContainerRef","toggleButtonRef","selectListRef","textFilter","setTextFilter","useState","showList","setShowList","selectListId","useMemo","uuid","active","find","i","id","inputText","setInputText","activeOption","setActiveOption","selectedOption","filteredItems","filter","item","toLowerCase","includes","ariaDescribedBy","ARIA_ERROR_SUFFIX","ARIA_CONTEXT_SUFFIX","scrollToItem","nextElement","document","getElementById","simulateFocusScroll","closeList","current","blur","openList","extractItemFromEvent","e","value","currentTarget","getAttribute","listItem","handleSelect","valueToEmit","preventDefault","HTMLElement","some","target","handleNavigationKeys","key","keys","space","enter","arrowDown","length","possibleNextIndex","findIndex","nextIndex","nextItem","setNextActive","arrowUp","setPreviousActive","useEffect","focus","handleClickOutside","composedPath","contains","addEventListener","removeEventListener","h","div","cx","map","m","ref","SelectButton","selected","onButtonKeyDown","escape","shiftKey","tab","onFocus","toggleList","SelectList","onHover","onSelect","defaultProps"],"mappings":"+iBAYA,SAASA,GAAOC,MACZA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,WACvBA,GAAa,EAAIC,SACjBA,GAAW,EAAKC,SAChBA,EAAW,SAAQC,QACnBA,EAAOC,cACPA,EAAaC,KACbA,EAAIC,UACJA,EAASC,QACTA,EAAOC,YACPA,EAAWC,SACXA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,cACjBA,EAAaC,YACbA,EAAWC,aACXA,IAEA,MAAMC,EAAiBC,EAAO,MACxBC,EAAqBD,EAAO,MAC5BE,EAAkBF,EAAO,MACzBG,EAAgBH,EAAO,OACtBI,EAAYC,GAAiBC,EAAiB,OAC9CC,EAAUC,GAAeF,GAAkB,GAC5CG,EAAuBC,GAAQ,IAAM,UAAUC,OAAU,IAEzDC,EAAqB/B,EAAMgC,MAAKC,GAAKA,EAAEC,KAAO3B,KAAmB,IAEhE4B,EAAWC,GAAgBX,KAE3BY,EA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Z,EAAEY,MAAQC,EAAKC,OAAWrE,GAAeuB,IAOxGgC,EAAE0C,UAAY1C,EAAEY,MAAQC,EAAK8B,KAG7B3C,EAAEY,MAAQC,EAAK8B,MADtBhD,KARAK,EAAEO,iBACGvC,EAGD2C,EAAqBX,GAFrBF,IASR,EA8GQ8C,QAAS9C,EACTlD,QAjFcoD,IACtB,MAAMC,EAAiBD,EAAEU,OAA4BT,MACrDvB,EAAauB,GACbnC,EAAcmC,GACVrD,GACAA,EAAQqD,EACZ,EA4EQhD,YAAaA,EACbP,SAAUA,EACVwB,aAAcA,EACdF,SAAUA,EACVL,gBAAiBA,EACjBkF,WA1EQ7C,IAChBA,EAAEO,iBACGvC,GAIDU,EAAaG,EAAe/B,MAC5B6C,MAJAjB,EAAa,MACboB,IAIJ,EAmEQ3C,SAAUA,EACVgC,gBAAiBA,IAErB6C,EAACc,EAAAA,CACGzE,OAAQM,EACRG,cAAeA,EACfiE,QA1JS/C,IACjBA,EAAEO,iBACF,MAAMvB,EAAOe,EAAqBC,GAClCpB,EAAgBI,EAAAA,EAwJRgE,SAAU3C,EACVkC,SAAU1D,EACVX,aAAcA,EACdN,cAAeA,EACfI,SAAUA,IAI1B,CAEA3B,EAAO4G,aAAe,CAClB1G,UAAW,GACXC,mBAAoB,GACpBC,YAAY,EACZH,MAAO,GACPI,UAAU,EACVC,SAAU"}
1
+ {"version":3,"file":"Select.js","sources":["../../../../../../src/components/internal/FormFields/Select/Select.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport cx from 'classnames';\nimport SelectButton from './components/SelectButton';\nimport SelectList from './components/SelectList';\nimport uuid from '../../../../utils/uuid';\nimport { keys } from './constants';\nimport { SelectItem, SelectProps } from './types';\nimport './Select.scss';\nimport { ARIA_CONTEXT_SUFFIX, ARIA_ERROR_SUFFIX } from '../../../../core/Errors/constants';\nimport { simulateFocusScroll } from '../utils';\n\nfunction Select({\n items = [],\n className = '',\n classNameModifiers = [],\n filterable = true,\n readonly = false,\n onChange = () => {},\n onInput,\n selectedValue,\n name,\n isInvalid,\n isValid,\n placeholder,\n uniqueId,\n disabled,\n disableTextFilter,\n clearOnSelect,\n blurOnClose,\n onListToggle,\n allowIdOnButton = false\n}: SelectProps) {\n const filterInputRef = useRef(null);\n const selectContainerRef = useRef(null);\n const toggleButtonRef = useRef(null);\n const selectListRef = useRef(null);\n const [textFilter, setTextFilter] = useState<string>(null);\n const [showList, setShowList] = useState<boolean>(false);\n const selectListId: string = useMemo(() => `select-${uuid()}`, []);\n\n const active: SelectItem = items.find(i => i.id === selectedValue) || ({} as SelectItem);\n\n const [inputText, setInputText] = useState<string>();\n\n const [activeOption, setActiveOption] = useState<SelectItem>(active);\n\n const selectedOption = active;\n\n const filteredItems = disableTextFilter ? items : items.filter(item => !textFilter || item.name.toLowerCase().includes(textFilter.toLowerCase()));\n\n const suffix = isInvalid ? ARIA_ERROR_SUFFIX : ARIA_CONTEXT_SUFFIX;\n const ariaDescribedBy = uniqueId ? `${uniqueId}${suffix}` : null;\n\n const setNextActive = () => {\n if (!filteredItems || filteredItems.length < 1) return;\n const possibleNextIndex = filteredItems.findIndex(listItem => listItem === activeOption) + 1;\n const nextIndex = possibleNextIndex < filteredItems.length ? possibleNextIndex : 0;\n const nextItem = filteredItems[nextIndex];\n scrollToItem(nextItem);\n setActiveOption(nextItem);\n };\n\n const setPreviousActive = () => {\n if (!filteredItems || filteredItems.length < 1) return;\n const possibleNextIndex = filteredItems.findIndex(listItem => listItem === activeOption) - 1;\n const nextIndex = possibleNextIndex < 0 ? filteredItems.length - 1 : possibleNextIndex;\n const nextItem = filteredItems[nextIndex];\n scrollToItem(nextItem);\n setActiveOption(nextItem);\n };\n\n const scrollToItem = (item: SelectItem) => {\n if (!item) return;\n const nextElement = document.getElementById(`listItem-${item.id}`);\n simulateFocusScroll(nextElement);\n };\n\n /**\n * Closes the selectList, empties the text filter and focuses the button element\n */\n const closeList = () => {\n //blurs the field when the list is closed, makes for a better UX for most users, needs more testing\n blurOnClose && filterInputRef.current.blur();\n setShowList(false);\n };\n\n const openList = () => {\n setShowList(true);\n };\n\n const extractItemFromEvent = (e: Event): SelectItem => {\n const value = (e.currentTarget as HTMLInputElement).getAttribute('data-value');\n return filteredItems.find(listItem => listItem.id == value);\n };\n\n /**\n * Closes the select list and fires an onChange\n * @param e - Event\n */\n const handleSelect = (e: Event) => {\n e.preventDefault();\n\n // We use a local variable here since writing and if statement is cleaner then a long ternary\n let valueToEmit;\n\n if (e.currentTarget instanceof HTMLElement && e.currentTarget.getAttribute('role') === 'option') {\n // This is the main scenario when clicking and item in the list\n // Item comes from the event\n valueToEmit = extractItemFromEvent(e);\n } else if (activeOption.id && filteredItems.some(item => item.id === activeOption.id)) {\n // This is the scenario where a user is using the keyboard to navigate\n // In the case item comes from the visually select item\n valueToEmit = activeOption;\n } else {\n // This is the scenario the user didn't select anything\n if (textFilter) {\n // if we filtering for something then select the first option\n valueToEmit = filteredItems[0];\n } else {\n // This will happen when we want to keep an already chosen option\n // If no active option we should just emit again with the value that was already selected\n valueToEmit = { id: selectedValue };\n }\n }\n\n if (valueToEmit && !valueToEmit.disabled) {\n onChange({ target: { value: valueToEmit.id, name: name } });\n\n if (clearOnSelect) setInputText(null);\n\n closeList();\n }\n };\n\n /**\n * Handles hovering and directions\n * @param e - Event\n */\n const handleHover = (e: Event) => {\n e.preventDefault();\n const item = extractItemFromEvent(e);\n setActiveOption(item);\n };\n\n /**\n * Handle keyDown events on the selectList button\n * Responsible for opening and closing the list\n * @param e - KeyboardEvent\n */\n const handleButtonKeyDown = (e: KeyboardEvent) => {\n if (e.key === keys.enter && filterable && showList && textFilter) {\n handleSelect(e);\n } else if (e.key === keys.escape) {\n // When user has focused Select button but not yet moved into Select list - close list and keep focus on the Select Button re. a11y guidelines\n // https://w3c.github.io/aria-practices/examples/disclosure/disclosure-navigation.html\n closeList();\n } else if ([keys.arrowUp, keys.arrowDown, keys.enter].includes(e.key) || (e.key === keys.space && (!filterable || !showList))) {\n e.preventDefault();\n if (!showList) {\n openList();\n } else {\n handleNavigationKeys(e);\n }\n } else if (e.shiftKey && e.key === keys.tab) {\n // Shift-Tab out of Select - close list re. a11y guidelines (above)\n closeList();\n } else if (e.key === keys.tab) {\n closeList();\n }\n };\n\n /**\n * Handles movement with navigation keys and enter\n * Navigates through the list, or select an element, or focus the filter input, or close the menu.\n * @param e - KeyDownEvent\n */\n const handleNavigationKeys = (e: KeyboardEvent) => {\n switch (e.key) {\n case keys.space:\n case keys.enter:\n handleSelect(e);\n break;\n case keys.arrowDown:\n e.preventDefault();\n setNextActive();\n break;\n case keys.arrowUp:\n e.preventDefault();\n setPreviousActive();\n break;\n default:\n }\n };\n\n /**\n * Updates the state with the current text filter value\n * @param e - KeyboardEvent\n */\n const handleTextFilter = (e: KeyboardEvent) => {\n const value: string = (e.target as HTMLInputElement).value;\n setInputText(value);\n setTextFilter(value);\n if (onInput) {\n onInput(value);\n }\n };\n\n /**\n * Toggles the selectList and focuses in either the filter input or in the selectList button\n * @param e - Event\n */\n const toggleList = (e: Event) => {\n e.preventDefault();\n if (!showList) {\n setInputText(null);\n openList();\n } else {\n setInputText(selectedOption.name);\n closeList();\n }\n };\n\n useEffect(() => {\n if (showList) {\n setInputText(null);\n } else {\n setTextFilter(null);\n }\n }, [showList]);\n\n /**\n * Focus on the input if filterable\n */\n useEffect(() => {\n if (showList && filterable && filterInputRef.current) {\n filterInputRef.current.focus();\n }\n onListToggle?.(showList);\n }, [showList]);\n\n useEffect(() => {\n /**\n * Close the select list when clicking outside the list\n * @param e - MouseEvent\n */\n function handleClickOutside(e: MouseEvent) {\n // use composedPath so it can also check when inside a web component\n // if composedPath is not available fallback to e.target\n const clickIsOutside = e.composedPath\n ? !e.composedPath().includes(selectContainerRef.current)\n : !selectContainerRef.current.contains(e.target);\n if (clickIsOutside) {\n closeList();\n }\n }\n\n document.addEventListener('click', handleClickOutside, false);\n\n return () => {\n document.removeEventListener('click', handleClickOutside, false);\n };\n }, [selectContainerRef]);\n\n return (\n <div\n className={cx(['adyen-checkout__dropdown', className, ...classNameModifiers.map(m => `adyen-checkout__dropdown--${m}`)])}\n ref={selectContainerRef}\n >\n <SelectButton\n inputText={inputText}\n id={uniqueId ?? null}\n active={activeOption}\n selected={selectedOption}\n filterInputRef={filterInputRef}\n filterable={filterable}\n isInvalid={isInvalid}\n isValid={isValid}\n onButtonKeyDown={handleButtonKeyDown}\n onFocus={openList}\n onInput={handleTextFilter}\n placeholder={placeholder}\n readonly={readonly}\n selectListId={selectListId}\n showList={showList}\n toggleButtonRef={toggleButtonRef}\n toggleList={toggleList}\n disabled={disabled}\n ariaDescribedBy={ariaDescribedBy}\n allowIdOnButton={allowIdOnButton}\n />\n <SelectList\n active={activeOption}\n filteredItems={filteredItems}\n onHover={handleHover}\n onSelect={handleSelect}\n selected={selectedOption}\n selectListId={selectListId}\n selectListRef={selectListRef}\n showList={showList}\n />\n </div>\n );\n}\n\nSelect.defaultProps = {\n className: '',\n classNameModifiers: [],\n filterable: true,\n items: [],\n readonly: false,\n onChange: () => {}\n};\n\nexport default Select;\n"],"names":["Select","items","className","classNameModifiers","filterable","readonly","onChange","onInput","selectedValue","name","isInvalid","isValid","placeholder","uniqueId","disabled","disableTextFilter","clearOnSelect","blurOnClose","onListToggle","allowIdOnButton","filterInputRef","useRef","selectContainerRef","toggleButtonRef","selectListRef","textFilter","setTextFilter","useState","showList","setShowList","selectListId","useMemo","uuid","active","find","i","id","inputText","setInputText","activeOption","setActiveOption","selectedOption","filteredItems","filter","item","toLowerCase","includes","ariaDescribedBy","ARIA_ERROR_SUFFIX","ARIA_CONTEXT_SUFFIX","scrollToItem","nextElement","document","getElementById","simulateFocusScroll","closeList","current","blur","openList","extractItemFromEvent","e","value","currentTarget","getAttribute","listItem","handleSelect","valueToEmit","preventDefault","HTMLElement","some","target","handleNavigationKeys","key","keys","space","enter","arrowDown","length","possibleNextIndex","findIndex","nextIndex","nextItem","setNextActive","arrowUp","setPreviousActive","useEffect","focus","handleClickOutside","composedPath","contains","addEventListener","removeEventListener","h","div","cx","map","m","ref","SelectButton","selected","onButtonKeyDown","escape","shiftKey","tab","onFocus","toggleList","SelectList","onHover","onSelect","defaultProps"],"mappings":"+iBAYA,SAASA,GAAOC,MACZA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,WACvBA,GAAa,EAAIC,SACjBA,GAAW,EAAKC,SAChBA,EAAW,OAAQC,QACnBA,EAAOC,cACPA,EAAaC,KACbA,EAAIC,UACJA,EAASC,QACTA,EAAOC,YACPA,EAAWC,SACXA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,cACjBA,EAAaC,YACbA,EAAWC,aACXA,EAAYC,gBACZA,GAAkB,IAElB,MAAMC,EAAiBC,EAAO,MACxBC,EAAqBD,EAAO,MAC5BE,EAAkBF,EAAO,MACzBG,EAAgBH,EAAO,OACtBI,EAAYC,GAAiBC,EAAiB,OAC9CC,EAAUC,GAAeF,GAAkB,GAC5CG,EAAuBC,GAAQ,IAAM,UAAUC,OAAU,IAEzDC,EAAqBhC,EAAMiC,MAAKC,GAAKA,EAAEC,KAAO5B,KAAmB,IAEhE6B,EAAWC,GAAgBX,KAE3BY,EAAcC,GAAmBb,EAAqBM,GAEvDQ,EAAiBR,EAEjBS,EAAgB3B,EAAoBd,EAAQA,EAAM0C,QAAOC,IAASnB,GAAcmB,EAAKnC,KAAKoC,cAAcC,SAASrB,EAAWoB,iBAG5HE,EAAkBlC,EAAW,GAAGA,IADvBH,EAAYsC,EAAoBC,IACa,KAoBtDC,EAAgBN,IAClB,IAAKA,EAAM,OACX,MAAMO,EAAcC,SAASC,eAAe,YAAYT,EAAKR,MAC7DkB,EAAoBH,EAAAA,EAMlBI,EAAY,KAEdtC,GAAeG,EAAeoC,QAAQC,OACtC5B,GAAY,EAAA,EAGV6B,EAAW,KACb7B,GAAY,EAAA,EAGV8B,EAAwBC,IAC1B,MAAMC,EAAQD,EAAGE,cAAmC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,MAJAjB,EAAa,MACboB,IAIJ,EAmEQ5C,SAAUA,EACViC,gBAAiBA,EACjB5B,gBAAiBA,IAErByE,EAACc,EAAAA,CACGzE,OAAQM,EACRG,cAAeA,EACfiE,QA3JS/C,IACjBA,EAAEO,iBACF,MAAMvB,EAAOe,EAAqBC,GAClCpB,EAAgBI,EAAAA,EAyJRgE,SAAU3C,EACVkC,SAAU1D,EACVX,aAAcA,EACdN,cAAeA,EACfI,SAAUA,IAI1B,CAEA5B,EAAO6G,aAAe,CAClB3G,UAAW,GACXC,mBAAoB,GACpBC,YAAY,EACZH,MAAO,GACPI,UAAU,EACVC,SAAU"}
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as t}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/index.js";import o from"../../../Img/Img.js";function a({filterable:t,toggleButtonRef:n,...o}){return t?e("div",{...o,ref:n}):e("button",{id:o.id,"aria-describedby":o.ariaDescribedBy,type:"button",...o,ref:n})}function d(d){const{active:c,selected:r,inputText:l,readonly:i,showList:s}=d,u=r.selectedOptionName||r.name||d.placeholder||"",_=s?l:u,p=i?null:d.filterable?e=>{e.preventDefault(),document.activeElement===d.filterInputRef.current?d.showList||d.toggleList(e):d.filterInputRef.current&&d.filterInputRef.current.focus()}:d.toggleList,b=i?null:d.onFocus,f=c.id?`listItem-${c.id}`:"";return e(a,{className:n({"adyen-checkout__dropdown__button":!0,"adyen-checkout__dropdown__button--readonly":i,"adyen-checkout__dropdown__button--active":s,"adyen-checkout__dropdown__button--invalid":d.isInvalid,"adyen-checkout__dropdown__button--valid":d.isValid,"adyen-checkout__dropdown__button--disabled":r.disabled}),disabled:d.disabled,filterable:d.filterable,onClick:p,onKeyDown:i?null:d.onButtonKeyDown,toggleButtonRef:d.toggleButtonRef},d.filterable?e(t,null,!s&&r.icon&&e(o,{className:"adyen-checkout__dropdown__button__icon",src:r.icon,alt:r.name}),e("input",{value:_,"aria-autocomplete":"list","aria-controls":d.selectListId,"aria-expanded":s,"aria-owns":d.selectListId,autoComplete:"off",className:"adyen-checkout__filter-input",onInput:d.onInput,onFocus:b,ref:d.filterInputRef,role:"combobox","aria-activedescendant":f,type:"text",readOnly:d.readonly,id:d.id,"aria-describedby":d.ariaDescribedBy}),!s&&r.secondaryText&&e("span",{className:"adyen-checkout__dropdown__button__secondary-text"},r.secondaryText)):e(t,null,r.icon&&e(o,{className:"adyen-checkout__dropdown__button__icon",src:r.icon,alt:r.name}),e("span",{className:"adyen-checkout__dropdown__button__text"},u),r.secondaryText&&e("span",{className:"adyen-checkout__dropdown__button__secondary-text"},r.secondaryText)))}export{d as default};
1
+ import{createElement as e,Fragment as t}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/index.js";import o from"../../../Img/Img.js";function a({filterable:t,toggleButtonRef:n,...o}){if(t){const{id:t,...a}=o;return e("div",{...a,ref:n})}return e("button",{id:o.id,"aria-describedby":o.ariaDescribedBy,type:"button",...o,ref:n})}function d(d){const{active:c,selected:r,inputText:i,readonly:l,showList:s}=d,u=r.selectedOptionName||r.name||d.placeholder||"",_=s?i:u,p=l?null:d.filterable?e=>{e.preventDefault(),document.activeElement===d.filterInputRef.current?d.showList||d.toggleList(e):d.filterInputRef.current&&d.filterInputRef.current.focus()}:d.toggleList,f=l?null:d.onFocus,b=c.id?`listItem-${c.id}`:"";return e(a,{className:n({"adyen-checkout__dropdown__button":!0,"adyen-checkout__dropdown__button--readonly":l,"adyen-checkout__dropdown__button--active":s,"adyen-checkout__dropdown__button--invalid":d.isInvalid,"adyen-checkout__dropdown__button--valid":d.isValid,"adyen-checkout__dropdown__button--disabled":r.disabled}),disabled:d.disabled,filterable:d.filterable,onClick:p,onKeyDown:l?null:d.onButtonKeyDown,toggleButtonRef:d.toggleButtonRef,...d.allowIdOnButton&&d.id&&{id:d.id}},d.filterable?e(t,null,!s&&r.icon&&e(o,{className:"adyen-checkout__dropdown__button__icon",src:r.icon,alt:r.name}),e("input",{value:_,"aria-autocomplete":"list","aria-controls":d.selectListId,"aria-expanded":s,"aria-owns":d.selectListId,autoComplete:"off",className:"adyen-checkout__filter-input",onInput:d.onInput,onFocus:f,ref:d.filterInputRef,role:"combobox","aria-activedescendant":b,type:"text",readOnly:d.readonly,id:d.id,"aria-describedby":d.ariaDescribedBy}),!s&&r.secondaryText&&e("span",{className:"adyen-checkout__dropdown__button__secondary-text"},r.secondaryText)):e(t,null,r.icon&&e(o,{className:"adyen-checkout__dropdown__button__icon",src:r.icon,alt:r.name}),e("span",{className:"adyen-checkout__dropdown__button__text"},u),r.secondaryText&&e("span",{className:"adyen-checkout__dropdown__button__secondary-text"},r.secondaryText)))}export{d as default};
2
2
  //# sourceMappingURL=SelectButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectButton.js","sources":["../../../../../../../src/components/internal/FormFields/Select/components/SelectButton.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport cx from 'classnames';\nimport { SelectButtonProps } from '../types';\nimport Img from '../../../Img';\n\nfunction SelectButtonElement({ filterable, toggleButtonRef, ...props }) {\n if (filterable) return <div {...props} ref={toggleButtonRef} />;\n\n return <button id={props.id} aria-describedby={props.ariaDescribedBy} type={'button'} {...props} ref={toggleButtonRef} />;\n}\n\nfunction SelectButton(props: Readonly<SelectButtonProps>) {\n const { active, selected, inputText, readonly, showList } = props;\n\n // display fallback order\n const displayText = selected.selectedOptionName || selected.name || props.placeholder || '';\n // displayInputText only used for the text input for the filter\n // display the \"typed\" filter text when showing the dropdown,\n // hide it and show the \"selected\" value when collapsed\n const displayInputText = showList ? inputText : displayText;\n\n const setFocus = (e: Event) => {\n e.preventDefault();\n if (document.activeElement === props.filterInputRef.current) {\n if (!props.showList) {\n props.toggleList(e);\n }\n } else if (props.filterInputRef.current) props.filterInputRef.current.focus();\n };\n\n // 1. If readonly we ignore the click action\n // 2. If filterable we want to show the list and focus on the input\n // 3. Otherwise we just toggle the list\n const onClickHandler = readonly ? null : props.filterable ? setFocus : props.toggleList;\n\n const onFocusHandler = readonly ? null : props.onFocus;\n\n // check COWEB-1301 [Investigate] Drop-in Accessibility - ADA Compliance questions\n const currentSelectedItemId = active.id ? `listItem-${active.id}` : '';\n\n return (\n <SelectButtonElement\n className={cx({\n 'adyen-checkout__dropdown__button': true,\n 'adyen-checkout__dropdown__button--readonly': readonly,\n 'adyen-checkout__dropdown__button--active': showList,\n 'adyen-checkout__dropdown__button--invalid': props.isInvalid,\n 'adyen-checkout__dropdown__button--valid': props.isValid,\n 'adyen-checkout__dropdown__button--disabled': selected.disabled\n })}\n disabled={props.disabled}\n filterable={props.filterable}\n onClick={onClickHandler}\n onKeyDown={!readonly ? props.onButtonKeyDown : null}\n toggleButtonRef={props.toggleButtonRef}\n >\n {!props.filterable ? (\n <Fragment>\n {selected.icon && <Img className=\"adyen-checkout__dropdown__button__icon\" src={selected.icon} alt={selected.name} />}\n <span className=\"adyen-checkout__dropdown__button__text\">{displayText}</span>\n {selected.secondaryText && <span className=\"adyen-checkout__dropdown__button__secondary-text\">{selected.secondaryText}</span>}\n </Fragment>\n ) : (\n <Fragment>\n {!showList && selected.icon && <Img className=\"adyen-checkout__dropdown__button__icon\" src={selected.icon} alt={selected.name} />}\n <input\n value={displayInputText}\n aria-autocomplete=\"list\"\n aria-controls={props.selectListId}\n aria-expanded={showList}\n aria-owns={props.selectListId}\n autoComplete=\"off\"\n className=\"adyen-checkout__filter-input\"\n onInput={props.onInput}\n onFocus={onFocusHandler}\n ref={props.filterInputRef}\n role=\"combobox\"\n aria-activedescendant={currentSelectedItemId}\n type=\"text\"\n readOnly={props.readonly}\n id={props.id}\n aria-describedby={props.ariaDescribedBy}\n />\n {!showList && selected.secondaryText && (\n <span className=\"adyen-checkout__dropdown__button__secondary-text\">{selected.secondaryText}</span>\n )}\n </Fragment>\n )}\n </SelectButtonElement>\n );\n}\n\nexport default SelectButton;\n"],"names":["SelectButtonElement","filterable","toggleButtonRef","props","h","div","ref","button","id","aria-describedby","ariaDescribedBy","type","SelectButton","active","selected","inputText","readonly","showList","displayText","selectedOptionName","name","placeholder","displayInputText","onClickHandler","e","preventDefault","document","activeElement","filterInputRef","current","toggleList","focus","onFocusHandler","onFocus","currentSelectedItemId","className","cx","isInvalid","isValid","disabled","onClick","onKeyDown","onButtonKeyDown","Fragment","icon","Img","src","alt","input","value","aria-autocomplete","aria-controls","selectListId","aria-expanded","aria-owns","autoComplete","onInput","role","aria-activedescendant","readOnly","secondaryText","span"],"mappings":"0LAKA,SAASA,GAAoBC,WAAEA,EAAUC,gBAAEA,KAAoBC,IAC3D,OAAIF,EAAmBG,EAACC,MAAAA,IAAQF,EAAOG,IAAKJ,IAErCE,EAACG,SAAAA,CAAOC,GAAIL,EAAMK,GAAIC,mBAAkBN,EAAMO,gBAAiBC,KAAM,YAAcR,EAAOG,IAAKJ,GAC1G,CAEA,SAASU,EAAaT,GAClB,MAAMU,OAAEA,EAAMC,SAAEA,EAAQC,UAAEA,EAASC,SAAEA,EAAQC,SAAEA,GAAad,EAGtDe,EAAcJ,EAASK,oBAAsBL,EAASM,MAAQjB,EAAMkB,aAAe,GAInFC,EAAmBL,EAAWF,EAAYG,EAc1CK,EAAiBP,EAAW,KAAOb,EAAMF,WAZ7BuB,IACdA,EAAEC,iBACEC,SAASC,gBAAkBxB,EAAMyB,eAAeC,QAC3C1B,EAAMc,UACPd,EAAM2B,WAAWN,GAEdrB,EAAMyB,eAAeC,SAAS1B,EAAMyB,eAAeC,QAAQE,OAAK,EAMR5B,EAAM2B,WAEvEE,EAAiBhB,EAAW,KAAOb,EAAM8B,QAGzCC,EAAwBrB,EAAOL,GAAK,YAAYK,EAAOL,KAAO,GAEpE,OACIJ,EAACJ,EAAAA,CACGmC,UAAWC,EAAG,CACV,oCAAoC,EACpC,6CAA8CpB,EAC9C,2CAA4CC,EAC5C,4CAA6Cd,EAAMkC,UACnD,0CAA2ClC,EAAMmC,QACjD,6CAA8CxB,EAASyB,WAE3DA,SAAUpC,EAAMoC,SAChBtC,WAAYE,EAAMF,WAClBuC,QAASjB,EACTkB,UAAYzB,EAAmC,KAAxBb,EAAMuC,gBAC7BxC,gBAAiBC,EAAMD,iBAErBC,EAAMF,WAOJG,EAACuC,EAAAA,MACK1B,GAAYH,EAAS8B,MAAQxC,EAACyC,EAAAA,CAAIV,UAAU,yCAAyCW,IAAKhC,EAAS8B,KAAMG,IAAKjC,EAASM,OACzHhB,EAAC4C,QAAAA,CACGC,MAAO3B,EACP4B,oBAAkB,OAClBC,gBAAehD,EAAMiD,aACrBC,gBAAepC,EACfqC,YAAWnD,EAAMiD,aACjBG,aAAa,MACbpB,UAAU,+BACVqB,QAASrD,EAAMqD,QACfvB,QAASD,EACT1B,IAAKH,EAAMyB,eACX6B,KAAK,WACLC,wBAAuBxB,EACvBvB,KAAK,OACLgD,SAAUxD,EAAMa,SAChBR,GAAIL,EAAMK,GACVC,mBAAkBN,EAAMO,mBAE1BO,GAAYH,EAAS8C,eACnBxD,EAACyD,OAAAA,CAAK1B,UAAU,oDAAoDrB,EAAS8C,gBA3BrFxD,EAACuC,OACI7B,EAAS8B,MAAQxC,EAACyC,EAAAA,CAAIV,UAAU,yCAAyCW,IAAKhC,EAAS8B,KAAMG,IAAKjC,EAASM,OAC5GhB,EAACyD,OAAAA,CAAK1B,UAAU,0CAA0CjB,GACzDJ,EAAS8C,eAAiBxD,EAACyD,OAAAA,CAAK1B,UAAU,oDAAoDrB,EAAS8C,gBA8B5H"}
1
+ {"version":3,"file":"SelectButton.js","sources":["../../../../../../../src/components/internal/FormFields/Select/components/SelectButton.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport cx from 'classnames';\nimport { SelectButtonProps } from '../types';\nimport Img from '../../../Img';\n\nfunction SelectButtonElement({ filterable, toggleButtonRef, ...props }) {\n if (filterable) {\n // Even if passed, we can't add an id to this div since it is not allowed to associate a div with a label element\n const { id, ...strippedProps } = props;\n return <div {...strippedProps} ref={toggleButtonRef} />;\n }\n\n return <button id={props.id} aria-describedby={props.ariaDescribedBy} type={'button'} {...props} ref={toggleButtonRef} />;\n}\n\nfunction SelectButton(props: Readonly<SelectButtonProps>) {\n const { active, selected, inputText, readonly, showList } = props;\n\n // display fallback order\n const displayText = selected.selectedOptionName || selected.name || props.placeholder || '';\n // displayInputText only used for the text input for the filter\n // display the \"typed\" filter text when showing the dropdown,\n // hide it and show the \"selected\" value when collapsed\n const displayInputText = showList ? inputText : displayText;\n\n const setFocus = (e: Event) => {\n e.preventDefault();\n if (document.activeElement === props.filterInputRef.current) {\n if (!props.showList) {\n props.toggleList(e);\n }\n } else if (props.filterInputRef.current) props.filterInputRef.current.focus();\n };\n\n // 1. If readonly we ignore the click action\n // 2. If filterable we want to show the list and focus on the input\n // 3. Otherwise we just toggle the list\n const onClickHandler = readonly ? null : props.filterable ? setFocus : props.toggleList;\n\n const onFocusHandler = readonly ? null : props.onFocus;\n\n // check COWEB-1301 [Investigate] Drop-in Accessibility - ADA Compliance questions\n const currentSelectedItemId = active.id ? `listItem-${active.id}` : '';\n\n return (\n <SelectButtonElement\n className={cx({\n 'adyen-checkout__dropdown__button': true,\n 'adyen-checkout__dropdown__button--readonly': readonly,\n 'adyen-checkout__dropdown__button--active': showList,\n 'adyen-checkout__dropdown__button--invalid': props.isInvalid,\n 'adyen-checkout__dropdown__button--valid': props.isValid,\n 'adyen-checkout__dropdown__button--disabled': selected.disabled\n })}\n disabled={props.disabled}\n filterable={props.filterable}\n onClick={onClickHandler}\n onKeyDown={!readonly ? props.onButtonKeyDown : null}\n toggleButtonRef={props.toggleButtonRef}\n // Only for some dropdowns e.g. the one found in installments when it is just in the form of a single dropdown, do we want to add an id that links to a label's for attr\n // If we allow an id to be added to the buttons in CtPCardsList, for example, unit tests start failing because it seems a button with an id no longer has a name property that can be used\n // as a qualifier in findByRole\n {...(props.allowIdOnButton && props.id && { id: props.id })}\n >\n {!props.filterable ? (\n <Fragment>\n {selected.icon && <Img className=\"adyen-checkout__dropdown__button__icon\" src={selected.icon} alt={selected.name} />}\n <span className=\"adyen-checkout__dropdown__button__text\">{displayText}</span>\n {selected.secondaryText && <span className=\"adyen-checkout__dropdown__button__secondary-text\">{selected.secondaryText}</span>}\n </Fragment>\n ) : (\n <Fragment>\n {!showList && selected.icon && <Img className=\"adyen-checkout__dropdown__button__icon\" src={selected.icon} alt={selected.name} />}\n <input\n value={displayInputText}\n aria-autocomplete=\"list\"\n aria-controls={props.selectListId}\n aria-expanded={showList}\n aria-owns={props.selectListId}\n autoComplete=\"off\"\n className=\"adyen-checkout__filter-input\"\n onInput={props.onInput}\n onFocus={onFocusHandler}\n ref={props.filterInputRef}\n role=\"combobox\"\n aria-activedescendant={currentSelectedItemId}\n type=\"text\"\n readOnly={props.readonly}\n id={props.id}\n aria-describedby={props.ariaDescribedBy}\n />\n {!showList && selected.secondaryText && (\n <span className=\"adyen-checkout__dropdown__button__secondary-text\">{selected.secondaryText}</span>\n )}\n </Fragment>\n )}\n </SelectButtonElement>\n );\n}\n\nexport default SelectButton;\n"],"names":["SelectButtonElement","filterable","toggleButtonRef","props","id","strippedProps","h","div","ref","button","aria-describedby","ariaDescribedBy","type","SelectButton","active","selected","inputText","readonly","showList","displayText","selectedOptionName","name","placeholder","displayInputText","onClickHandler","e","preventDefault","document","activeElement","filterInputRef","current","toggleList","focus","onFocusHandler","onFocus","currentSelectedItemId","className","cx","isInvalid","isValid","disabled","onClick","onKeyDown","onButtonKeyDown","allowIdOnButton","Fragment","icon","Img","src","alt","input","value","aria-autocomplete","aria-controls","selectListId","aria-expanded","aria-owns","autoComplete","onInput","role","aria-activedescendant","readOnly","secondaryText","span"],"mappings":"0LAKA,SAASA,GAAoBC,WAAEA,EAAUC,gBAAEA,KAAoBC,IAC3D,GAAIF,EAAY,CAEZ,MAAMG,GAAEA,KAAOC,GAAkBF,EACjC,OAAOG,EAACC,MAAAA,IAAQF,EAAeG,IAAKN,GACxC,CAEA,OAAOI,EAACG,SAAAA,CAAOL,GAAID,EAAMC,GAAIM,mBAAkBP,EAAMQ,gBAAiBC,KAAM,YAAcT,EAAOK,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ACX8B,KAAK,WACLC,wBAAuBzB,EACvBvB,KAAK,OACLiD,SAAU1D,EAAMc,SAChBb,GAAID,EAAMC,GACVM,mBAAkBP,EAAMQ,mBAE1BO,GAAYH,EAAS+C,eACnBxD,EAACyD,OAAAA,CAAK3B,UAAU,oDAAoDrB,EAAS+C,gBA3BrFxD,EAACuC,OACI9B,EAAS+B,MAAQxC,EAACyC,EAAAA,CAAIX,UAAU,yCAAyCY,IAAKjC,EAAS+B,KAAMG,IAAKlC,EAASM,OAC5Gf,EAACyD,OAAAA,CAAK3B,UAAU,0CAA0CjB,GACzDJ,EAAS+C,eAAiBxD,EAACyD,OAAAA,CAAK3B,UAAU,oDAAoDrB,EAAS+C,gBA8B5H"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectList.js","sources":["../../../../../../../src/components/internal/FormFields/Select/components/SelectList.tsx"],"sourcesContent":["import { h } from 'preact';\nimport cx from 'classnames';\nimport SelectListItem from './SelectListItem';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { SelectListProps } from '../types';\n\nfunction SelectList({ selected, active, filteredItems, showList, ...props }: SelectListProps) {\n const { i18n } = useCoreContext();\n\n return (\n <ul\n className={cx({\n 'adyen-checkout__dropdown__list': true,\n 'adyen-checkout__dropdown__list--active': showList\n })}\n id={props.selectListId}\n ref={props.selectListRef}\n role=\"listbox\"\n >\n {filteredItems.length ? (\n filteredItems.map(item => (\n <SelectListItem\n active={item.id === active.id}\n item={item}\n key={item.id}\n onSelect={props.onSelect}\n onHover={props.onHover}\n selected={item.id === selected.id}\n />\n ))\n ) : (\n <div className=\"adyen-checkout__dropdown__element adyen-checkout__dropdown__element--no-options\">\n {i18n.get('select.noOptionsFound')}\n </div>\n )}\n </ul>\n );\n}\n\nexport default SelectList;\n"],"names":["SelectList","selected","active","filteredItems","showList","props","i18n","useCoreContext","h","ul","className","cx","id","selectListId","ref","selectListRef","role","length","map","item","SelectListItem","key","onSelect","onHover","div","get"],"mappings":"yPAMA,SAASA,GAAWC,SAAEA,EAAQC,OAAEA,EAAMC,cAAEA,EAAaC,SAAEA,KAAaC,IAChE,MAAMC,KAAEA,GAASC,IAEjB,OACIC,EAACC,KAAAA,CACGC,UAAWC,EAAG,CACV,kCAAkC,EAClC,yCAA0CP,IAE9CQ,GAAIP,EAAMQ,aACVC,IAAKT,EAAMU,cACXC,KAAK,WAEJb,EAAcc,OACXd,EAAce,KAAIC,GACdX,EAACY,EAAAA,CACGlB,OAAQiB,EAAKP,KAAOV,EAAOU,GAC3BO,KAAMA,EACNE,IAAKF,EAAKP,GACVU,SAAUjB,EAAMiB,SAChBC,QAASlB,EAAMkB,QACftB,SAAUkB,EAAKP,KAAOX,EAASW,OAIvCJ,EAACgB,MAAAA,CAAId,UAAU,mFACVJ,EAAKmB,IAAI,0BAK9B"}
1
+ {"version":3,"file":"SelectList.js","sources":["../../../../../../../src/components/internal/FormFields/Select/components/SelectList.tsx"],"sourcesContent":["import { h } from 'preact';\nimport cx from 'classnames';\nimport SelectListItem from './SelectListItem';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { SelectListProps } from '../types';\n\nfunction SelectList({ selected, active, filteredItems, showList, ...props }: SelectListProps) {\n const { i18n } = useCoreContext();\n\n return (\n /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n <ul\n className={cx({\n 'adyen-checkout__dropdown__list': true,\n 'adyen-checkout__dropdown__list--active': showList\n })}\n id={props.selectListId}\n ref={props.selectListRef}\n role=\"listbox\"\n >\n {filteredItems.length ? (\n filteredItems.map(item => (\n <SelectListItem\n active={item.id === active.id}\n item={item}\n key={item.id}\n onSelect={props.onSelect}\n onHover={props.onHover}\n selected={item.id === selected.id}\n />\n ))\n ) : (\n <div className=\"adyen-checkout__dropdown__element adyen-checkout__dropdown__element--no-options\">\n {i18n.get('select.noOptionsFound')}\n </div>\n )}\n </ul>\n );\n}\n\nexport default SelectList;\n"],"names":["SelectList","selected","active","filteredItems","showList","props","i18n","useCoreContext","h","ul","className","cx","id","selectListId","ref","selectListRef","role","length","map","item","SelectListItem","key","onSelect","onHover","div","get"],"mappings":"yPAMA,SAASA,GAAWC,SAAEA,EAAQC,OAAEA,EAAMC,cAAEA,EAAaC,SAAEA,KAAaC,IAChE,MAAMC,KAAEA,GAASC,IAEjB,OAEIC,EAACC,KAAAA,CACGC,UAAWC,EAAG,CACV,kCAAkC,EAClC,yCAA0CP,IAE9CQ,GAAIP,EAAMQ,aACVC,IAAKT,EAAMU,cACXC,KAAK,WAEJb,EAAcc,OACXd,EAAce,KAAIC,GACdX,EAACY,EAAAA,CACGlB,OAAQiB,EAAKP,KAAOV,EAAOU,GAC3BO,KAAMA,EACNE,IAAKF,EAAKP,GACVU,SAAUjB,EAAMiB,SAChBC,QAASlB,EAAMkB,QACftB,SAAUkB,EAAKP,KAAOX,EAASW,OAIvCJ,EAACgB,MAAAA,CAAId,UAAU,mFACVJ,EAAKmB,IAAI,0BAK9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectListItem.js","sources":["../../../../../../../src/components/internal/FormFields/Select/components/SelectListItem.tsx"],"sourcesContent":["import { h } from 'preact';\nimport cx from 'classnames';\nimport { SelectItemProps } from '../types';\nimport Img from '../../../Img';\nimport Icon from '../../../Icon';\nimport { PREFIX } from '../../../Icon/constants';\n\nconst SelectListItem = ({ item, active, selected, ...props }: SelectItemProps) => {\n return (\n <li\n aria-disabled={!!item.disabled}\n aria-selected={selected}\n className={cx([\n 'adyen-checkout__dropdown__element',\n {\n 'adyen-checkout__dropdown__element--active': active,\n 'adyen-checkout__dropdown__element--disabled': !!item.disabled\n }\n ])}\n // A change in Preact v10.11.1 means that all falsy values are assessed and set on data attributes.\n // In the case of data-disabled we only ever want it set if item.disabled is actually true, since the presence of the data-disabled attr,\n // regardless of its value, will disable the select list item\n data-disabled={item.disabled === true ? true : null}\n data-value={item.id}\n onClick={props.onSelect}\n onMouseEnter={props.onHover}\n role=\"option\"\n //tabIndex={-1}\n id={`listItem-${item.id}`}\n >\n {item.icon && <Img className=\"adyen-checkout__dropdown__element__icon\" alt={item.name} src={item.icon} />}\n <span className=\"adyen-checkout__dropdown__element__text\">{item.name}</span>\n {item.secondaryText && <span className=\"adyen-checkout__dropdown__element__secondary-text\">{item.secondaryText}</span>}\n {selected && <Icon type={`${PREFIX}checkmark`} height={14} width={14} />}\n </li>\n );\n};\n\nexport default SelectListItem;\n"],"names":["SelectListItem","item","active","selected","props","h","li","aria-disabled","disabled","aria-selected","className","cx","data-disabled","data-value","id","onClick","onSelect","onMouseEnter","onHover","role","icon","Img","alt","name","src","span","secondaryText","Icon","type","PREFIX","height","width"],"mappings":"qQAOMA,MAAAA,EAAiB,EAAGC,OAAMC,SAAQC,cAAaC,KAE7CC,EAACC,KAAAA,CACGC,kBAAiBN,EAAKO,SACtBC,gBAAeN,EACfO,UAAWC,EAAG,CACV,oCACA,CACI,4CAA6CT,EAC7C,gDAAiDD,EAAKO,YAM9DI,iBAAiC,IAAlBX,EAAKO,UAA2B,KAC/CK,aAAYZ,EAAKa,GACjBC,QAASX,EAAMY,SACfC,aAAcb,EAAMc,QACpBC,KAAK,SAELL,GAAI,YAAYb,EAAKa,MAEpBb,EAAKmB,MAAQf,EAACgB,EAAAA,CAAIX,UAAU,0CAA0CY,IAAKrB,EAAKsB,KAAMC,IAAKvB,EAAKmB,OACjGf,EAACoB,OAAAA,CAAKf,UAAU,2CAA2CT,EAAKsB,MAC/DtB,EAAKyB,eAAiBrB,EAACoB,OAAAA,CAAKf,UAAU,qDAAqDT,EAAKyB,eAChGvB,GAAYE,EAACsB,EAAAA,CAAKC,KAAM,GAAGC,aAAmBC,OAAQ,GAAIC,MAAO"}
1
+ {"version":3,"file":"SelectListItem.js","sources":["../../../../../../../src/components/internal/FormFields/Select/components/SelectListItem.tsx"],"sourcesContent":["import { h } from 'preact';\nimport cx from 'classnames';\nimport { SelectItemProps } from '../types';\nimport Img from '../../../Img';\nimport Icon from '../../../Icon';\nimport { PREFIX } from '../../../Icon/constants';\n\nconst SelectListItem = ({ item, active, selected, ...props }: SelectItemProps) => {\n return (\n /* eslint-disable jsx-a11y/click-events-have-key-events */\n <li\n aria-disabled={!!item.disabled}\n aria-selected={selected}\n className={cx([\n 'adyen-checkout__dropdown__element',\n {\n 'adyen-checkout__dropdown__element--active': active,\n 'adyen-checkout__dropdown__element--disabled': !!item.disabled\n }\n ])}\n // A change in Preact v10.11.1 means that all falsy values are assessed and set on data attributes.\n // In the case of data-disabled we only ever want it set if item.disabled is actually true, since the presence of the data-disabled attr,\n // regardless of its value, will disable the select list item\n data-disabled={item.disabled === true ? true : null}\n data-value={item.id}\n onClick={props.onSelect}\n onMouseEnter={props.onHover}\n /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role */\n role=\"option\"\n //tabIndex={-1}\n id={`listItem-${item.id}`}\n >\n {item.icon && <Img className=\"adyen-checkout__dropdown__element__icon\" alt={item.name} src={item.icon} />}\n <span className=\"adyen-checkout__dropdown__element__text\">{item.name}</span>\n {item.secondaryText && <span className=\"adyen-checkout__dropdown__element__secondary-text\">{item.secondaryText}</span>}\n {selected && <Icon type={`${PREFIX}checkmark`} height={14} width={14} />}\n </li>\n );\n};\n\nexport default SelectListItem;\n"],"names":["SelectListItem","item","active","selected","props","h","li","aria-disabled","disabled","aria-selected","className","cx","data-disabled","data-value","id","onClick","onSelect","onMouseEnter","onHover","role","icon","Img","alt","name","src","span","secondaryText","Icon","type","PREFIX","height","width"],"mappings":"qQAOMA,MAAAA,EAAiB,EAAGC,OAAMC,SAAQC,cAAaC,KAG7CC,EAACC,KAAAA,CACGC,kBAAiBN,EAAKO,SACtBC,gBAAeN,EACfO,UAAWC,EAAG,CACV,oCACA,CACI,4CAA6CT,EAC7C,gDAAiDD,EAAKO,YAM9DI,iBAAiC,IAAlBX,EAAKO,UAA2B,KAC/CK,aAAYZ,EAAKa,GACjBC,QAASX,EAAMY,SACfC,aAAcb,EAAMc,QAEpBC,KAAK,SAELL,GAAI,YAAYb,EAAKa,MAEpBb,EAAKmB,MAAQf,EAACgB,EAAAA,CAAIX,UAAU,0CAA0CY,IAAKrB,EAAKsB,KAAMC,IAAKvB,EAAKmB,OACjGf,EAACoB,OAAAA,CAAKf,UAAU,2CAA2CT,EAAKsB,MAC/DtB,EAAKyB,eAAiBrB,EAACoB,OAAAA,CAAKf,UAAU,qDAAqDT,EAAKyB,eAChGvB,GAAYE,EAACsB,EAAAA,CAAKC,KAAM,GAAGC,aAAmBC,OAAQ,GAAIC,MAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../../../src/components/internal/Modal/Modal.tsx"],"sourcesContent":["import { ComponentChildren, h } from 'preact';\nimport { useRef } from 'preact/hooks';\nimport cx from 'classnames';\nimport './Modal.scss';\nimport { useModal } from './useModal';\n\ntype ModalRenderFnProps = {\n /**\n * Function used to properly trigger the Modal close mechanism. It takes into account the element that the Modal needs\n * to set focus when it is dismissed.\n */\n onCloseModal(): void;\n};\n\ntype ModalProps = {\n children: ({ onCloseModal }: ModalRenderFnProps) => ComponentChildren;\n classNameModifiers?: string[];\n onClose(): void;\n isOpen: boolean;\n isDismissible?: boolean;\n labelledBy: string;\n describedBy: string;\n /**\n * Reference to the element that should be focused when the modal is opened\n */\n focusFirst: HTMLElement;\n /**\n * Reference to the element that should be focused when the modal is closed\n */\n focusAfterClose: HTMLElement;\n};\n\nconst Modal = ({\n children,\n classNameModifiers = [],\n isOpen,\n onClose,\n isDismissible = true,\n labelledBy,\n describedBy,\n focusFirst,\n focusAfterClose,\n ...props\n}: ModalProps) => {\n const modalContainerRef = useRef<HTMLDivElement>();\n const { closeModal, handleClickOutside } = useModal({\n modalElement: modalContainerRef.current,\n isOpen,\n isDismissible,\n focusFirst,\n focusAfterClose,\n onClose\n });\n\n return (\n <div\n className={cx(\n 'adyen-checkout__modal-wrapper',\n classNameModifiers.map(m => `adyen-checkout__modal-wrapper--${m}`),\n { 'adyen-checkout__modal-wrapper--open': isOpen }\n )}\n role=\"dialog\"\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n aria-modal=\"true\"\n aria-hidden={!isOpen}\n onClick={handleClickOutside}\n {...props}\n >\n <div className=\"adyen-checkout__modal\" ref={modalContainerRef}>\n {children({ onCloseModal: closeModal })}\n </div>\n </div>\n );\n};\n\nexport { Modal };\n"],"names":["Modal","children","classNameModifiers","isOpen","onClose","isDismissible","labelledBy","describedBy","focusFirst","focusAfterClose","props","modalContainerRef","useRef","closeModal","handleClickOutside","useModal","modalElement","current","h","div","className","cx","map","m","role","aria-labelledby","aria-describedby","aria-modal","aria-hidden","onClick","ref","onCloseModal"],"mappings":"4OAgCMA,MAAAA,EAAQ,EACVC,WACAC,qBAAqB,GACrBC,SACAC,UACAC,iBAAgB,EAChBC,aACAC,cACAC,aACAC,qBACGC,MAEH,MAAMC,EAAoBC,KACpBC,WAAEA,EAAUC,mBAAEA,GAAuBC,EAAS,CAChDC,aAAcL,EAAkBM,QAChCd,SACAE,gBACAG,aACAC,kBACAL,YAGJ,OACIc,EAACC,MAAAA,CACGC,UAAWC,EACP,gCACAnB,EAAmBoB,KAAIC,GAAK,kCAAkCA,MAC9D,CAAE,sCAAuCpB,IAE7CqB,KAAK,SACLC,kBAAiBnB,EACjBoB,mBAAkBnB,EAClBoB,aAAW,OACXC,eAAczB,EACd0B,QAASf,KACLJ,GAEJQ,EAACC,MAAAA,CAAIC,UAAU,wBAAwBU,IAAKnB,GACvCV,EAAS,CAAE8B,aAAclB,KAAW"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../../../src/components/internal/Modal/Modal.tsx"],"sourcesContent":["import { ComponentChildren, h } from 'preact';\nimport { useRef } from 'preact/hooks';\nimport cx from 'classnames';\nimport './Modal.scss';\nimport { useModal } from './useModal';\n\ntype ModalRenderFnProps = {\n /**\n * Function used to properly trigger the Modal close mechanism. It takes into account the element that the Modal needs\n * to set focus when it is dismissed.\n */\n onCloseModal(): void;\n};\n\ntype ModalProps = {\n children: ({ onCloseModal }: ModalRenderFnProps) => ComponentChildren;\n classNameModifiers?: string[];\n onClose(): void;\n isOpen: boolean;\n isDismissible?: boolean;\n labelledBy: string;\n describedBy: string;\n /**\n * Reference to the element that should be focused when the modal is opened\n */\n focusFirst: HTMLElement;\n /**\n * Reference to the element that should be focused when the modal is closed\n */\n focusAfterClose: HTMLElement;\n};\n\nconst Modal = ({\n children,\n classNameModifiers = [],\n isOpen,\n onClose,\n isDismissible = true,\n labelledBy,\n describedBy,\n focusFirst,\n focusAfterClose,\n ...props\n}: ModalProps) => {\n const modalContainerRef = useRef<HTMLDivElement>();\n const { closeModal, handleClickOutside } = useModal({\n modalElement: modalContainerRef.current,\n isOpen,\n isDismissible,\n focusFirst,\n focusAfterClose,\n onClose\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions\n <div\n className={cx(\n 'adyen-checkout__modal-wrapper',\n classNameModifiers.map(m => `adyen-checkout__modal-wrapper--${m}`),\n { 'adyen-checkout__modal-wrapper--open': isOpen }\n )}\n role=\"dialog\"\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n aria-modal=\"true\"\n aria-hidden={!isOpen}\n onClick={handleClickOutside}\n {...props}\n >\n <div className=\"adyen-checkout__modal\" ref={modalContainerRef}>\n {children({ onCloseModal: closeModal })}\n </div>\n </div>\n );\n};\n\nexport { Modal };\n"],"names":["Modal","children","classNameModifiers","isOpen","onClose","isDismissible","labelledBy","describedBy","focusFirst","focusAfterClose","props","modalContainerRef","useRef","closeModal","handleClickOutside","useModal","modalElement","current","h","div","className","cx","map","m","role","aria-labelledby","aria-describedby","aria-modal","aria-hidden","onClick","ref","onCloseModal"],"mappings":"4OAgCMA,MAAAA,EAAQ,EACVC,WACAC,qBAAqB,GACrBC,SACAC,UACAC,iBAAgB,EAChBC,aACAC,cACAC,aACAC,qBACGC,MAEH,MAAMC,EAAoBC,KACpBC,WAAEA,EAAUC,mBAAEA,GAAuBC,EAAS,CAChDC,aAAcL,EAAkBM,QAChCd,SACAE,gBACAG,aACAC,kBACAL,YAGJ,OAEIc,EAACC,MAAAA,CACGC,UAAWC,EACP,gCACAnB,EAAmBoB,KAAIC,GAAK,kCAAkCA,MAC9D,CAAE,sCAAuCpB,IAE7CqB,KAAK,SACLC,kBAAiBnB,EACjBoB,mBAAkBnB,EAClBoB,aAAW,OACXC,eAAczB,EACd0B,QAASf,KACLJ,GAEJQ,EAACC,MAAAA,CAAIC,UAAU,wBAAwBU,IAAKnB,GACvCV,EAAS,CAAE8B,aAAclB,KAAW"}
@@ -1,2 +1,2 @@
1
- import{Component as t,createElement as e}from"../../../external/preact/dist/preact.js";import o from"../Countdown/index.js";import r from"../Button/Button.js";import s from"../Spinner/Spinner.js";import a from"../../../core/Services/payment-status.js";import{processResponse as n}from"../../../core/ProcessResponse/process-response.js";import{copyToClipboard as i}from"../../../utils/clipboard.js";import c from"../../../core/Errors/AdyenCheckoutError.js";import{useCoreContext as p}from"../../../core/Context/CoreProvider.js";import d from"../ContentSeparator/ContentSeparator.js";import l from"../../../core/Context/useImage.js";import{useA11yReporter as m}from"../../../core/Errors/useA11yReporter.js";import u from"../../../utils/useAutoFocus.js";import{ANALYTICS_DOWNLOAD_STR as h,ANALYTICS_QR_CODE_DOWNLOAD as _}from"../../../core/Analytics/constants.js";import{PREFIX as y}from"../Icon/constants.js";class g extends t{timeoutId;constructor(t){super(t),this.state={buttonStatus:"default",completed:!1,delay:t.delay,expired:!1,loading:!0,percentage:100,timePassed:0}}static defaultProps={delay:2e3,countdownTime:15,onError:()=>{},onComplete:()=>{},throttleTime:6e4,classNameModifiers:[],throttledInterval:1e4,introduction:"wechatpay.scanqrcode",timeToPay:"wechatpay.timetopay",buttonLabel:"openApp"};componentDidMount(){this.statusInterval()}componentWillUnmount(){clearTimeout(this.timeoutId)}redirectToApp=t=>{window.location.assign(t)};statusInterval=(t=0)=>{if(this.state.expired||this.state.completed)return;this.setState((e=>({timePassed:e.timePassed+this.props.delay+t})));const e=this.state.timePassed>=this.props.throttleTime?this.props.throttledInterval:this.state.delay;this.pollStatus(e)};pollStatus(t){clearTimeout(this.timeoutId),this.timeoutId=setTimeout((async()=>{const t=performance.now();await this.checkStatus();const e=performance.now();this.statusInterval(Math.round(e-t))}),t)}onTick=t=>{this.setState({percentage:t.percentage})};onTimeUp=()=>{this.setState({expired:!0}),clearTimeout(this.timeoutId),this.props.onError(new c("ERROR","Payment Expired"))};onComplete=t=>{clearTimeout(this.timeoutId),this.setState({completed:!0,loading:!1});const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)};onError=t=>{if(clearTimeout(this.timeoutId),this.setState({expired:!0,loading:!1}),t.props.payload){const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)}const e=new c("ERROR","error result with no payload in response");return this.props.onError(e)};checkStatus=()=>{const{paymentData:t,clientKey:e,loadingContext:o,throttledInterval:r}=this.props;return a(t,e,o,r).then(n).catch((t=>({type:"network-error",props:t}))).then((t=>{switch(t.type){case"success":this.onComplete(t);break;case"error":this.onError(t);break;default:this.setState({loading:!1})}return t}))};render({amount:t,url:a,brandLogo:n,brandName:c,countdownTime:g,type:k,onActionHandled:f},{expired:q,completed:b,loading:C}){const{i18n:v,loadingContext:T}=p(),N=l(),w=this.props.qrCodeData?`${T}barcode.shtml?barcodeType=qrCode&fileType=png&data=${this.props.qrCodeData}`:this.props.qrCodeImage,I=(t,o)=>{const r=v.get(o);return m(r),e("div",{className:"adyen-checkout__qr-loader adyen-checkout__qr-loader--result"},e("img",{className:"adyen-checkout__qr-loader__icon adyen-checkout__qr-loader__icon--result",src:N({imageFolder:"components/"})(t),alt:r}),e("div",{className:"adyen-checkout__qr-loader__subtitle adyen-checkout__qr-loader__subtitle--result"},r))};if(q)return I("error","error.subtitle.payment");if(b)return I("success","creditCard.success");if(C)return e("div",{className:"adyen-checkout__qr-loader"},n&&e("img",{alt:c,src:n,className:"adyen-checkout__qr-loader__brand-logo"}),e(s,null));const S=v.get(this.props.timeToPay).split("%@"),j=u();return e("div",{className:`\n adyen-checkout__qr-loader\n adyen-checkout__qr-loader--${k}\n ${this.props.classNameModifiers.map((t=>`adyen-checkout__qr-loader--${t}`))}\n `},n&&e("img",{src:n,alt:c,className:"adyen-checkout__qr-loader__brand-logo"}),t&&t.value&&t.currency&&e("div",{className:"adyen-checkout__qr-loader__payment_amount"},v.amount(t.value,t.currency)),a&&e("div",{className:"adyen-checkout__qr-loader__app-link"},this.props.redirectIntroduction&&e("div",{className:"adyen-checkout__qr-loader__subtitle"},v.get(this.props.redirectIntroduction)),e(r,{classNameModifiers:["qr-loader"],onClick:()=>this.redirectToApp(a),label:v.get(this.props.buttonLabel)}),e(d,null)),e("div",{ref:j,tabIndex:0,className:"adyen-checkout__qr-loader__subtitle"},v.get(this.props.introduction)),e("img",{src:w,alt:v.get("wechatpay.scanqrcode"),onLoad:()=>{f?.({componentType:this.props.type,actionDescription:"qr-code-loaded"})}}),e("div",{className:"adyen-checkout__qr-loader__progress"},e("span",{className:"adyen-checkout__qr-loader__percentage",style:{width:`${this.state.percentage}%`}})),e("div",{className:"adyen-checkout__qr-loader__countdown"},S[0]," ",e(o,{minutesFromNow:g,onTick:this.onTick,onCompleted:this.onTimeUp})," ",S[1]),"string"==typeof this.props.instructions?e("div",{className:"adyen-checkout__qr-loader__instructions"},v.get(this.props.instructions)):this.props.instructions?.(),this.props.copyBtn&&e("div",{className:"adyen-checkout__qr-loader__actions"},e(r,{inline:!0,variant:"action",onClick:(t,{complete:e})=>{i(this.props.qrCodeData),this.props.onSubmitAnalytics({type:h,target:_}),e()},icon:N({imageFolder:"components/"})(`${y}copy`),label:v.get("button.copy")})))}}export{g as default};
1
+ import{Component as t,createElement as e}from"../../../external/preact/dist/preact.js";import o from"../Countdown/index.js";import r from"../Button/Button.js";import s from"../Spinner/Spinner.js";import a from"../../../core/Services/payment-status.js";import{processResponse as n}from"../../../core/ProcessResponse/process-response.js";import{copyToClipboard as i}from"../../../utils/clipboard.js";import c from"../../../core/Errors/AdyenCheckoutError.js";import{useCoreContext as p}from"../../../core/Context/CoreProvider.js";import d from"../ContentSeparator/ContentSeparator.js";import l from"../../../core/Context/useImage.js";import{useA11yReporter as m}from"../../../core/Errors/useA11yReporter.js";import u from"../../../utils/useAutoFocus.js";import{ANALYTICS_DOWNLOAD_STR as h,ANALYTICS_QR_CODE_DOWNLOAD as _}from"../../../core/Analytics/constants.js";import{PREFIX as y}from"../Icon/constants.js";class g extends t{timeoutId;constructor(t){super(t),this.state={buttonStatus:"default",completed:!1,delay:t.delay,expired:!1,loading:!0,percentage:100,timePassed:0}}static defaultProps={delay:2e3,countdownTime:15,onError:()=>{},onComplete:()=>{},throttleTime:6e4,classNameModifiers:[],throttledInterval:1e4,introduction:"wechatpay.scanqrcode",timeToPay:"wechatpay.timetopay",buttonLabel:"openApp"};componentDidMount(){this.statusInterval()}componentWillUnmount(){clearTimeout(this.timeoutId)}redirectToApp=t=>{window.location.assign(t)};statusInterval=(t=0)=>{if(this.state.expired||this.state.completed)return;this.setState((e=>({timePassed:e.timePassed+this.props.delay+t})));const e=this.state.timePassed>=this.props.throttleTime?this.props.throttledInterval:this.state.delay;this.pollStatus(e)};pollStatus(t){clearTimeout(this.timeoutId),this.timeoutId=setTimeout((async()=>{const t=performance.now();await this.checkStatus();const e=performance.now();this.statusInterval(Math.round(e-t))}),t)}onTick=t=>{this.setState({percentage:t.percentage})};onTimeUp=()=>{this.setState({expired:!0}),clearTimeout(this.timeoutId),this.props.onError(new c("ERROR","Payment Expired"))};onComplete=t=>{clearTimeout(this.timeoutId),this.setState({completed:!0,loading:!1});const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)};onError=t=>{if(clearTimeout(this.timeoutId),this.setState({expired:!0,loading:!1}),t.props.payload){const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)}const e=new c("ERROR","error result with no payload in response");return this.props.onError(e)};checkStatus=()=>{const{paymentData:t,clientKey:e,loadingContext:o,throttledInterval:r}=this.props;return a(t,e,o,r).then(n).catch((t=>({type:"network-error",props:t}))).then((t=>{switch(t.type){case"success":this.onComplete(t);break;case"error":this.onError(t);break;default:this.setState({loading:!1})}return t}))};render({amount:t,url:a,brandLogo:n,brandName:c,countdownTime:g,type:k,onActionHandled:f},{expired:q,completed:b,loading:C}){const{i18n:v,loadingContext:T}=p(),N=l(),w=this.props.qrCodeData?`${T}barcode.shtml?barcodeType=qrCode&fileType=png&data=${this.props.qrCodeData}`:this.props.qrCodeImage,I=(t,o)=>{const r=v.get(o);return m(r),e("div",{className:"adyen-checkout__qr-loader adyen-checkout__qr-loader--result"},e("img",{className:"adyen-checkout__qr-loader__icon adyen-checkout__qr-loader__icon--result",src:N({imageFolder:"components/"})(t),alt:r}),e("div",{className:"adyen-checkout__qr-loader__subtitle adyen-checkout__qr-loader__subtitle--result"},r))};if(q)return I("error","error.subtitle.payment");if(b)return I("success","creditCard.success");if(C)return e("div",{className:"adyen-checkout__qr-loader"},n&&e("img",{alt:c,src:n,className:"adyen-checkout__qr-loader__brand-logo"}),e(s,null));const S=v.get(this.props.timeToPay).split("%@"),j=u(),x=this.props.classNameModifiers.map((t=>`adyen-checkout__qr-loader--${t}`));return e("div",{className:`adyen-checkout__qr-loader adyen-checkout__qr-loader--${k} ${x.join(" ")}`},n&&e("img",{src:n,alt:c,className:"adyen-checkout__qr-loader__brand-logo"}),t&&t.value&&t.currency&&e("div",{className:"adyen-checkout__qr-loader__payment_amount"},v.amount(t.value,t.currency)),a&&e("div",{className:"adyen-checkout__qr-loader__app-link"},this.props.redirectIntroduction&&e("div",{className:"adyen-checkout__qr-loader__subtitle"},v.get(this.props.redirectIntroduction)),e(r,{classNameModifiers:["qr-loader"],onClick:()=>this.redirectToApp(a),label:v.get(this.props.buttonLabel)}),e(d,null)),e("div",{ref:j,tabIndex:0,className:"adyen-checkout__qr-loader__subtitle"},v.get(this.props.introduction)),e("img",{src:w,alt:v.get("wechatpay.scanqrcode"),onLoad:()=>{f?.({componentType:this.props.type,actionDescription:"qr-code-loaded"})}}),e("div",{className:"adyen-checkout__qr-loader__progress"},e("span",{className:"adyen-checkout__qr-loader__percentage",style:{width:`${this.state.percentage}%`}})),e("div",{className:"adyen-checkout__qr-loader__countdown"},S[0]," ",e(o,{minutesFromNow:g,onTick:this.onTick,onCompleted:this.onTimeUp})," ",S[1]),"string"==typeof this.props.instructions?e("div",{className:"adyen-checkout__qr-loader__instructions"},v.get(this.props.instructions)):this.props.instructions?.(),this.props.copyBtn&&e("div",{className:"adyen-checkout__qr-loader__actions"},e(r,{inline:!0,variant:"action",onClick:(t,{complete:e})=>{i(this.props.qrCodeData),this.props.onSubmitAnalytics({type:h,target:_}),e()},icon:N({imageFolder:"components/"})(`${y}copy`),label:v.get("button.copy")})))}}export{g as default};
2
2
  //# sourceMappingURL=QRLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QRLoader.js","sources":["../../../../../src/components/internal/QRLoader/QRLoader.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport Countdown from '../Countdown';\nimport Button from '../Button';\nimport Spinner from '../Spinner';\nimport checkPaymentStatus from '../../../core/Services/payment-status';\nimport processResponse from '../../../core/ProcessResponse';\n\nimport './QRLoader.scss';\nimport { QRLoaderProps, QRLoaderState } from './types';\nimport copyToClipboard from '../../../utils/clipboard';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport ContentSeparator from '../ContentSeparator';\nimport { StatusObject } from '../Await/types';\nimport useImage from '../../../core/Context/useImage';\nimport { useA11yReporter } from '../../../core/Errors/useA11yReporter';\nimport useAutoFocus from '../../../utils/useAutoFocus';\nimport { ANALYTICS_DOWNLOAD_STR, ANALYTICS_QR_CODE_DOWNLOAD } from '../../../core/Analytics/constants';\nimport { PREFIX } from '../Icon/constants';\n\nconst QRCODE_URL = 'barcode.shtml?barcodeType=qrCode&fileType=png&data=';\n\nclass QRLoader extends Component<QRLoaderProps, QRLoaderState> {\n private timeoutId;\n\n constructor(props) {\n super(props);\n\n this.state = {\n buttonStatus: 'default',\n completed: false,\n delay: props.delay,\n expired: false,\n loading: true,\n percentage: 100,\n timePassed: 0\n };\n }\n\n public static defaultProps = {\n delay: 2000,\n countdownTime: 15,\n onError: () => {},\n onComplete: () => {},\n throttleTime: 60000,\n classNameModifiers: [],\n throttledInterval: 10000,\n introduction: 'wechatpay.scanqrcode',\n timeToPay: 'wechatpay.timetopay',\n buttonLabel: 'openApp'\n };\n\n componentDidMount() {\n this.statusInterval();\n }\n\n componentWillUnmount() {\n clearTimeout(this.timeoutId);\n }\n\n public redirectToApp = (url: string | URL) => {\n window.location.assign(url);\n };\n\n // Retry until getting a complete response from the server, or it times out\n public statusInterval = (responseTime = 0) => {\n // If we are already in the final statuses, do not poll!\n if (this.state.expired || this.state.completed) return;\n\n this.setState(previous => ({ timePassed: previous.timePassed + this.props.delay + responseTime }));\n // Changes interval time to 10 seconds after 1 minute (60 seconds)\n const newDelay = this.state.timePassed >= this.props.throttleTime ? this.props.throttledInterval : this.state.delay;\n this.pollStatus(newDelay);\n };\n\n private pollStatus(delay: number) {\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(async () => {\n // Wait for previous status call to finish.\n // Also taking the server response time into the consideration to calculate timePassed.\n const start = performance.now();\n await this.checkStatus();\n const end = performance.now();\n this.statusInterval(Math.round(end - start));\n }, delay);\n }\n\n private onTick = (time): void => {\n this.setState({ percentage: time.percentage });\n };\n\n private onTimeUp = (): void => {\n this.setState({ expired: true });\n clearTimeout(this.timeoutId);\n this.props.onError(new AdyenCheckoutError('ERROR', 'Payment Expired'));\n };\n\n private onComplete = (status: StatusObject): void => {\n clearTimeout(this.timeoutId);\n this.setState({ completed: true, loading: false });\n\n const state = {\n data: {\n details: { payload: status.props.payload },\n paymentData: this.props.paymentData\n }\n };\n\n this.props.onComplete(state, this);\n };\n\n private onError = (status: StatusObject): void => {\n clearTimeout(this.timeoutId);\n this.setState({ expired: true, loading: false });\n\n if (status.props.payload) {\n const state = {\n data: {\n details: { payload: status.props.payload },\n paymentData: this.props.paymentData\n }\n };\n this.props.onComplete(state, this);\n }\n\n const error = new AdyenCheckoutError('ERROR', 'error result with no payload in response');\n return this.props.onError(error);\n };\n\n private checkStatus = () => {\n const { paymentData, clientKey, loadingContext, throttledInterval } = this.props;\n\n return checkPaymentStatus(paymentData, clientKey, loadingContext, throttledInterval)\n .then(processResponse)\n .catch(response => ({ type: 'network-error', props: response }))\n .then((status: StatusObject) => {\n switch (status.type) {\n case 'success':\n this.onComplete(status);\n break;\n case 'error':\n this.onError(status);\n break;\n default:\n this.setState({ loading: false });\n }\n return status;\n });\n };\n\n render({ amount, url, brandLogo, brandName, countdownTime, type, onActionHandled }: QRLoaderProps, { expired, completed, loading }) {\n const { i18n, loadingContext } = useCoreContext();\n const getImage = useImage();\n const qrCodeImage = this.props.qrCodeData ? `${loadingContext}${QRCODE_URL}${this.props.qrCodeData}` : this.props.qrCodeImage;\n const finalState = (image, message) => {\n const status = i18n.get(message);\n useA11yReporter(status);\n return (\n <div className=\"adyen-checkout__qr-loader adyen-checkout__qr-loader--result\">\n <img\n className=\"adyen-checkout__qr-loader__icon adyen-checkout__qr-loader__icon--result\"\n src={getImage({ imageFolder: 'components/' })(image)}\n alt={status}\n />\n <div className=\"adyen-checkout__qr-loader__subtitle adyen-checkout__qr-loader__subtitle--result\">{status}</div>\n </div>\n );\n };\n\n if (expired) {\n return finalState('error', 'error.subtitle.payment');\n }\n\n if (completed) {\n return finalState('success', 'creditCard.success');\n }\n\n if (loading) {\n return (\n <div className=\"adyen-checkout__qr-loader\">\n {brandLogo && <img alt={brandName} src={brandLogo} className=\"adyen-checkout__qr-loader__brand-logo\" />}\n <Spinner />\n </div>\n );\n }\n\n const timeToPayString = i18n.get(this.props.timeToPay).split('%@');\n\n const qrSubtitleRef = useAutoFocus();\n\n return (\n <div\n className={`\n adyen-checkout__qr-loader\n adyen-checkout__qr-loader--${type}\n ${this.props.classNameModifiers.map(m => `adyen-checkout__qr-loader--${m}`)}\n `}\n >\n {brandLogo && <img src={brandLogo} alt={brandName} className=\"adyen-checkout__qr-loader__brand-logo\" />}\n\n {amount && amount.value && amount.currency && (\n <div className=\"adyen-checkout__qr-loader__payment_amount\">{i18n.amount(amount.value, amount.currency)}</div>\n )}\n\n {url && (\n <div className=\"adyen-checkout__qr-loader__app-link\">\n {this.props.redirectIntroduction && (\n <div className=\"adyen-checkout__qr-loader__subtitle\">{i18n.get(this.props.redirectIntroduction)}</div>\n )}\n <Button classNameModifiers={['qr-loader']} onClick={() => this.redirectToApp(url)} label={i18n.get(this.props.buttonLabel)} />\n <ContentSeparator />\n </div>\n )}\n\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div ref={qrSubtitleRef} tabIndex={0} className=\"adyen-checkout__qr-loader__subtitle\">\n {i18n.get(this.props.introduction)}\n </div>\n\n <img\n src={qrCodeImage}\n alt={i18n.get('wechatpay.scanqrcode')}\n onLoad={() => {\n onActionHandled?.({ componentType: this.props.type, actionDescription: 'qr-code-loaded' });\n }}\n />\n\n <div className=\"adyen-checkout__qr-loader__progress\">\n <span className=\"adyen-checkout__qr-loader__percentage\" style={{ width: `${this.state.percentage}%` }} />\n </div>\n\n <div className=\"adyen-checkout__qr-loader__countdown\">\n {timeToPayString[0]}&nbsp;\n <Countdown minutesFromNow={countdownTime} onTick={this.onTick} onCompleted={this.onTimeUp} />\n &nbsp;{timeToPayString[1]}\n </div>\n\n {typeof this.props.instructions === 'string' ? (\n <div className=\"adyen-checkout__qr-loader__instructions\">{i18n.get(this.props.instructions)}</div>\n ) : (\n this.props.instructions?.()\n )}\n\n {this.props.copyBtn && (\n <div className=\"adyen-checkout__qr-loader__actions\">\n <Button\n inline\n variant=\"action\"\n onClick={(e, { complete }) => {\n copyToClipboard(this.props.qrCodeData);\n this.props.onSubmitAnalytics({\n type: ANALYTICS_DOWNLOAD_STR,\n target: ANALYTICS_QR_CODE_DOWNLOAD\n });\n complete();\n }}\n icon={getImage({ imageFolder: 'components/' })(`${PREFIX}copy`)}\n label={i18n.get('button.copy')}\n />\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default QRLoader;\n"],"names":["QRLoader","Component","timeoutId","constructor","props","super","this","state","buttonStatus","completed","delay","expired","loading","percentage","timePassed","static","countdownTime","onError","onComplete","throttleTime","classNameModifiers","throttledInterval","introduction","timeToPay","buttonLabel","componentDidMount","statusInterval","componentWillUnmount","clearTimeout","redirectToApp","url","window","location","assign","responseTime","setState","previous","newDelay","pollStatus","setTimeout","async","start","performance","now","checkStatus","end","Math","round","onTick","time","onTimeUp","AdyenCheckoutError","status","data","details","payload","paymentData","error","clientKey","loadingContext","checkPaymentStatus","then","processResponse","catch","response","type","render","amount","brandLogo","brandName","onActionHandled","i18n","useCoreContext","getImage","useImage","qrCodeImage","qrCodeData","finalState","image","message","get","useA11yReporter","h","div","className","img","src","imageFolder","alt","Spinner","timeToPayString","split","qrSubtitleRef","useAutoFocus","map","m","value","currency","redirectIntroduction","Button","onClick","label","ContentSeparator","ref","tabIndex","onLoad","componentType","actionDescription","span","style","width","Countdown","minutesFromNow","onCompleted","instructions","copyBtn","inline","variant","e","complete","copyToClipboard","onSubmitAnalytics","ANALYTICS_DOWNLOAD_STR","target","ANALYTICS_QR_CODE_DOWNLOAD","icon","PREFIX"],"mappings":"24BAsBA,MAAMA,UAAiBC,EACXC,UAERC,WAAAA,CAAYC,GACRC,MAAMD,GAENE,KAAKC,MAAQ,CACTC,aAAc,UACdC,WAAW,EACXC,MAAON,EAAMM,MACbC,SAAS,EACTC,SAAS,EACTC,WAAY,IACZC,WAAY,EAEpB,CAEAC,oBAA6B,CACzBL,MAAO,IACPM,cAAe,GACfC,QAAS,OACTC,WAAY,OACZC,aAAc,IACdC,mBAAoB,GACpBC,kBAAmB,IACnBC,aAAc,uBACdC,UAAW,sBACXC,YAAa,WAGjBC,iBAAAA,GACInB,KAAKoB,gB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AAEC,MAAO,GAAGxG,KAAKC,MAAMM,kBAG1FqE,EAACC,MAAAA,CAAIC,UAAU,wCACVM,EAAgB,GAAG,IACpBR,EAAC6B,EAAAA,CAAUC,eAAgBhG,EAAegC,OAAQ1C,KAAK0C,OAAQiE,YAAa3G,KAAK4C,WAAY,IACtFwC,EAAgB,IAGS,iBAA5BpF,KAAKF,MAAM8G,aACfhC,EAACC,MAAAA,CAAIC,UAAU,2CAA2Cb,EAAKS,IAAI1E,KAAKF,MAAM8G,eAE9E5G,KAAKF,MAAM8G,iBAGd5G,KAAKF,MAAM+G,SACRjC,EAACC,MAAAA,CAAIC,UAAU,sCACXF,EAACiB,EAAAA,CACGiB,QAAAA,EACAC,QAAQ,SACRjB,QAAS,CAACkB,GAAKC,eACXC,EAAgBlH,KAAKF,MAAMwE,YAC3BtE,KAAKF,MAAMqH,kBAAkB,CACzBxD,KAAMyD,EACNC,OAAQC,IAEZL,GAAAA,EAEJM,KAAMpD,EAAS,CAAEc,YAAa,eAAxBd,CAAyC,GAAGqD,SAClDzB,MAAO9B,EAAKS,IAAI,kBAMxC"}
1
+ {"version":3,"file":"QRLoader.js","sources":["../../../../../src/components/internal/QRLoader/QRLoader.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport Countdown from '../Countdown';\nimport Button from '../Button';\nimport Spinner from '../Spinner';\nimport checkPaymentStatus from '../../../core/Services/payment-status';\nimport processResponse from '../../../core/ProcessResponse';\n\nimport './QRLoader.scss';\nimport { QRLoaderProps, QRLoaderState } from './types';\nimport copyToClipboard from '../../../utils/clipboard';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport ContentSeparator from '../ContentSeparator';\nimport { StatusObject } from '../Await/types';\nimport useImage from '../../../core/Context/useImage';\nimport { useA11yReporter } from '../../../core/Errors/useA11yReporter';\nimport useAutoFocus from '../../../utils/useAutoFocus';\nimport { ANALYTICS_DOWNLOAD_STR, ANALYTICS_QR_CODE_DOWNLOAD } from '../../../core/Analytics/constants';\nimport { PREFIX } from '../Icon/constants';\n\nconst QRCODE_URL = 'barcode.shtml?barcodeType=qrCode&fileType=png&data=';\n\nclass QRLoader extends Component<QRLoaderProps, QRLoaderState> {\n private timeoutId;\n\n constructor(props) {\n super(props);\n\n this.state = {\n buttonStatus: 'default',\n completed: false,\n delay: props.delay,\n expired: false,\n loading: true,\n percentage: 100,\n timePassed: 0\n };\n }\n\n public static defaultProps = {\n delay: 2000,\n countdownTime: 15,\n onError: () => {},\n onComplete: () => {},\n throttleTime: 60000,\n classNameModifiers: [],\n throttledInterval: 10000,\n introduction: 'wechatpay.scanqrcode',\n timeToPay: 'wechatpay.timetopay',\n buttonLabel: 'openApp'\n };\n\n componentDidMount() {\n this.statusInterval();\n }\n\n componentWillUnmount() {\n clearTimeout(this.timeoutId);\n }\n\n public redirectToApp = (url: string | URL) => {\n window.location.assign(url);\n };\n\n // Retry until getting a complete response from the server, or it times out\n public statusInterval = (responseTime = 0) => {\n // If we are already in the final statuses, do not poll!\n if (this.state.expired || this.state.completed) return;\n\n this.setState(previous => ({ timePassed: previous.timePassed + this.props.delay + responseTime }));\n // Changes interval time to 10 seconds after 1 minute (60 seconds)\n const newDelay = this.state.timePassed >= this.props.throttleTime ? this.props.throttledInterval : this.state.delay;\n this.pollStatus(newDelay);\n };\n\n private pollStatus(delay: number) {\n clearTimeout(this.timeoutId);\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.timeoutId = setTimeout(async () => {\n // Wait for previous status call to finish.\n // Also taking the server response time into the consideration to calculate timePassed.\n const start = performance.now();\n await this.checkStatus();\n const end = performance.now();\n this.statusInterval(Math.round(end - start));\n }, delay);\n }\n\n private onTick = (time): void => {\n this.setState({ percentage: time.percentage });\n };\n\n private onTimeUp = (): void => {\n this.setState({ expired: true });\n clearTimeout(this.timeoutId);\n this.props.onError(new AdyenCheckoutError('ERROR', 'Payment Expired'));\n };\n\n private onComplete = (status: StatusObject): void => {\n clearTimeout(this.timeoutId);\n this.setState({ completed: true, loading: false });\n\n const state = {\n data: {\n details: { payload: status.props.payload },\n paymentData: this.props.paymentData\n }\n };\n\n this.props.onComplete(state, this);\n };\n\n private onError = (status: StatusObject): void => {\n clearTimeout(this.timeoutId);\n this.setState({ expired: true, loading: false });\n\n if (status.props.payload) {\n const state = {\n data: {\n details: { payload: status.props.payload },\n paymentData: this.props.paymentData\n }\n };\n this.props.onComplete(state, this);\n }\n\n const error = new AdyenCheckoutError('ERROR', 'error result with no payload in response');\n return this.props.onError(error);\n };\n\n private checkStatus = () => {\n const { paymentData, clientKey, loadingContext, throttledInterval } = this.props;\n\n return checkPaymentStatus(paymentData, clientKey, loadingContext, throttledInterval)\n .then(processResponse)\n .catch(response => ({ type: 'network-error', props: response }))\n .then((status: StatusObject) => {\n switch (status.type) {\n case 'success':\n this.onComplete(status);\n break;\n case 'error':\n this.onError(status);\n break;\n default:\n this.setState({ loading: false });\n }\n return status;\n });\n };\n\n render({ amount, url, brandLogo, brandName, countdownTime, type, onActionHandled }: QRLoaderProps, { expired, completed, loading }) {\n const { i18n, loadingContext } = useCoreContext();\n const getImage = useImage();\n const qrCodeImage = this.props.qrCodeData ? `${loadingContext}${QRCODE_URL}${this.props.qrCodeData}` : this.props.qrCodeImage;\n const finalState = (image, message) => {\n const status = i18n.get(message);\n useA11yReporter(status);\n return (\n <div className=\"adyen-checkout__qr-loader adyen-checkout__qr-loader--result\">\n <img\n className=\"adyen-checkout__qr-loader__icon adyen-checkout__qr-loader__icon--result\"\n src={getImage({ imageFolder: 'components/' })(image)}\n alt={status}\n />\n <div className=\"adyen-checkout__qr-loader__subtitle adyen-checkout__qr-loader__subtitle--result\">{status}</div>\n </div>\n );\n };\n\n if (expired) {\n return finalState('error', 'error.subtitle.payment');\n }\n\n if (completed) {\n return finalState('success', 'creditCard.success');\n }\n\n if (loading) {\n return (\n <div className=\"adyen-checkout__qr-loader\">\n {brandLogo && <img alt={brandName} src={brandLogo} className=\"adyen-checkout__qr-loader__brand-logo\" />}\n <Spinner />\n </div>\n );\n }\n\n const timeToPayString = i18n.get(this.props.timeToPay).split('%@');\n\n const qrSubtitleRef = useAutoFocus();\n const classnames = this.props.classNameModifiers.map(m => `adyen-checkout__qr-loader--${m}`);\n\n return (\n <div className={`adyen-checkout__qr-loader adyen-checkout__qr-loader--${type} ${classnames.join(' ')}`}>\n {brandLogo && <img src={brandLogo} alt={brandName} className=\"adyen-checkout__qr-loader__brand-logo\" />}\n\n {amount && amount.value && amount.currency && (\n <div className=\"adyen-checkout__qr-loader__payment_amount\">{i18n.amount(amount.value, amount.currency)}</div>\n )}\n\n {url && (\n <div className=\"adyen-checkout__qr-loader__app-link\">\n {this.props.redirectIntroduction && (\n <div className=\"adyen-checkout__qr-loader__subtitle\">{i18n.get(this.props.redirectIntroduction)}</div>\n )}\n <Button classNameModifiers={['qr-loader']} onClick={() => this.redirectToApp(url)} label={i18n.get(this.props.buttonLabel)} />\n <ContentSeparator />\n </div>\n )}\n\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div ref={qrSubtitleRef} tabIndex={0} className=\"adyen-checkout__qr-loader__subtitle\">\n {i18n.get(this.props.introduction)}\n </div>\n\n <img\n src={qrCodeImage}\n alt={i18n.get('wechatpay.scanqrcode')}\n onLoad={() => {\n onActionHandled?.({ componentType: this.props.type, actionDescription: 'qr-code-loaded' });\n }}\n />\n\n <div className=\"adyen-checkout__qr-loader__progress\">\n <span className=\"adyen-checkout__qr-loader__percentage\" style={{ width: `${this.state.percentage}%` }} />\n </div>\n\n <div className=\"adyen-checkout__qr-loader__countdown\">\n {timeToPayString[0]}&nbsp;\n <Countdown minutesFromNow={countdownTime} onTick={this.onTick} onCompleted={this.onTimeUp} />\n &nbsp;{timeToPayString[1]}\n </div>\n\n {typeof this.props.instructions === 'string' ? (\n <div className=\"adyen-checkout__qr-loader__instructions\">{i18n.get(this.props.instructions)}</div>\n ) : (\n this.props.instructions?.()\n )}\n\n {this.props.copyBtn && (\n <div className=\"adyen-checkout__qr-loader__actions\">\n <Button\n inline\n variant=\"action\"\n onClick={(e, { complete }) => {\n copyToClipboard(this.props.qrCodeData);\n this.props.onSubmitAnalytics({\n type: ANALYTICS_DOWNLOAD_STR,\n target: ANALYTICS_QR_CODE_DOWNLOAD\n });\n complete();\n }}\n icon={getImage({ imageFolder: 'components/' })(`${PREFIX}copy`)}\n label={i18n.get('button.copy')}\n />\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default QRLoader;\n"],"names":["QRLoader","Component","timeoutId","constructor","props","super","this","state","buttonStatus","completed","delay","expired","loading","percentage","timePassed","static","countdownTime","onError","onComplete","throttleTime","classNameModifiers","throttledInterval","introduction","timeToPay","buttonLabel","componentDidMount","statusInterval","componentWillUnmount","clearTimeout","redirectToApp","url","window","location","assign","responseTime","setState","previous","newDelay","pollStatus","setTimeout","async","start","performance","now","checkStatus","end","Math","round","onTick","time","onTimeUp","AdyenCheckoutError","status","data","details","payload","paymentData","error","clientKey","loadingContext","checkPaymentStatus","then","processResponse","catch","response","type","render","amount","brandLogo","brandName","onActionHandled","i18n","useCoreContext","getImage","useImage","qrCodeImage","qrCodeData","finalState","image","message","get","useA11yReporter","h","div","className","img","src","imageFolder","alt","Spinner","timeToPayString","split","qrSubtitleRef","useAutoFocus","classnames","map","m","join","value","currency","redirectIntroduction","Button","onClick","label","ContentSeparator","ref","tabIndex","onLoad","componentType","actionDescription","span","style","width","Countdown","minutesFromNow","onCompleted","instructions","copyBtn","inline","variant","e","complete","copyToClipboard","onSubmitAnalytics","ANALYTICS_DOWNLOAD_STR","target","ANALYTICS_QR_CODE_DOWNLOAD","icon","PREFIX"],"mappings":"24BAsBA,MAAMA,UAAiBC,EACXC,UAERC,WAAAA,CAAYC,GACRC,MAAMD,GAENE,KAAKC,MAAQ,CACTC,aAAc,UACdC,WAAW,EACXC,MAAON,EAAMM,MACbC,SAAS,EACTC,SAAS,EACTC,WAAY,IACZC,WAAY,EAEpB,CAEAC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