@foxy.io/elements 1.29.0-beta.6 → 1.30.0-beta.1

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 (137) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-form.js +1 -1
  3. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  4. package/dist/cdn/foxy-api-browser.js +1 -1
  5. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  6. package/dist/cdn/foxy-attribute-form.js +1 -1
  7. package/dist/cdn/foxy-cancellation-form.js +1 -1
  8. package/dist/cdn/foxy-cart-form.js +2 -2
  9. package/dist/cdn/foxy-client-form.js +1 -1
  10. package/dist/cdn/foxy-collection-pages.js +1 -1
  11. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  12. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  13. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  14. package/dist/cdn/foxy-coupon-form.js +1 -1
  15. package/dist/cdn/foxy-custom-field-form.js +1 -1
  16. package/dist/cdn/foxy-customer-form.js +1 -1
  17. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  18. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  19. package/dist/cdn/foxy-customer-portal.js +1 -1
  20. package/dist/cdn/foxy-customer.js +1 -1
  21. package/dist/cdn/foxy-donation.js +1 -1
  22. package/dist/cdn/foxy-downloadable-form.js +1 -1
  23. package/dist/cdn/foxy-email-template-form.js +1 -1
  24. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  25. package/dist/cdn/foxy-form-dialog.js +1 -1
  26. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  27. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  28. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  29. package/dist/cdn/foxy-gift-card-form.js +1 -1
  30. package/dist/cdn/foxy-i18n-editor.js +1 -1
  31. package/dist/cdn/foxy-integration-form.js +1 -1
  32. package/dist/cdn/foxy-item-category-form.js +1 -1
  33. package/dist/cdn/foxy-item-form.js +3 -3
  34. package/dist/cdn/foxy-item-option-form.js +1 -1
  35. package/dist/cdn/foxy-items-form.js +1 -1
  36. package/dist/cdn/foxy-native-integration-form.js +1 -1
  37. package/dist/cdn/foxy-pagination.js +1 -1
  38. package/dist/cdn/foxy-passkey-form.js +1 -1
  39. package/dist/cdn/foxy-payment-method-card.js +1 -1
  40. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  41. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  42. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  43. package/dist/cdn/foxy-report-form.js +1 -1
  44. package/dist/cdn/foxy-sign-in-form.js +1 -1
  45. package/dist/cdn/foxy-store-form.js +1 -1
  46. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  47. package/dist/cdn/foxy-subscription-card.js +1 -1
  48. package/dist/cdn/foxy-subscription-form.js +1 -1
  49. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  50. package/dist/cdn/foxy-tax-form.js +1 -1
  51. package/dist/cdn/foxy-template-config-form.js +1 -1
  52. package/dist/cdn/foxy-template-form.js +1 -1
  53. package/dist/cdn/foxy-template-set-form.js +1 -1
  54. package/dist/cdn/foxy-transaction-card.js +1 -1
  55. package/dist/cdn/foxy-transaction.js +1 -1
  56. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  57. package/dist/cdn/foxy-user-form.js +1 -1
  58. package/dist/cdn/foxy-users-table.js +1 -1
  59. package/dist/cdn/foxy-webhook-card.js +1 -1
  60. package/dist/cdn/foxy-webhook-form.js +1 -1
  61. package/dist/cdn/{shared-cfb33387.js → shared-01f18104.js} +1 -1
  62. package/dist/cdn/{shared-3483c729.js → shared-09fc6fa0.js} +1 -1
  63. package/dist/cdn/{shared-8bb3eb45.js → shared-1729e19a.js} +1 -1
  64. package/dist/cdn/{shared-fe4a2e3d.js → shared-19f46691.js} +1 -1
  65. package/dist/cdn/{shared-38f0bda5.js → shared-2bd96ec7.js} +2 -2
  66. package/dist/cdn/{shared-a97c3129.js → shared-2d75f154.js} +1 -1
  67. package/dist/cdn/{shared-8526ed32.js → shared-3b975a29.js} +1 -1
  68. package/dist/cdn/{shared-ae00ce7c.js → shared-3cf043a7.js} +1 -1
  69. package/dist/cdn/{shared-0ad0fb9f.js → shared-41e7554e.js} +1 -1
  70. package/dist/cdn/{shared-ee2cda29.js → shared-471e77dd.js} +1 -1
  71. package/dist/cdn/{shared-1467a889.js → shared-476827c7.js} +1 -1
  72. package/dist/cdn/{shared-75331d5e.js → shared-4a652d60.js} +1 -1
  73. package/dist/cdn/{shared-22ba950a.js → shared-4d172731.js} +1 -1
  74. package/dist/cdn/{shared-70747a5c.js → shared-5721fb53.js} +1 -1
  75. package/dist/cdn/{shared-376784f0.js → shared-5bc86d84.js} +1 -1
  76. package/dist/cdn/shared-6d11abd7.js +280 -0
  77. package/dist/cdn/{shared-13203be0.js → shared-6f4fa343.js} +1 -1
  78. package/dist/cdn/{shared-f21254a3.js → shared-6f877b15.js} +1 -1
  79. package/dist/cdn/{shared-d0e4d7b1.js → shared-73045804.js} +1 -1
  80. package/dist/cdn/{shared-f4abc29a.js → shared-787e8da4.js} +1 -1
  81. package/dist/cdn/{shared-9a22d597.js → shared-7dd710e4.js} +1 -1
  82. package/dist/cdn/{shared-970d98db.js → shared-8fbebf38.js} +1 -1
  83. package/dist/cdn/{shared-cc808e01.js → shared-9637a2de.js} +1 -1
  84. package/dist/cdn/{shared-dfc47fd9.js → shared-96a392d9.js} +1 -1
  85. package/dist/cdn/{shared-4f183419.js → shared-97514fcb.js} +1 -1
  86. package/dist/cdn/{shared-c9845b4a.js → shared-9bf7d9a7.js} +1 -1
  87. package/dist/cdn/{shared-421a3ced.js → shared-a0efdc94.js} +1 -1
  88. package/dist/cdn/{shared-32e92c3b.js → shared-a8233033.js} +1 -1
  89. package/dist/cdn/{shared-edae6816.js → shared-ad76e640.js} +1 -1
  90. package/dist/cdn/{shared-6a8a40cc.js → shared-b38762ef.js} +1 -1
  91. package/dist/cdn/{shared-ce0465c6.js → shared-b980ba1d.js} +1 -1
  92. package/dist/cdn/{shared-afd7214a.js → shared-cb3b9d8b.js} +1 -1
  93. package/dist/cdn/{shared-ecf479f2.js → shared-d5ff9121.js} +1 -1
  94. package/dist/cdn/{shared-1ecfa77b.js → shared-deff3eda.js} +1 -1
  95. package/dist/cdn/{shared-301a779e.js → shared-e47bd38e.js} +1 -1
  96. package/dist/cdn/{shared-dbda59a0.js → shared-e5098b19.js} +1 -1
  97. package/dist/cdn/{shared-19768452.js → shared-e7bff5de.js} +1 -1
  98. package/dist/cdn/{shared-e4870c47.js → shared-ea5ff8bc.js} +1 -1
  99. package/dist/cdn/translations/admin-subscription-form/en.json +108 -0
  100. package/dist/cdn/translations/coupon-form/en.json +103 -50
  101. package/dist/cdn/translations/transaction/en.json +108 -0
  102. package/dist/cdn/translations/webhook-card/en.json +5 -1
  103. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +9 -2
  104. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +150 -32
  105. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  106. package/dist/elements/internal/InternalAsyncListControl/index.d.ts +3 -0
  107. package/dist/elements/internal/InternalAsyncListControl/index.js +3 -0
  108. package/dist/elements/internal/InternalAsyncListControl/index.js.map +1 -1
  109. package/dist/elements/internal/InternalAsyncListControl/styles.d.ts +1 -0
  110. package/dist/elements/internal/InternalAsyncListControl/styles.js +12 -0
  111. package/dist/elements/internal/InternalAsyncListControl/styles.js.map +1 -0
  112. package/dist/elements/internal/InternalAsyncListControl/types.d.ts +5 -1
  113. package/dist/elements/internal/InternalAsyncListControl/types.js.map +1 -1
  114. package/dist/elements/public/CouponForm/CouponForm.d.ts +0 -3
  115. package/dist/elements/public/CouponForm/CouponForm.js +56 -76
  116. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  117. package/dist/elements/public/CouponForm/index.d.ts +2 -2
  118. package/dist/elements/public/CouponForm/index.js +2 -2
  119. package/dist/elements/public/CouponForm/index.js.map +1 -1
  120. package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
  121. package/dist/elements/public/Transaction/Transaction.d.ts +2 -0
  122. package/dist/elements/public/Transaction/Transaction.js +114 -19
  123. package/dist/elements/public/Transaction/Transaction.js.map +1 -1
  124. package/dist/elements/public/Transaction/index.d.ts +6 -0
  125. package/dist/elements/public/Transaction/index.js +6 -0
  126. package/dist/elements/public/Transaction/index.js.map +1 -1
  127. package/dist/elements/public/WebhookCard/WebhookCard.d.ts +8 -0
  128. package/dist/elements/public/WebhookCard/WebhookCard.js +73 -6
  129. package/dist/elements/public/WebhookCard/WebhookCard.js.map +1 -1
  130. package/dist/elements/public/WebhookCard/index.d.ts +2 -0
  131. package/dist/elements/public/WebhookCard/index.js +2 -0
  132. package/dist/elements/public/WebhookCard/index.js.map +1 -1
  133. package/dist/elements/public/WebhookForm/WebhookForm.d.ts +7 -0
  134. package/dist/elements/public/WebhookForm/WebhookForm.js +40 -4
  135. package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
  136. package/package.json +1 -1
  137. package/dist/cdn/shared-ba7354fa.js +0 -6
@@ -120,12 +120,16 @@
120
120
  "ordinal_other": "th",
121
121
  "ordinal_two": "nd",
122
122
  "ordinal_zero": "th",
123
- "name": {
124
- "label": "Name",
125
- "placeholder": "Required",
126
- "helper_text": "Coupon name is visible to the customers.",
127
- "v8n_required": "Please enter a name for this coupon.",
128
- "v8n_too_long": "Please shorten the name to 50 characters or less."
123
+ "general": {
124
+ "label": "",
125
+ "helper_text": "",
126
+ "name": {
127
+ "label": "Name",
128
+ "placeholder": "Required",
129
+ "helper_text": "Coupon name is visible to the customers.",
130
+ "v8n_required": "Please enter a name for this coupon.",
131
+ "v8n_too_long": "Please shorten the name to 50 characters or less."
132
+ }
129
133
  },
130
134
  "rules": {
131
135
  "label": "Rules",
@@ -439,23 +443,27 @@
439
443
  "previous": "Previous"
440
444
  }
441
445
  },
442
- "number-of-uses-allowed": {
443
- "label": "Uses per coupon",
444
- "placeholder": "Unlimited",
445
- "helper_text": "The maximum number of times this coupon can be used. Leave blank for unlimited uses.",
446
- "v8n_too_small": "Please enter a value greater or equal to 0."
447
- },
448
- "number-of-uses-allowed-per-customer": {
449
- "label": "Uses per customer",
450
- "placeholder": "Unlimited",
451
- "helper_text": "The maximum number of times a single customer can use this coupon. Leave blank for unlimited uses.",
452
- "v8n_too_small": "Please enter a value greater or equal to 0."
453
- },
454
- "number-of-uses-allowed-per-code": {
455
- "label": "Uses per code",
456
- "placeholder": "Unlimited",
457
- "helper_text": "The maximum number of times a single code can be used. Leave blank for unlimited uses.",
458
- "v8n_too_small": "Please enter a value greater or equal to 0."
446
+ "uses": {
447
+ "label": "Usage restrictions",
448
+ "helper_text": "",
449
+ "number-of-uses-allowed": {
450
+ "label": "Uses per coupon",
451
+ "placeholder": "Unlimited",
452
+ "helper_text": "The maximum number of times this coupon can be used. Leave blank for unlimited uses.",
453
+ "v8n_too_small": "Please enter a value greater or equal to 0."
454
+ },
455
+ "number-of-uses-allowed-per-customer": {
456
+ "label": "Uses per customer",
457
+ "placeholder": "Unlimited",
458
+ "helper_text": "The maximum number of times a single customer can use this coupon. Leave blank for unlimited uses.",
459
+ "v8n_too_small": "Please enter a value greater or equal to 0."
460
+ },
461
+ "number-of-uses-allowed-per-code": {
462
+ "label": "Uses per code",
463
+ "placeholder": "Unlimited",
464
+ "helper_text": "The maximum number of times a single code can be used. Leave blank for unlimited uses.",
465
+ "v8n_too_small": "Please enter a value greater or equal to 0."
466
+ }
459
467
  },
460
468
  "product-code-restrictions": {
461
469
  "label": "Product code restrictions",
@@ -469,36 +477,77 @@
469
477
  },
470
478
  "options": {
471
479
  "label": "Options",
472
- "option_multiple_codes_allowed": "Allow multiple codes on the same order",
473
- "option_combinable": "Allow combining with other coupons",
474
- "option_exclude_category_discounts": "Don't apply category discounts with this coupon",
475
- "option_exclude_line_item_discounts": "Don't apply line item discounts with this coupon",
476
- "option_is_taxable": "Apply taxes before this coupon",
477
- "option_shared_codes_allowed": "Enable code sharing between coupons",
478
- "option_customer_auto_apply": "Enable auto-apply",
479
- "helper_text": ""
480
- },
481
- "start-date": {
482
- "label": "Start date",
483
- "placeholder": "Optional",
484
- "helper_text": "The date and time when this coupon will become active. Leave blank to activate immediately."
480
+ "helper_text": "",
481
+ "multiple-codes-allowed": {
482
+ "label": "Allow multiple codes on the same order",
483
+ "helper_text": "",
484
+ "checked": "Yes",
485
+ "unchecked": "No"
486
+ },
487
+ "combinable": {
488
+ "label": "Allow combining with other coupons",
489
+ "helper_text": "",
490
+ "checked": "Yes",
491
+ "unchecked": "No"
492
+ },
493
+ "exclude-category-discounts": {
494
+ "label": "Don't apply category discounts with this coupon",
495
+ "helper_text": "",
496
+ "checked": "Yes",
497
+ "unchecked": "No"
498
+ },
499
+ "exclude-line-item-discounts": {
500
+ "label": "Don't apply line item discounts with this coupon",
501
+ "helper_text": "",
502
+ "checked": "Yes",
503
+ "unchecked": "No"
504
+ },
505
+ "is-taxable": {
506
+ "label": "Apply taxes before this coupon",
507
+ "helper_text": "",
508
+ "checked": "Yes",
509
+ "unchecked": "No"
510
+ },
511
+ "shared-codes-allowed": {
512
+ "label": "Enable code sharing between coupons",
513
+ "helper_text": "",
514
+ "checked": "Yes",
515
+ "unchecked": "No"
516
+ },
517
+ "customer-auto-apply": {
518
+ "label": "Enable auto-apply",
519
+ "helper_text": "",
520
+ "checked": "Yes",
521
+ "unchecked": "No"
522
+ }
485
523
  },
486
- "end-date": {
487
- "label": "End date",
488
- "placeholder": "Optional",
489
- "helper_text": "The date and time when this coupon will expire. Leave blank for no expiration."
524
+ "timeframe": {
525
+ "label": "Date restrictions",
526
+ "helper_text": "",
527
+ "start-date": {
528
+ "label": "Start date",
529
+ "placeholder": "Select",
530
+ "display_value": "{{ value, date }}",
531
+ "helper_text": "The date and time when this coupon will become active. Leave blank to activate immediately."
532
+ },
533
+ "end-date": {
534
+ "label": "End date",
535
+ "placeholder": "Select",
536
+ "display_value": "{{ value, date }}",
537
+ "helper_text": "The date and time when this coupon will expire. Leave blank for no expiration."
538
+ }
490
539
  },
491
540
  "customer-subscription-restrictions": {
492
- "label": "Auto-apply: subscription restrictions",
541
+ "label": "Subscription restrictions",
493
542
  "placeholder": "Enter a product code and hit Enter",
494
- "helper_text": "This coupon will be automatically applied when a subscription includes a product with one of the codes in the list. Wildcards are allowed just like in product code restrictions.",
543
+ "helper_text": "This coupon will be applied only when a subscription includes a product with one of the codes in the list. Wildcards are allowed just like in product code restrictions.",
495
544
  "caption": "Add this code",
496
545
  "delete": "Delete this code",
497
546
  "v8n_too_long": "Unfortunately we are unable to store that many subscription restrictions at the moment. Please reduce the number of rules in this section until this message disappears."
498
547
  },
499
548
  "customer-attribute-restrictions": {
500
- "label": "Auto-apply: customer restrictions",
501
- "helper_text": "This coupon will be automatically applied when a customer record matches this query.",
549
+ "label": "Customer restrictions",
550
+ "helper_text": "This coupon will be applied only when a customer record matches this query.",
502
551
  "v8n_too_long": "Unfortunately we are unable to store that many customer restrictions at the moment. Please reduce the number of rules in this section until this message disappears.",
503
552
  "query-builder": {
504
553
  "add_or_clause": "Add OR clause",
@@ -598,12 +647,16 @@
598
647
  },
599
648
  "helper_text": "Limit which categories this coupon applies to. All changes are saved automatically."
600
649
  },
601
- "inclusive-tax-rate": {
602
- "label": "Tax rate",
603
- "placeholder": "Optional",
604
- "helper_text": "The tax rate to apply to the coupon in tax-inclusive mode. This is a decimal value from 0 to 1.",
605
- "v8n_too_small": "Please enter a value greater or equal to 0.",
606
- "v8n_too_big": "Please enter a value less than or equal to 1."
650
+ "taxes": {
651
+ "label": "Tax settings",
652
+ "helper_text": "",
653
+ "inclusive-tax-rate": {
654
+ "label": "Tax rate",
655
+ "placeholder": "Optional",
656
+ "helper_text": "The tax rate to apply to the coupon in tax-inclusive mode. This is a decimal value from 0 to 1.",
657
+ "v8n_too_small": "Please enter a value greater or equal to 0.",
658
+ "v8n_too_big": "Please enter a value less than or equal to 1."
659
+ }
607
660
  },
608
661
  "timestamps": {
609
662
  "date_created": "Created on",
@@ -732,6 +732,103 @@
732
732
  }
733
733
  }
734
734
  },
735
+ "webhooks": {
736
+ "label": "Webhooks",
737
+ "helper_text": "This list shows v2 webhooks only. Legacy v1 webhooks are available in Settings > Integrations and on admin.foxycart.com.",
738
+ "dialog": {
739
+ "close": "Close",
740
+ "cancel": "Cancel",
741
+ "header_update": "Webhook",
742
+ "webhook-form": {
743
+ "header": {
744
+ "title_existing": "{{ name }}",
745
+ "subtitle_transaction": ""
746
+ },
747
+ "url": {
748
+ "label": "URL",
749
+ "helper_text": ""
750
+ },
751
+ "statuses": {
752
+ "label": "Runs",
753
+ "pagination": {
754
+ "first": "First",
755
+ "last": "Last",
756
+ "next": "Next",
757
+ "pagination": "{{from}}-{{to}} out of {{total}}",
758
+ "previous": "Previous",
759
+ "card": {
760
+ "status_successful": "Successful",
761
+ "status_pending": "Pending",
762
+ "status_failed": "Failed",
763
+ "date": "{{ value, date }} at {{ value, time }}",
764
+ "spinner": {
765
+ "loading_busy": "Loading",
766
+ "loading_error": "Unknown error",
767
+ "loading_empty": "No runs for this transaction yet"
768
+ }
769
+ }
770
+ }
771
+ },
772
+ "logs": {
773
+ "label": "Logs",
774
+ "pagination": {
775
+ "first": "First",
776
+ "last": "Last",
777
+ "next": "Next",
778
+ "pagination": "{{from}}-{{to}} out of {{total}}",
779
+ "previous": "Previous",
780
+ "card": {
781
+ "date": "{{ value, date }} at {{ value, time }}",
782
+ "spinner": {
783
+ "loading_busy": "Loading",
784
+ "loading_error": "Unknown error",
785
+ "loading_empty": "No runs for this transaction yet"
786
+ }
787
+ }
788
+ }
789
+ },
790
+ "spinner": {
791
+ "refresh": "Refresh",
792
+ "loading_busy": "Loading",
793
+ "loading_error": "Unknown error"
794
+ }
795
+ }
796
+ },
797
+ "pagination": {
798
+ "select_button_text": "Select",
799
+ "cancel_button_text": "Cancel",
800
+ "refeed_bulk_action_caption_idle": "Refeed ({{ count }})",
801
+ "refeed_bulk_action_caption_busy": "Refeeding...",
802
+ "refeed_bulk_action_notification_done": "Selected webhooks were sent successfully.",
803
+ "refeed_bulk_action_notification_fail": "Failed to refeed selected webhooks.",
804
+ "first": "First",
805
+ "last": "Last",
806
+ "next": "Next",
807
+ "pagination": "{{from}}-{{to}} out of {{total}}",
808
+ "previous": "Previous",
809
+ "card": {
810
+ "status_successful": "OK",
811
+ "status_pending": "Pending",
812
+ "status_failed": "Failed",
813
+ "status_none": "No runs yet",
814
+ "spinner": {
815
+ "loading_busy": "Loading",
816
+ "loading_empty": "No webhooks",
817
+ "loading_error": "Unknown error"
818
+ }
819
+ }
820
+ }
821
+ },
822
+ "datafeed": {
823
+ "label": "Legacy XML datafeed",
824
+ "helper_text": "To resend this webhook, use the Resend datafeed button at the top of the page.",
825
+ "data-is-fed": {
826
+ "label": "Status",
827
+ "helper_text": "",
828
+ "checked": "Sent",
829
+ "unchecked": "Not sent"
830
+ }
831
+ },
735
832
  "summary": {
736
833
  "total_shipping": "Shipping",
737
834
  "total_tax": "Tax",
@@ -1569,6 +1666,17 @@
1569
1666
  "cancel": "No"
1570
1667
  }
1571
1668
  },
1669
+ "resend-datafeed": {
1670
+ "idle": "Resend datafeed",
1671
+ "busy": "Resending datafeed...",
1672
+ "fail": "Failed to resend datafeed",
1673
+ "confirm": {
1674
+ "header": "Resend datafeed",
1675
+ "message": "Are you sure you'd like to resend XML datafeed for this transaction?",
1676
+ "confirm": "Yes",
1677
+ "cancel": "No"
1678
+ }
1679
+ },
1572
1680
  "subscription": {
1573
1681
  "caption": "Go to subscription"
1574
1682
  }
@@ -1,7 +1,11 @@
1
1
  {
2
+ "status_successful": "OK",
3
+ "status_pending": "Pending",
4
+ "status_failed": "Failed",
5
+ "status_none": "No runs yet",
2
6
  "spinner": {
3
7
  "loading_busy": "Loading",
4
8
  "loading_error": "Unknown error",
5
9
  "loading_empty": "No data"
6
10
  }
7
- }
11
+ }
@@ -1,8 +1,9 @@
1
1
  import type { PropertyDeclarations, TemplateResult } from 'lit-element';
2
2
  import type { CollectionPage } from '../../public/index';
3
+ import type { BulkAction, SwipeAction } from './types';
4
+ import type { HALJSONResource } from '../../public/NucleonElement/types';
3
5
  import type { FormDialog } from '../../index';
4
6
  import type { Option } from '../../public/QueryBuilder/types';
5
- import type { Action } from './types';
6
7
  import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';
7
8
  export declare class InternalAsyncListControl extends InternalEditableControl {
8
9
  static get properties(): PropertyDeclarations;
@@ -12,10 +13,12 @@ export declare class InternalAsyncListControl extends InternalEditableControl {
12
13
  keepDialogOpenOnPost: boolean;
13
14
  /** If provided, renders Create button as a link to this page. */
14
15
  createPageHref: string | null;
16
+ /** Bulk actions that appear when one or more items are selected. */
17
+ bulkActions: BulkAction<HALJSONResource>[];
15
18
  /** Same as the `related` property of `NucleonElement`. */
16
19
  related: string[];
17
20
  /** Swipe actions. */
18
- actions: Action<import("../../public/NucleonElement/types").HALJSONResource>[];
21
+ actions: SwipeAction<HALJSONResource>[];
19
22
  /** Query parameters to apply to the `first` URL. */
20
23
  filters: Option[];
21
24
  /** Limit query parameter to apply to the `first` URL. */
@@ -42,7 +45,11 @@ export declare class InternalAsyncListControl extends InternalEditableControl {
42
45
  getPageHref: ((itemHref: string, item: unknown) => string | null) | null;
43
46
  private __deletionConfimationCallback;
44
47
  private __cachedCardRenderer;
48
+ private __activeBulkAction;
45
49
  private __isFilterVisible;
50
+ private __notification;
51
+ private __isSelecting;
52
+ private __selection;
46
53
  private __itemRenderer;
47
54
  private __filter;
48
55
  renderControl(): TemplateResult;
@@ -1,6 +1,7 @@
1
1
  import { InternalEditableControl } from "../InternalEditableControl/InternalEditableControl.js";
2
2
  import { ifDefined } from 'lit-html/directives/if-defined';
3
3
  import { classMap } from "../../../utils/class-map.js";
4
+ import { render } from 'lit-html';
4
5
  import { html } from 'lit-element';
5
6
  export class InternalAsyncListControl extends InternalEditableControl {
6
7
  constructor() {
@@ -11,6 +12,8 @@ export class InternalAsyncListControl extends InternalEditableControl {
11
12
  this.keepDialogOpenOnPost = false;
12
13
  /** If provided, renders Create button as a link to this page. */
13
14
  this.createPageHref = null;
15
+ /** Bulk actions that appear when one or more items are selected. */
16
+ this.bulkActions = [];
14
17
  /** Same as the `related` property of `NucleonElement`. */
15
18
  this.related = [];
16
19
  /** Swipe actions. */
@@ -41,11 +44,36 @@ export class InternalAsyncListControl extends InternalEditableControl {
41
44
  this.getPageHref = null;
42
45
  this.__deletionConfimationCallback = null;
43
46
  this.__cachedCardRenderer = null;
47
+ this.__activeBulkAction = null;
44
48
  this.__isFilterVisible = false;
49
+ this.__notification = null;
50
+ this.__isSelecting = false;
51
+ this.__selection = [];
45
52
  this.__itemRenderer = ctx => {
46
53
  var _a;
47
54
  if (!ctx.data)
48
55
  return this.__cardRenderer(ctx);
56
+ if (this.__isSelecting) {
57
+ return html `
58
+ <vaadin-checkbox
59
+ class="block w-full"
60
+ style="padding-left: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
61
+ data-async-list-control
62
+ ?disabled=${this.disabled || !!this.__activeBulkAction}
63
+ ?checked=${this.__selection.find(v => v._links.self.href === ctx.data._links.self.href)}
64
+ @change=${(evt) => {
65
+ if (evt.currentTarget.checked) {
66
+ this.__selection = [...this.__selection, ctx.data];
67
+ }
68
+ else {
69
+ this.__selection = this.__selection.filter(v => v._links.self.href !== ctx.data._links.self.href);
70
+ }
71
+ }}
72
+ >
73
+ ${this.__cardRenderer(ctx)}
74
+ </vaadin-checkbox>
75
+ `;
76
+ }
49
77
  const href = (_a = this.getPageHref) === null || _a === void 0 ? void 0 : _a.call(this, ctx.href, ctx.data);
50
78
  if (typeof href !== 'string' && !this.form)
51
79
  return this.__cardRenderer(ctx);
@@ -88,7 +116,7 @@ export class InternalAsyncListControl extends InternalEditableControl {
88
116
  <button ?disabled=${isDisabled} class=${wrapperClass} @click=${handleClick}>${card}</button>
89
117
  `;
90
118
  }
91
- if (this.hideDeleteButton || this.readonly)
119
+ if ((this.hideDeleteButton && !this.actions.length) || this.readonly)
92
120
  return clickableItem;
93
121
  return html `
94
122
  <foxy-swipe-actions class="block">
@@ -124,25 +152,28 @@ export class InternalAsyncListControl extends InternalEditableControl {
124
152
  </vaadin-button>
125
153
  `;
126
154
  })}
127
-
128
- <vaadin-button
129
- theme="primary error"
130
- class="h-full rounded-none"
131
- slot="action"
132
- @click=${(evt) => {
133
- const button = evt.currentTarget;
134
- const confirm = this.renderRoot.querySelector('#confirm');
135
- confirm.show(button);
136
- this.__deletionConfimationCallback = () => {
137
- const cardButton = button.parentElement.firstElementChild;
138
- const card = cardButton.querySelector('[href]');
139
- card === null || card === void 0 ? void 0 : card.delete();
140
- this.__deletionConfimationCallback = null;
141
- };
142
- }}
143
- >
144
- <foxy-i18n infer="" key="delete_button_text"></foxy-i18n>
145
- </vaadin-button>
155
+ ${this.hideDeleteButton
156
+ ? ''
157
+ : html `
158
+ <vaadin-button
159
+ theme="primary error"
160
+ class="h-full rounded-none"
161
+ slot="action"
162
+ @click=${(evt) => {
163
+ const button = evt.currentTarget;
164
+ const confirm = this.renderRoot.querySelector('#confirm');
165
+ confirm.show(button);
166
+ this.__deletionConfimationCallback = () => {
167
+ const cardButton = button.parentElement.firstElementChild;
168
+ const card = cardButton.querySelector('[href]');
169
+ card === null || card === void 0 ? void 0 : card.delete();
170
+ this.__deletionConfimationCallback = null;
171
+ };
172
+ }}
173
+ >
174
+ <foxy-i18n infer="" key="delete_button_text"></foxy-i18n>
175
+ </vaadin-button>
176
+ `}
146
177
  </foxy-swipe-actions>
147
178
  `;
148
179
  };
@@ -166,14 +197,19 @@ export class InternalAsyncListControl extends InternalEditableControl {
166
197
  itemProps: { type: Object, attribute: 'item-props' },
167
198
  wide: { type: Boolean },
168
199
  alert: { type: Boolean },
169
- actions: { type: Array },
200
+ actions: { attribute: false },
201
+ bulkActions: { attribute: false },
170
202
  filters: { type: Array },
171
203
  __filter: { attribute: false },
204
+ __selection: { attribute: false },
205
+ __isSelecting: { attribute: false },
206
+ __notification: { attribute: false },
172
207
  __isFilterVisible: { attribute: false },
208
+ __activeBulkAction: { attribute: false },
173
209
  };
174
210
  }
175
211
  renderControl() {
176
- var _a, _b;
212
+ var _a, _b, _c;
177
213
  let first;
178
214
  try {
179
215
  const url = new URL((_a = this.first) !== null && _a !== void 0 ? _a : '');
@@ -182,11 +218,11 @@ export class InternalAsyncListControl extends InternalEditableControl {
182
218
  filter.forEach((value, key) => url.searchParams.set(key, value));
183
219
  first = url.toString();
184
220
  }
185
- catch (_c) {
221
+ catch (_d) {
186
222
  first = undefined;
187
223
  }
188
224
  return html `
189
- ${this.form
225
+ ${this.form && !this.__isSelecting
190
226
  ? html `
191
227
  <foxy-form-dialog
192
228
  parent=${ifDefined((_b = this.first) !== null && _b !== void 0 ? _b : void 0)}
@@ -203,7 +239,7 @@ export class InternalAsyncListControl extends InternalEditableControl {
203
239
  </foxy-form-dialog>
204
240
  `
205
241
  : ''}
206
- ${this.hideDeleteButton || this.readonly
242
+ ${this.hideDeleteButton || this.readonly || this.__isSelecting
207
243
  ? ''
208
244
  : html `
209
245
  <foxy-internal-confirm-dialog
@@ -223,11 +259,11 @@ export class InternalAsyncListControl extends InternalEditableControl {
223
259
  </foxy-internal-confirm-dialog>
224
260
  `}
225
261
  <div class="flex gap-m items-center justify-between mb-xs text-s font-medium">
226
- <span class="text-secondary">
262
+ <span class="text-secondary mr-auto">
227
263
  ${this.label && this.label !== 'label' ? this.label : ''}
228
264
  </span>
229
265
 
230
- ${this.filters.length > 0
266
+ ${this.filters.length > 0 && !this.__isSelecting
231
267
  ? html `
232
268
  <foxy-internal-async-list-control-filter-overlay
233
269
  .noVerticalOverlap=${true}
@@ -249,7 +285,6 @@ export class InternalAsyncListControl extends InternalEditableControl {
249
285
 
250
286
  <vaadin-button
251
287
  theme="tertiary-inline contrast"
252
- class="ml-auto"
253
288
  id="filters"
254
289
  ?disabled=${this.disabled}
255
290
  @click=${() => (this.__isFilterVisible = !this.__isFilterVisible)}
@@ -258,7 +293,67 @@ export class InternalAsyncListControl extends InternalEditableControl {
258
293
  </vaadin-button>
259
294
  `
260
295
  : ''}
261
- ${(!this.form && !this.createPageHref) || this.readonly || this.hideCreateButton
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
+ }}
326
+ >
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
+ })
336
+ : ''}
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
262
357
  ? ''
263
358
  : this.createPageHref && !this.disabled
264
359
  ? html `
@@ -297,8 +392,8 @@ export class InternalAsyncListControl extends InternalEditableControl {
297
392
  <foxy-collection-page
298
393
  class=${classMap({
299
394
  'block divide-y divide-contrast-5 rounded overflow-hidden': true,
300
- 'ring-1 ring-inset ring-contrast-10': !this.form && !this.getPageHref,
301
- 'bg-contrast-5': !!this.form || !!this.getPageHref,
395
+ 'ring-1 ring-inset ring-contrast-10': this.__isSelecting || (!this.form && !this.getPageHref),
396
+ 'bg-contrast-5': !this.__isSelecting && (!!this.form || !!this.getPageHref),
302
397
  })}
303
398
  infer="card"
304
399
  .related=${this.related}
@@ -321,10 +416,33 @@ export class InternalAsyncListControl extends InternalEditableControl {
321
416
 
322
417
  <div
323
418
  class="mt-xs text-xs leading-xs text-error"
324
- ?hidden=${!this._errorMessage || this.disabled || this.readonly}
419
+ ?hidden=${!this._errorMessage || this.disabled || this.readonly || this.__isSelecting}
325
420
  >
326
421
  ${this._errorMessage}
327
422
  </div>
423
+
424
+ <vaadin-notification
425
+ position="bottom-end"
426
+ duration="3000"
427
+ theme=${ifDefined((_c = this.__notification) === null || _c === void 0 ? void 0 : _c.theme)}
428
+ .renderer=${(root) => {
429
+ var _a, _b;
430
+ if (!root.firstElementChild)
431
+ root.innerHTML = '<span></span>';
432
+ const theme = (_a = this.__notification) === null || _a === void 0 ? void 0 : _a.theme;
433
+ const layout = html `
434
+ <foxy-i18n
435
+ style="color: var(--lumo-${theme ? `${theme}-contrast` : 'body-text'}-color)"
436
+ lang=${this.lang}
437
+ key=${(_b = this.__notification) === null || _b === void 0 ? void 0 : _b.key}
438
+ ns="${this.ns} pagination"
439
+ >
440
+ </foxy-i18n>
441
+ `;
442
+ render(layout, root.firstElementChild);
443
+ }}
444
+ >
445
+ </vaadin-notification>
328
446
  `;
329
447
  }
330
448
  get __dialog() {