@foxy.io/elements 1.33.0-beta.1 → 1.33.0-beta.3

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 (200) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  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-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-api-browser.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-form.js +1 -1
  12. package/dist/cdn/foxy-billing-address-card.js +1 -1
  13. package/dist/cdn/foxy-cancellation-form.js +1 -1
  14. package/dist/cdn/foxy-cart-card.js +1 -1
  15. package/dist/cdn/foxy-cart-form.js +1 -1
  16. package/dist/cdn/foxy-client-card.js +1 -1
  17. package/dist/cdn/foxy-client-form.js +1 -1
  18. package/dist/cdn/foxy-collection-page.js +1 -1
  19. package/dist/cdn/foxy-collection-pages.js +1 -1
  20. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  21. package/dist/cdn/foxy-coupon-card.js +1 -1
  22. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  26. package/dist/cdn/foxy-coupon-form.js +1 -1
  27. package/dist/cdn/foxy-custom-field-card.js +1 -1
  28. package/dist/cdn/foxy-custom-field-form.js +1 -1
  29. package/dist/cdn/foxy-customer-card.js +1 -1
  30. package/dist/cdn/foxy-customer-form.js +1 -1
  31. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  33. package/dist/cdn/foxy-customer-portal.js +1 -1
  34. package/dist/cdn/foxy-customer.js +4 -4
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +1 -1
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  47. package/dist/cdn/foxy-form-dialog.js +1 -1
  48. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-card.js +1 -1
  50. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  54. package/dist/cdn/foxy-gift-card-form.js +1 -1
  55. package/dist/cdn/foxy-i18n-editor.js +1 -1
  56. package/dist/cdn/foxy-i18n.js +1 -1
  57. package/dist/cdn/foxy-integration-card.js +1 -1
  58. package/dist/cdn/foxy-integration-form.js +1 -1
  59. package/dist/cdn/foxy-item-card.js +1 -1
  60. package/dist/cdn/foxy-item-category-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-form.js +1 -1
  62. package/dist/cdn/foxy-item-form.js +1 -1
  63. package/dist/cdn/foxy-item-option-card.js +1 -1
  64. package/dist/cdn/foxy-item-option-form.js +1 -1
  65. package/dist/cdn/foxy-items-form.js +1 -1
  66. package/dist/cdn/foxy-native-integration-card.js +1 -1
  67. package/dist/cdn/foxy-native-integration-form.js +1 -1
  68. package/dist/cdn/foxy-pagination.js +1 -1
  69. package/dist/cdn/foxy-passkey-card.js +1 -1
  70. package/dist/cdn/foxy-passkey-form.js +1 -1
  71. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  72. package/dist/cdn/foxy-payment-card.js +1 -1
  73. package/dist/cdn/foxy-payment-method-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  76. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  80. package/dist/cdn/foxy-query-builder.js +1 -1
  81. package/dist/cdn/foxy-report-form.js +1 -1
  82. package/dist/cdn/foxy-reports-table.js +1 -1
  83. package/dist/cdn/foxy-shipment-card.js +1 -1
  84. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  85. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  88. package/dist/cdn/foxy-sign-in-form.js +1 -1
  89. package/dist/cdn/foxy-spinner.js +2 -2
  90. package/dist/cdn/foxy-store-card.js +1 -1
  91. package/dist/cdn/foxy-store-form.js +1 -1
  92. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  93. package/dist/cdn/foxy-subscription-card.js +1 -1
  94. package/dist/cdn/foxy-subscription-form.js +1 -1
  95. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  96. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  97. package/dist/cdn/foxy-table.js +1 -1
  98. package/dist/cdn/foxy-tax-card.js +1 -1
  99. package/dist/cdn/foxy-tax-form.js +1 -1
  100. package/dist/cdn/foxy-template-config-form.js +1 -1
  101. package/dist/cdn/foxy-template-form.js +1 -1
  102. package/dist/cdn/foxy-template-set-card.js +1 -1
  103. package/dist/cdn/foxy-template-set-form.js +1 -1
  104. package/dist/cdn/foxy-transaction-card.js +1 -1
  105. package/dist/cdn/foxy-transaction.js +1 -1
  106. package/dist/cdn/foxy-transactions-table.js +6 -6
  107. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  108. package/dist/cdn/foxy-user-card.js +1 -1
  109. package/dist/cdn/foxy-user-form.js +1 -1
  110. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  111. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  112. package/dist/cdn/foxy-users-table.js +1 -1
  113. package/dist/cdn/foxy-webhook-card.js +1 -1
  114. package/dist/cdn/foxy-webhook-form.js +1 -1
  115. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  116. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  117. package/dist/cdn/{shared-51efaf53.js → shared-02c737dc.js} +1 -1
  118. package/dist/cdn/{shared-359793d4.js → shared-08e73812.js} +1 -1
  119. package/dist/cdn/{shared-3bfbd5af.js → shared-0d4cdb19.js} +1 -1
  120. package/dist/cdn/{shared-91500a0f.js → shared-136942c7.js} +1 -1
  121. package/dist/cdn/{shared-53443b27.js → shared-148214ee.js} +1 -1
  122. package/dist/cdn/shared-1acbd965.js +1 -0
  123. package/dist/cdn/{shared-c671d5c7.js → shared-1d0d814b.js} +1 -1
  124. package/dist/cdn/{shared-ad3eea80.js → shared-25b83adb.js} +1 -1
  125. package/dist/cdn/{shared-b384e653.js → shared-2aee2a22.js} +1 -1
  126. package/dist/cdn/{shared-01cbaba9.js → shared-2ca888f6.js} +1 -1
  127. package/dist/cdn/{shared-c24bc616.js → shared-2dd2ff95.js} +1 -1
  128. package/dist/cdn/{shared-9b1b4c9d.js → shared-32566c11.js} +1 -1
  129. package/dist/cdn/{shared-81bf4ca2.js → shared-33c9ef32.js} +1 -1
  130. package/dist/cdn/{shared-f09454f9.js → shared-3db18172.js} +1 -1
  131. package/dist/cdn/{shared-97627d50.js → shared-3ebbd21d.js} +1 -1
  132. package/dist/cdn/{shared-838bd79c.js → shared-3ef5dcef.js} +1 -1
  133. package/dist/cdn/{shared-935adc3b.js → shared-433ff5ae.js} +1 -1
  134. package/dist/cdn/{shared-c86db2c0.js → shared-46189aae.js} +1 -1
  135. package/dist/cdn/{shared-3ca58fb9.js → shared-47fe9f56.js} +1 -1
  136. package/dist/cdn/{shared-b14bf56d.js → shared-4f33425a.js} +1 -1
  137. package/dist/cdn/{shared-bb9f0d8b.js → shared-52c9fa57.js} +1 -1
  138. package/dist/cdn/{shared-455856d9.js → shared-56ee26d7.js} +2 -2
  139. package/dist/cdn/{shared-91321de3.js → shared-57373d84.js} +1 -1
  140. package/dist/cdn/{shared-4b4c8ccf.js → shared-5cdec81e.js} +1 -1
  141. package/dist/cdn/{shared-4beb6fef.js → shared-62af0ef5.js} +1 -1
  142. package/dist/cdn/{shared-bdcf2d35.js → shared-636cf673.js} +1 -1
  143. package/dist/cdn/{shared-e0c93cfa.js → shared-6583e3f9.js} +1 -1
  144. package/dist/cdn/{shared-dbe8536b.js → shared-66e2a4ee.js} +1 -1
  145. package/dist/cdn/shared-67d1de9a.js +1 -0
  146. package/dist/cdn/shared-684174e7.js +1 -0
  147. package/dist/cdn/{shared-eecba1f5.js → shared-69c7aec1.js} +1 -1
  148. package/dist/cdn/{shared-0d43de87.js → shared-69cdc370.js} +1 -1
  149. package/dist/cdn/{shared-b7dc7e64.js → shared-6b15ed9e.js} +1 -1
  150. package/dist/cdn/{shared-5452fdfe.js → shared-6b578d1a.js} +1 -1
  151. package/dist/cdn/{shared-fd1adc35.js → shared-6b5e4fe4.js} +1 -1
  152. package/dist/cdn/{shared-57164953.js → shared-705ce87a.js} +1 -1
  153. package/dist/cdn/{shared-6d7c1a2f.js → shared-70612035.js} +1 -1
  154. package/dist/cdn/{shared-4f852fd5.js → shared-77135874.js} +1 -1
  155. package/dist/cdn/{shared-1024aa20.js → shared-7edf38e9.js} +1 -1
  156. package/dist/cdn/{shared-6be8e65e.js → shared-83c8a2d2.js} +1 -1
  157. package/dist/cdn/{shared-6a8ccf0c.js → shared-8a65adfd.js} +1 -1
  158. package/dist/cdn/{shared-3a7db771.js → shared-8d5b9662.js} +1 -1
  159. package/dist/cdn/{shared-78bfc71e.js → shared-8d826ccb.js} +1 -1
  160. package/dist/cdn/{shared-b2bc3a0e.js → shared-95a591b3.js} +1 -1
  161. package/dist/cdn/{shared-b3d36746.js → shared-9dd252c7.js} +1 -1
  162. package/dist/cdn/{shared-ceafb6c3.js → shared-9ea762dc.js} +1 -1
  163. package/dist/cdn/{shared-e39760d5.js → shared-9f4fad24.js} +1 -1
  164. package/dist/cdn/{shared-e231722c.js → shared-a1f697c2.js} +1 -1
  165. package/dist/cdn/{shared-bbc53ef2.js → shared-a2616e4b.js} +1 -1
  166. package/dist/cdn/{shared-30cc688f.js → shared-a46c8030.js} +1 -1
  167. package/dist/cdn/{shared-0f4472d2.js → shared-a8f38962.js} +1 -1
  168. package/dist/cdn/{shared-317cb721.js → shared-a9b8c3ab.js} +1 -1
  169. package/dist/cdn/{shared-0b4a62e9.js → shared-a9f4e92e.js} +1 -1
  170. package/dist/cdn/{shared-14179b23.js → shared-b73aaedb.js} +1 -1
  171. package/dist/cdn/{shared-7448fda4.js → shared-b8ae5af7.js} +1 -1
  172. package/dist/cdn/{shared-68f01c8d.js → shared-b8c6eafc.js} +1 -1
  173. package/dist/cdn/{shared-529f2b48.js → shared-cb24170b.js} +1 -1
  174. package/dist/cdn/{shared-377e3168.js → shared-cc8ce493.js} +1 -1
  175. package/dist/cdn/shared-ccc7a886.js +1 -0
  176. package/dist/cdn/{shared-d6985b5f.js → shared-cfe76d01.js} +1 -1
  177. package/dist/cdn/{shared-1220bf7d.js → shared-d3ffbcb0.js} +1 -1
  178. package/dist/cdn/{shared-0203d3da.js → shared-e8744e04.js} +1 -1
  179. package/dist/cdn/{shared-e1dea184.js → shared-eb8a9f27.js} +1 -1
  180. package/dist/cdn/{shared-14bf37ae.js → shared-f0db16a5.js} +1 -1
  181. package/dist/cdn/{shared-4b52b410.js → shared-f4e03cdc.js} +1 -1
  182. package/dist/cdn/{shared-cacd4407.js → shared-f6f4bed5.js} +1 -1
  183. package/dist/cdn/{shared-3493737e.js → shared-f79438f8.js} +1 -1
  184. package/dist/cdn/{shared-08be5c32.js → shared-ff10b9fb.js} +1 -1
  185. package/dist/cdn/translations/store-form/en.json +10 -4
  186. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.d.ts +4 -0
  187. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +21 -2
  188. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  189. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +1 -1
  190. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  191. package/dist/elements/public/StoreForm/StoreForm.d.ts +4 -0
  192. package/dist/elements/public/StoreForm/StoreForm.js +89 -11
  193. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  194. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +3 -3
  195. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
  196. package/package.json +2 -1
  197. package/dist/cdn/shared-0e83a899.js +0 -1
  198. package/dist/cdn/shared-2dd497e5.js +0 -1
  199. package/dist/cdn/shared-54d7dfdb.js +0 -1
  200. package/dist/cdn/shared-a84befbf.js +0 -1
@@ -1 +1 @@
1
- import"./shared-e0c93cfa.js";import"./shared-6d7c1a2f.js";class o extends HTMLElement{static get version(){return"1.6.1"}}customElements.define("vaadin-lumo-styles",o);const n=document.createElement("template");n.innerHTML='<custom-style>\n <style>\n html {\n /* Base (background) */\n --lumo-base-color: #FFF;\n\n /* Tint */\n --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);\n --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);\n --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);\n --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);\n --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);\n --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);\n --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);\n --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);\n --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);\n --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);\n --lumo-tint: #FFF;\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);\n --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);\n --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);\n --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);\n --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);\n --lumo-shade-50pct: hsla(214, 45%, 20%, 0.5);\n --lumo-shade-60pct: hsla(214, 43%, 19%, 0.61);\n --lumo-shade-70pct: hsla(214, 42%, 18%, 0.72);\n --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);\n --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);\n --lumo-shade: hsl(214, 35%, 15%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-shade-5pct);\n --lumo-contrast-10pct: var(--lumo-shade-10pct);\n --lumo-contrast-20pct: var(--lumo-shade-20pct);\n --lumo-contrast-30pct: var(--lumo-shade-30pct);\n --lumo-contrast-40pct: var(--lumo-shade-40pct);\n --lumo-contrast-50pct: var(--lumo-shade-50pct);\n --lumo-contrast-60pct: var(--lumo-shade-60pct);\n --lumo-contrast-70pct: var(--lumo-shade-70pct);\n --lumo-contrast-80pct: var(--lumo-shade-80pct);\n --lumo-contrast-90pct: var(--lumo-shade-90pct);\n --lumo-contrast: var(--lumo-shade);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 90%, 52%);\n --lumo-primary-color-50pct: hsla(214, 90%, 52%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 52%, 0.1);\n --lumo-primary-text-color: var(--lumo-primary-color);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 100%, 61%);\n --lumo-error-color-50pct: hsla(3, 100%, 60%, 0.5);\n --lumo-error-color-10pct: hsla(3, 100%, 60%, 0.1);\n --lumo-error-text-color: hsl(3, 92%, 53%);\n --lumo-error-contrast-color: #FFF;\n\n /* Success */\n --lumo-success-color: hsl(145, 80%, 42%); /* hsl(144,82%,37%); */\n --lumo-success-color-50pct: hsla(145, 76%, 44%, 0.55);\n --lumo-success-color-10pct: hsla(145, 76%, 44%, 0.12);\n --lumo-success-text-color: hsl(145, 100%, 32%);\n --lumo-success-contrast-color: #FFF;\n }\n </style>\n</custom-style><dom-module id="lumo-color">\n <template>\n <style>\n [theme~="dark"] {\n /* Base (background) */\n --lumo-base-color: hsl(214, 35%, 21%);\n\n /* Tint */\n --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);\n --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);\n --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);\n --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);\n --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);\n --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);\n --lumo-tint-60pct: hsla(214, 82%, 90%, 0.6);\n --lumo-tint-70pct: hsla(214, 87%, 92%, 0.7);\n --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);\n --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);\n --lumo-tint: hsl(214, 100%, 98%);\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);\n --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);\n --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);\n --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);\n --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);\n --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);\n --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);\n --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);\n --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);\n --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);\n --lumo-shade: hsl(214, 33%, 13%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-tint-5pct);\n --lumo-contrast-10pct: var(--lumo-tint-10pct);\n --lumo-contrast-20pct: var(--lumo-tint-20pct);\n --lumo-contrast-30pct: var(--lumo-tint-30pct);\n --lumo-contrast-40pct: var(--lumo-tint-40pct);\n --lumo-contrast-50pct: var(--lumo-tint-50pct);\n --lumo-contrast-60pct: var(--lumo-tint-60pct);\n --lumo-contrast-70pct: var(--lumo-tint-70pct);\n --lumo-contrast-80pct: var(--lumo-tint-80pct);\n --lumo-contrast-90pct: var(--lumo-tint-90pct);\n --lumo-contrast: var(--lumo-tint);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 86%, 55%);\n --lumo-primary-color-50pct: hsla(214, 86%, 55%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 63%, 0.1);\n --lumo-primary-text-color: hsl(214, 100%, 70%);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 90%, 63%);\n --lumo-error-color-50pct: hsla(3, 90%, 63%, 0.5);\n --lumo-error-color-10pct: hsla(3, 90%, 63%, 0.1);\n --lumo-error-text-color: hsl(3, 100%, 67%);\n\n /* Success */\n --lumo-success-color: hsl(145, 65%, 42%);\n --lumo-success-color-50pct: hsla(145, 65%, 42%, 0.5);\n --lumo-success-color-10pct: hsla(145, 65%, 42%, 0.1);\n --lumo-success-text-color: hsl(145, 85%, 47%);\n }\n\n html {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n [theme~="dark"] {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n color: var(--lumo-header-text-color);\n }\n\n a {\n color: var(--lumo-primary-text-color);\n }\n\n blockquote {\n color: var(--lumo-secondary-text-color);\n }\n\n code,\n pre {\n background-color: var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius-m);\n }\n </style>\n </template>\n</dom-module><dom-module id="lumo-color-legacy">\n <template>\n <style include="lumo-color">\n :host {\n color: var(--lumo-body-text-color) !important;\n background-color: var(--lumo-base-color) !important;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(n.content);const t=document.createElement("template");t.innerHTML="<custom-style>\n <style>\n html {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n </style>\n</custom-style>",document.head.appendChild(t.content);const l=document.createElement("template");l.innerHTML="<custom-style>\n <style>\n html {\n /* Square */\n --lumo-space-xs: 0.25rem;\n --lumo-space-s: 0.5rem;\n --lumo-space-m: 1rem;\n --lumo-space-l: 1.5rem;\n --lumo-space-xl: 2.5rem;\n\n /* Wide */\n --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);\n --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);\n --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);\n --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);\n --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);\n\n /* Tall */\n --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);\n --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);\n --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);\n --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);\n --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);\n }\n </style>\n</custom-style>",document.head.appendChild(l.content);const e=document.createElement("template");e.innerHTML="<custom-style>\n <style>\n html {\n /* Border radius */\n --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */\n --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */\n --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */\n --lumo-border-radius: 0.25em; /* Deprecated */\n\n /* Shadow */\n --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);\n --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);\n --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);\n --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);\n --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);\n\n /* Clickable element cursor */\n --lumo-clickable-cursor: default;\n }\n </style>\n</custom-style>",document.head.appendChild(e.content);const a=document.createElement("template");a.innerHTML='<custom-style>\n <style>\n html {\n /* Font families */\n --lumo-font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n\n /* Font sizes */\n --lumo-font-size-xxs: .75rem;\n --lumo-font-size-xs: .8125rem;\n --lumo-font-size-s: .875rem;\n --lumo-font-size-m: 1rem;\n --lumo-font-size-l: 1.125rem;\n --lumo-font-size-xl: 1.375rem;\n --lumo-font-size-xxl: 1.75rem;\n --lumo-font-size-xxxl: 2.5rem;\n\n /* Line heights */\n --lumo-line-height-xs: 1.25;\n --lumo-line-height-s: 1.375;\n --lumo-line-height-m: 1.625;\n }\n\n </style>\n</custom-style><dom-module id="lumo-typography">\n <template>\n <style>\n html {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Can’t combine with the above selector because that doesn’t work in browsers without native shadow dom */\n :host {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n small,\n [theme~="font-size-s"] {\n font-size: var(--lumo-font-size-s);\n line-height: var(--lumo-line-height-s);\n }\n\n [theme~="font-size-xs"] {\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight: 600;\n line-height: var(--lumo-line-height-xs);\n margin-top: 1.25em;\n }\n\n h1 {\n font-size: var(--lumo-font-size-xxxl);\n margin-bottom: 0.75em;\n }\n\n h2 {\n font-size: var(--lumo-font-size-xxl);\n margin-bottom: 0.5em;\n }\n\n h3 {\n font-size: var(--lumo-font-size-xl);\n margin-bottom: 0.5em;\n }\n\n h4 {\n font-size: var(--lumo-font-size-l);\n margin-bottom: 0.5em;\n }\n\n h5 {\n font-size: var(--lumo-font-size-m);\n margin-bottom: 0.25em;\n }\n\n h6 {\n font-size: var(--lumo-font-size-xs);\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n }\n\n p,\n blockquote {\n margin-top: 0.5em;\n margin-bottom: 0.75em;\n }\n\n a {\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n\n hr {\n display: block;\n align-self: stretch;\n height: 1px;\n border: 0;\n padding: 0;\n margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);\n background-color: var(--lumo-contrast-10pct);\n }\n\n blockquote {\n border-left: 2px solid var(--lumo-contrast-30pct);\n }\n\n b,\n strong {\n font-weight: 600;\n }\n\n /* RTL specific styles */\n\n blockquote[dir="rtl"] {\n border-left: none;\n border-right: 2px solid var(--lumo-contrast-30pct);\n }\n\n </style>\n </template>\n</dom-module>',document.head.appendChild(a.content);
1
+ import"./shared-6583e3f9.js";import"./shared-70612035.js";class o extends HTMLElement{static get version(){return"1.6.1"}}customElements.define("vaadin-lumo-styles",o);const n=document.createElement("template");n.innerHTML='<custom-style>\n <style>\n html {\n /* Base (background) */\n --lumo-base-color: #FFF;\n\n /* Tint */\n --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);\n --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);\n --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);\n --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);\n --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);\n --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);\n --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);\n --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);\n --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);\n --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);\n --lumo-tint: #FFF;\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);\n --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);\n --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);\n --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);\n --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);\n --lumo-shade-50pct: hsla(214, 45%, 20%, 0.5);\n --lumo-shade-60pct: hsla(214, 43%, 19%, 0.61);\n --lumo-shade-70pct: hsla(214, 42%, 18%, 0.72);\n --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);\n --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);\n --lumo-shade: hsl(214, 35%, 15%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-shade-5pct);\n --lumo-contrast-10pct: var(--lumo-shade-10pct);\n --lumo-contrast-20pct: var(--lumo-shade-20pct);\n --lumo-contrast-30pct: var(--lumo-shade-30pct);\n --lumo-contrast-40pct: var(--lumo-shade-40pct);\n --lumo-contrast-50pct: var(--lumo-shade-50pct);\n --lumo-contrast-60pct: var(--lumo-shade-60pct);\n --lumo-contrast-70pct: var(--lumo-shade-70pct);\n --lumo-contrast-80pct: var(--lumo-shade-80pct);\n --lumo-contrast-90pct: var(--lumo-shade-90pct);\n --lumo-contrast: var(--lumo-shade);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 90%, 52%);\n --lumo-primary-color-50pct: hsla(214, 90%, 52%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 52%, 0.1);\n --lumo-primary-text-color: var(--lumo-primary-color);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 100%, 61%);\n --lumo-error-color-50pct: hsla(3, 100%, 60%, 0.5);\n --lumo-error-color-10pct: hsla(3, 100%, 60%, 0.1);\n --lumo-error-text-color: hsl(3, 92%, 53%);\n --lumo-error-contrast-color: #FFF;\n\n /* Success */\n --lumo-success-color: hsl(145, 80%, 42%); /* hsl(144,82%,37%); */\n --lumo-success-color-50pct: hsla(145, 76%, 44%, 0.55);\n --lumo-success-color-10pct: hsla(145, 76%, 44%, 0.12);\n --lumo-success-text-color: hsl(145, 100%, 32%);\n --lumo-success-contrast-color: #FFF;\n }\n </style>\n</custom-style><dom-module id="lumo-color">\n <template>\n <style>\n [theme~="dark"] {\n /* Base (background) */\n --lumo-base-color: hsl(214, 35%, 21%);\n\n /* Tint */\n --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);\n --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);\n --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);\n --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);\n --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);\n --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);\n --lumo-tint-60pct: hsla(214, 82%, 90%, 0.6);\n --lumo-tint-70pct: hsla(214, 87%, 92%, 0.7);\n --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);\n --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);\n --lumo-tint: hsl(214, 100%, 98%);\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);\n --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);\n --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);\n --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);\n --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);\n --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);\n --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);\n --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);\n --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);\n --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);\n --lumo-shade: hsl(214, 33%, 13%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-tint-5pct);\n --lumo-contrast-10pct: var(--lumo-tint-10pct);\n --lumo-contrast-20pct: var(--lumo-tint-20pct);\n --lumo-contrast-30pct: var(--lumo-tint-30pct);\n --lumo-contrast-40pct: var(--lumo-tint-40pct);\n --lumo-contrast-50pct: var(--lumo-tint-50pct);\n --lumo-contrast-60pct: var(--lumo-tint-60pct);\n --lumo-contrast-70pct: var(--lumo-tint-70pct);\n --lumo-contrast-80pct: var(--lumo-tint-80pct);\n --lumo-contrast-90pct: var(--lumo-tint-90pct);\n --lumo-contrast: var(--lumo-tint);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 86%, 55%);\n --lumo-primary-color-50pct: hsla(214, 86%, 55%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 63%, 0.1);\n --lumo-primary-text-color: hsl(214, 100%, 70%);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 90%, 63%);\n --lumo-error-color-50pct: hsla(3, 90%, 63%, 0.5);\n --lumo-error-color-10pct: hsla(3, 90%, 63%, 0.1);\n --lumo-error-text-color: hsl(3, 100%, 67%);\n\n /* Success */\n --lumo-success-color: hsl(145, 65%, 42%);\n --lumo-success-color-50pct: hsla(145, 65%, 42%, 0.5);\n --lumo-success-color-10pct: hsla(145, 65%, 42%, 0.1);\n --lumo-success-text-color: hsl(145, 85%, 47%);\n }\n\n html {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n [theme~="dark"] {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n color: var(--lumo-header-text-color);\n }\n\n a {\n color: var(--lumo-primary-text-color);\n }\n\n blockquote {\n color: var(--lumo-secondary-text-color);\n }\n\n code,\n pre {\n background-color: var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius-m);\n }\n </style>\n </template>\n</dom-module><dom-module id="lumo-color-legacy">\n <template>\n <style include="lumo-color">\n :host {\n color: var(--lumo-body-text-color) !important;\n background-color: var(--lumo-base-color) !important;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(n.content);const t=document.createElement("template");t.innerHTML="<custom-style>\n <style>\n html {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n </style>\n</custom-style>",document.head.appendChild(t.content);const l=document.createElement("template");l.innerHTML="<custom-style>\n <style>\n html {\n /* Square */\n --lumo-space-xs: 0.25rem;\n --lumo-space-s: 0.5rem;\n --lumo-space-m: 1rem;\n --lumo-space-l: 1.5rem;\n --lumo-space-xl: 2.5rem;\n\n /* Wide */\n --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);\n --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);\n --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);\n --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);\n --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);\n\n /* Tall */\n --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);\n --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);\n --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);\n --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);\n --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);\n }\n </style>\n</custom-style>",document.head.appendChild(l.content);const e=document.createElement("template");e.innerHTML="<custom-style>\n <style>\n html {\n /* Border radius */\n --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */\n --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */\n --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */\n --lumo-border-radius: 0.25em; /* Deprecated */\n\n /* Shadow */\n --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);\n --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);\n --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);\n --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);\n --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);\n\n /* Clickable element cursor */\n --lumo-clickable-cursor: default;\n }\n </style>\n</custom-style>",document.head.appendChild(e.content);const a=document.createElement("template");a.innerHTML='<custom-style>\n <style>\n html {\n /* Font families */\n --lumo-font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n\n /* Font sizes */\n --lumo-font-size-xxs: .75rem;\n --lumo-font-size-xs: .8125rem;\n --lumo-font-size-s: .875rem;\n --lumo-font-size-m: 1rem;\n --lumo-font-size-l: 1.125rem;\n --lumo-font-size-xl: 1.375rem;\n --lumo-font-size-xxl: 1.75rem;\n --lumo-font-size-xxxl: 2.5rem;\n\n /* Line heights */\n --lumo-line-height-xs: 1.25;\n --lumo-line-height-s: 1.375;\n --lumo-line-height-m: 1.625;\n }\n\n </style>\n</custom-style><dom-module id="lumo-typography">\n <template>\n <style>\n html {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Can’t combine with the above selector because that doesn’t work in browsers without native shadow dom */\n :host {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n small,\n [theme~="font-size-s"] {\n font-size: var(--lumo-font-size-s);\n line-height: var(--lumo-line-height-s);\n }\n\n [theme~="font-size-xs"] {\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight: 600;\n line-height: var(--lumo-line-height-xs);\n margin-top: 1.25em;\n }\n\n h1 {\n font-size: var(--lumo-font-size-xxxl);\n margin-bottom: 0.75em;\n }\n\n h2 {\n font-size: var(--lumo-font-size-xxl);\n margin-bottom: 0.5em;\n }\n\n h3 {\n font-size: var(--lumo-font-size-xl);\n margin-bottom: 0.5em;\n }\n\n h4 {\n font-size: var(--lumo-font-size-l);\n margin-bottom: 0.5em;\n }\n\n h5 {\n font-size: var(--lumo-font-size-m);\n margin-bottom: 0.25em;\n }\n\n h6 {\n font-size: var(--lumo-font-size-xs);\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n }\n\n p,\n blockquote {\n margin-top: 0.5em;\n margin-bottom: 0.75em;\n }\n\n a {\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n\n hr {\n display: block;\n align-self: stretch;\n height: 1px;\n border: 0;\n padding: 0;\n margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);\n background-color: var(--lumo-contrast-10pct);\n }\n\n blockquote {\n border-left: 2px solid var(--lumo-contrast-30pct);\n }\n\n b,\n strong {\n font-weight: 600;\n }\n\n /* RTL specific styles */\n\n blockquote[dir="rtl"] {\n border-left: none;\n border-right: 2px solid var(--lumo-contrast-30pct);\n }\n\n </style>\n </template>\n</dom-module>',document.head.appendChild(a.content);
@@ -17,33 +17,39 @@
17
17
  "done": "Copied to clipboard"
18
18
  }
19
19
  },
20
+ "error": {
21
+ "store_domain_reserved": "Selected domain is reserved for internal use. Please choose another domain.",
22
+ "store_domain_exists": "Selected domain is already in use by another store. Please choose another domain."
23
+ },
20
24
  "essentials": {
21
25
  "label": "Essentials",
22
26
  "helper_text": "",
23
27
  "store-name": {
24
28
  "label": "Name",
25
- "placeholder": "My Store",
29
+ "placeholder": "Required",
26
30
  "helper_text": "",
27
31
  "v8n_required": "Please enter the name of your store",
28
32
  "v8n_too_long": "Please reduce the name of your store to 50 characters or less"
29
33
  },
30
34
  "logo-url": {
31
35
  "label": "Logo URL",
32
- "placeholder": "https://example.com/logo.png",
36
+ "placeholder": "Optional",
33
37
  "helper_text": "",
34
38
  "v8n_too_long": "Please shorten this link to 200 characters of less"
35
39
  },
36
40
  "store-domain": {
37
41
  "label": "Domain",
38
- "placeholder": "my-store.foxycart.com",
42
+ "placeholder": "Required",
39
43
  "helper_text": "",
40
44
  "custom_domain_note": "To use a custom domain, you must order (at no cost) an SSL certificate through Foxy. This option is only for developers who have full control of their domain settings and may take a few days to fully process.",
41
45
  "v8n_required": "Please enter the domain of your store",
46
+ "v8n_invalid": "Please enter a valid domain. For internationalized domain names, please use punycode.",
47
+ "v8n_unavailable": "Selected domain is already in use by another store. Please choose another domain.",
42
48
  "v8n_too_long": "Please use a domain that is 100 characters or less"
43
49
  },
44
50
  "store-url": {
45
51
  "label": "Website",
46
- "placeholder": "https://my.store.example.com",
52
+ "placeholder": "Required",
47
53
  "helper_text": "",
48
54
  "v8n_required": "Please enter the URL of your online store",
49
55
  "v8n_too_long": "Please use a URL that is 300 characters or less"
@@ -11,10 +11,14 @@ import { InternalControl } from '../InternalControl/InternalControl';
11
11
  */
12
12
  export declare class InternalEditableControl extends InternalControl {
13
13
  static get properties(): PropertyDeclarations;
14
+ checkValidityAsync: ((value: unknown) => Promise<true | string>) | null;
14
15
  getValue: () => unknown;
15
16
  setValue: (newValue: unknown) => void;
17
+ private __debouncedCheckValidityAsync;
18
+ private __previousValue;
16
19
  private __placeholder;
17
20
  private __helperText;
21
+ private __asyncError;
18
22
  private __v8nPrefix;
19
23
  private __property;
20
24
  private __label;
@@ -1,4 +1,5 @@
1
1
  import { InternalControl } from "../InternalControl/InternalControl.js";
2
+ import debounce from 'lodash-es/debounce';
2
3
  /**
3
4
  * An internal base class for controls that have editing functionality, e.g. a text field.
4
5
  * Instances of this class will provide shortcuts for translatable placeholder, label, helper
@@ -11,10 +12,20 @@ import { InternalControl } from "../InternalControl/InternalControl.js";
11
12
  export class InternalEditableControl extends InternalControl {
12
13
  constructor() {
13
14
  super(...arguments);
15
+ this.checkValidityAsync = null;
14
16
  this.getValue = () => { var _a; return (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form[this.property]; };
15
17
  this.setValue = (newValue) => { var _a; return (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.edit({ [this.property]: newValue }); };
18
+ this.__debouncedCheckValidityAsync = debounce(async (newValue) => {
19
+ var _a;
20
+ const validOrError = await ((_a = this.checkValidityAsync) === null || _a === void 0 ? void 0 : _a.call(this, newValue));
21
+ if (this._value !== newValue)
22
+ return;
23
+ this.__asyncError = validOrError === true ? null : validOrError !== null && validOrError !== void 0 ? validOrError : null;
24
+ }, 300);
25
+ this.__previousValue = null;
16
26
  this.__placeholder = null;
17
27
  this.__helperText = null;
28
+ this.__asyncError = null;
18
29
  this.__v8nPrefix = null;
19
30
  this.__property = null;
20
31
  this.__label = null;
@@ -22,6 +33,7 @@ export class InternalEditableControl extends InternalControl {
22
33
  static get properties() {
23
34
  return {
24
35
  ...super.properties,
36
+ checkValidityAsync: { attribute: false },
25
37
  placeholder: { type: String, noAccessor: true },
26
38
  helperText: { type: String, attribute: 'helper-text', noAccessor: true },
27
39
  v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },
@@ -29,6 +41,7 @@ export class InternalEditableControl extends InternalControl {
29
41
  setValue: { attribute: false },
30
42
  property: { type: String, noAccessor: true },
31
43
  label: { type: String, noAccessor: true },
44
+ __asyncError: { attribute: false },
32
45
  };
33
46
  }
34
47
  /**
@@ -151,6 +164,11 @@ export class InternalEditableControl extends InternalControl {
151
164
  return this.getValue();
152
165
  }
153
166
  set _value(newValue) {
167
+ this.__previousValue = this._value;
168
+ this.__asyncError = null;
169
+ if (!this._error && this.__previousValue !== newValue) {
170
+ this.__debouncedCheckValidityAsync(newValue);
171
+ }
154
172
  const event = new CustomEvent('change', { cancelable: true, detail: newValue });
155
173
  const useDefaultAction = this.dispatchEvent(event);
156
174
  if (useDefaultAction)
@@ -158,8 +176,9 @@ export class InternalEditableControl extends InternalControl {
158
176
  }
159
177
  /** A shortcut returning the first v8n error associated with this control. */
160
178
  get _error() {
161
- var _a;
162
- return (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.errors.find(v => v.startsWith(this.v8nPrefix));
179
+ var _a, _b;
180
+ const syncError = (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.errors.find(v => v.startsWith(this.v8nPrefix));
181
+ return (_b = syncError !== null && syncError !== void 0 ? syncError : this.__asyncError) !== null && _b !== void 0 ? _b : void 0;
163
182
  }
164
183
  /** A shortcut returning the localized text of the first v8n error associated with this control. */
165
184
  get _errorMessage() {
@@ -1 +1 @@
1
- {"version":3,"file":"InternalEditableControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableControl/InternalEditableControl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AAErE;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAcE,aAAQ,GAAG,GAAY,EAAE,wBAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAC,CAAC;QAE5D,aAAQ,GAAG,CAAC,QAAiB,EAAQ,EAAE,wBAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAC,CAAC;QAElF,kBAAa,GAAkB,IAAI,CAAC;QAEpC,iBAAY,GAAkB,IAAI,CAAC;QAEnC,gBAAW,GAAkB,IAAI,CAAC;QAElC,eAAU,GAAkB,IAAI,CAAC;QAEjC,YAAO,GAAkB,IAAI,CAAC;IA8JxC,CAAC;IAvLC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;YAC/C,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE;YACxE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE;YACtE,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YAC9B,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YAC9B,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5C,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;SAC1C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AAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;IACtE,CAAC;IACD,mGAAmG;IAEnG,IAAc,aAAa;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,CAAC;IACD,qFAAqF;IAErF,IAAc,cAAc;QAC1B,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport { InternalControl } from '../InternalControl/InternalControl';\n\n/**\n * An internal base class for controls that have editing functionality, e.g. a text field.\n * Instances of this class will provide shortcuts for translatable placeholder, label, helper\n * text and more. Unlike a regular control, editable control can not only read from a NucleonElement\n * instance up the DOM tree, but also send changes to it and trigger validation process.\n *\n * @element foxy-internal-editable-control\n * @since 1.17.0\n */\nexport class InternalEditableControl extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n placeholder: { type: String, noAccessor: true },\n helperText: { type: String, attribute: 'helper-text', noAccessor: true },\n v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },\n getValue: { attribute: false },\n setValue: { attribute: false },\n property: { type: String, noAccessor: true },\n label: { type: String, noAccessor: true },\n };\n }\n\n getValue = (): unknown => this.nucleon?.form[this.property];\n\n setValue = (newValue: unknown): void => this.nucleon?.edit({ [this.property]: newValue });\n\n private __placeholder: string | null = null;\n\n private __helperText: string | null = null;\n\n private __v8nPrefix: string | null = null;\n\n private __property: string | null = null;\n\n private __label: string | null = null;\n\n /**\n * Translated placeholder text for this control. You can set your own placeholder text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetPlaceholder()`\n * to restore the default translation.\n */\n get placeholder(): string {\n return typeof this.__placeholder === 'string' ? this.__placeholder : this.t('placeholder');\n }\n\n set placeholder(newValue: string) {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = newValue;\n }\n\n /**\n * Translated helper text for this control. You can set your own helper text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetHelperText()`\n * to restore the default translation.\n */\n get helperText(): string {\n return typeof this.__helperText === 'string' ? this.__helperText : this.t('helper_text');\n }\n\n set helperText(newValue: string) {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = newValue;\n }\n\n /**\n * A prefix for all v8n errors related to this control. You can set your own v8n prefix\n * if the default one doesn't work for you. Use `.resetV8nPrefix()`\n * to restore the default v8n prefix.\n */\n get v8nPrefix(): string {\n if (typeof this.__v8nPrefix === 'string') return this.__v8nPrefix;\n if (typeof this.infer === 'string') return `${this.infer}:`;\n return '';\n }\n\n set v8nPrefix(newValue: string) {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = newValue;\n }\n\n /**\n * Name of the property to bind to inferred from the control name by converting it to snake_case.\n * You can set your own property name if the default inference method produces an incorrect result.\n * Use `.resetProperty()` to restore the default property name.\n */\n get property(): string {\n if (typeof this.__property === 'string') return this.__property;\n if (typeof this.infer === 'string') return this.infer.replace(/-/g, '_');\n return '';\n }\n\n set property(newValue: string) {\n this.requestUpdate('property', this.__property);\n this.__property = newValue;\n }\n\n /**\n * Translated label for this control. You can set your own label if the default key in the inferred\n * namespace doesn't work for you. Use `.resetLabel()` to restore the default translation.\n */\n get label(): string {\n return typeof this.__label === 'string' ? this.__label : this.t('label');\n }\n\n set label(newValue: string) {\n this.requestUpdate('label', this.__label);\n this.__label = newValue;\n }\n\n /** Restores the default placeholder translation. */\n resetPlaceholder(): void {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = null;\n }\n\n /** Restores the default helper text translation. */\n resetHelperText(): void {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = null;\n }\n\n /** Restores the default v8n prefix for errors. */\n resetV8nPrefix(): void {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = null;\n }\n\n /** Restores the default property name. */\n resetProperty(): void {\n this.requestUpdate('property', this.__property);\n this.__property = null;\n }\n\n /** Restores the default label translation. */\n resetLabel(): void {\n this.requestUpdate('label', this.__label);\n this.__label = null;\n }\n\n reportValidity(): void {\n const walker = this.ownerDocument.createTreeWalker(this.renderRoot, NodeFilter.SHOW_ELEMENT);\n\n do {\n type Input = Node & Record<string, () => unknown>;\n\n const node = walker.currentNode as Input;\n const methods = ['reportValidity', 'validate'];\n\n for (const method of methods) {\n if (method in node) {\n try {\n node[method]();\n break;\n } catch {\n continue;\n }\n }\n }\n } while (walker.nextNode());\n }\n\n /**\n * A shortcut to get the inferred value from the NucleonElement instance\n * up the DOM tree. If no such value or instance exists, returns `undefined`.\n * Assigning a value to this property will dispatch a cancelable `change` event\n * with the new value in the detail and write changes to the NucleonElement instance if permitted.\n */\n\n protected get _value(): unknown | undefined {\n return this.getValue();\n }\n\n protected set _value(newValue: unknown | undefined) {\n const event = new CustomEvent('change', { cancelable: true, detail: newValue });\n const useDefaultAction = this.dispatchEvent(event);\n if (useDefaultAction) this.setValue(newValue);\n }\n /** A shortcut returning the first v8n error associated with this control. */\n\n protected get _error(): string | undefined {\n return this.nucleon?.errors.find(v => v.startsWith(this.v8nPrefix));\n }\n /** A shortcut returning the localized text of the first v8n error associated with this control. */\n\n protected get _errorMessage(): string | undefined {\n return this._error ? this.t(this._error.substring(this.v8nPrefix.length)) : undefined;\n }\n /** A helper returning a `.checkValidity()` function for use with Vaadin elements. */\n\n protected get _checkValidity(): () => boolean {\n return () => !this._error;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalEditableControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableControl/InternalEditableControl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AAErE,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,O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InternalControl/InternalControl';\n\nimport debounce from 'lodash-es/debounce';\n\n/**\n * An internal base class for controls that have editing functionality, e.g. a text field.\n * Instances of this class will provide shortcuts for translatable placeholder, label, helper\n * text and more. Unlike a regular control, editable control can not only read from a NucleonElement\n * instance up the DOM tree, but also send changes to it and trigger validation process.\n *\n * @element foxy-internal-editable-control\n * @since 1.17.0\n */\nexport class InternalEditableControl extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n checkValidityAsync: { attribute: false },\n placeholder: { type: String, noAccessor: true },\n helperText: { type: String, attribute: 'helper-text', noAccessor: true },\n v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },\n getValue: { attribute: false },\n setValue: { attribute: false },\n property: { type: String, noAccessor: true },\n label: { type: String, noAccessor: true },\n __asyncError: { attribute: false },\n };\n }\n\n checkValidityAsync: ((value: unknown) => Promise<true | string>) | null = null;\n\n getValue = (): unknown => this.nucleon?.form[this.property];\n\n setValue = (newValue: unknown): void => this.nucleon?.edit({ [this.property]: newValue });\n\n private __debouncedCheckValidityAsync = debounce(async (newValue: unknown) => {\n const validOrError = await this.checkValidityAsync?.(newValue);\n if (this._value !== newValue) return;\n this.__asyncError = validOrError === true ? null : validOrError ?? null;\n }, 300);\n\n private __previousValue: unknown | null = null;\n\n private __placeholder: string | null = null;\n\n private __helperText: string | null = null;\n\n private __asyncError: string | null = null;\n\n private __v8nPrefix: string | null = null;\n\n private __property: string | null = null;\n\n private __label: string | null = null;\n\n /**\n * Translated placeholder text for this control. You can set your own placeholder text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetPlaceholder()`\n * to restore the default translation.\n */\n get placeholder(): string {\n return typeof this.__placeholder === 'string' ? this.__placeholder : this.t('placeholder');\n }\n\n set placeholder(newValue: string) {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = newValue;\n }\n\n /**\n * Translated helper text for this control. You can set your own helper text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetHelperText()`\n * to restore the default translation.\n */\n get helperText(): string {\n return typeof this.__helperText === 'string' ? this.__helperText : this.t('helper_text');\n }\n\n set helperText(newValue: string) {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = newValue;\n }\n\n /**\n * A prefix for all v8n errors related to this control. You can set your own v8n prefix\n * if the default one doesn't work for you. Use `.resetV8nPrefix()`\n * to restore the default v8n prefix.\n */\n get v8nPrefix(): string {\n if (typeof this.__v8nPrefix === 'string') return this.__v8nPrefix;\n if (typeof this.infer === 'string') return `${this.infer}:`;\n return '';\n }\n\n set v8nPrefix(newValue: string) {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = newValue;\n }\n\n /**\n * Name of the property to bind to inferred from the control name by converting it to snake_case.\n * You can set your own property name if the default inference method produces an incorrect result.\n * Use `.resetProperty()` to restore the default property name.\n */\n get property(): string {\n if (typeof this.__property === 'string') return this.__property;\n if (typeof this.infer === 'string') return this.infer.replace(/-/g, '_');\n return '';\n }\n\n set property(newValue: string) {\n this.requestUpdate('property', this.__property);\n this.__property = newValue;\n }\n\n /**\n * Translated label for this control. You can set your own label if the default key in the inferred\n * namespace doesn't work for you. Use `.resetLabel()` to restore the default translation.\n */\n get label(): string {\n return typeof this.__label === 'string' ? this.__label : this.t('label');\n }\n\n set label(newValue: string) {\n this.requestUpdate('label', this.__label);\n this.__label = newValue;\n }\n\n /** Restores the default placeholder translation. */\n resetPlaceholder(): void {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = null;\n }\n\n /** Restores the default helper text translation. */\n resetHelperText(): void {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = null;\n }\n\n /** Restores the default v8n prefix for errors. */\n resetV8nPrefix(): void {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = null;\n }\n\n /** Restores the default property name. */\n resetProperty(): void {\n this.requestUpdate('property', this.__property);\n this.__property = null;\n }\n\n /** Restores the default label translation. */\n resetLabel(): void {\n this.requestUpdate('label', this.__label);\n this.__label = null;\n }\n\n reportValidity(): void {\n const walker = this.ownerDocument.createTreeWalker(this.renderRoot, NodeFilter.SHOW_ELEMENT);\n\n do {\n type Input = Node & Record<string, () => unknown>;\n\n const node = walker.currentNode as Input;\n const methods = ['reportValidity', 'validate'];\n\n for (const method of methods) {\n if (method in node) {\n try {\n node[method]();\n break;\n } catch {\n continue;\n }\n }\n }\n } while (walker.nextNode());\n }\n\n /**\n * A shortcut to get the inferred value from the NucleonElement instance\n * up the DOM tree. If no such value or instance exists, returns `undefined`.\n * Assigning a value to this property will dispatch a cancelable `change` event\n * with the new value in the detail and write changes to the NucleonElement instance if permitted.\n */\n protected get _value(): unknown | undefined {\n return this.getValue();\n }\n\n protected set _value(newValue: unknown | undefined) {\n this.__previousValue = this._value;\n this.__asyncError = null;\n if (!this._error && this.__previousValue !== newValue) {\n this.__debouncedCheckValidityAsync(newValue);\n }\n\n const event = new CustomEvent('change', { cancelable: true, detail: newValue });\n const useDefaultAction = this.dispatchEvent(event);\n if (useDefaultAction) this.setValue(newValue);\n }\n\n /** A shortcut returning the first v8n error associated with this control. */\n protected get _error(): string | undefined {\n const syncError = this.nucleon?.errors.find(v => v.startsWith(this.v8nPrefix));\n return syncError ?? this.__asyncError ?? void 0;\n }\n\n /** A shortcut returning the localized text of the first v8n error associated with this control. */\n protected get _errorMessage(): string | undefined {\n return this._error ? this.t(this._error.substring(this.v8nPrefix.length)) : undefined;\n }\n\n /** A helper returning a `.checkValidity()` function for use with Vaadin elements. */\n protected get _checkValidity(): () => boolean {\n return () => !this._error;\n }\n}\n"]}
@@ -16,7 +16,7 @@ export class InternalSummaryControl extends InternalEditableControl {
16
16
  }
17
17
  renderControl() {
18
18
  return html `
19
- <div class="leading-s mb-s">
19
+ <div class="leading-s mb-s" ?hidden=${!this.label && !this.helperText}>
20
20
  <p class="font-medium text-body text-l" ?hidden=${!this.label}>${this.label}</p>
21
21
  <p class="text-s text-secondary" ?hidden=${!this.helperText}>${this.helperText}</p>
22
22
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"InternalSummaryControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalSummaryControl/InternalSummaryControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IACjE,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,KAAK,CAAC,MAAM;YACf,GAAG;;;;OAKF;SACF,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO;IACT,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAA;;0DAE2C,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;mDAChC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU;;;;;KAKjF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, css } from 'lit-element';\n\nexport class InternalSummaryControl extends InternalEditableControl {\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n ::slotted(*) {\n background-color: var(--lumo-contrast-5pct);\n padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px);\n }\n `,\n ];\n }\n\n renderLightDom(): void {\n return;\n }\n\n renderControl(): TemplateResult {\n return html`\n <div class=\"leading-s mb-s\">\n <p class=\"font-medium text-body text-l\" ?hidden=${!this.label}>${this.label}</p>\n <p class=\"text-s text-secondary\" ?hidden=${!this.helperText}>${this.helperText}</p>\n </div>\n <div class=\"rounded overflow-hidden grid\" style=\"gap: 1px\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalSummaryControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalSummaryControl/InternalSummaryControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IACjE,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,KAAK,CAAC,MAAM;YACf,GAAG;;;;OAKF;SACF,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO;IACT,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAA;4CAC6B,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,UAAU;0DACjB,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;mDAChC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU;;;;;KAKjF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, css } from 'lit-element';\n\nexport class InternalSummaryControl extends InternalEditableControl {\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n ::slotted(*) {\n background-color: var(--lumo-contrast-5pct);\n padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px);\n }\n `,\n ];\n }\n\n renderLightDom(): void {\n return;\n }\n\n renderControl(): TemplateResult {\n return html`\n <div class=\"leading-s mb-s\" ?hidden=${!this.label && !this.helperText}>\n <p class=\"font-medium text-body text-l\" ?hidden=${!this.label}>${this.label}</p>\n <p class=\"text-s text-secondary\" ?hidden=${!this.helperText}>${this.helperText}</p>\n </div>\n <div class=\"rounded overflow-hidden grid\" style=\"gap: 1px\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}
@@ -15,6 +15,8 @@ declare const Base: typeof InternalForm & import("lit-element").Constructor<impo
15
15
  export declare class StoreForm extends Base<Data> {
16
16
  static get properties(): PropertyDeclarations;
17
17
  static get v8n(): NucleonV8N<Data>;
18
+ /** URL of the `fx:reporting_store_domain_exists` endpoint. */
19
+ reportingStoreDomainExists: string | null;
18
20
  /** URL of the `fx:customer_password_hash_types` property helper resource. */
19
21
  customerPasswordHashTypes: string | null;
20
22
  /** URL of the `fx:shipping_address_types` property helper resource. */
@@ -51,6 +53,8 @@ export declare class StoreForm extends Base<Data> {
51
53
  private readonly __currencyStyleGetValue;
52
54
  private readonly __currencyStyleSetValue;
53
55
  private readonly __appSessionTimeOptions;
56
+ private readonly __checkStoreDomainAvailability;
57
+ private readonly __storeNameSetValue;
54
58
  private readonly __getStoreEmailValue;
55
59
  private readonly __setStoreEmailValue;
56
60
  private readonly __getUseSmtpConfigValue;
@@ -4,6 +4,7 @@ import { InternalForm } from "../../internal/InternalForm/InternalForm.js";
4
4
  import { ifDefined } from 'lit-html/directives/if-defined';
5
5
  import { html } from 'lit-html';
6
6
  import cloneDeep from 'lodash-es/cloneDeep';
7
+ import slugify from '@sindresorhus/slugify';
7
8
  const NS = 'store-form';
8
9
  const Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));
9
10
  /**
@@ -15,6 +16,8 @@ const Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));
15
16
  export class StoreForm extends Base {
16
17
  constructor() {
17
18
  super(...arguments);
19
+ /** URL of the `fx:reporting_store_domain_exists` endpoint. */
20
+ this.reportingStoreDomainExists = null;
18
21
  /** URL of the `fx:customer_password_hash_types` property helper resource. */
19
22
  this.customerPasswordHashTypes = null;
20
23
  /** URL of the `fx:shipping_address_types` property helper resource. */
@@ -88,6 +91,30 @@ export class StoreForm extends Base {
88
91
  { value: 'h', label: 'hour' },
89
92
  { value: 'd', label: 'day' },
90
93
  ];
94
+ this.__checkStoreDomainAvailability = async (value) => {
95
+ var _a;
96
+ if (this.reportingStoreDomainExists) {
97
+ if (value === ((_a = this.data) === null || _a === void 0 ? void 0 : _a.store_domain))
98
+ return true;
99
+ const url = new URL(this.reportingStoreDomainExists);
100
+ url.searchParams.set('store_domain', value);
101
+ const response = await new StoreForm.API(this).fetch(url.toString());
102
+ return response.ok || 'store-domain:v8n_unavailable';
103
+ }
104
+ else {
105
+ throw new Error('reportingStoreDomainExists is not set.');
106
+ }
107
+ };
108
+ this.__storeNameSetValue = (newValue) => {
109
+ var _a, _b;
110
+ const previousSuggestedDomain = slugify((_a = this.form.store_name) !== null && _a !== void 0 ? _a : '');
111
+ const currentStoreDomain = (_b = this.form.store_domain) !== null && _b !== void 0 ? _b : '';
112
+ const newSuggestedDomain = slugify(newValue);
113
+ if (previousSuggestedDomain === currentStoreDomain) {
114
+ this.edit({ store_domain: newSuggestedDomain });
115
+ }
116
+ this.edit({ store_name: newValue });
117
+ };
91
118
  this.__getStoreEmailValue = () => {
92
119
  var _a;
93
120
  const emails = (_a = this.form.store_email) !== null && _a !== void 0 ? _a : '';
@@ -135,12 +162,18 @@ export class StoreForm extends Base {
135
162
  this.edit({ app_session_time: map[units] * count });
136
163
  };
137
164
  this.__setStoreDomainValue = (newValue) => {
138
- if (newValue.endsWith('.foxycart.com')) {
139
- const domain = newValue.substring(0, newValue.length - 13);
140
- this.edit({ store_domain: domain, use_remote_domain: domain.includes('.') });
165
+ var _a;
166
+ if (this.data) {
167
+ if (newValue.endsWith('.foxycart.com')) {
168
+ const domain = newValue.substring(0, newValue.length - 13);
169
+ this.edit({ store_domain: domain, use_remote_domain: false });
170
+ }
171
+ else {
172
+ this.edit({ store_domain: newValue, use_remote_domain: newValue.includes('.') });
173
+ }
141
174
  }
142
175
  else {
143
- this.edit({ store_domain: newValue, use_remote_domain: newValue.includes('.') });
176
+ this.edit({ store_domain: (_a = newValue.split('.')[0]) !== null && _a !== void 0 ? _a : '', use_remote_domain: false });
144
177
  }
145
178
  };
146
179
  this.__smtpConfigHostGetValue = () => {
@@ -209,6 +242,7 @@ export class StoreForm extends Base {
209
242
  static get properties() {
210
243
  return {
211
244
  ...super.properties,
245
+ reportingStoreDomainExists: { attribute: 'reporting-store-domain-exists' },
212
246
  customerPasswordHashTypes: { attribute: 'customer-password-hash-types' },
213
247
  shippingAddressTypes: { attribute: 'shipping-address-types' },
214
248
  hCaptchaSiteKey: { attribute: 'h-captcha-site-key' },
@@ -225,8 +259,25 @@ export class StoreForm extends Base {
225
259
  return [
226
260
  ({ store_name: v }) => !!v || 'store-name:v8n_required',
227
261
  ({ store_name: v }) => (v && v.length <= 50) || 'store-name:v8n_too_long',
228
- ({ store_domain: v }) => !!v || 'store-domain:v8n_required',
229
- ({ store_domain: v }) => (v && v.length <= 100) || 'store-domain:v8n_too_long',
262
+ ({ store_domain: storeDomain, use_remote_domain: useRemoteDomain }) => {
263
+ if (!storeDomain)
264
+ return 'store-domain:v8n_required';
265
+ if (storeDomain.length > 100)
266
+ return 'store-domain:v8n_too_long';
267
+ const [tld, ...slds] = storeDomain.split('.').reverse();
268
+ if (useRemoteDomain &&
269
+ slds.length > 1 &&
270
+ slds.every(s => /^(?!-)[a-z0-9-]{1,63}(?<!-)$/.test(s)) &&
271
+ /^[a-z]{2,63}$/.test(tld)) {
272
+ return true;
273
+ }
274
+ if (!useRemoteDomain &&
275
+ slds.length === 0 &&
276
+ /^(?!-)[a-z0-9-]{1,63}(?<!-)$/.test(storeDomain)) {
277
+ return true;
278
+ }
279
+ return 'store-domain:v8n_invalid';
280
+ },
230
281
  ({ store_url: v }) => !!v || 'store-url:v8n_required',
231
282
  ({ store_url: v }) => (v && v.length <= 300) || 'store-url:v8n_too_long',
232
283
  ({ receipt_continue_url: v }) => !v || v.length <= 300 || 'receipt-continue-url:v8n_too_long',
@@ -317,7 +368,11 @@ export class StoreForm extends Base {
317
368
  ${this.renderHeader()}
318
369
 
319
370
  <foxy-internal-summary-control infer="essentials">
320
- <foxy-internal-text-control layout="summary-item" infer="store-name">
371
+ <foxy-internal-text-control
372
+ layout="summary-item"
373
+ infer="store-name"
374
+ .setValue=${this.__storeNameSetValue}
375
+ >
321
376
  </foxy-internal-text-control>
322
377
 
323
378
  <foxy-internal-text-control layout="summary-item" infer="logo-url">
@@ -329,6 +384,9 @@ export class StoreForm extends Base {
329
384
  suffix=${storeDomainSuffix}
330
385
  infer="store-domain"
331
386
  .setValue=${this.__setStoreDomainValue}
387
+ .checkValidityAsync=${this.reportingStoreDomainExists
388
+ ? this.__checkStoreDomainAvailability
389
+ : null}
332
390
  >
333
391
  </foxy-internal-text-control>
334
392
 
@@ -774,6 +832,7 @@ export class StoreForm extends Base {
774
832
  : ''}
775
833
  </foxy-internal-summary-control>
776
834
 
835
+ ${this.renderTemplateOrSlot()}
777
836
  ${this.href || !this.hCaptchaSiteKey
778
837
  ? ''
779
838
  : html `
@@ -828,10 +887,29 @@ export class StoreForm extends Base {
828
887
  }
829
888
  }
830
889
  async _fetch(...args) {
831
- const request = new StoreForm.API.WHATWGRequest(...args);
832
- if (this.__hCaptchaToken)
833
- request.headers.set('h-captcha-code', this.__hCaptchaToken);
834
- return super._fetch(request);
890
+ try {
891
+ const request = new StoreForm.API.WHATWGRequest(...args);
892
+ if (this.__hCaptchaToken)
893
+ request.headers.set('h-captcha-code', this.__hCaptchaToken);
894
+ return await super._fetch(request);
895
+ }
896
+ catch (err) {
897
+ let errorText;
898
+ try {
899
+ errorText = await err.text();
900
+ }
901
+ catch (_a) {
902
+ throw err;
903
+ }
904
+ if (errorText.includes('store_domain is invalid because it has a reserved format') ||
905
+ errorText.includes('store_domain can not end with')) {
906
+ throw ['error:store_domain_reserved'];
907
+ }
908
+ if (errorText.includes('store_domain is already in use')) {
909
+ throw ['error:store_domain_exists'];
910
+ }
911
+ throw err;
912
+ }
835
913
  }
836
914
  get __displayIdExamples() {
837
915
  const config = this.__getCustomDisplayIdConfig();