@foxy.io/elements 1.34.0 → 1.35.0-beta.2

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 (246) 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 +2 -2
  34. package/dist/cdn/foxy-customer.js +1 -1
  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-experimental-add-to-cart-builder.js +1 -0
  46. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  47. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  48. package/dist/cdn/foxy-form-dialog.js +1 -1
  49. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-form.js +1 -1
  56. package/dist/cdn/foxy-i18n-editor.js +1 -1
  57. package/dist/cdn/foxy-i18n.js +1 -1
  58. package/dist/cdn/foxy-integration-card.js +1 -1
  59. package/dist/cdn/foxy-integration-form.js +1 -1
  60. package/dist/cdn/foxy-item-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-form.js +1 -1
  63. package/dist/cdn/foxy-item-form.js +1 -1
  64. package/dist/cdn/foxy-item-option-card.js +1 -1
  65. package/dist/cdn/foxy-item-option-form.js +1 -1
  66. package/dist/cdn/foxy-items-form.js +1 -1
  67. package/dist/cdn/foxy-native-integration-card.js +1 -1
  68. package/dist/cdn/foxy-native-integration-form.js +1 -1
  69. package/dist/cdn/foxy-nucleon-element.js +1 -1
  70. package/dist/cdn/foxy-pagination.js +1 -1
  71. package/dist/cdn/foxy-passkey-card.js +1 -1
  72. package/dist/cdn/foxy-passkey-form.js +1 -1
  73. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  74. package/dist/cdn/foxy-payment-card.js +1 -1
  75. package/dist/cdn/foxy-payment-method-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  81. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  82. package/dist/cdn/foxy-payments-api.js +1 -1
  83. package/dist/cdn/foxy-query-builder.js +1 -1
  84. package/dist/cdn/foxy-report-form.js +1 -1
  85. package/dist/cdn/foxy-reports-table.js +1 -1
  86. package/dist/cdn/foxy-shipment-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  90. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  91. package/dist/cdn/foxy-sign-in-form.js +1 -1
  92. package/dist/cdn/foxy-spinner.js +2 -2
  93. package/dist/cdn/foxy-store-card.js +1 -1
  94. package/dist/cdn/foxy-store-form.js +1 -1
  95. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  96. package/dist/cdn/foxy-subscription-card.js +1 -1
  97. package/dist/cdn/foxy-subscription-form.js +1 -1
  98. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  99. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  100. package/dist/cdn/foxy-table.js +1 -1
  101. package/dist/cdn/foxy-tax-card.js +1 -1
  102. package/dist/cdn/foxy-tax-form.js +1 -1
  103. package/dist/cdn/foxy-template-config-form.js +1 -1
  104. package/dist/cdn/foxy-template-form.js +1 -1
  105. package/dist/cdn/foxy-template-set-card.js +1 -1
  106. package/dist/cdn/foxy-template-set-form.js +1 -1
  107. package/dist/cdn/foxy-transaction-card.js +1 -1
  108. package/dist/cdn/foxy-transaction.js +1 -1
  109. package/dist/cdn/foxy-transactions-table.js +7 -7
  110. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  111. package/dist/cdn/foxy-user-card.js +1 -1
  112. package/dist/cdn/foxy-user-form.js +1 -1
  113. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  114. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  115. package/dist/cdn/foxy-users-table.js +1 -1
  116. package/dist/cdn/foxy-webhook-card.js +1 -1
  117. package/dist/cdn/foxy-webhook-form.js +1 -1
  118. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  119. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  120. package/dist/cdn/{shared-126cb82b.js → shared-018166d0.js} +1 -1
  121. package/dist/cdn/{shared-8e73014c.js → shared-01f85a69.js} +1 -1
  122. package/dist/cdn/{shared-e9e2fd3f.js → shared-066fb69f.js} +1 -1
  123. package/dist/cdn/{shared-1b5f155f.js → shared-0ae33cf9.js} +1 -1
  124. package/dist/cdn/{shared-d735fc99.js → shared-0e2a0b21.js} +1 -1
  125. package/dist/cdn/{shared-4f216dc1.js → shared-112e521b.js} +1 -1
  126. package/dist/cdn/{shared-6cf39826.js → shared-1c4ddc9b.js} +1 -1
  127. package/dist/cdn/{shared-f8252d03.js → shared-238d397f.js} +1 -1
  128. package/dist/cdn/{shared-370be17b.js → shared-257389e5.js} +4 -4
  129. package/dist/cdn/{shared-a86480c5.js → shared-27e2e59a.js} +1 -1
  130. package/dist/cdn/{shared-527eb17e.js → shared-28b0e29a.js} +1 -1
  131. package/dist/cdn/{shared-869ed25d.js → shared-297e8531.js} +1 -1
  132. package/dist/cdn/{shared-e8df4368.js → shared-2cb3cb3a.js} +1 -1
  133. package/dist/cdn/{shared-851b96ae.js → shared-2f02918d.js} +1 -1
  134. package/dist/cdn/{shared-fceaef95.js → shared-31d8e958.js} +1 -1
  135. package/dist/cdn/{shared-bbd2a4e6.js → shared-32440b17.js} +1 -1
  136. package/dist/cdn/{shared-5245b330.js → shared-363dce45.js} +1 -1
  137. package/dist/cdn/{shared-b62fb09f.js → shared-3713f047.js} +1 -1
  138. package/dist/cdn/shared-44118acb.js +1 -0
  139. package/dist/cdn/shared-44fd89ce.js +1 -0
  140. package/dist/cdn/{shared-e0b00e0f.js → shared-4c4b87c2.js} +1 -1
  141. package/dist/cdn/{shared-3efc6649.js → shared-504f3c65.js} +1 -1
  142. package/dist/cdn/{shared-a34983ea.js → shared-51fd39fa.js} +1 -1
  143. package/dist/cdn/{shared-f57e1679.js → shared-525c1936.js} +1 -1
  144. package/dist/cdn/{shared-16766722.js → shared-53caa399.js} +1 -1
  145. package/dist/cdn/{shared-e6379bd1.js → shared-573d6e21.js} +1 -1
  146. package/dist/cdn/{shared-ae68261f.js → shared-57a98543.js} +1 -1
  147. package/dist/cdn/{shared-3e25035f.js → shared-5d308dd7.js} +1 -1
  148. package/dist/cdn/{shared-e766f6e0.js → shared-5e0b71a2.js} +1 -1
  149. package/dist/cdn/shared-67898669.js +1 -0
  150. package/dist/cdn/{shared-1838736d.js → shared-68fdcf24.js} +1 -1
  151. package/dist/cdn/{shared-f378fe25.js → shared-6de0e9f3.js} +1 -1
  152. package/dist/cdn/{shared-d806ec21.js → shared-70487b4c.js} +1 -1
  153. package/dist/cdn/{shared-7cfd461d.js → shared-7889f2f2.js} +1 -1
  154. package/dist/cdn/{shared-a83e33cd.js → shared-80688cd4.js} +1 -1
  155. package/dist/cdn/{shared-9e9bec09.js → shared-80a7903f.js} +1 -1
  156. package/dist/cdn/{shared-74d9b3d4.js → shared-84761b5b.js} +1 -1
  157. package/dist/cdn/{shared-0db6454a.js → shared-8af5a4f2.js} +1 -1
  158. package/dist/cdn/{shared-1df36027.js → shared-8b838d83.js} +1 -1
  159. package/dist/cdn/{shared-6c4a5133.js → shared-95a7dab8.js} +1 -1
  160. package/dist/cdn/{shared-c176c4fa.js → shared-96886940.js} +1 -1
  161. package/dist/cdn/{shared-6a63a308.js → shared-9f97643d.js} +1 -1
  162. package/dist/cdn/{shared-9421c0d7.js → shared-9fcd36e5.js} +1 -1
  163. package/dist/cdn/{shared-6cf0c762.js → shared-a585bfd3.js} +1 -1
  164. package/dist/cdn/shared-a7617e76.js +1 -0
  165. package/dist/cdn/{shared-0d0fe9c0.js → shared-ab26c69f.js} +1 -1
  166. package/dist/cdn/{shared-46de2ed2.js → shared-b04e9753.js} +1 -1
  167. package/dist/cdn/{shared-a4953186.js → shared-b0d76785.js} +1 -1
  168. package/dist/cdn/{shared-a24264e6.js → shared-b16829cd.js} +1 -1
  169. package/dist/cdn/{shared-7e1768cf.js → shared-b1fa0b61.js} +1 -1
  170. package/dist/cdn/{shared-85803aca.js → shared-b77e1a8a.js} +1 -1
  171. package/dist/cdn/{shared-e8b8c8d0.js → shared-bb3c9e23.js} +1 -1
  172. package/dist/cdn/{shared-7d234de2.js → shared-c5326ab8.js} +1 -1
  173. package/dist/cdn/{shared-921e3f1e.js → shared-c532d615.js} +1 -1
  174. package/dist/cdn/{shared-c1f4a6ef.js → shared-c5cb7e8a.js} +1 -1
  175. package/dist/cdn/{shared-2b6b735d.js → shared-c7740aa2.js} +1 -1
  176. package/dist/cdn/{shared-e7069b0f.js → shared-ce055dce.js} +1 -1
  177. package/dist/cdn/{shared-dbc9aff0.js → shared-cf0ca582.js} +1 -1
  178. package/dist/cdn/{shared-bec65d6d.js → shared-d3a5cb85.js} +2 -2
  179. package/dist/cdn/{shared-23aa2506.js → shared-d973155b.js} +1 -1
  180. package/dist/cdn/{shared-4e6c65e6.js → shared-da393323.js} +1 -1
  181. package/dist/cdn/{shared-0293eba8.js → shared-e77d8d01.js} +1 -1
  182. package/dist/cdn/{shared-2fd6e530.js → shared-eadddff6.js} +1 -1
  183. package/dist/cdn/{shared-51fd3fc6.js → shared-eb7bf7ba.js} +1 -1
  184. package/dist/cdn/{shared-7040eef3.js → shared-ebc72d69.js} +1 -1
  185. package/dist/cdn/{shared-9c479921.js → shared-ec5b614e.js} +1 -1
  186. package/dist/cdn/{shared-a7524277.js → shared-fc6bcfc5.js} +1 -1
  187. package/dist/cdn/{shared-2ddb119e.js → shared-ffc84c84.js} +1 -1
  188. package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +558 -0
  189. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +21 -6
  190. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  191. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.d.ts +5 -2
  192. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +61 -1
  193. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  194. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +1 -0
  195. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
  196. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.d.ts +52 -0
  197. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js +887 -0
  198. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js.map +1 -0
  199. package/dist/elements/public/ExperimentalAddToCartBuilder/index.d.ts +16 -0
  200. package/dist/elements/public/ExperimentalAddToCartBuilder/index.js +18 -0
  201. package/dist/elements/public/ExperimentalAddToCartBuilder/index.js.map +1 -0
  202. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.d.ts +6 -0
  203. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.js +14 -0
  204. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.js.map +1 -0
  205. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.d.ts +3 -0
  206. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.js +5 -0
  207. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.js.map +1 -0
  208. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.d.ts +11 -0
  209. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.js +2 -0
  210. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.js.map +1 -0
  211. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.d.ts +21 -0
  212. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.js +123 -0
  213. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.js.map +1 -0
  214. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.d.ts +9 -0
  215. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.js +11 -0
  216. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.js.map +1 -0
  217. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.d.ts +11 -0
  218. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.js +2 -0
  219. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.js.map +1 -0
  220. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.d.ts +15 -0
  221. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js +397 -0
  222. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js.map +1 -0
  223. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.d.ts +19 -0
  224. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.js +21 -0
  225. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.js.map +1 -0
  226. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.d.ts +2 -0
  227. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.js +153 -0
  228. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.js.map +1 -0
  229. package/dist/elements/public/ExperimentalAddToCartBuilder/types.d.ts +59 -0
  230. package/dist/elements/public/ExperimentalAddToCartBuilder/types.js +2 -0
  231. package/dist/elements/public/ExperimentalAddToCartBuilder/types.js.map +1 -0
  232. package/dist/elements/public/NucleonElement/API.js +3 -1
  233. package/dist/elements/public/NucleonElement/API.js.map +1 -1
  234. package/dist/elements/public/index.d.ts +1 -0
  235. package/dist/elements/public/index.defined.d.ts +1 -0
  236. package/dist/elements/public/index.defined.js +1 -0
  237. package/dist/elements/public/index.defined.js.map +1 -1
  238. package/dist/elements/public/index.js +1 -0
  239. package/dist/elements/public/index.js.map +1 -1
  240. package/dist/mixins/themeable.js +32 -0
  241. package/dist/mixins/themeable.js.map +1 -1
  242. package/package.json +3 -2
  243. package/dist/cdn/shared-0fe1dd67.js +0 -1
  244. package/dist/cdn/shared-41072bad.js +0 -1
  245. package/dist/cdn/shared-88bfb7f5.js +0 -1
  246. package/dist/cdn/shared-c518ece2.js +0 -1
@@ -0,0 +1,558 @@
1
+ {
2
+ "items": {
3
+ "label": "Items",
4
+ "helper_text": "",
5
+ "item-group": {
6
+ "label": "New item",
7
+ "helper_text": "",
8
+ "item": {
9
+ "basics-group": {
10
+ "label": "",
11
+ "helper_text": "",
12
+ "name": {
13
+ "label": "Name",
14
+ "placeholder": "New item",
15
+ "helper_text": ""
16
+ },
17
+ "item-category-uri": {
18
+ "label": "Category",
19
+ "helper_text": "",
20
+ "placeholder": "DEFAULT",
21
+ "value": "{{ resource.name }}",
22
+ "dialog": {
23
+ "cancel": "Cancel",
24
+ "close": "Close",
25
+ "header": "Select an item category",
26
+ "selection": {
27
+ "label": "",
28
+ "helper_text": "",
29
+ "search": "Search",
30
+ "clear": "Clear",
31
+ "pagination": {
32
+ "search_button_text": "Search",
33
+ "first": "First",
34
+ "last": "Last",
35
+ "next": "Next",
36
+ "pagination": "{{from}}-{{to}} out of {{total}}",
37
+ "previous": "Previous",
38
+ "card": {
39
+ "spinner": {
40
+ "loading_busy": "Loading",
41
+ "loading_empty": "No item categories found",
42
+ "loading_error": "Unknown error"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "card": {
49
+ "spinner": {
50
+ "loading_busy": "Loading",
51
+ "loading_empty": "Not assigned – click to select",
52
+ "loading_error": "Unknown error"
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "price-group": {
58
+ "label": "",
59
+ "helper_text": "",
60
+ "price": {
61
+ "label": "Price",
62
+ "placeholder": "0",
63
+ "helper_text": ""
64
+ },
65
+ "price-default": {
66
+ "label": "Default price",
67
+ "placeholder": "0",
68
+ "helper_text": ""
69
+ },
70
+ "price-configurable": {
71
+ "label": "Allow custom amount",
72
+ "helper_text": "For donations or pay-what-you-want items.",
73
+ "checked": "Yes",
74
+ "unchecked": "No"
75
+ }
76
+ },
77
+ "code-group": {
78
+ "label": "",
79
+ "helper_text": "",
80
+ "code": {
81
+ "label": "SKU",
82
+ "placeholder": "Optional",
83
+ "helper_text": ""
84
+ },
85
+ "parent-code": {
86
+ "label": "Parent SKU",
87
+ "placeholder": "Optional",
88
+ "helper_text": "For child items in a bundle."
89
+ }
90
+ },
91
+ "appearance-group": {
92
+ "label": "",
93
+ "helper_text": "",
94
+ "weight": {
95
+ "label": "Weight",
96
+ "helper_text": "",
97
+ "placeholder": "0"
98
+ }
99
+ },
100
+ "subscriptions-group": {
101
+ "label": "",
102
+ "helper_text": "",
103
+ "sub-enabled": {
104
+ "label": "Enable subscription",
105
+ "helper_text": "",
106
+ "checked": "Yes",
107
+ "unchecked": "No"
108
+ },
109
+ "sub-frequency": {
110
+ "label": "Frequency",
111
+ "helper_text": "",
112
+ "placeholder": "0",
113
+ "select": "Select",
114
+ "times_a_month": "times/mo",
115
+ "day": "day",
116
+ "day_plural": "days",
117
+ "week": "week",
118
+ "week_plural": "weeks",
119
+ "month": "month",
120
+ "month_plural": "months",
121
+ "year": "year",
122
+ "year_plural": "years"
123
+ },
124
+ "sub-startdate-format": {
125
+ "label": "Start",
126
+ "helper_text": "",
127
+ "placeholder": "Select",
128
+ "option_none": "Immediately",
129
+ "option_yyyymmdd": "On a specific date",
130
+ "option_dd": "On a specific day of the month",
131
+ "option_duration": "After a period of time"
132
+ },
133
+ "sub-startdate-yyyymmdd": {
134
+ "label": "Start date",
135
+ "helper_text": "",
136
+ "display_value": "{{ value, date }}",
137
+ "placeholder": "Required"
138
+ },
139
+ "sub-startdate-dd": {
140
+ "label": "Start day of the month",
141
+ "helper_text": "",
142
+ "placeholder": "Required"
143
+ },
144
+ "sub-startdate-duration": {
145
+ "label": "Start after",
146
+ "helper_text": "",
147
+ "placeholder": "0",
148
+ "select": "Select",
149
+ "day": "Day",
150
+ "day_plural": "Days",
151
+ "week": "Week",
152
+ "week_plural": "Weeks",
153
+ "month": "Month",
154
+ "month_plural": "Months",
155
+ "year": "Year",
156
+ "year_plural": "Years"
157
+ },
158
+ "sub-enddate-format": {
159
+ "label": "End",
160
+ "helper_text": "",
161
+ "placeholder": "Select",
162
+ "option_none": "When cancelled",
163
+ "option_yyyymmdd": "On a specific date",
164
+ "option_duration": "After a period of time"
165
+ },
166
+ "sub-enddate-yyyymmdd": {
167
+ "label": "End date",
168
+ "helper_text": "",
169
+ "display_value": "{{ value, date }}",
170
+ "placeholder": "Required"
171
+ },
172
+ "sub-enddate-duration": {
173
+ "label": "End after",
174
+ "helper_text": "",
175
+ "placeholder": "0",
176
+ "select": "Select",
177
+ "day": "Day",
178
+ "day_plural": "Days",
179
+ "week": "Week",
180
+ "week_plural": "Weeks",
181
+ "month": "Month",
182
+ "month_plural": "Months",
183
+ "year": "Year",
184
+ "year_plural": "Years"
185
+ }
186
+ },
187
+ "quantity-group": {
188
+ "label": "Quantity",
189
+ "helper_text": "",
190
+ "quantity": {
191
+ "label": "Quantity",
192
+ "placeholder": "1",
193
+ "helper_text": ""
194
+ },
195
+ "quantity-min": {
196
+ "label": "Minimum quantity",
197
+ "placeholder": "1",
198
+ "helper_text": ""
199
+ },
200
+ "quantity-max": {
201
+ "label": "Maximum quantity",
202
+ "placeholder": "None",
203
+ "helper_text": ""
204
+ },
205
+ "hide-quantity": {
206
+ "label": "Hide quantity field in the form",
207
+ "helper_text": "",
208
+ "checked": "Yes",
209
+ "unchecked": "No"
210
+ }
211
+ },
212
+ "advanced-group": {
213
+ "label": "Advanced",
214
+ "helper_text": "",
215
+ "discount-name": {
216
+ "label": "Discount",
217
+ "helper_text": "",
218
+ "placeholder": "None"
219
+ },
220
+ "discount-builder": {
221
+ "tier": "Tier",
222
+ "tier_by": "by",
223
+ "tier_if": "if",
224
+ "tier_allunits": "price of each item",
225
+ "tier_incremental": "price of additional items",
226
+ "tier_repeat": "price of next item",
227
+ "tier_single": "order total",
228
+ "tier_then": "then",
229
+ "quantity": "quantity",
230
+ "total": "total",
231
+ "reduce": "reduce",
232
+ "increase": "increase"
233
+ },
234
+ "expires-format": {
235
+ "label": "Expiration",
236
+ "helper_text": "",
237
+ "placeholder": "Select",
238
+ "option_none": "Doesn't expire",
239
+ "option_minutes": "After a number of minutes",
240
+ "option_timestamp": "On a specific date"
241
+ },
242
+ "expires-value-timestamp": {
243
+ "label": "Expiration date",
244
+ "helper_text": "",
245
+ "display_value": "{{ value, date }}",
246
+ "placeholder": "Required"
247
+ },
248
+ "expires-value-minutes": {
249
+ "label": "Expires after",
250
+ "helper_text": "",
251
+ "placeholder": "0"
252
+ },
253
+ "image": {
254
+ "label": "Image URL",
255
+ "placeholder": "Optional",
256
+ "helper_text": ""
257
+ },
258
+ "url": {
259
+ "label": "Product URL",
260
+ "placeholder": "Optional",
261
+ "helper_text": ""
262
+ },
263
+ "width": {
264
+ "label": "Width",
265
+ "helper_text": "",
266
+ "placeholder": "0"
267
+ },
268
+ "height": {
269
+ "label": "Height",
270
+ "helper_text": "",
271
+ "placeholder": "0"
272
+ },
273
+ "length": {
274
+ "label": "Length",
275
+ "helper_text": "",
276
+ "placeholder": "0"
277
+ }
278
+ },
279
+ "custom-options": {
280
+ "label": "Custom options",
281
+ "delete_header": "Remove custom option?",
282
+ "delete_message": "Please confirm that you'd like to remove this custom option from the product.",
283
+ "delete_confirm": "Remove",
284
+ "delete_cancel": "Cancel",
285
+ "dialog": {
286
+ "header_create": "Add option",
287
+ "header_update": "Update option",
288
+ "close": "Close",
289
+ "save": "Save",
290
+ "cancel": "Cancel",
291
+ "undo_header": "Unsaved changes",
292
+ "undo_message": "Looks like you didn't save your changes! What would you like to do with them?",
293
+ "undo_cancel": "Review",
294
+ "undo_confirm": "Discard",
295
+ "internal-experimental-add-to-cart-builder-custom-option-form": {
296
+ "error": {
297
+ "option_exists": "Option with this name and value already exists.",
298
+ "option_exists_configurable": "Only one option with this name can exist when its value is configurable."
299
+ },
300
+ "basics-group": {
301
+ "label": "",
302
+ "helper_text": "",
303
+ "name": {
304
+ "label": "Name",
305
+ "placeholder": "Required",
306
+ "helper_text": ""
307
+ },
308
+ "value": {
309
+ "label": "Value",
310
+ "placeholder": "Required",
311
+ "helper_text": ""
312
+ },
313
+ "default-value": {
314
+ "label": "Default value",
315
+ "placeholder": "Optional",
316
+ "helper_text": ""
317
+ },
318
+ "value-configurable": {
319
+ "label": "Let users enter a custom value",
320
+ "helper_text": "",
321
+ "checked": "Yes",
322
+ "unchecked": "No"
323
+ }
324
+ },
325
+ "price-group": {
326
+ "label": "",
327
+ "helper_text": "",
328
+ "price": {
329
+ "label": "Price modifier",
330
+ "placeholder": "0",
331
+ "helper_text": ""
332
+ },
333
+ "replace-price": {
334
+ "label": "Replace item price with this value",
335
+ "helper_text": "",
336
+ "checked": "Yes",
337
+ "unchecked": "No"
338
+ }
339
+ },
340
+ "weight-group": {
341
+ "label": "",
342
+ "helper_text": "",
343
+ "weight": {
344
+ "label": "Weight modifier",
345
+ "placeholder": "0",
346
+ "helper_text": ""
347
+ },
348
+ "replace-weight": {
349
+ "label": "Replace item weight with this value",
350
+ "helper_text": "",
351
+ "checked": "Yes",
352
+ "unchecked": "No"
353
+ }
354
+ },
355
+ "code-group": {
356
+ "label": "",
357
+ "helper_text": "",
358
+ "code": {
359
+ "label": "Code modifier",
360
+ "placeholder": "None",
361
+ "helper_text": ""
362
+ },
363
+ "replace-code": {
364
+ "label": "Replace item code with this value",
365
+ "helper_text": "",
366
+ "checked": "Yes",
367
+ "unchecked": "No"
368
+ }
369
+ },
370
+ "category-group": {
371
+ "label": "",
372
+ "helper_text": "",
373
+ "item-category-uri": {
374
+ "label": "Change item category to",
375
+ "helper_text": "",
376
+ "placeholder": "Don't change",
377
+ "value": "{{ resource.code }}",
378
+ "dialog": {
379
+ "cancel": "Cancel",
380
+ "close": "Close",
381
+ "header": "Select an item category",
382
+ "selection": {
383
+ "label": "",
384
+ "helper_text": "",
385
+ "search": "Search",
386
+ "clear": "Clear",
387
+ "pagination": {
388
+ "search_button_text": "Search",
389
+ "first": "First",
390
+ "last": "Last",
391
+ "next": "Next",
392
+ "pagination": "{{from}}-{{to}} out of {{total}}",
393
+ "previous": "Previous",
394
+ "card": {
395
+ "spinner": {
396
+ "loading_busy": "Loading",
397
+ "loading_empty": "No item categories found",
398
+ "loading_error": "Unknown error"
399
+ }
400
+ }
401
+ }
402
+ }
403
+ },
404
+ "card": {
405
+ "spinner": {
406
+ "loading_busy": "Loading",
407
+ "loading_empty": "Not assigned – click to select",
408
+ "loading_error": "Unknown error"
409
+ }
410
+ }
411
+ }
412
+ },
413
+ "delete": {
414
+ "delete": "Delete",
415
+ "cancel": "Cancel",
416
+ "delete_prompt": "Are you sure you'd like to remove this custom option? You won't be able to bring it back."
417
+ },
418
+ "undo": {
419
+ "caption": "Undo"
420
+ },
421
+ "submit": {
422
+ "caption": "Save changes"
423
+ },
424
+ "create": {
425
+ "caption": "Create"
426
+ },
427
+ "spinner": {
428
+ "refresh": "Refresh",
429
+ "loading_busy": "Loading",
430
+ "loading_error": "Unknown error"
431
+ }
432
+ }
433
+ },
434
+ "pagination": {
435
+ "card": {
436
+ "delete_button_text": "Delete",
437
+ "spinner": {
438
+ "loading_busy": "Loading",
439
+ "loading_empty": "No options",
440
+ "loading_error": "Unknown error"
441
+ }
442
+ },
443
+ "create_button_text": "Add option +",
444
+ "first": "First",
445
+ "last": "Last",
446
+ "next": "Next",
447
+ "pagination": "{{from}}-{{to}} out of {{total}}",
448
+ "previous": "Previous"
449
+ }
450
+ },
451
+ "delete": {
452
+ "caption": "Remove from bundle"
453
+ }
454
+ }
455
+ },
456
+ "add-product": {
457
+ "caption": "Add another item"
458
+ }
459
+ },
460
+ "cart-settings": {
461
+ "label": "Settings",
462
+ "helper_text": "",
463
+ "template-set-uri": {
464
+ "label": "Template set",
465
+ "helper_text": "",
466
+ "value": "{{ resource.code }}",
467
+ "value_busy": "Loading...",
468
+ "value_fail": "Failed to load",
469
+ "placeholder": "DEFAULT",
470
+ "dialog": {
471
+ "cancel": "Cancel",
472
+ "close": "Close",
473
+ "header": "Select an template set",
474
+ "selection": {
475
+ "label": "Template sets",
476
+ "helper_text": "",
477
+ "pagination": {
478
+ "search_button_text": "Search",
479
+ "first": "First",
480
+ "last": "Last",
481
+ "next": "Next",
482
+ "pagination": "{{from}}-{{to}} out of {{total}}",
483
+ "previous": "Previous",
484
+ "card": {
485
+ "spinner": {
486
+ "loading_busy": "Loading",
487
+ "loading_empty": "No template sets found",
488
+ "loading_error": "Unknown error"
489
+ }
490
+ }
491
+ }
492
+ }
493
+ }
494
+ },
495
+ "empty": {
496
+ "label": "Before adding items",
497
+ "helper_text": "",
498
+ "placeholder": "Select",
499
+ "option_false": "Do nothing",
500
+ "option_true": "Clear the current cart",
501
+ "option_reset": "Create a new cart"
502
+ },
503
+ "cart": {
504
+ "label": "After adding items",
505
+ "helper_text": "",
506
+ "placeholder": "Select",
507
+ "option_add": "Do nothing",
508
+ "option_checkout": "Open checkout",
509
+ "option_redirect": "Redirect to a page"
510
+ },
511
+ "redirect": {
512
+ "label": "Redirect URL",
513
+ "placeholder": "Required",
514
+ "helper_text": ""
515
+ },
516
+ "coupon": {
517
+ "label": "Coupon code",
518
+ "helper_text": "",
519
+ "placeholder": "Optional"
520
+ }
521
+ },
522
+ "link": {
523
+ "label": "",
524
+ "helper_text": "",
525
+ "direct_link": "Direct link",
526
+ "empty": "Modify the item parameters to see the add-to-cart link.",
527
+ "unavailable": "Direct link is not available when one or more items have configurable options.",
528
+ "copy-to-clipboard": {
529
+ "failed_to_copy": "Failed to copy",
530
+ "click_to_copy": "Copy to clipboard",
531
+ "copying": "Copying...",
532
+ "done": "Copied to clipboard"
533
+ }
534
+ },
535
+ "preview": {
536
+ "label": "Preview",
537
+ "helper_text": "",
538
+ "edits_tip": "You are free to edit this code and add styles to match your website. When editing, make sure to keep the names and values of the form elements intact, and preserve all Foxy URLs in the snippet.",
539
+ "edits_docs": "Learn more...",
540
+ "price_label": "Price:",
541
+ "quantity_label": "Quantity:",
542
+ "shipto_label": "Ship to:",
543
+ "submit_caption": "Add to cart",
544
+ "unavailable": {
545
+ "loading_busy": "Loading preview..."
546
+ },
547
+ "spinner": {
548
+ "loading_busy": "Signing",
549
+ "loading_error": "Failed to sign"
550
+ },
551
+ "copy-to-clipboard": {
552
+ "failed_to_copy": "Failed to copy",
553
+ "click_to_copy": "Copy to clipboard",
554
+ "copying": "Copying...",
555
+ "done": "Copied to clipboard"
556
+ }
557
+ }
558
+ }
@@ -24,14 +24,29 @@ export class InternalEditableControl extends InternalControl {
24
24
  return value;
25
25
  };
26
26
  this.setValue = (newValue) => {
27
- var _a, _b, _c, _d;
28
- if (this.jsonPath) {
29
- const json = JSON.parse((_b = (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form[this.property]) !== null && _b !== void 0 ? _b : this.jsonTemplate);
30
- set(json, this.jsonPath, newValue);
31
- (_c = this.nucleon) === null || _c === void 0 ? void 0 : _c.edit({ [this.property]: JSON.stringify(json) });
27
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
28
+ const [formProperty, ...nestedPath] = this.property.split('.');
29
+ if (nestedPath.length) {
30
+ const nestedForm = (_b = (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form[formProperty]) !== null && _b !== void 0 ? _b : {};
31
+ if (this.jsonPath) {
32
+ const json = JSON.parse((_d = (_c = this.nucleon) === null || _c === void 0 ? void 0 : _c.form[formProperty]) !== null && _d !== void 0 ? _d : this.jsonTemplate);
33
+ set(json, this.jsonPath, newValue);
34
+ set(nestedForm, nestedPath, JSON.stringify(json));
35
+ }
36
+ else {
37
+ set(nestedForm, nestedPath, newValue);
38
+ }
39
+ (_e = this.nucleon) === null || _e === void 0 ? void 0 : _e.edit({ [formProperty]: nestedForm });
32
40
  }
33
41
  else {
34
- (_d = this.nucleon) === null || _d === void 0 ? void 0 : _d.edit({ [this.property]: newValue });
42
+ if (this.jsonPath) {
43
+ const json = JSON.parse((_g = (_f = this.nucleon) === null || _f === void 0 ? void 0 : _f.form[formProperty]) !== null && _g !== void 0 ? _g : this.jsonTemplate);
44
+ set(json, this.jsonPath, newValue);
45
+ (_h = this.nucleon) === null || _h === void 0 ? void 0 : _h.edit({ [formProperty]: JSON.stringify(json) });
46
+ }
47
+ else {
48
+ (_j = this.nucleon) === null || _j === void 0 ? void 0 : _j.edit({ [formProperty]: newValue });
49
+ }
35
50
  }
36
51
  };
37
52
  this.__debouncedCheckValidityAsync = debounce(async (newValue) => {
@@ -1 +1 @@
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;AAC1C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAkBE,uBAAkB,GAAwD,IAAI,CAAC;QAE/E,iBAAY,GAAkB,IAAI,CAAC;QAEnC,aAAQ,GAAkB,IAAI,CAAC;QAE/B,aAAQ,GAAG,GAAY,EAAE;;YACvB,MAAM,KAAK,GAAG,GAAG,OAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,C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GAAI,IAAI,CAAC,YAAY,mCAAI,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,mGAAmG;IACnG,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;IAED,qFAAqF;IACrF,IAAc,cAAc;QAC1B,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\n\nimport { InternalControl } from '../InternalControl/InternalControl';\n\nimport debounce from 'lodash-es/debounce';\nimport { get, set } from 'lodash-es';\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 jsonTemplate: { attribute: 'json-template' },\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 jsonPath: { attribute: 'json-path' },\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 jsonTemplate: string | null = null;\n\n jsonPath: string | null = null;\n\n getValue = (): unknown => {\n const value = get(this.nucleon?.form, this.property);\n if (this.jsonPath) return get(JSON.parse(value ?? this.jsonTemplate), this.jsonPath);\n return value;\n };\n\n setValue = (newValue: unknown): void => {\n if (this.jsonPath) {\n const json = JSON.parse(this.nucleon?.form[this.property] ?? this.jsonTemplate);\n set(json, this.jsonPath, newValue);\n this.nucleon?.edit({ [this.property]: JSON.stringify(json) });\n } else {\n this.nucleon?.edit({ [this.property]: newValue });\n }\n };\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"]}
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;AAC1C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAkBE,uBAAkB,GAAwD,IAAI,CAAC;QAE/E,iBAAY,GAAkB,IAAI,CAAC;QAEnC,aAAQ,GAAkB,IAAI,CAAC;QAE/B,aAAQ,GAAG,GAAY,EAAE;;YACvB,MAAM,KAAK,GAAG,GAAG,OAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,QAAQ,CAA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;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;YACrD,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;SAC9C;QAED,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChF,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,gBAAgB;YAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,6EAA6E;IAC7E,IAAc,MAAM;;QAClB,MAAM,SAAS,SAAG,IAAI,CAAC,OAAO,0CAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/E,aAAO,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,YAAY,mCAAI,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,mGAAmG;IACnG,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;IAED,qFAAqF;IACrF,IAAc,cAAc;QAC1B,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\n\nimport { InternalControl } from '../InternalControl/InternalControl';\n\nimport debounce from 'lodash-es/debounce';\nimport { get, set } from 'lodash-es';\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 jsonTemplate: { attribute: 'json-template' },\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 jsonPath: { attribute: 'json-path' },\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 jsonTemplate: string | null = null;\n\n jsonPath: string | null = null;\n\n getValue = (): unknown => {\n const value = get(this.nucleon?.form, this.property);\n if (this.jsonPath) return get(JSON.parse(value ?? this.jsonTemplate), this.jsonPath);\n return value;\n };\n\n setValue = (newValue: unknown): void => {\n const [formProperty, ...nestedPath] = this.property.split('.');\n\n if (nestedPath.length) {\n const nestedForm = this.nucleon?.form[formProperty] ?? {};\n\n if (this.jsonPath) {\n const json = JSON.parse(this.nucleon?.form[formProperty] ?? this.jsonTemplate);\n set(json, this.jsonPath, newValue);\n set(nestedForm, nestedPath, JSON.stringify(json));\n } else {\n set(nestedForm, nestedPath, newValue);\n }\n\n this.nucleon?.edit({ [formProperty]: nestedForm });\n } else {\n if (this.jsonPath) {\n const json = JSON.parse(this.nucleon?.form[formProperty] ?? this.jsonTemplate);\n set(json, this.jsonPath, newValue);\n this.nucleon?.edit({ [formProperty]: JSON.stringify(json) });\n } else {\n this.nucleon?.edit({ [formProperty]: newValue });\n }\n }\n };\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"]}