@foxy.io/elements 1.36.0 → 1.37.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 (227) 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 +2 -2
  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 +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 +2 -2
  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-pagination.js +1 -1
  70. package/dist/cdn/foxy-passkey-card.js +1 -1
  71. package/dist/cdn/foxy-passkey-form.js +1 -1
  72. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  73. package/dist/cdn/foxy-payment-card.js +1 -1
  74. package/dist/cdn/foxy-payment-method-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  81. package/dist/cdn/foxy-payments-api.js +1 -1
  82. package/dist/cdn/foxy-query-builder.js +1 -1
  83. package/dist/cdn/foxy-report-form.js +2 -2
  84. package/dist/cdn/foxy-reports-table.js +1 -1
  85. package/dist/cdn/foxy-shipment-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  90. package/dist/cdn/foxy-sign-in-form.js +1 -1
  91. package/dist/cdn/foxy-spinner.js +2 -2
  92. package/dist/cdn/foxy-store-card.js +1 -1
  93. package/dist/cdn/foxy-store-form.js +1 -1
  94. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  95. package/dist/cdn/foxy-subscription-card.js +1 -1
  96. package/dist/cdn/foxy-subscription-form.js +1 -1
  97. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  98. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  99. package/dist/cdn/foxy-table.js +1 -1
  100. package/dist/cdn/foxy-tax-card.js +1 -1
  101. package/dist/cdn/foxy-tax-form.js +1 -1
  102. package/dist/cdn/foxy-template-config-form.js +1 -1
  103. package/dist/cdn/foxy-template-form.js +1 -1
  104. package/dist/cdn/foxy-template-set-card.js +1 -1
  105. package/dist/cdn/foxy-template-set-form.js +1 -1
  106. package/dist/cdn/foxy-transaction-card.js +1 -1
  107. package/dist/cdn/foxy-transaction.js +1 -1
  108. package/dist/cdn/foxy-transactions-table.js +1 -1
  109. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  110. package/dist/cdn/foxy-user-card.js +1 -1
  111. package/dist/cdn/foxy-user-form.js +1 -1
  112. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  113. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  114. package/dist/cdn/foxy-users-table.js +1 -1
  115. package/dist/cdn/foxy-webhook-card.js +1 -1
  116. package/dist/cdn/foxy-webhook-form.js +1 -1
  117. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  118. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  119. package/dist/cdn/{shared-01bb183b.js → shared-00b50480.js} +1 -1
  120. package/dist/cdn/{shared-c1ade7a9.js → shared-00cd0e86.js} +1 -1
  121. package/dist/cdn/shared-0564def4.js +1 -0
  122. package/dist/cdn/{shared-e622d8cf.js → shared-05ed8288.js} +1 -1
  123. package/dist/cdn/{shared-7ce74b42.js → shared-0782fee5.js} +5 -5
  124. package/dist/cdn/{shared-93774efe.js → shared-0c61b5ce.js} +1 -1
  125. package/dist/cdn/{shared-cc76a917.js → shared-0d757c1c.js} +1 -1
  126. package/dist/cdn/{shared-0d8e7067.js → shared-1036a0cd.js} +1 -1
  127. package/dist/cdn/{shared-61ef8001.js → shared-1563cd85.js} +1 -1
  128. package/dist/cdn/{shared-6a45a781.js → shared-15ded782.js} +2 -2
  129. package/dist/cdn/{shared-2879b67f.js → shared-188a9c2e.js} +1 -1
  130. package/dist/cdn/{shared-c5cf889e.js → shared-1c6a1571.js} +1 -1
  131. package/dist/cdn/{shared-b927be75.js → shared-1eeddc24.js} +1 -1
  132. package/dist/cdn/{shared-48970bb4.js → shared-1fcf3749.js} +1 -1
  133. package/dist/cdn/{shared-1482d5dd.js → shared-256fe764.js} +1 -1
  134. package/dist/cdn/{shared-0053cf93.js → shared-31b98ac2.js} +1 -1
  135. package/dist/cdn/{shared-cd652fd0.js → shared-355ef444.js} +1 -1
  136. package/dist/cdn/{shared-fea2714e.js → shared-4215bff2.js} +1 -1
  137. package/dist/cdn/{shared-d2340faa.js → shared-421b13a8.js} +1 -1
  138. package/dist/cdn/{shared-89d09114.js → shared-4558cdb4.js} +1 -1
  139. package/dist/cdn/shared-47962c3f.js +1 -0
  140. package/dist/cdn/{shared-2503aefc.js → shared-56f7db6f.js} +1 -1
  141. package/dist/cdn/{shared-0b00883f.js → shared-5cea7ef0.js} +1 -1
  142. package/dist/cdn/{shared-9d7ae4aa.js → shared-6042ee79.js} +1 -1
  143. package/dist/cdn/{shared-6d11190a.js → shared-6524d421.js} +1 -1
  144. package/dist/cdn/{shared-7cb8722a.js → shared-6660c6df.js} +1 -1
  145. package/dist/cdn/{shared-9092b247.js → shared-673fb8a1.js} +1 -1
  146. package/dist/cdn/{shared-528b3bdb.js → shared-6aa8f7ee.js} +1 -1
  147. package/dist/cdn/{shared-8521017c.js → shared-70bd1896.js} +1 -1
  148. package/dist/cdn/{shared-76dcc864.js → shared-75908858.js} +1 -1
  149. package/dist/cdn/{shared-901b41cf.js → shared-7ab454fb.js} +1 -1
  150. package/dist/cdn/{shared-f20eefdd.js → shared-82614ac9.js} +1 -1
  151. package/dist/cdn/{shared-40e4854e.js → shared-8f6400d9.js} +1 -1
  152. package/dist/cdn/{shared-c52295d5.js → shared-944dc1e2.js} +1 -1
  153. package/dist/cdn/{shared-03355bd1.js → shared-95339d7a.js} +1 -1
  154. package/dist/cdn/{shared-4c90701b.js → shared-a208ae8c.js} +1 -1
  155. package/dist/cdn/{shared-2e8361e1.js → shared-a3f1420c.js} +1 -1
  156. package/dist/cdn/{shared-d279baa5.js → shared-a63c89a1.js} +1 -1
  157. package/dist/cdn/{shared-2d11750b.js → shared-a72df5aa.js} +1 -1
  158. package/dist/cdn/{shared-cbd1fab7.js → shared-ae4d5fd6.js} +1 -1
  159. package/dist/cdn/{shared-8676e5c0.js → shared-b15d45b1.js} +1 -1
  160. package/dist/cdn/{shared-133fc37b.js → shared-b293a928.js} +1 -1
  161. package/dist/cdn/{shared-10b54c49.js → shared-b4b9735c.js} +1 -1
  162. package/dist/cdn/{shared-5f43aa36.js → shared-b7889b37.js} +1 -1
  163. package/dist/cdn/{shared-4e8a5b95.js → shared-bb43f0ad.js} +1 -1
  164. package/dist/cdn/{shared-f316780a.js → shared-c05984d1.js} +1 -1
  165. package/dist/cdn/{shared-86aa139c.js → shared-c1a3e4fd.js} +1 -1
  166. package/dist/cdn/{shared-5f1a4329.js → shared-c267f04c.js} +1 -1
  167. package/dist/cdn/{shared-3aaf64e6.js → shared-c2ca5bee.js} +1 -1
  168. package/dist/cdn/{shared-6b76afc2.js → shared-c3fd2e9c.js} +1 -1
  169. package/dist/cdn/{shared-cf28d2c8.js → shared-c5fa5c92.js} +1 -1
  170. package/dist/cdn/{shared-f92b9842.js → shared-c6ce69fc.js} +1 -1
  171. package/dist/cdn/{shared-4cf87721.js → shared-cb2a2e33.js} +1 -1
  172. package/dist/cdn/{shared-e0d1856d.js → shared-cf8e2611.js} +1 -1
  173. package/dist/cdn/{shared-60150977.js → shared-df76d498.js} +1 -1
  174. package/dist/cdn/{shared-85475a4e.js → shared-e0488d44.js} +1 -1
  175. package/dist/cdn/{shared-1a49f70b.js → shared-e14bc410.js} +1 -1
  176. package/dist/cdn/{shared-43e551f2.js → shared-e1b97b27.js} +1 -1
  177. package/dist/cdn/{shared-25893d83.js → shared-e4159eb9.js} +1 -1
  178. package/dist/cdn/{shared-4666b6aa.js → shared-e7b48aaa.js} +4 -4
  179. package/dist/cdn/shared-edb68eb7.js +1 -0
  180. package/dist/cdn/{shared-231687fd.js → shared-ef11a60b.js} +1 -1
  181. package/dist/cdn/{shared-0b1b1c14.js → shared-f0afd1ee.js} +1 -1
  182. package/dist/cdn/{shared-22dd6cbe.js → shared-fda02728.js} +1 -1
  183. package/dist/cdn/{shared-f72d82a9.js → shared-fefaece7.js} +2 -2
  184. package/dist/cdn/translations/admin-subscription-form/en.json +3 -0
  185. package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +4 -1
  186. package/dist/cdn/translations/gift-card-code-form/en.json +1 -0
  187. package/dist/cdn/translations/gift-card-form/en.json +1 -0
  188. package/dist/cdn/translations/transaction/en.json +3 -0
  189. package/dist/cdn/translations/user-invitation-form/en.json +3 -3
  190. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +11 -1
  191. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +244 -168
  192. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  193. package/dist/elements/internal/InternalAsyncListControl/index.d.ts +1 -0
  194. package/dist/elements/internal/InternalAsyncListControl/index.js +1 -0
  195. package/dist/elements/internal/InternalAsyncListControl/index.js.map +1 -1
  196. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +20 -10
  197. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  198. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +2 -2
  199. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
  200. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.d.ts +1 -0
  201. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +6 -2
  202. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  203. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +4 -1
  204. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +15 -1
  205. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
  206. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js +1 -0
  207. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js.map +1 -1
  208. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +1 -1
  209. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
  210. package/dist/elements/public/GiftCardCodeForm/index.d.ts +2 -0
  211. package/dist/elements/public/GiftCardCodeForm/index.js +2 -0
  212. package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -1
  213. package/dist/elements/public/PaymentsApi/PaymentsApi.js +1 -1
  214. package/dist/elements/public/PaymentsApi/PaymentsApi.js.map +1 -1
  215. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.d.ts +1 -0
  216. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +15 -1
  217. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
  218. package/dist/elements/public/UserInvitationForm/UserInvitationForm.js +3 -2
  219. package/dist/elements/public/UserInvitationForm/UserInvitationForm.js.map +1 -1
  220. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js +8 -2
  221. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js.map +1 -1
  222. package/dist/mixins/themeable.js +0 -4
  223. package/dist/mixins/themeable.js.map +1 -1
  224. package/package.json +1 -1
  225. package/dist/cdn/shared-1c07cd7f.js +0 -1
  226. package/dist/cdn/shared-42bb9e8e.js +0 -1
  227. package/dist/cdn/shared-d784b79a.js +0 -1
@@ -278,6 +278,9 @@
278
278
  },
279
279
  "custom-options": {
280
280
  "label": "Custom options",
281
+ "helper_text": "",
282
+ "total_items": "{{ count }} option",
283
+ "total_items_plural": "{{ count }} options",
281
284
  "delete_header": "Remove custom option?",
282
285
  "delete_message": "Please confirm that you'd like to remove this custom option from the product.",
283
286
  "delete_confirm": "Remove",
@@ -444,7 +447,7 @@
444
447
  "first": "First",
445
448
  "last": "Last",
446
449
  "next": "Next",
447
- "pagination": "{{from}}-{{to}} out of {{total}}",
450
+ "pagination": "{{from}}-{{to}}",
448
451
  "previous": "Previous"
449
452
  }
450
453
  },
@@ -36,6 +36,7 @@
36
36
  "end-date": {
37
37
  "label": "Expires on",
38
38
  "placeholder": "Optional",
39
+ "display_value": "{{ value, date }}",
39
40
  "helper_text": ""
40
41
  }
41
42
  },
@@ -403,6 +403,7 @@
403
403
  "end-date": {
404
404
  "label": "Expires on",
405
405
  "placeholder": "Optional",
406
+ "display_value": "{{ value, date }}",
406
407
  "helper_text": ""
407
408
  }
408
409
  },
@@ -1710,6 +1710,9 @@
1710
1710
  },
1711
1711
  "subscription": {
1712
1712
  "caption": "Go to subscription"
1713
+ },
1714
+ "receipt": {
1715
+ "caption": "View receipt"
1713
1716
  }
1714
1717
  },
1715
1718
  "spinner": {
@@ -7,11 +7,11 @@
7
7
  "admin_status_title_rejected": "Invitation rejected",
8
8
  "admin_status_title_accepted": "This user is a store admin",
9
9
  "admin_status_title_expired": "Invitation expired",
10
- "admin_status_text_revoked": "This user may have been an admin in the past but has no access to this store at the moment. We will keep this record for historical purposes. To restore this user's access, resend the invitation using the button below.",
10
+ "admin_status_text_revoked": "This user may have been an admin in the past but has no access to this store at the moment. We will keep this record for historical purposes. To restore this user's access, delete the invitation using the button below and invite the user again.",
11
11
  "admin_status_text_sent": "We've sent an email to this user asking them to join this store. Once they accept, they will be granted full admin access. If they don't accept within 2 weeks, this invitation will expire.",
12
12
  "admin_status_text_rejected": "If this was a mistake, ask the user to delete this invitation in profile settings. You will be able to invite them again after that.",
13
13
  "admin_status_text_accepted": "They have full access to this store, including the ability to add and remove users.",
14
- "admin_status_text_expired": "This invitation has expired. You can resend this invitation using the button below.",
14
+ "admin_status_text_expired": "This invitation has expired. To add this user again, please delete this invitation and create a new one.",
15
15
  "user_status_title_rejected": "You've rejected an invitation to join {{ store_name }} as administrator",
16
16
  "user_status_title_accepted": "You're a store administrator at {{ store_name }}",
17
17
  "user_status_title_revoked": "You no longer have access to {{ store_name }}",
@@ -21,7 +21,7 @@
21
21
  "user_status_text_accepted": "If you'd like to leave this store, you can do so by pressing the button below. Please note that if you'd like to join again, the store owner will need to invite you.",
22
22
  "user_status_text_revoked": "If you'd like to join this store again, please ask the store owner to reactivate your access in settings.",
23
23
  "user_status_text_sent": "Accepting this invitation will grant you full access to this store. Rejecting it will prevent this store from inviting you again.",
24
- "user_status_text_expired": "To join this store, please ask the store owner to delete this invitation and invite you again.",
24
+ "user_status_text_expired": "To join this store, please ask the store owner to reactivate your access in settings.",
25
25
  "full_name": "{{ first_name }} {{ last_name }}",
26
26
  "full_name_empty": "Unknown User",
27
27
  "leave": {
@@ -17,6 +17,8 @@ export declare class InternalAsyncListControl extends InternalEditableControl {
17
17
  bulkActions: BulkAction<HALJSONResource>[];
18
18
  /** Same as the `related` property of `NucleonElement`. */
19
19
  related: string[];
20
+ /** When set to `details`, makes the entire control collapsible. */
21
+ layout: 'details' | null;
20
22
  /** Swipe actions. */
21
23
  actions: SwipeAction<HALJSONResource>[];
22
24
  /** Query parameters to apply to the `first` URL. */
@@ -35,6 +37,10 @@ export declare class InternalAsyncListControl extends InternalEditableControl {
35
37
  itemProps: Record<string, unknown>;
36
38
  /** Same as the `wide` property of `FormDialog`. */
37
39
  wide: boolean;
40
+ /** Visually hides the control when the collection is empty or loading. */
41
+ hideWhenEmpty: boolean;
42
+ /** Same as the `open` property of `InternalSummaryControl`. */
43
+ open: boolean;
38
44
  /** Same as the `alert` property of `FormDialog`. */
39
45
  alert: boolean;
40
46
  /** Hides Delete Swipe Action if true. */
@@ -49,10 +55,14 @@ export declare class InternalAsyncListControl extends InternalEditableControl {
49
55
  private __isFilterVisible;
50
56
  private __notification;
51
57
  private __isSelecting;
58
+ private __totalItems;
52
59
  private __selection;
53
60
  private __itemRenderer;
54
61
  private __filter;
62
+ render(): TemplateResult;
55
63
  renderControl(): TemplateResult;
56
- private get __dialog();
57
64
  private get __cardRenderer();
65
+ private get __dialog();
66
+ private __renderActions;
67
+ private __renderContent;
58
68
  }
@@ -16,6 +16,8 @@ export class InternalAsyncListControl extends InternalEditableControl {
16
16
  this.bulkActions = [];
17
17
  /** Same as the `related` property of `NucleonElement`. */
18
18
  this.related = [];
19
+ /** When set to `details`, makes the entire control collapsible. */
20
+ this.layout = null;
19
21
  /** Swipe actions. */
20
22
  this.actions = [];
21
23
  /** Query parameters to apply to the `first` URL. */
@@ -34,6 +36,10 @@ export class InternalAsyncListControl extends InternalEditableControl {
34
36
  this.itemProps = {};
35
37
  /** Same as the `wide` property of `FormDialog`. */
36
38
  this.wide = false;
39
+ /** Visually hides the control when the collection is empty or loading. */
40
+ this.hideWhenEmpty = false;
41
+ /** Same as the `open` property of `InternalSummaryControl`. */
42
+ this.open = false;
37
43
  /** Same as the `alert` property of `FormDialog`. */
38
44
  this.alert = false;
39
45
  /** Hides Delete Swipe Action if true. */
@@ -48,15 +54,18 @@ export class InternalAsyncListControl extends InternalEditableControl {
48
54
  this.__isFilterVisible = false;
49
55
  this.__notification = null;
50
56
  this.__isSelecting = false;
57
+ this.__totalItems = 0;
51
58
  this.__selection = [];
52
59
  this.__itemRenderer = ctx => {
53
60
  var _a;
61
+ const item = this.__cardRenderer(ctx);
62
+ const readonlyItem = html `<div class="bg-contrast-5">${item}</div>`;
54
63
  if (!ctx.data)
55
- return this.__cardRenderer(ctx);
64
+ return readonlyItem;
56
65
  if (this.__isSelecting) {
57
66
  return html `
58
67
  <vaadin-checkbox
59
- class="block w-full"
68
+ class=${classMap({ 'block w-full': true, 'bg-contrast-5': this.layout === 'details' })}
60
69
  style="padding-left: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
61
70
  data-async-list-control
62
71
  ?disabled=${this.disabled || !!this.__activeBulkAction}
@@ -76,16 +85,16 @@ export class InternalAsyncListControl extends InternalEditableControl {
76
85
  }
77
86
  const href = (_a = this.getPageHref) === null || _a === void 0 ? void 0 : _a.call(this, ctx.href, ctx.data);
78
87
  if (typeof href !== 'string' && !this.form)
79
- return this.__cardRenderer(ctx);
88
+ return readonlyItem;
80
89
  const isDisabled = this.disabledSelector.matches('card', true);
81
90
  const card = this.__cardRenderer(ctx);
82
91
  let clickableItem;
83
92
  const wrapperClass = classMap({
84
- 'rounded-t': !ctx.previous,
93
+ 'rounded-t': this.layout !== 'details' && !ctx.previous,
85
94
  'rounded-b': !ctx.next,
86
95
  'focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50': true,
87
- 'text-left w-full block transition-colors': true,
88
- 'hover-bg-contrast-5': !isDisabled,
96
+ 'text-left w-full block bg-contrast-5 transition-colors': true,
97
+ 'hover-bg-contrast-10': !isDisabled,
89
98
  });
90
99
  if (this.getPageHref) {
91
100
  if (isDisabled) {
@@ -189,6 +198,7 @@ export class InternalAsyncListControl extends InternalEditableControl {
189
198
  createPageHref: { attribute: 'create-page-href' },
190
199
  getPageHref: { attribute: false },
191
200
  related: { type: Array },
201
+ layout: {},
192
202
  first: {},
193
203
  limit: { type: Number },
194
204
  form: {},
@@ -196,36 +206,34 @@ export class InternalAsyncListControl extends InternalEditableControl {
196
206
  item: {},
197
207
  itemProps: { type: Object, attribute: 'item-props' },
198
208
  wide: { type: Boolean },
209
+ open: { type: Boolean },
210
+ hideWhenEmpty: { type: Boolean, attribute: 'hide-when-empty' },
199
211
  alert: { type: Boolean },
200
212
  actions: { attribute: false },
201
213
  bulkActions: { attribute: false },
202
214
  filters: { type: Array },
203
215
  __filter: { attribute: false },
204
216
  __selection: { attribute: false },
217
+ __totalItems: { attribute: false },
205
218
  __isSelecting: { attribute: false },
206
219
  __notification: { attribute: false },
207
220
  __isFilterVisible: { attribute: false },
208
221
  __activeBulkAction: { attribute: false },
209
222
  };
210
223
  }
224
+ render() {
225
+ const hidden = this.hideWhenEmpty && !this.__totalItems;
226
+ return html `<div class=${classMap({ hidden })}>${super.render()}</div>`;
227
+ }
211
228
  renderControl() {
212
- var _a, _b, _c;
213
- let first;
214
- try {
215
- const url = new URL((_a = this.first) !== null && _a !== void 0 ? _a : '');
216
- const filter = new URLSearchParams(this.__filter);
217
- url.searchParams.set('limit', String(this.limit));
218
- filter.forEach((value, key) => url.searchParams.set(key, value));
219
- first = url.toString();
220
- }
221
- catch (_d) {
222
- first = undefined;
223
- }
229
+ var _a, _b;
230
+ const actions = this.__renderActions();
231
+ const content = this.__renderContent();
224
232
  return html `
225
233
  ${this.form && !this.__isSelecting
226
234
  ? html `
227
235
  <foxy-form-dialog
228
- parent=${ifDefined((_b = this.first) !== null && _b !== void 0 ? _b : void 0)}
236
+ parent=${ifDefined((_a = this.first) !== null && _a !== void 0 ? _a : void 0)}
229
237
  infer="dialog"
230
238
  id="form"
231
239
  ?wide=${this.wide}
@@ -258,157 +266,54 @@ export class InternalAsyncListControl extends InternalEditableControl {
258
266
  >
259
267
  </foxy-internal-confirm-dialog>
260
268
  `}
261
- <div class="flex gap-m items-center justify-between text-l font-medium">
262
- <span class="text-body mr-auto">
263
- ${this.label && this.label !== 'label' ? this.label : ''}
264
- </span>
265
-
266
- ${this.filters.length > 0 && !this.__isSelecting
269
+ ${this.layout === 'details'
267
270
  ? html `
268
- <foxy-internal-async-list-control-filter-overlay
269
- .noVerticalOverlap=${true}
270
- .positionTarget=${this.renderRoot.querySelector('#filters')}
271
- .model=${{
272
- options: this.filters,
273
- value: this.__filter,
274
- lang: this.lang,
275
- ns: this.ns,
276
- }}
277
- ?opened=${this.__isFilterVisible}
278
- @vaadin-overlay-close=${() => (this.__isFilterVisible = false)}
279
- @search=${(evt) => {
280
- var _a;
281
- this.__filter = (_a = evt.detail) !== null && _a !== void 0 ? _a : '';
271
+ <foxy-internal-summary-control
272
+ layout="details"
273
+ count=${ifDefined(this.open ? void 0 : `${this.__totalItems}`)}
274
+ infer=""
275
+ ?open=${this.open}
276
+ @toggle=${(evt) => {
277
+ const summary = evt.currentTarget;
278
+ this.open = summary.open;
279
+ if (!evt.composed && !evt.bubbles)
280
+ this.dispatchEvent(new CustomEvent('toggle'));
282
281
  }}
283
- >
284
- </foxy-internal-async-list-control-filter-overlay>
285
-
286
- <vaadin-button
287
- theme="tertiary-inline contrast"
288
- id="filters"
289
- ?disabled=${this.disabled}
290
- @click=${() => (this.__isFilterVisible = !this.__isFilterVisible)}
291
- >
292
- <foxy-i18n infer="pagination" key="search_button_text"></foxy-i18n>
293
- </vaadin-button>
294
- `
295
- : ''}
296
- ${this.bulkActions.length > 0 && this.first
297
- ? html `
298
- ${this.__selection.length > 0
299
- ? this.bulkActions.map(action => {
300
- var _a;
301
- const nPrefix = `${action.name}_bulk_action_notification`;
302
- const cPrefix = `${action.name}_bulk_action_caption`;
303
- const isActive = ((_a = this.__activeBulkAction) === null || _a === void 0 ? void 0 : _a.name) === action.name;
304
- return html `
305
- <vaadin-button
306
- data-testclass="bulk-action"
307
- theme="tertiary-inline"
308
- ?disabled=${this.disabled || !!this.__activeBulkAction}
309
- @click=${async () => {
310
- var _a;
311
- this.__activeBulkAction = action;
312
- try {
313
- await action.onClick(this.__selection);
314
- this.__selection = [];
315
- this.__isSelecting = false;
316
- this.__notification = { key: `${nPrefix}_done`, theme: 'success' };
317
- }
318
- catch (_b) {
319
- this.__notification = { key: `${nPrefix}_fail`, theme: 'error' };
320
- }
321
- finally {
322
- this.__activeBulkAction = null;
323
- (_a = this.renderRoot.querySelector('vaadin-notification')) === null || _a === void 0 ? void 0 : _a.open();
324
- }
325
- }}
282
+ >
283
+ ${actions.length
284
+ ? html `
285
+ <div class="flex gap-s">
286
+ <foxy-i18n
287
+ infer=""
288
+ class="mr-auto text-tertiary"
289
+ key="total_items"
290
+ .options=${{ count: this.__totalItems }}
326
291
  >
327
- <foxy-i18n
328
- infer="pagination"
329
- key="${cPrefix}_${isActive ? 'busy' : 'idle'}"
330
- .options=${{ count: this.__selection.length }}
331
- >
332
- </foxy-i18n>
333
- </vaadin-button>
334
- `;
335
- })
292
+ </foxy-i18n>
293
+ ${actions}
294
+ </div>
295
+ `
336
296
  : ''}
337
- <vaadin-button
338
- theme="tertiary-inline contrast"
339
- ?disabled=${this.disabled || !!this.__activeBulkAction}
340
- @click=${() => {
341
- this.__isSelecting = !this.__isSelecting;
342
- this.__selection = [];
343
- }}
344
- >
345
- <foxy-i18n
346
- infer="pagination"
347
- key=${this.__isSelecting ? 'cancel_button_text' : 'select_button_text'}
348
- >
349
- </foxy-i18n>
350
- </vaadin-button>
351
- `
352
- : ''}
353
- ${(!this.form && !this.createPageHref) ||
354
- this.readonly ||
355
- this.hideCreateButton ||
356
- this.__isSelecting
357
- ? ''
358
- : this.createPageHref && !this.disabled
359
- ? html `
360
- <a
361
- class="rounded-s text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50"
362
- href=${this.createPageHref}
363
- >
364
- <foxy-i18n
365
- class="transition-opacity group-hover-opacity-80"
366
- infer=""
367
- key="create_button_text"
368
- >
369
- </foxy-i18n>
370
- </a>
371
- `
372
- : html `
373
- <vaadin-button
374
- theme="tertiary-inline"
375
- ?disabled=${this.disabled}
376
- @click=${(evt) => {
377
- evt.preventDefault();
378
- evt.stopPropagation();
379
- const dialog = this.__dialog;
380
- const button = evt.currentTarget;
381
- dialog.header = 'header_create';
382
- dialog.href = '';
383
- dialog.show(button);
384
- }}
385
- >
386
- <foxy-i18n infer="pagination" key="create_button_text"></foxy-i18n>
387
- </vaadin-button>
388
- `}
389
- </div>
297
+ <div class="p-0 bg-transparent">${content}</div>
298
+ </foxy-internal-summary-control>
299
+ `
300
+ : html `
301
+ <div class="flex gap-s items-center justify-between font-medium">
302
+ <span class="text-body mr-auto text-l">
303
+ ${this.label && this.label !== 'label' ? this.label : ''}
304
+ </span>
305
+ ${actions}
306
+ </div>
390
307
 
391
- <div
392
- class="text-secondary text-s"
393
- ?hidden=${!this.helperText || this.helperText === 'helper_text'}
394
- >
395
- ${this.helperText}
396
- </div>
308
+ <div
309
+ class="text-secondary text-s"
310
+ ?hidden=${!this.helperText || this.helperText === 'helper_text'}
311
+ >
312
+ ${this.helperText}
313
+ </div>
397
314
 
398
- <foxy-pagination first=${ifDefined(first)} infer="pagination">
399
- <foxy-collection-page
400
- class=${classMap({
401
- 'block divide-y divide-contrast-5 bg-contrast-5 rounded overflow-hidden': true,
402
- 'mt-s': (!!this.label && this.label !== 'label') ||
403
- (!!this.helperText && this.helperText !== 'helper_text'),
404
- })}
405
- infer="card"
406
- .related=${this.related}
407
- .props=${this.itemProps}
408
- .item=${this.__itemRenderer}
409
- >
410
- </foxy-collection-page>
411
- </foxy-pagination>
315
+ ${content}
316
+ `}
412
317
 
413
318
  <div
414
319
  class="mt-s text-s leading-xs text-error"
@@ -420,7 +325,7 @@ export class InternalAsyncListControl extends InternalEditableControl {
420
325
  <vaadin-notification
421
326
  position="bottom-end"
422
327
  duration="3000"
423
- theme=${ifDefined((_c = this.__notification) === null || _c === void 0 ? void 0 : _c.theme)}
328
+ theme=${ifDefined((_b = this.__notification) === null || _b === void 0 ? void 0 : _b.theme)}
424
329
  .renderer=${(root) => {
425
330
  var _a, _b;
426
331
  if (!root.firstElementChild)
@@ -441,9 +346,6 @@ export class InternalAsyncListControl extends InternalEditableControl {
441
346
  </vaadin-notification>
442
347
  `;
443
348
  }
444
- get __dialog() {
445
- return this.renderRoot.querySelector('#form');
446
- }
447
349
  get __cardRenderer() {
448
350
  var _a;
449
351
  const item = this.item;
@@ -470,5 +372,179 @@ export class InternalAsyncListControl extends InternalEditableControl {
470
372
  }
471
373
  return this.__cachedCardRenderer.render;
472
374
  }
375
+ get __dialog() {
376
+ return this.renderRoot.querySelector('#form');
377
+ }
378
+ __renderActions() {
379
+ return [
380
+ this.filters.length > 0 && !this.__isSelecting
381
+ ? html `
382
+ <foxy-internal-async-list-control-filter-overlay
383
+ .noVerticalOverlap=${true}
384
+ .positionTarget=${this.renderRoot.querySelector('#filters')}
385
+ .model=${{
386
+ options: this.filters,
387
+ value: this.__filter,
388
+ lang: this.lang,
389
+ ns: this.ns,
390
+ }}
391
+ ?opened=${this.__isFilterVisible}
392
+ @vaadin-overlay-close=${() => (this.__isFilterVisible = false)}
393
+ @search=${(evt) => {
394
+ var _a;
395
+ this.__filter = (_a = evt.detail) !== null && _a !== void 0 ? _a : '';
396
+ }}
397
+ >
398
+ </foxy-internal-async-list-control-filter-overlay>
399
+
400
+ <vaadin-button
401
+ theme="tertiary-inline contrast"
402
+ id="filters"
403
+ ?disabled=${this.disabled}
404
+ @click=${() => (this.__isFilterVisible = !this.__isFilterVisible)}
405
+ >
406
+ <foxy-i18n infer="pagination" key="search_button_text"></foxy-i18n>
407
+ </vaadin-button>
408
+ `
409
+ : '',
410
+ this.bulkActions.length > 0 && this.first
411
+ ? html `
412
+ ${this.__selection.length > 0
413
+ ? this.bulkActions.map(action => {
414
+ var _a;
415
+ const nPrefix = `${action.name}_bulk_action_notification`;
416
+ const cPrefix = `${action.name}_bulk_action_caption`;
417
+ const isActive = ((_a = this.__activeBulkAction) === null || _a === void 0 ? void 0 : _a.name) === action.name;
418
+ return html `
419
+ <vaadin-button
420
+ data-testclass="bulk-action"
421
+ theme="tertiary-inline"
422
+ ?disabled=${this.disabled || !!this.__activeBulkAction}
423
+ @click=${async () => {
424
+ var _a;
425
+ this.__activeBulkAction = action;
426
+ try {
427
+ await action.onClick(this.__selection);
428
+ this.__selection = [];
429
+ this.__isSelecting = false;
430
+ this.__notification = { key: `${nPrefix}_done`, theme: 'success' };
431
+ }
432
+ catch (_b) {
433
+ this.__notification = { key: `${nPrefix}_fail`, theme: 'error' };
434
+ }
435
+ finally {
436
+ this.__activeBulkAction = null;
437
+ (_a = this.renderRoot.querySelector('vaadin-notification')) === null || _a === void 0 ? void 0 : _a.open();
438
+ }
439
+ }}
440
+ >
441
+ <foxy-i18n
442
+ infer="pagination"
443
+ key="${cPrefix}_${isActive ? 'busy' : 'idle'}"
444
+ .options=${{ count: this.__selection.length }}
445
+ >
446
+ </foxy-i18n>
447
+ </vaadin-button>
448
+ `;
449
+ })
450
+ : ''}
451
+ <vaadin-button
452
+ theme="tertiary-inline contrast"
453
+ ?disabled=${this.disabled || !!this.__activeBulkAction}
454
+ @click=${() => {
455
+ this.__isSelecting = !this.__isSelecting;
456
+ this.__selection = [];
457
+ }}
458
+ >
459
+ <foxy-i18n
460
+ infer="pagination"
461
+ key=${this.__isSelecting ? 'cancel_button_text' : 'select_button_text'}
462
+ >
463
+ </foxy-i18n>
464
+ </vaadin-button>
465
+ `
466
+ : '',
467
+ (!this.form && !this.createPageHref) ||
468
+ this.readonly ||
469
+ this.hideCreateButton ||
470
+ this.__isSelecting
471
+ ? ''
472
+ : this.createPageHref && !this.disabled
473
+ ? html `
474
+ <a
475
+ class="rounded-s text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50"
476
+ href=${this.createPageHref}
477
+ >
478
+ <foxy-i18n
479
+ class="transition-opacity group-hover-opacity-80"
480
+ infer=""
481
+ key="create_button_text"
482
+ >
483
+ </foxy-i18n>
484
+ </a>
485
+ `
486
+ : html `
487
+ <vaadin-button
488
+ theme="tertiary-inline"
489
+ ?disabled=${this.disabled}
490
+ @click=${(evt) => {
491
+ evt.preventDefault();
492
+ evt.stopPropagation();
493
+ const dialog = this.__dialog;
494
+ const button = evt.currentTarget;
495
+ dialog.header = 'header_create';
496
+ dialog.href = '';
497
+ dialog.show(button);
498
+ }}
499
+ >
500
+ <foxy-i18n infer="pagination" key="create_button_text"></foxy-i18n>
501
+ </vaadin-button>
502
+ `,
503
+ ].filter(v => !!v);
504
+ }
505
+ __renderContent() {
506
+ var _a;
507
+ const helperText = this.helperText;
508
+ const isDetails = this.layout === 'details';
509
+ const label = this.label;
510
+ let first;
511
+ try {
512
+ const url = new URL((_a = this.first) !== null && _a !== void 0 ? _a : '');
513
+ const filter = new URLSearchParams(this.__filter);
514
+ url.searchParams.set('limit', String(this.limit));
515
+ filter.forEach((value, key) => url.searchParams.set(key, value));
516
+ first = url.toString();
517
+ }
518
+ catch (_b) {
519
+ first = undefined;
520
+ }
521
+ return html `
522
+ <foxy-pagination
523
+ first=${ifDefined(first)}
524
+ infer="pagination"
525
+ class=${classMap({ hidden: isDetails && this.__totalItems === 0 })}
526
+ >
527
+ <foxy-collection-page
528
+ class=${classMap({
529
+ 'grid grid-cols-1 overflow-hidden': true,
530
+ 'rounded': !isDetails,
531
+ 'mt-s': !isDetails &&
532
+ ((!!label && label !== 'label') || (!!helperText && helperText !== 'helper_text')),
533
+ })}
534
+ style="gap: 1px"
535
+ infer="card"
536
+ .related=${this.related}
537
+ .props=${this.itemProps}
538
+ .item=${this.__itemRenderer}
539
+ @update=${(evt) => {
540
+ var _a, _b;
541
+ const page = evt.currentTarget;
542
+ this.__totalItems = parseInt((_b = (_a = page.data) === null || _a === void 0 ? void 0 : _a.total_items) !== null && _b !== void 0 ? _b : 0);
543
+ }}
544
+ >
545
+ </foxy-collection-page>
546
+ </foxy-pagination>
547
+ `;
548
+ }
473
549
  }
474
550
  //# sourceMappingURL=InternalAsyncListControl.js.map