@foxy.io/elements 1.24.0-beta.4 → 1.24.0-beta.6

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 (302) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +2 -2
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +1 -1
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-cancellation-form.js +1 -1
  12. package/dist/cdn/foxy-cart-card.js +1 -1
  13. package/dist/cdn/foxy-cart-form.js +1 -1
  14. package/dist/cdn/foxy-client-card.js +1 -1
  15. package/dist/cdn/foxy-client-form.js +1 -1
  16. package/dist/cdn/foxy-collection-page.js +1 -1
  17. package/dist/cdn/foxy-collection-pages.js +1 -1
  18. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  19. package/dist/cdn/foxy-coupon-card.js +1 -1
  20. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  21. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  22. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-form.js +1 -1
  24. package/dist/cdn/foxy-custom-field-card.js +1 -1
  25. package/dist/cdn/foxy-custom-field-form.js +1 -1
  26. package/dist/cdn/foxy-customer-api.js +1 -1
  27. package/dist/cdn/foxy-customer-card.js +1 -1
  28. package/dist/cdn/foxy-customer-form.js +1 -1
  29. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  30. package/dist/cdn/foxy-customer-portal.js +13 -31
  31. package/dist/cdn/foxy-customer.js +7 -7
  32. package/dist/cdn/foxy-customers-table.js +1 -1
  33. package/dist/cdn/foxy-discount-builder.js +1 -1
  34. package/dist/cdn/foxy-discount-card.js +1 -1
  35. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  36. package/dist/cdn/foxy-donation.js +1 -1
  37. package/dist/cdn/foxy-downloadable-card.js +1 -1
  38. package/dist/cdn/foxy-downloadable-form.js +1 -1
  39. package/dist/cdn/foxy-email-template-card.js +1 -1
  40. package/dist/cdn/foxy-email-template-form.js +1 -1
  41. package/dist/cdn/foxy-error-entry-card.js +1 -1
  42. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  43. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  44. package/dist/cdn/foxy-form-dialog.js +1 -1
  45. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  46. package/dist/cdn/foxy-gift-card-card.js +1 -1
  47. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  48. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  49. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-form.js +1 -1
  51. package/dist/cdn/foxy-i18n-editor.js +2 -2
  52. package/dist/cdn/foxy-i18n.js +1 -1
  53. package/dist/cdn/foxy-integration-card.js +1 -1
  54. package/dist/cdn/foxy-integration-form.js +1 -1
  55. package/dist/cdn/foxy-item-card.js +1 -1
  56. package/dist/cdn/foxy-item-category-card.js +1 -1
  57. package/dist/cdn/foxy-item-category-form.js +1 -1
  58. package/dist/cdn/foxy-item-form.js +1 -1
  59. package/dist/cdn/foxy-item-option-card.js +1 -1
  60. package/dist/cdn/foxy-item-option-form.js +1 -1
  61. package/dist/cdn/foxy-items-form.js +1 -1
  62. package/dist/cdn/foxy-nucleon-element.js +1 -1
  63. package/dist/cdn/foxy-pagination.js +1 -1
  64. package/dist/cdn/foxy-passkey-card.js +1 -1
  65. package/dist/cdn/foxy-passkey-form.js +1 -1
  66. package/dist/cdn/foxy-payment-card.js +1 -1
  67. package/dist/cdn/foxy-payment-method-card.js +1 -1
  68. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  69. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  70. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  71. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  72. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  73. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  74. package/dist/cdn/foxy-payments-api.js +1 -1
  75. package/dist/cdn/foxy-query-builder.js +1 -1
  76. package/dist/cdn/foxy-report-form.js +4 -4
  77. package/dist/cdn/foxy-reports-table.js +5 -5
  78. package/dist/cdn/foxy-shipment-card.js +2 -2
  79. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  80. package/dist/cdn/foxy-sign-in-form.js +1 -1
  81. package/dist/cdn/foxy-spinner.js +2 -2
  82. package/dist/cdn/foxy-store-card.js +1 -1
  83. package/dist/cdn/foxy-store-form.js +1 -1
  84. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  85. package/dist/cdn/foxy-subscription-card.js +1 -1
  86. package/dist/cdn/foxy-subscription-form.js +2 -2
  87. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  88. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  89. package/dist/cdn/foxy-table.js +1 -1
  90. package/dist/cdn/foxy-tax-card.js +1 -1
  91. package/dist/cdn/foxy-tax-form.js +1 -1
  92. package/dist/cdn/foxy-template-config-form.js +1 -1
  93. package/dist/cdn/foxy-template-form.js +1 -1
  94. package/dist/cdn/foxy-template-set-card.js +1 -1
  95. package/dist/cdn/foxy-template-set-form.js +1 -1
  96. package/dist/cdn/foxy-transaction-card.js +1 -1
  97. package/dist/cdn/foxy-transaction.js +1 -1
  98. package/dist/cdn/foxy-transactions-table.js +7 -7
  99. package/dist/cdn/foxy-user-card.js +1 -1
  100. package/dist/cdn/foxy-user-form.js +1 -1
  101. package/dist/cdn/foxy-users-table.js +1 -1
  102. package/dist/cdn/foxy-webhook-card.js +1 -1
  103. package/dist/cdn/foxy-webhook-form.js +1 -1
  104. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  105. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  106. package/dist/cdn/{shared-479ad951.js → shared-099c1f57.js} +1 -1
  107. package/dist/cdn/{shared-c4240bc6.js → shared-0c0ee663.js} +1 -1
  108. package/dist/cdn/shared-1196b6a7.js +1 -0
  109. package/dist/cdn/shared-13fbea95.js +122 -0
  110. package/dist/cdn/{shared-8474bc4a.js → shared-27d21f4a.js} +1 -1
  111. package/dist/cdn/shared-2edcd981.js +1 -0
  112. package/dist/cdn/{shared-a92ae606.js → shared-31d8e3b8.js} +1 -1
  113. package/dist/cdn/shared-35728235.js +1 -0
  114. package/dist/cdn/shared-3b709ddc.js +29 -0
  115. package/dist/cdn/shared-3bcc07cd.js +1 -0
  116. package/dist/cdn/shared-3c2414d4.js +9 -0
  117. package/dist/cdn/{shared-31651a9c.js → shared-3f04e4cc.js} +1 -1
  118. package/dist/cdn/{shared-ba658670.js → shared-406ce9ad.js} +1 -1
  119. package/dist/cdn/{shared-6f84ac3e.js → shared-4b20fc75.js} +1 -1
  120. package/dist/cdn/shared-4c2e9064.js +15 -0
  121. package/dist/cdn/{shared-1d28220a.js → shared-5103c1b4.js} +1 -1
  122. package/dist/cdn/{shared-4674063d.js → shared-5784c088.js} +27 -27
  123. package/dist/cdn/shared-584174ff.js +1 -0
  124. package/dist/cdn/{shared-1b060170.js → shared-59fc6288.js} +1 -1
  125. package/dist/cdn/{shared-51d28e6d.js → shared-5a889c45.js} +1 -1
  126. package/dist/cdn/{shared-c7f2f1ab.js → shared-5cf7b194.js} +1 -1
  127. package/dist/cdn/{shared-9c626d58.js → shared-5db85492.js} +1 -1
  128. package/dist/cdn/shared-601f27b1.js +1 -0
  129. package/dist/cdn/{shared-36725fe3.js → shared-621b3283.js} +1 -1
  130. package/dist/cdn/shared-630a0ff2.js +1 -0
  131. package/dist/cdn/{shared-984fcdf5.js → shared-6daeb197.js} +3 -3
  132. package/dist/cdn/{shared-4c956a8e.js → shared-7723f756.js} +1 -1
  133. package/dist/cdn/{shared-4dc58b73.js → shared-773e7177.js} +1 -1
  134. package/dist/cdn/{shared-6dc64a17.js → shared-799dc083.js} +1 -1
  135. package/dist/cdn/{shared-e84fa0ea.js → shared-7a455b15.js} +1 -1
  136. package/dist/cdn/{shared-e6828dbf.js → shared-7abbc95c.js} +5 -5
  137. package/dist/cdn/shared-7f33a83a.js +12 -12
  138. package/dist/cdn/{shared-69a21b9d.js → shared-7fab31ac.js} +1 -1
  139. package/dist/cdn/shared-800ee6c0.js +1 -0
  140. package/dist/cdn/shared-8a9c64b2.js +1 -0
  141. package/dist/cdn/{shared-db21f6db.js → shared-8f922de8.js} +2 -2
  142. package/dist/cdn/{shared-e6997950.js → shared-9048eeb2.js} +1 -1
  143. package/dist/cdn/{shared-e10052d0.js → shared-9954ee26.js} +2 -2
  144. package/dist/cdn/{shared-4bbd600d.js → shared-9aa72495.js} +1 -1
  145. package/dist/cdn/shared-9b12aeac.js +1 -0
  146. package/dist/cdn/{shared-6abdfcf2.js → shared-9b486845.js} +1 -1
  147. package/dist/cdn/{shared-b3ac59eb.js → shared-ad80244a.js} +2 -2
  148. package/dist/cdn/{shared-c6c6ba69.js → shared-b446c140.js} +1 -1
  149. package/dist/cdn/shared-b7556b77.js +1 -0
  150. package/dist/cdn/{shared-30bebd39.js → shared-b87d1af0.js} +3 -3
  151. package/dist/cdn/{shared-0a248c0d.js → shared-ba93be6b.js} +1 -1
  152. package/dist/cdn/{shared-9caffb4d.js → shared-baeef007.js} +1 -1
  153. package/dist/cdn/{shared-64f98a0f.js → shared-bee111d6.js} +7 -2
  154. package/dist/cdn/shared-c76ef8d8.js +804 -0
  155. package/dist/cdn/{shared-65318cc1.js → shared-c839e147.js} +1 -1
  156. package/dist/cdn/{shared-4904bca4.js → shared-d1f5de89.js} +1 -1
  157. package/dist/cdn/{shared-a3c73e91.js → shared-d90dbae7.js} +1 -1
  158. package/dist/cdn/{shared-dccf0420.js → shared-ddac7722.js} +2 -2
  159. package/dist/cdn/{shared-e8e92fe3.js → shared-de3dae6c.js} +2 -2
  160. package/dist/cdn/shared-e006e82c.js +1 -0
  161. package/dist/cdn/shared-e2e2ca6a.js +1 -0
  162. package/dist/cdn/shared-e5239bec.js +212 -0
  163. package/dist/cdn/shared-e8a51c60.js +1 -0
  164. package/dist/cdn/shared-e8a85228.js +1 -0
  165. package/dist/cdn/{shared-17d0db7f.js → shared-eb8a0fdf.js} +3 -3
  166. package/dist/cdn/{shared-88e36564.js → shared-ef7f2d07.js} +26 -27
  167. package/dist/cdn/{shared-665d6cc4.js → shared-efaf8d49.js} +1 -1
  168. package/dist/cdn/{shared-ff992ead.js → shared-f0a9f3c2.js} +1 -1
  169. package/dist/cdn/{shared-379b37e6.js → shared-f21e5761.js} +7 -11
  170. package/dist/cdn/shared-f241722a.js +1 -0
  171. package/dist/cdn/{shared-b48a83b0.js → shared-f29acc38.js} +1 -1
  172. package/dist/cdn/{shared-e7c3b7b6.js → shared-f29d410a.js} +1 -1
  173. package/dist/cdn/{shared-bdb51db9.js → shared-f5bbb1e0.js} +1 -1
  174. package/dist/cdn/{shared-c97e0d6e.js → shared-fcfbfbdb.js} +1 -1
  175. package/dist/cdn/{shared-bafcab47.js → shared-fd40a40c.js} +3 -3
  176. package/dist/cdn/{shared-4b67d699.js → shared-fd96bcd1.js} +1 -1
  177. package/dist/cdn/{shared-dfe2602a.js → shared-ff7fd5fa.js} +1 -1
  178. package/dist/cdn/{shared-d14c2060.js → shared-fff03a45.js} +1 -1
  179. package/dist/cdn/translations/address-form/en.json +577 -0
  180. package/dist/cdn/translations/customer/en.json +653 -15
  181. package/dist/cdn/translations/customer-form/en.json +84 -15
  182. package/dist/cdn/translations/customer-portal/en.json +694 -32
  183. package/dist/cdn/translations/customer-portal-settings/en.json +9 -0
  184. package/dist/cdn/translations/transaction/en.json +79 -15
  185. package/dist/elements/internal/InternalForm/InternalForm.d.ts +10 -0
  186. package/dist/elements/internal/InternalForm/InternalForm.js +48 -1
  187. package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
  188. package/dist/elements/internal/InternalForm/index.d.ts +1 -0
  189. package/dist/elements/internal/InternalForm/index.js +1 -0
  190. package/dist/elements/internal/InternalForm/index.js.map +1 -1
  191. package/dist/elements/internal/InternalForm/types.d.ts +4 -0
  192. package/dist/elements/internal/InternalForm/types.js +2 -0
  193. package/dist/elements/internal/InternalForm/types.js.map +1 -0
  194. package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.d.ts +5 -1
  195. package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js +36 -1
  196. package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js.map +1 -1
  197. package/dist/elements/internal/InternalPasswordControl/generateRandomPassword.d.ts +1 -0
  198. package/dist/elements/internal/InternalPasswordControl/generateRandomPassword.js +11 -0
  199. package/dist/elements/internal/InternalPasswordControl/generateRandomPassword.js.map +1 -0
  200. package/dist/elements/public/AddressForm/AddressForm.d.ts +2 -1
  201. package/dist/elements/public/AddressForm/AddressForm.js +53 -17
  202. package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
  203. package/dist/elements/public/AddressForm/countries.d.ts +1 -1
  204. package/dist/elements/public/AddressForm/countries.js +554 -251
  205. package/dist/elements/public/AddressForm/countries.js.map +1 -1
  206. package/dist/elements/public/Customer/Customer.d.ts +5 -2
  207. package/dist/elements/public/Customer/Customer.js +10 -0
  208. package/dist/elements/public/Customer/Customer.js.map +1 -1
  209. package/dist/elements/public/Customer/types.d.ts +1 -0
  210. package/dist/elements/public/Customer/types.js.map +1 -1
  211. package/dist/elements/public/CustomerApi/CustomerApi.d.ts +33 -2
  212. package/dist/elements/public/CustomerApi/CustomerApi.js +62 -11
  213. package/dist/elements/public/CustomerApi/CustomerApi.js.map +1 -1
  214. package/dist/elements/public/CustomerForm/CustomerForm.d.ts +47 -15
  215. package/dist/elements/public/CustomerForm/CustomerForm.js +259 -155
  216. package/dist/elements/public/CustomerForm/CustomerForm.js.map +1 -1
  217. package/dist/elements/public/CustomerForm/index.d.ts +6 -6
  218. package/dist/elements/public/CustomerForm/index.js +6 -6
  219. package/dist/elements/public/CustomerForm/index.js.map +1 -1
  220. package/dist/elements/public/CustomerForm/internal/InternalCustomerFormLegalNoticeControl/InternalCustomerFormLegalNoticeControl.d.ts +5 -0
  221. package/dist/elements/public/CustomerForm/internal/InternalCustomerFormLegalNoticeControl/InternalCustomerFormLegalNoticeControl.js +23 -0
  222. package/dist/elements/public/CustomerForm/internal/InternalCustomerFormLegalNoticeControl/InternalCustomerFormLegalNoticeControl.js.map +1 -0
  223. package/dist/elements/public/CustomerForm/internal/InternalCustomerFormLegalNoticeControl/index.d.ts +4 -0
  224. package/dist/elements/public/CustomerForm/internal/InternalCustomerFormLegalNoticeControl/index.js +6 -0
  225. package/dist/elements/public/CustomerForm/internal/InternalCustomerFormLegalNoticeControl/index.js.map +1 -0
  226. package/dist/elements/public/CustomerForm/types.d.ts +27 -7
  227. package/dist/elements/public/CustomerForm/types.js.map +1 -1
  228. package/dist/elements/public/CustomerPortal/CustomerPortal.js +12 -15
  229. package/dist/elements/public/CustomerPortal/CustomerPortal.js.map +1 -1
  230. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.d.ts +8 -11
  231. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +9 -33
  232. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  233. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.d.ts +14 -10
  234. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +152 -16
  235. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
  236. package/dist/elements/public/CustomerPortal/index.d.ts +2 -0
  237. package/dist/elements/public/CustomerPortal/index.js +2 -2
  238. package/dist/elements/public/CustomerPortal/index.js.map +1 -1
  239. package/dist/elements/public/CustomerPortalSettings/CustomerPortalSettings.js +14 -0
  240. package/dist/elements/public/CustomerPortalSettings/CustomerPortalSettings.js.map +1 -1
  241. package/dist/elements/public/CustomerPortalSettings/machine.js +10 -0
  242. package/dist/elements/public/CustomerPortalSettings/machine.js.map +1 -1
  243. package/dist/elements/public/CustomerPortalSettings/private/SignUp/SignUp.d.ts +14 -0
  244. package/dist/elements/public/CustomerPortalSettings/private/SignUp/SignUp.js +132 -0
  245. package/dist/elements/public/CustomerPortalSettings/private/SignUp/SignUp.js.map +1 -0
  246. package/dist/elements/public/CustomerPortalSettings/private/SignUp/SignUpChangeEvent.d.ts +4 -0
  247. package/dist/elements/public/CustomerPortalSettings/private/SignUp/SignUpChangeEvent.js +6 -0
  248. package/dist/elements/public/CustomerPortalSettings/private/SignUp/SignUpChangeEvent.js.map +1 -0
  249. package/dist/elements/public/CustomerPortalSettings/types.d.ts +4 -0
  250. package/dist/elements/public/CustomerPortalSettings/types.js.map +1 -1
  251. package/dist/elements/public/FilterAttributeCard/FilterAttributeCard.js +1 -1
  252. package/dist/elements/public/FilterAttributeCard/FilterAttributeCard.js.map +1 -1
  253. package/dist/elements/public/FormDialog/FormDialog.d.ts +2 -0
  254. package/dist/elements/public/FormDialog/FormDialog.js +6 -0
  255. package/dist/elements/public/FormDialog/FormDialog.js.map +1 -1
  256. package/dist/elements/public/FormDialog/types.d.ts +3 -1
  257. package/dist/elements/public/FormDialog/types.js.map +1 -1
  258. package/dist/elements/public/NucleonElement/NucleonElement.d.ts +1 -1
  259. package/dist/elements/public/NucleonElement/NucleonElement.js +1 -1
  260. package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
  261. package/dist/elements/public/NucleonElement/types.d.ts +1 -1
  262. package/dist/elements/public/NucleonElement/types.js.map +1 -1
  263. package/dist/mixins/themeable.js +16 -0
  264. package/dist/mixins/themeable.js.map +1 -1
  265. package/dist/types/hapi.d.ts +14 -0
  266. package/dist/types/hapi.js.map +1 -1
  267. package/dist/utils/parse-duration.js +2 -2
  268. package/dist/utils/parse-duration.js.map +1 -1
  269. package/package.json +13 -11
  270. package/dist/cdn/shared-09d4fbb8.js +0 -29
  271. package/dist/cdn/shared-1d08a5ad.js +0 -1
  272. package/dist/cdn/shared-1eac92fa.js +0 -1
  273. package/dist/cdn/shared-25f64060.js +0 -1
  274. package/dist/cdn/shared-307262a1.js +0 -15
  275. package/dist/cdn/shared-332f2997.js +0 -1
  276. package/dist/cdn/shared-39f3b48d.js +0 -1
  277. package/dist/cdn/shared-432c5183.js +0 -9
  278. package/dist/cdn/shared-4dee79d4.js +0 -1
  279. package/dist/cdn/shared-53061389.js +0 -1
  280. package/dist/cdn/shared-59042137.js +0 -201
  281. package/dist/cdn/shared-65ba8b39.js +0 -1
  282. package/dist/cdn/shared-77a4d8e8.js +0 -1
  283. package/dist/cdn/shared-7f5618ba.js +0 -1
  284. package/dist/cdn/shared-92f27a38.js +0 -1
  285. package/dist/cdn/shared-b0f534ef.js +0 -1
  286. package/dist/cdn/shared-be24dd36.js +0 -804
  287. package/dist/cdn/shared-bf62a65b.js +0 -1
  288. package/dist/cdn/shared-c2d3b32b.js +0 -1
  289. package/dist/cdn/shared-cf269a17.js +0 -1
  290. package/dist/cdn/shared-fe54babe.js +0 -1
  291. package/dist/cdn/shared-fef9ecc1.js +0 -122
  292. package/dist/elements/public/AddressForm/regions.d.ts +0 -1
  293. package/dist/elements/public/AddressForm/regions.js +0 -67
  294. package/dist/elements/public/AddressForm/regions.js.map +0 -1
  295. package/dist/elements/public/CustomerPortal/InternalCustomerPortalChangePassword.d.ts +0 -29
  296. package/dist/elements/public/CustomerPortal/InternalCustomerPortalChangePassword.js +0 -169
  297. package/dist/elements/public/CustomerPortal/InternalCustomerPortalChangePassword.js.map +0 -1
  298. /package/dist/cdn/{shared-64657919.js → shared-343d1fd7.js} +0 -0
  299. /package/dist/cdn/{shared-d6276c83.js → shared-3ab0306f.js} +0 -0
  300. /package/dist/cdn/{shared-e6f3e9f0.js → shared-bb05cfed.js} +0 -0
  301. /package/dist/cdn/{shared-99065f2a.js → shared-d7be11de.js} +0 -0
  302. /package/dist/cdn/{shared-0479553e.js → shared-f9180815.js} +0 -0
@@ -70,6 +70,15 @@
70
70
  "title": "Enable Single Sign-On (SSO)",
71
71
  "subtitle": "Sync your sessions across your website and our checkout"
72
72
  },
73
+ "sign_up": {
74
+ "title": "Enable customer registration",
75
+ "subtitle": "Add a sign up form to your portal and enable the API",
76
+ "hcaptcha_explainer": "By default, Customer Portal uses Foxy's hCaptcha account to protect the sign up form. If you'd like to use your own hCaptcha account, please enter your site key and secret key above.",
77
+ "site_key_label": "hCaptcha site key",
78
+ "site_key_placeholder": "Use Foxy default",
79
+ "secret_key_label": "hCaptcha secret key",
80
+ "secret_key_placeholder": "Use Foxy default"
81
+ },
73
82
  "jwt": {
74
83
  "title": "JWT shared secret",
75
84
  "subtitle": "Reset this key to drop all active sessions",
@@ -88,21 +88,85 @@
88
88
  }
89
89
  },
90
90
  "customer-form": {
91
- "cancel": "Cancel",
92
- "confirm": "Confirm",
93
- "create": "Create",
94
- "date": "{{value, date}}",
95
- "date_created": "Created on",
96
- "date_modified": "Last updated",
97
- "delete": "Delete",
98
- "delete_prompt": "This resource will be permanently removed. Are you sure?",
99
- "email": "Email",
100
- "first_name": "First name",
101
- "last_name": "Last name",
102
- "tax_id": "Tax ID",
103
- "v8n_invalid_email": "Invalid email",
104
- "v8n_required": "Required",
105
- "v8n_too_long": "Too long",
91
+ "message": {
92
+ "password_change_success": "You have successfully set a new password for {{ email }}.",
93
+ "close": "Close"
94
+ },
95
+ "error": {
96
+ "registration_disabled": "Customer registration is disabled for this store. If you're seeing this message as a customer, please contact the store owner.",
97
+ "verification_failed": "Client verification failed. If you are seeing this message as a customer, please contact the store owner.",
98
+ "email_already_used": "This email is already in use. Please use a different email."
99
+ },
100
+ "first-name": {
101
+ "label": "First name",
102
+ "placeholder": "Not set",
103
+ "helper_text": "Customer's given name, optional.",
104
+ "v8n_too_long": "We can't store first names longer than 50 characters."
105
+ },
106
+ "last-name": {
107
+ "label": "Last name",
108
+ "placeholder": "Not set",
109
+ "helper_text": "Customer's surname, optional.",
110
+ "v8n_too_long": "We can't store last names longer than 50 characters."
111
+ },
112
+ "tax-id": {
113
+ "label": "Tax ID",
114
+ "placeholder": "Not set",
115
+ "helper_text": "Tax identification number for this customer, optional.",
116
+ "v8n_too_long": "We can't store tax IDs longer than 50 characters."
117
+ },
118
+ "email": {
119
+ "label": "Email",
120
+ "placeholder": "Required",
121
+ "helper_text": "This email will be used as the login to the Checkout and Customer Portal.",
122
+ "helper_text_last_login_date": "This customer's login to the Checkout and Customer Portal. Last used on {{ date, date }} at {{ date, time }}.",
123
+ "v8n_too_long": "We can't store emails longer than 100 characters.",
124
+ "v8n_invalid_email": "This email is invalid.",
125
+ "v8n_required": "Please fill out this field."
126
+ },
127
+ "is-anonymous": {
128
+ "label": "Account type",
129
+ "helper_text": "Guest customers dont't have access to Customer Portal. Once the account type is set, it can not be changed.",
130
+ "option_true": "Guest",
131
+ "option_false": "Registered"
132
+ },
133
+ "password": {
134
+ "label": "Password",
135
+ "placeholder": "Required",
136
+ "placeholder_new": "Keep current password",
137
+ "helper_text": "Set a password for this customer. To generate a secure random password for this account, use the ✨ button.",
138
+ "helper_text_new": "To change this customer's password, enter a new password here. If you leave it blank, their password will remain the same.",
139
+ "v8n_too_long": "Please use a password that is no longer than 50 characters.",
140
+ "v8n_too_weak": "Please use a stronger password. To make this password stronger, make it at least 8 characters long and include a few upper and lower case letters, numbers, and special characters.",
141
+ "v8n_required": "Please fill out this field."
142
+ },
143
+ "password-old": {
144
+ "label": "Old password",
145
+ "placeholder": "",
146
+ "helper_text": "Enter the old password to set a new password. If you're a store admin, you can leave this field blank.",
147
+ "v8n_required": "Please fill out this field."
148
+ },
149
+ "forgot-password": {
150
+ "label": "One-time code",
151
+ "placeholder": "Not set",
152
+ "helper_text": "Set a one-time code that this customer can use instead of a password to sign in. Keep in mind that this code will expire after 30 minutes.",
153
+ "helper_text_expired_on": "A one-time code that this customer can use instead of a password to sign in. This code expired on {{ expiresOn, date }} at {{ expiresOn, time }}.",
154
+ "helper_text_expires_in": "A one-time code that this customer can use instead of a password to sign in. This code will expire in {{ expiresInMin, relative }}.",
155
+ "v8n_too_long": "Please use a code that is no longer than 50 characters."
156
+ },
157
+ "timestamps": {
158
+ "date_created": "Created on",
159
+ "date_modified": "Last updated",
160
+ "date": "{{value, date}}"
161
+ },
162
+ "delete": {
163
+ "delete": "Delete",
164
+ "cancel": "Cancel",
165
+ "delete_prompt": "This action is irreversible. Are you sure you want to delete this customer?"
166
+ },
167
+ "create": {
168
+ "create": "Create"
169
+ },
106
170
  "spinner": {
107
171
  "loading_busy": "Loading",
108
172
  "loading_error": "Failed to load"
@@ -1,5 +1,7 @@
1
+ import type { PropertyDeclarations } from 'lit-element';
1
2
  import type { HALJSONResource } from '../../public/NucleonElement/types';
2
3
  import type { TemplateResult } from 'lit-html';
4
+ import type { Status } from './types';
3
5
  import { NucleonElement } from '../../public/NucleonElement/NucleonElement';
4
6
  declare const Base: typeof NucleonElement & {
5
7
  styles: import("lit-element").CSSResultArray;
@@ -12,6 +14,11 @@ declare const Base: typeof NucleonElement & {
12
14
  * @since 1.17.0
13
15
  */
14
16
  export declare class InternalForm<TData extends HALJSONResource> extends Base<TData> {
17
+ /** Validation errors with this prefix will show up at the top of the form. */
18
+ static generalErrorPrefix: string;
19
+ static get properties(): PropertyDeclarations;
20
+ /** Status message to render at the top of the form. If `null`, the message is hidden. */
21
+ status: null | Status;
15
22
  /**
16
23
  * Renders form body. This is the method you should implement in your forms
17
24
  * instead of `.render()`. If you'd like to keep the submit button and the timestamps,
@@ -23,5 +30,8 @@ export declare class InternalForm<TData extends HALJSONResource> extends Base<TD
23
30
  * instead of this method in your form to keep the spinner and the common layout features.
24
31
  */
25
32
  render(): TemplateResult;
33
+ private get __generalErrors();
34
+ private __renderGeneralError;
35
+ private __renderStatus;
26
36
  }
27
37
  export {};
@@ -12,6 +12,17 @@ const Base = ConfigurableMixin(ThemeableMixin(NucleonElement));
12
12
  * @since 1.17.0
13
13
  */
14
14
  export class InternalForm extends Base {
15
+ constructor() {
16
+ super(...arguments);
17
+ /** Status message to render at the top of the form. If `null`, the message is hidden. */
18
+ this.status = null;
19
+ }
20
+ static get properties() {
21
+ return {
22
+ ...super.properties,
23
+ status: { type: Object },
24
+ };
25
+ }
15
26
  /**
16
27
  * Renders form body. This is the method you should implement in your forms
17
28
  * instead of `.render()`. If you'd like to keep the submit button and the timestamps,
@@ -40,7 +51,8 @@ export class InternalForm extends Base {
40
51
  'opacity-0 pointer-events-none': isSpinnerVisible,
41
52
  })}
42
53
  >
43
- ${this.renderBody()}
54
+ ${this.__generalErrors.map(err => this.__renderGeneralError(err))}
55
+ ${this.status ? this.__renderStatus(this.status) : ''} ${this.renderBody()}
44
56
  </div>
45
57
 
46
58
  <div
@@ -61,5 +73,40 @@ export class InternalForm extends Base {
61
73
  </div>
62
74
  `;
63
75
  }
76
+ get __generalErrors() {
77
+ const prefix = this.constructor.generalErrorPrefix;
78
+ return this.errors.filter(v => v.startsWith(prefix));
79
+ }
80
+ __renderGeneralError(err) {
81
+ return html `
82
+ <foxy-i18n
83
+ class="leading-xs text-body rounded bg-error-10 block"
84
+ style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
85
+ infer="error"
86
+ key=${err.replace('error:', '')}
87
+ >
88
+ </foxy-i18n>
89
+ `;
90
+ }
91
+ __renderStatus({ key, options }) {
92
+ return html `
93
+ <p
94
+ data-testid="status"
95
+ class="leading-xs text-body rounded bg-success-10 flex items-start gap-m"
96
+ style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
97
+ >
98
+ <foxy-i18n class="flex-1" infer="status" key=${key} .options=${options}></foxy-i18n>
99
+ <vaadin-button
100
+ class="flex-shrink-0"
101
+ theme="success tertiary-inline"
102
+ @click=${() => (this.status = null)}
103
+ >
104
+ <foxy-i18n class="flex-1" infer="status" key="close"></foxy-i18n>
105
+ </vaadin-button>
106
+ </p>
107
+ `;
108
+ }
64
109
  }
110
+ /** Validation errors with this prefix will show up at the top of the form. */
111
+ InternalForm.generalErrorPrefix = 'error:';
65
112
  //# sourceMappingURL=InternalForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalForm.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/InternalForm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,cAAc,EAAE,sDAAmD;AAC5E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,OAAO,YAA4C,SAAQ,IAAW;IAC1E;;;;OAIG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,IAAI;YACd,CAAC,CAAC,IAAI,CAAA;;;SAGH;YACH,CAAC,CAAC,IAAI,CAAA,8EAA8E,CAAC;IACzF,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,MAAM,gBAAgB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5F,OAAO,IAAI,CAAA;uBACQ,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;;kBAEpB,QAAQ,CAAC;YACf,wBAAwB,EAAE,IAAI;YAC9B,oBAAoB,EAAE,IAAI;YAC1B,+BAA+B,EAAE,gBAAgB;SAClD,CAAC;;YAEA,IAAI,CAAC,UAAU,EAAE;;;;;kBAKX,QAAQ,CAAC;YACf,0CAA0C,EAAE,IAAI;YAChD,+BAA+B,EAAE,CAAC,gBAAgB;SACnD,CAAC;;;qBAGS,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;;oBAE1C,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;;;;;;KAMjD,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { HALJSONResource } from '../../public/NucleonElement/types';\nimport type { TemplateResult } from 'lit-html';\n\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { NucleonElement } from '../../public/NucleonElement/NucleonElement';\nimport { classMap } from '../../../utils/class-map';\nimport { html } from 'lit-html';\n\nconst Base = ConfigurableMixin(ThemeableMixin(NucleonElement));\n\n/**\n * An internal base class for any nucleon-powered form. Renders create/delete\n * buttons and timestamps by default, displays a spinner in non-idle states.\n *\n * @element foxy-internal-form\n * @since 1.17.0\n */\nexport class InternalForm<TData extends HALJSONResource> extends Base<TData> {\n /**\n * Renders form body. This is the method you should implement in your forms\n * instead of `.render()`. If you'd like to keep the submit button and the timestamps,\n * don't forget to add `super.renderBody()` to your template.\n */\n renderBody(): TemplateResult {\n return this.data\n ? html`\n <foxy-internal-timestamps-control infer=\"timestamps\"></foxy-internal-timestamps-control>\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n `\n : html`<foxy-internal-create-control infer=\"create\"></foxy-internal-create-control>`;\n }\n\n /**\n * Renders the entire form. You should probably implement `.renderBody()`\n * instead of this method in your form to keep the spinner and the common layout features.\n */\n render(): TemplateResult {\n const isSpinnerVisible = !this.in('idle') && (!this.in({ busy: 'fetching' }) || !this.data);\n\n return html`\n <div aria-busy=${this.in('busy')} aria-live=\"polite\" class=\"relative\">\n <div\n class=${classMap({\n 'grid grid-cols-1 gap-m': true,\n 'transition-opacity': true,\n 'opacity-0 pointer-events-none': isSpinnerVisible,\n })}\n >\n ${this.renderBody()}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition-opacity absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !isSpinnerVisible,\n })}\n >\n <foxy-spinner\n layout=${this.in('fail') ? 'vertical' : 'no-label'}\n class=\"m-auto\"\n state=${this.in('fail') ? 'error' : 'busy'}\n infer=\"spinner\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalForm.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/InternalForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,cAAc,EAAE,sDAAmD;AAC5E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,OAAO,YAA4C,SAAQ,IAAW;IAA5E;;QAWE,yFAAyF;QACzF,WAAM,GAAkB,IAAI,CAAC;IA0F/B,CAAC;IAlGC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACzB,CAAC;IACJ,CAAC;IAKD;;;;OAIG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,IAAI;YACd,CAAC,CAAC,IAAI,CAAA;;;SAGH;YACH,CAAC,CAAC,IAAI,CAAA,8EAA8E,CAAC;IACzF,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,MAAM,gBAAgB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5F,OAAO,IAAI,CAAA;uBACQ,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;;kBAEpB,QAAQ,CAAC;YACf,wBAAwB,EAAE,IAAI;YAC9B,oBAAoB,EAAE,IAAI;YAC1B,+BAA+B,EAAE,gBAAgB;SAClD,CAAC;;YAEA,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;YAC/D,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;;;;;kBAKlE,QAAQ,CAAC;YACf,0CAA0C,EAAE,IAAI;YAChD,+BAA+B,EAAE,CAAC,gBAAgB;SACnD,CAAC;;;qBAGS,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;;oBAE1C,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;;;;;;KAMjD,CAAC;IACJ,CAAC;IAED,IAAY,eAAe;QACzB,MAAM,MAAM,GAAI,IAAI,CAAC,WAAmC,CAAC,kBAAkB,CAAC;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAEO,oBAAoB,CAAC,GAAW;QACtC,OAAO,IAAI,CAAA;;;;;cAKD,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;;;KAGlC,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,EAAE,GAAG,EAAE,OAAO,EAAU;QAC7C,OAAO,IAAI,CAAA;;;;;;uDAMwC,GAAG,aAAa,OAAO;;;;mBAI3D,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;KAKxC,CAAC;IACJ,CAAC;;AApGD,8EAA8E;AACvE,+BAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { HALJSONResource } from '../../public/NucleonElement/types';\nimport type { TemplateResult } from 'lit-html';\nimport type { Status } from './types';\n\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { NucleonElement } from '../../public/NucleonElement/NucleonElement';\nimport { classMap } from '../../../utils/class-map';\nimport { html } from 'lit-html';\n\nconst Base = ConfigurableMixin(ThemeableMixin(NucleonElement));\n\n/**\n * An internal base class for any nucleon-powered form. Renders create/delete\n * buttons and timestamps by default, displays a spinner in non-idle states.\n *\n * @element foxy-internal-form\n * @since 1.17.0\n */\nexport class InternalForm<TData extends HALJSONResource> extends Base<TData> {\n /** Validation errors with this prefix will show up at the top of the form. */\n static generalErrorPrefix = 'error:';\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n status: { type: Object },\n };\n }\n\n /** Status message to render at the top of the form. If `null`, the message is hidden. */\n status: null | Status = null;\n\n /**\n * Renders form body. This is the method you should implement in your forms\n * instead of `.render()`. If you'd like to keep the submit button and the timestamps,\n * don't forget to add `super.renderBody()` to your template.\n */\n renderBody(): TemplateResult {\n return this.data\n ? html`\n <foxy-internal-timestamps-control infer=\"timestamps\"></foxy-internal-timestamps-control>\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n `\n : html`<foxy-internal-create-control infer=\"create\"></foxy-internal-create-control>`;\n }\n\n /**\n * Renders the entire form. You should probably implement `.renderBody()`\n * instead of this method in your form to keep the spinner and the common layout features.\n */\n render(): TemplateResult {\n const isSpinnerVisible = !this.in('idle') && (!this.in({ busy: 'fetching' }) || !this.data);\n\n return html`\n <div aria-busy=${this.in('busy')} aria-live=\"polite\" class=\"relative\">\n <div\n class=${classMap({\n 'grid grid-cols-1 gap-m': true,\n 'transition-opacity': true,\n 'opacity-0 pointer-events-none': isSpinnerVisible,\n })}\n >\n ${this.__generalErrors.map(err => this.__renderGeneralError(err))}\n ${this.status ? this.__renderStatus(this.status) : ''} ${this.renderBody()}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition-opacity absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !isSpinnerVisible,\n })}\n >\n <foxy-spinner\n layout=${this.in('fail') ? 'vertical' : 'no-label'}\n class=\"m-auto\"\n state=${this.in('fail') ? 'error' : 'busy'}\n infer=\"spinner\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private get __generalErrors() {\n const prefix = (this.constructor as typeof InternalForm).generalErrorPrefix;\n return this.errors.filter(v => v.startsWith(prefix));\n }\n\n private __renderGeneralError(err: string) {\n return html`\n <foxy-i18n\n class=\"leading-xs text-body rounded bg-error-10 block\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n infer=\"error\"\n key=${err.replace('error:', '')}\n >\n </foxy-i18n>\n `;\n }\n\n private __renderStatus({ key, options }: Status) {\n return html`\n <p\n data-testid=\"status\"\n class=\"leading-xs text-body rounded bg-success-10 flex items-start gap-m\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <foxy-i18n class=\"flex-1\" infer=\"status\" key=${key} .options=${options}></foxy-i18n>\n <vaadin-button\n class=\"flex-shrink-0\"\n theme=\"success tertiary-inline\"\n @click=${() => (this.status = null)}\n >\n <foxy-i18n class=\"flex-1\" infer=\"status\" key=\"close\"></foxy-i18n>\n </vaadin-button>\n </p>\n `;\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import '@vaadin/vaadin-button';
1
2
  import '../InternalTimestampsControl/index';
2
3
  import '../InternalCreateControl/index';
3
4
  import '../InternalDeleteControl/index';
@@ -1,3 +1,4 @@
1
+ import '@vaadin/vaadin-button';
1
2
  import "../InternalTimestampsControl/index.js";
2
3
  import "../InternalCreateControl/index.js";
3
4
  import "../InternalDeleteControl/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/index.ts"],"names":[],"mappings":"AAAA,+CAA4C;AAC5C,2CAAwC;AACxC,2CAAwC;AAExC,uCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,0BAAuB;AAE9C,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import '../InternalTimestampsControl/index';\nimport '../InternalCreateControl/index';\nimport '../InternalDeleteControl/index';\n\nimport '../../public/Spinner/index';\n\nimport { InternalForm } from './InternalForm';\n\ncustomElements.define('foxy-internal-form', InternalForm);\n\nexport { InternalForm };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,+CAA4C;AAC5C,2CAAwC;AACxC,2CAAwC;AAExC,uCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,0BAAuB;AAE9C,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-button';\n\nimport '../InternalTimestampsControl/index';\nimport '../InternalCreateControl/index';\nimport '../InternalDeleteControl/index';\n\nimport '../../public/Spinner/index';\n\nimport { InternalForm } from './InternalForm';\n\ncustomElements.define('foxy-internal-form', InternalForm);\n\nexport { InternalForm };\n"]}
@@ -0,0 +1,4 @@
1
+ export declare type Status = {
2
+ key: string;
3
+ options?: unknown;
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/types.ts"],"names":[],"mappings":"","sourcesContent":["export type Status = { key: string; options?: unknown };\n"]}
@@ -1,4 +1,4 @@
1
- import type { TemplateResult } from 'lit-element';
1
+ import type { PropertyDeclarations, TemplateResult } from 'lit-element';
2
2
  import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';
3
3
  /**
4
4
  * Internal control displaying a basic password box.
@@ -7,7 +7,11 @@ import { InternalEditableControl } from '../InternalEditableControl/InternalEdit
7
7
  * @element foxy-internal-password-field-control
8
8
  */
9
9
  export declare class InternalPasswordControl extends InternalEditableControl {
10
+ static get properties(): PropertyDeclarations;
11
+ /** If true, renders the password generator button. */
12
+ showGenerator: boolean;
10
13
  renderControl(): TemplateResult;
11
14
  protected get _value(): string;
12
15
  protected set _value(newValue: string);
16
+ private __renderGenerator;
13
17
  }
@@ -1,6 +1,8 @@
1
1
  import { InternalEditableControl } from "../InternalEditableControl/InternalEditableControl.js";
2
+ import { generateRandomPassword } from "./generateRandomPassword.js";
2
3
  import { ifDefined } from 'lit-html/directives/if-defined';
3
- import { html } from 'lit-element';
4
+ import { html, svg } from 'lit-element';
5
+ import { classMap } from "../../../utils/class-map.js";
4
6
  /**
5
7
  * Internal control displaying a basic password box.
6
8
  *
@@ -8,6 +10,17 @@ import { html } from 'lit-element';
8
10
  * @element foxy-internal-password-field-control
9
11
  */
10
12
  export class InternalPasswordControl extends InternalEditableControl {
13
+ constructor() {
14
+ super(...arguments);
15
+ /** If true, renders the password generator button. */
16
+ this.showGenerator = false;
17
+ }
18
+ static get properties() {
19
+ return {
20
+ ...super.properties,
21
+ showGenerator: { type: Boolean, attribute: 'show-generator' },
22
+ };
23
+ }
11
24
  renderControl() {
12
25
  return html `
13
26
  <vaadin-password-field
@@ -26,6 +39,7 @@ export class InternalPasswordControl extends InternalEditableControl {
26
39
  this._value = area.value;
27
40
  }}
28
41
  >
42
+ ${this.showGenerator ? this.__renderGenerator() : ''}
29
43
  </vaadin-password-field>
30
44
  `;
31
45
  }
@@ -36,5 +50,26 @@ export class InternalPasswordControl extends InternalEditableControl {
36
50
  set _value(newValue) {
37
51
  super._value = newValue;
38
52
  }
53
+ __renderGenerator() {
54
+ return html `
55
+ <div
56
+ data-testid="generator"
57
+ class=${classMap({
58
+ 'w-s h-s flex items-center justify-center cursor-default transition-colors': true,
59
+ 'text-contrast-60 hover-text-contrast-80': !this.disabled && !this.readonly,
60
+ 'text-contrast-20': this.disabled || this.readonly,
61
+ })}
62
+ slot="suffix"
63
+ @click=${() => {
64
+ this._value = generateRandomPassword();
65
+ const field = this.renderRoot.querySelector('vaadin-password-field');
66
+ // @ts-expect-error: this is a private method but it's ok since the version is fixed
67
+ field === null || field === void 0 ? void 0 : field._setPasswordVisible(true);
68
+ }}
69
+ >
70
+ ${svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.15em; height: 1.15em"><path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" /></svg>`}
71
+ </div>
72
+ `;
73
+ }
39
74
  }
40
75
  //# sourceMappingURL=InternalPasswordControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalPasswordControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/InternalPasswordControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,uBAAuB;IAClE,aAAa;QACX,OAAO,IAAI,CAAA;;wBAES,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;sBAC/B,IAAI,CAAC,UAAU;sBACf,IAAI,CAAC,WAAW;gBACtB,IAAI,CAAC,KAAK;;oBAEN,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;yBACR,IAAI,CAAC,cAAc;iBAC3B,IAAI,CAAC,MAAM;mBACT,CAAC,GAAkB,EAAE,EAAE,WAAC,OAAA,GAAG,CAAC,GAAG,KAAK,OAAO,WAAI,IAAI,CAAC,OAAO,0CAAE,MAAM,GAAE,CAAA,EAAA;iBACvE,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,aAAqC,CAAC;YACvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,CAAC;;;KAGJ,CAAC;IACJ,CAAC;IAED,IAAc,MAAM;;QAClB,aAAQ,KAAK,CAAC,MAA6B,mCAAI,EAAE,CAAC;IACpD,CAAC;IAED,IAAc,MAAM,CAAC,QAAgB;QACnC,KAAK,CAAC,MAAM,GAAG,QAA+B,CAAC;IACjD,CAAC;CACF","sourcesContent":["import type { PasswordFieldElement } from '@vaadin/vaadin-text-field/vaadin-password-field';\nimport type { TemplateResult } from 'lit-element';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-element';\n\n/**\n * Internal control displaying a basic password box.\n *\n * @since 1.17.0\n * @element foxy-internal-password-field-control\n */\nexport class InternalPasswordControl extends InternalEditableControl {\n renderControl(): TemplateResult {\n return html`\n <vaadin-password-field\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n class=\"w-full\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const area = evt.currentTarget as PasswordFieldElement;\n this._value = area.value;\n }}\n >\n </vaadin-password-field>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalPasswordControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/InternalPasswordControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,sBAAsB,EAAE,oCAAiC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,uBAAuB;IAApE;;QAQE,sDAAsD;QACtD,kBAAa,GAAG,KAAK,CAAC;IAsDxB,CAAC;IA9DC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE;SAC9D,CAAC;IACJ,CAAC;IAKD,aAAa;QACX,OAAO,IAAI,CAAA;;wBAES,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;sBAC/B,IAAI,CAAC,UAAU;sBACf,IAAI,CAAC,WAAW;gBACtB,IAAI,CAAC,KAAK;;oBAEN,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;yBACR,IAAI,CAAC,cAAc;iBAC3B,IAAI,CAAC,MAAM;mBACT,CAAC,GAAkB,EAAE,EAAE,WAAC,OAAA,GAAG,CAAC,GAAG,KAAK,OAAO,WAAI,IAAI,CAAC,OAAO,0CAAE,MAAM,GAAE,CAAA,EAAA;iBACvE,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,aAAqC,CAAC;YACvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,CAAC;;UAEC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE;;KAEvD,CAAC;IACJ,CAAC;IAED,IAAc,MAAM;;QAClB,aAAQ,KAAK,CAAC,MAA6B,mCAAI,EAAE,CAAC;IACpD,CAAC;IAED,IAAc,MAAM,CAAC,QAAgB;QACnC,KAAK,CAAC,MAAM,GAAG,QAA+B,CAAC;IACjD,CAAC;IAEO,iBAAiB;QACvB,OAAO,IAAI,CAAA;;;gBAGC,QAAQ,CAAC;YACf,2EAA2E,EAAE,IAAI;YACjF,yCAAyC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ;YAC3E,kBAAkB,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;SACnD,CAAC;;iBAEO,GAAG,EAAE;YACZ,IAAI,CAAC,MAAM,GAAG,sBAAsB,EAAE,CAAC;YACvC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;YACrE,oFAAoF;YACpF,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,mBAAmB,CAAC,IAAI,EAAE;QACnC,CAAC;;UAEC,GAAG,CAAA,g1BAAg1B;;KAEx1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { PasswordFieldElement } from '@vaadin/vaadin-text-field/vaadin-password-field';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { generateRandomPassword } from './generateRandomPassword';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, svg } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\n\n/**\n * Internal control displaying a basic password box.\n *\n * @since 1.17.0\n * @element foxy-internal-password-field-control\n */\nexport class InternalPasswordControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n showGenerator: { type: Boolean, attribute: 'show-generator' },\n };\n }\n\n /** If true, renders the password generator button. */\n showGenerator = false;\n\n renderControl(): TemplateResult {\n return html`\n <vaadin-password-field\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n class=\"w-full\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const area = evt.currentTarget as PasswordFieldElement;\n this._value = area.value;\n }}\n >\n ${this.showGenerator ? this.__renderGenerator() : ''}\n </vaadin-password-field>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n\n private __renderGenerator(): TemplateResult {\n return html`\n <div\n data-testid=\"generator\"\n class=${classMap({\n 'w-s h-s flex items-center justify-center cursor-default transition-colors': true,\n 'text-contrast-60 hover-text-contrast-80': !this.disabled && !this.readonly,\n 'text-contrast-20': this.disabled || this.readonly,\n })}\n slot=\"suffix\"\n @click=${() => {\n this._value = generateRandomPassword();\n const field = this.renderRoot.querySelector('vaadin-password-field');\n // @ts-expect-error: this is a private method but it's ok since the version is fixed\n field?._setPasswordVisible(true);\n }}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1.15em; height: 1.15em\"><path d=\"M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z\" /></svg>`}\n </div>\n `;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function generateRandomPassword(): string;
@@ -0,0 +1,11 @@
1
+ export function generateRandomPassword() {
2
+ const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
3
+ let result = '';
4
+ for (let i = 0; i < 18; i++) {
5
+ if (i > 0 && i % 6 === 0)
6
+ result += '-';
7
+ result += charset[Math.floor(Math.random() * charset.length)];
8
+ }
9
+ return result;
10
+ }
11
+ //# sourceMappingURL=generateRandomPassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRandomPassword.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/generateRandomPassword.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,sBAAsB;IACpC,MAAM,OAAO,GAAG,gEAAgE,CAAC;IACjF,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,GAAG,CAAC;QACxC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;KAC/D;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["export function generateRandomPassword(): string {\n const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n\n for (let i = 0; i < 18; i++) {\n if (i > 0 && i % 6 === 0) result += '-';\n result += charset[Math.floor(Math.random() * charset.length)];\n }\n\n return result;\n}\n"]}
@@ -62,7 +62,8 @@ export declare class AddressForm extends Base<Data> {
62
62
  templates: Templates;
63
63
  private readonly __getValidator;
64
64
  private readonly __bindField;
65
- private readonly __maybeRenderComboBox;
65
+ private readonly __maybeRenderCountry;
66
+ private readonly __maybeRenderRegion;
66
67
  private readonly __maybeRenderTextField;
67
68
  private readonly __renderTimestamps;
68
69
  private readonly __renderAction;
@@ -9,7 +9,6 @@ import { classMap } from "../../../utils/class-map.js";
9
9
  import { countries } from "./countries.js";
10
10
  import { ifDefined } from 'lit-html/directives/if-defined';
11
11
  import memoize from 'lodash-es/memoize';
12
- import { regions } from "./regions.js";
13
12
  const NS = 'address-form';
14
13
  const Base = ScopedElementsMixin(ConfigurableMixin(ThemeableMixin(TranslatableMixin(NucleonElement, NS))));
15
14
  /**
@@ -69,40 +68,78 @@ export class AddressForm extends Base {
69
68
  });
70
69
  this.__bindField = memoize((key) => {
71
70
  return (evt) => {
72
- const target = evt.target;
71
+ const target = evt.currentTarget;
73
72
  this.edit({ [key]: target.value });
74
73
  };
75
74
  });
76
- this.__maybeRenderComboBox = (params) => {
75
+ this.__maybeRenderCountry = () => {
77
76
  var _a, _b;
78
- const { source, field, custom = false } = params;
79
- const bsid = field.replace(/_/, '-');
80
- if (this.hiddenSelector.matches(bsid))
77
+ const field = 'country';
78
+ if (this.hiddenSelector.matches(field))
81
79
  return '';
82
- const I18nElement = customElements.get('foxy-i18n');
83
- const t = I18nElement.i18next.getFixedT(this.lang, field);
80
+ const source = Object.keys(countries);
84
81
  return html `
85
82
  <div>
86
- ${this.renderTemplateOrSlot(`${bsid}:before`)}
83
+ ${this.renderTemplateOrSlot(`${field}:before`)}
87
84
 
88
85
  <vaadin-combo-box
89
86
  class="w-full"
90
87
  label=${this.t(field).toString()}
91
88
  value=${ifDefined((_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a[field]) === null || _b === void 0 ? void 0 : _b.toString())}
92
89
  error-message=${this.__getErrorMessage(field)}
93
- data-testid=${bsid}
90
+ data-testid=${field}
94
91
  item-value-path="code"
95
92
  item-label-path="text"
96
93
  .checkValidity=${this.__getValidator(field)}
97
- .items=${source.map(code => ({ text: t(code).toString(), code }))}
98
- ?allow-custom-value=${custom}
99
- ?readonly=${this.readonlySelector.matches(bsid, true)}
100
- ?disabled=${!this.in('idle') || this.disabledSelector.matches(bsid, true)}
94
+ .items=${source.map(code => ({
95
+ text: this.t(`country_${code.toLowerCase()}`),
96
+ code,
97
+ }))}
98
+ ?readonly=${this.readonlySelector.matches(field, true)}
99
+ ?disabled=${!this.in('idle') || this.disabledSelector.matches(field, true)}
100
+ @change=${(evt) => {
101
+ const target = evt.currentTarget;
102
+ this.edit({ country: target.value, region: '' });
103
+ }}
104
+ >
105
+ </vaadin-combo-box>
106
+
107
+ ${this.renderTemplateOrSlot(`${field}:after`)}
108
+ </div>
109
+ `;
110
+ };
111
+ this.__maybeRenderRegion = () => {
112
+ var _a, _b, _c, _d, _e;
113
+ const field = 'region';
114
+ if (this.hiddenSelector.matches(field))
115
+ return '';
116
+ const source = (_b = countries[(_a = this.form.country) !== null && _a !== void 0 ? _a : '']) !== null && _b !== void 0 ? _b : [];
117
+ const country = (_c = this.form.country) !== null && _c !== void 0 ? _c : '';
118
+ return html `
119
+ <div>
120
+ ${this.renderTemplateOrSlot(`${field}:before`)}
121
+
122
+ <vaadin-combo-box
123
+ class="w-full"
124
+ label=${this.t(field).toString()}
125
+ value=${ifDefined((_e = (_d = this.form) === null || _d === void 0 ? void 0 : _d[field]) === null || _e === void 0 ? void 0 : _e.toString())}
126
+ error-message=${this.__getErrorMessage(field)}
127
+ data-testid=${field}
128
+ item-value-path="code"
129
+ item-label-path="text"
130
+ .checkValidity=${this.__getValidator(field)}
131
+ .items=${source.map(code => ({
132
+ text: this.t(`country_${country.toLowerCase()}_region_${code.toLowerCase()}`),
133
+ code,
134
+ }))}
135
+ ?allow-custom-value=${source.length === 0}
136
+ ?readonly=${this.readonlySelector.matches(field, true)}
137
+ ?disabled=${!this.in('idle') || this.disabledSelector.matches(field, true)}
101
138
  @change=${this.__bindField(field)}
102
139
  >
103
140
  </vaadin-combo-box>
104
141
 
105
- ${this.renderTemplateOrSlot(`${bsid}:after`)}
142
+ ${this.renderTemplateOrSlot(`${field}:after`)}
106
143
  </div>
107
144
  `;
108
145
  };
@@ -255,8 +292,7 @@ export class AddressForm extends Base {
255
292
  ${this.__maybeRenderTextField({ field: 'phone' })}
256
293
  ${this.__maybeRenderTextField({ field: 'address1', wide: true, required: true })}
257
294
  ${this.__maybeRenderTextField({ field: 'address2', wide: true })}
258
- ${this.__maybeRenderComboBox({ field: 'country', source: countries })}
259
- ${this.__maybeRenderComboBox({ field: 'region', source: regions, custom: true })}
295
+ ${this.__maybeRenderCountry()} ${this.__maybeRenderRegion()}
260
296
  ${this.__maybeRenderTextField({ field: 'city' })}
261
297
  ${this.__maybeRenderTextField({ field: 'postal_code' })}
262
298
  </div>