@foxy.io/elements 1.38.0-beta.2 → 1.38.0-beta.4
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.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +5 -5
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +11 -11
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +2 -2
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-1ba78e12.js → shared-058c340a.js} +1 -1
- package/dist/cdn/{shared-41aa53e0.js → shared-08b895b0.js} +1 -1
- package/dist/cdn/shared-0aedd809.js +1 -0
- package/dist/cdn/{shared-2bcdd0c6.js → shared-0d412ab6.js} +1 -1
- package/dist/cdn/{shared-812c706e.js → shared-16aa673a.js} +1 -1
- package/dist/cdn/{shared-12a553c2.js → shared-196b992c.js} +1 -1
- package/dist/cdn/{shared-82e82908.js → shared-1d0839af.js} +1 -1
- package/dist/cdn/{shared-2762e106.js → shared-28a6781e.js} +5 -5
- package/dist/cdn/{shared-f438f0f4.js → shared-2a305cf4.js} +1 -1
- package/dist/cdn/{shared-17a61265.js → shared-2aa23b5f.js} +1 -1
- package/dist/cdn/{shared-d199f862.js → shared-2b7e9979.js} +2 -2
- package/dist/cdn/{shared-a2693527.js → shared-2fe8f409.js} +1 -1
- package/dist/cdn/{shared-6960ab99.js → shared-377dea9e.js} +1 -1
- package/dist/cdn/{shared-f3209496.js → shared-37d9634f.js} +1 -1
- package/dist/cdn/{shared-fcf6424c.js → shared-3c54cb67.js} +1 -1
- package/dist/cdn/{shared-3a446f14.js → shared-3ca920e6.js} +1 -1
- package/dist/cdn/{shared-f61e5463.js → shared-3e7f5663.js} +2 -2
- package/dist/cdn/{shared-25a19cbe.js → shared-3f0b1660.js} +1 -1
- package/dist/cdn/{shared-85323ced.js → shared-4854f37a.js} +1 -1
- package/dist/cdn/shared-4a38cb3e.js +1 -0
- package/dist/cdn/{shared-aa211938.js → shared-52943926.js} +1 -1
- package/dist/cdn/{shared-7e9fdf64.js → shared-5592ec6e.js} +1 -1
- package/dist/cdn/{shared-d4d11fb8.js → shared-559ce27e.js} +1 -1
- package/dist/cdn/{shared-3a3dc0d9.js → shared-562d6c10.js} +1 -1
- package/dist/cdn/shared-5a19b58c.js +1 -0
- package/dist/cdn/{shared-eeb2bd18.js → shared-5afb584d.js} +1 -1
- package/dist/cdn/{shared-9f07fab6.js → shared-5b1511bc.js} +1 -1
- package/dist/cdn/{shared-d8cab6ab.js → shared-5bed5454.js} +1 -1
- package/dist/cdn/{shared-f2c4875b.js → shared-5c747b54.js} +1 -1
- package/dist/cdn/shared-5e4a03d1.js +1 -0
- package/dist/cdn/{shared-fcdb896f.js → shared-5ef40e86.js} +1 -1
- package/dist/cdn/{shared-dc6eb904.js → shared-65b74c44.js} +1 -1
- package/dist/cdn/{shared-c2efc54e.js → shared-673d668a.js} +1 -1
- package/dist/cdn/{shared-322ae633.js → shared-69b4b6a7.js} +1 -1
- package/dist/cdn/{shared-674ba44d.js → shared-7303e512.js} +1 -1
- package/dist/cdn/{shared-aab278b5.js → shared-730dd58a.js} +1 -1
- package/dist/cdn/{shared-7d797451.js → shared-73c3155d.js} +1 -1
- package/dist/cdn/{shared-d54b3216.js → shared-740e3ab9.js} +1 -1
- package/dist/cdn/{shared-dea71762.js → shared-746ecb15.js} +1 -1
- package/dist/cdn/{shared-019348d7.js → shared-7594e563.js} +1 -1
- package/dist/cdn/{shared-7c863df2.js → shared-75cf59dc.js} +1 -1
- package/dist/cdn/{shared-e6cd721f.js → shared-75feef80.js} +1 -1
- package/dist/cdn/{shared-aa45d4ec.js → shared-7bbb91c2.js} +1 -1
- package/dist/cdn/{shared-4bcfe691.js → shared-7cac2ea3.js} +1 -1
- package/dist/cdn/{shared-8e36bcc1.js → shared-8154088a.js} +1 -1
- package/dist/cdn/{shared-efecf1ca.js → shared-8219cdf0.js} +1 -1
- package/dist/cdn/shared-918c8b20.js +1 -0
- package/dist/cdn/{shared-5a08dbb0.js → shared-94756d7c.js} +1 -1
- package/dist/cdn/{shared-ccc91a5f.js → shared-96998138.js} +1 -1
- package/dist/cdn/{shared-9ca85d1e.js → shared-99a8889a.js} +1 -1
- package/dist/cdn/{shared-34119bbf.js → shared-9acbf607.js} +1 -1
- package/dist/cdn/{shared-f6e9eda6.js → shared-a6776a1d.js} +1 -1
- package/dist/cdn/{shared-2db8d17c.js → shared-ad179ade.js} +1 -1
- package/dist/cdn/{shared-2550f6d9.js → shared-ad888fc4.js} +1 -1
- package/dist/cdn/{shared-c27ee44e.js → shared-b0c5a062.js} +1 -1
- package/dist/cdn/{shared-49e0541d.js → shared-b24b86a3.js} +4 -4
- package/dist/cdn/{shared-299543b6.js → shared-b7775f62.js} +1 -1
- package/dist/cdn/{shared-57c3f0e4.js → shared-ba38add2.js} +1 -1
- package/dist/cdn/{shared-498ce88a.js → shared-bd2ebe88.js} +1 -1
- package/dist/cdn/{shared-1137b243.js → shared-c023350f.js} +1 -1
- package/dist/cdn/{shared-166204e5.js → shared-c44770f9.js} +1 -1
- package/dist/cdn/{shared-d1195c27.js → shared-cb58dfcd.js} +1 -1
- package/dist/cdn/{shared-13d65f57.js → shared-cbe634e6.js} +1 -1
- package/dist/cdn/{shared-6ef0392a.js → shared-cc8237eb.js} +1 -1
- package/dist/cdn/{shared-3691a26f.js → shared-ce12007b.js} +1 -1
- package/dist/cdn/{shared-893ead61.js → shared-cfb804b4.js} +1 -1
- package/dist/cdn/{shared-a2a27012.js → shared-cfce3012.js} +1 -1
- package/dist/cdn/{shared-604261a0.js → shared-d2bc4d51.js} +1 -1
- package/dist/cdn/{shared-569db166.js → shared-d40308b2.js} +1 -1
- package/dist/cdn/{shared-6555fd71.js → shared-d66a4bdb.js} +1 -1
- package/dist/cdn/{shared-bd941702.js → shared-deb5cb67.js} +1 -1
- package/dist/cdn/{shared-cba2b787.js → shared-e08f4e45.js} +1 -1
- package/dist/cdn/{shared-e1a6c036.js → shared-e5e98873.js} +1 -1
- package/dist/cdn/{shared-1da49e3d.js → shared-e9682623.js} +1 -1
- package/dist/cdn/{shared-641786b2.js → shared-eb963ba3.js} +1 -1
- package/dist/cdn/{shared-56ba2d28.js → shared-ef4ad461.js} +1 -1
- package/dist/cdn/{shared-59e22bc6.js → shared-f69bc3a6.js} +1 -1
- package/dist/cdn/{shared-71f3226f.js → shared-f6c479b8.js} +1 -1
- package/dist/cdn/shared-f83207fb.js +1 -0
- package/dist/cdn/{shared-58e7f6b1.js → shared-fb0c426a.js} +1 -1
- package/dist/cdn/translations/admin-subscription-form/en.json +14 -4
- package/dist/cdn/translations/coupon-code-form/en.json +2 -0
- package/dist/cdn/translations/coupon-form/en.json +2 -0
- package/dist/cdn/translations/customer/en.json +2 -0
- package/dist/cdn/translations/customer-portal/de.json +2 -0
- package/dist/cdn/translations/customer-portal/en.json +2 -0
- package/dist/cdn/translations/customer-portal/es.json +2 -0
- package/dist/cdn/translations/customer-portal/fr.json +2 -0
- package/dist/cdn/translations/customer-portal/nl.json +2 -0
- package/dist/cdn/translations/customer-portal/pl.json +2 -0
- package/dist/cdn/translations/customer-portal/sv.json +2 -0
- package/dist/cdn/translations/customer-portal/zh-hk.json +2 -0
- package/dist/cdn/translations/subscription-form/en.json +2 -0
- package/dist/cdn/translations/transaction/en.json +8 -0
- package/dist/cdn/translations/transaction-card/en.json +3 -1
- package/dist/elements/internal/InternalForm/InternalForm.d.ts +4 -0
- package/dist/elements/internal/InternalForm/InternalForm.js +22 -7
- package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.d.ts +1 -1
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +19 -13
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.js +19 -40
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.d.ts +0 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.js +0 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js +2 -2
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.d.ts +3 -0
- package/dist/elements/public/Transaction/Transaction.js +9 -0
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +16 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.d.ts +2 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js +2 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +14 -10
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
- package/dist/elements/public/TransactionCard/TransactionCard.js +25 -4
- package/dist/elements/public/TransactionCard/TransactionCard.js.map +1 -1
- package/dist/mixins/themeable.js +8 -12
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-1aff7995.js +0 -1
- package/dist/cdn/shared-882a0fda.js +0 -1
- package/dist/cdn/shared-9cf15285.js +0 -1
- package/dist/cdn/shared-a1f85307.js +0 -1
- package/dist/cdn/shared-d1dfac4d.js +0 -1
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"helper_text": "Loads the subscription into the cart. This is useful for changing the products that make up the subscription by loading the subscription and then proceeding to your website.",
|
|
99
99
|
"copy-to-clipboard": {
|
|
100
100
|
"failed_to_copy": "Failed to copy",
|
|
101
|
-
"click_to_copy": "Copy
|
|
101
|
+
"click_to_copy": "Copy URL",
|
|
102
102
|
"copying": "Copying...",
|
|
103
103
|
"done": "Copied to clipboard"
|
|
104
104
|
}
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"helper_text": "Loads the subscription into the cart and redirects to checkout. This link is useful for paying past due amounts, modifying address/payment information or transferring to another email address.",
|
|
109
109
|
"copy-to-clipboard": {
|
|
110
110
|
"failed_to_copy": "Failed to copy",
|
|
111
|
-
"click_to_copy": "Copy
|
|
111
|
+
"click_to_copy": "Copy URL",
|
|
112
112
|
"copying": "Copying...",
|
|
113
113
|
"done": "Copied to clipboard"
|
|
114
114
|
}
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"helper_text": "Sets the subscription to cancel at the end of the current paid period based on the next transaction date.",
|
|
119
119
|
"copy-to-clipboard": {
|
|
120
120
|
"failed_to_copy": "Failed to copy",
|
|
121
|
-
"click_to_copy": "Copy
|
|
121
|
+
"click_to_copy": "Copy URL",
|
|
122
122
|
"copying": "Copying...",
|
|
123
123
|
"done": "Copied to clipboard"
|
|
124
124
|
}
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"helper_text": "Sets the subscription to cancel the following day.",
|
|
129
129
|
"copy-to-clipboard": {
|
|
130
130
|
"failed_to_copy": "Failed to copy",
|
|
131
|
-
"click_to_copy": "Copy
|
|
131
|
+
"click_to_copy": "Copy URL",
|
|
132
132
|
"copying": "Copying...",
|
|
133
133
|
"done": "Copied to clipboard"
|
|
134
134
|
}
|
|
@@ -252,6 +252,8 @@
|
|
|
252
252
|
"description": "Description",
|
|
253
253
|
"price": "{{amount, price}}",
|
|
254
254
|
"time": "{{value, date}}",
|
|
255
|
+
"test": "Test",
|
|
256
|
+
"hidden_hint": "This transaction is archived",
|
|
255
257
|
"status_capturing": "Capturing",
|
|
256
258
|
"status_captured": "Captured",
|
|
257
259
|
"status_approved": "Approved",
|
|
@@ -310,6 +312,10 @@
|
|
|
310
312
|
"alert_status_pending_fraud_review": "The payment gateway flagged this transaction as potentially fraudulent. Please log in to your gateway’s dashboard and look for this transaction to review.",
|
|
311
313
|
"alert_status_rejected": "The payment gateway refused to process this transaction based on its internal policy. You may be able to get more information about this error by logging in to your gateway’s dashboard and looking for this transaction.",
|
|
312
314
|
"alert_status_declined": "The payment method used for this transaction was declined. This could be due to insufficient funds, an expired card, or a different reason. You may be able to get more information about this error in your gateway’s dashboard.",
|
|
315
|
+
"badges": {
|
|
316
|
+
"test": "Test",
|
|
317
|
+
"archived": "Archived"
|
|
318
|
+
},
|
|
313
319
|
"copy-id": {
|
|
314
320
|
"failed_to_copy": "Failed to copy",
|
|
315
321
|
"click_to_copy": "Copy ID",
|
|
@@ -1998,6 +2004,10 @@
|
|
|
1998
2004
|
},
|
|
1999
2005
|
"receipt": {
|
|
2000
2006
|
"caption": "View receipt"
|
|
2007
|
+
},
|
|
2008
|
+
"archive": {
|
|
2009
|
+
"caption_archive": "Archive",
|
|
2010
|
+
"caption_unarchive": "Unarchive"
|
|
2001
2011
|
}
|
|
2002
2012
|
},
|
|
2003
2013
|
"spinner": {
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"description": "Description",
|
|
43
43
|
"price": "{{amount, price}}",
|
|
44
44
|
"time": "{{value, date}}",
|
|
45
|
+
"test": "Test",
|
|
46
|
+
"hidden_hint": "This transaction is archived",
|
|
45
47
|
"status_capturing": "Capturing",
|
|
46
48
|
"status_captured": "Captured",
|
|
47
49
|
"status_approved": "Approved",
|
|
@@ -233,6 +233,8 @@
|
|
|
233
233
|
"description": "Description",
|
|
234
234
|
"price": "{{amount, price}}",
|
|
235
235
|
"time": "{{value, date}}",
|
|
236
|
+
"test": "Test",
|
|
237
|
+
"hidden_hint": "This transaction is archived",
|
|
236
238
|
"status_capturing": "Capturing",
|
|
237
239
|
"status_captured": "Captured",
|
|
238
240
|
"status_approved": "Approved",
|
|
@@ -1243,6 +1243,8 @@
|
|
|
1243
1243
|
"description": "Description",
|
|
1244
1244
|
"price": "{{amount, price}}",
|
|
1245
1245
|
"time": "{{value, date}}",
|
|
1246
|
+
"test": "Test",
|
|
1247
|
+
"hidden_hint": "This transaction is archived",
|
|
1246
1248
|
"status_capturing": "Capturing",
|
|
1247
1249
|
"status_captured": "Captured",
|
|
1248
1250
|
"status_approved": "Approved",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Beschreibung",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "Diese Transaktion ist archiviert",
|
|
1050
1052
|
"status_capturing": "Erfassen",
|
|
1051
1053
|
"status_captured": "Gefangen",
|
|
1052
1054
|
"status_approved": "Genehmigt",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Description",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "This transaction is archived",
|
|
1050
1052
|
"status_capturing": "Capturing",
|
|
1051
1053
|
"status_captured": "Captured",
|
|
1052
1054
|
"status_approved": "Approved",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Descripción",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "Esta transacción está archivada",
|
|
1050
1052
|
"status_capturing": "Capturando",
|
|
1051
1053
|
"status_captured": "capturado",
|
|
1052
1054
|
"status_approved": "Aprobado",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Description",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "Cette transaction est archivée",
|
|
1050
1052
|
"status_capturing": "Capturer",
|
|
1051
1053
|
"status_captured": "Capturé",
|
|
1052
1054
|
"status_approved": "Approuvé",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Beschrijving",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "Deze transactie is gearchiveerd",
|
|
1050
1052
|
"status_capturing": "Vastleggen",
|
|
1051
1053
|
"status_captured": "Gevangen genomen",
|
|
1052
1054
|
"status_approved": "Goedgekeurd",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Opis",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "Ta transakcja jest zarchiwizowana",
|
|
1050
1052
|
"status_capturing": "Przechwytywanie",
|
|
1051
1053
|
"status_captured": "Złapany",
|
|
1052
1054
|
"status_approved": "Zatwierdzony",
|
|
@@ -1047,6 +1047,8 @@
|
|
|
1047
1047
|
"description": "Beskrivning",
|
|
1048
1048
|
"price": "{{amount, price}}",
|
|
1049
1049
|
"time": "{{value, date}}",
|
|
1050
|
+
"test": "Test",
|
|
1051
|
+
"hidden_hint": "Denna transaktion är arkiverad",
|
|
1050
1052
|
"status_capturing": "Fångande",
|
|
1051
1053
|
"status_captured": "Fångad",
|
|
1052
1054
|
"status_approved": "Godkänd",
|
|
@@ -167,6 +167,8 @@
|
|
|
167
167
|
"description": "Description",
|
|
168
168
|
"price": "{{amount, price}}",
|
|
169
169
|
"time": "{{value, date}}",
|
|
170
|
+
"test": "Test",
|
|
171
|
+
"hidden_hint": "This transaction is archived",
|
|
170
172
|
"status_capturing": "Capturing",
|
|
171
173
|
"status_captured": "Captured",
|
|
172
174
|
"status_approved": "Approved",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"alert_status_pending_fraud_review": "The payment gateway flagged this transaction as potentially fraudulent. Please log in to your gateway’s dashboard and look for this transaction to review.",
|
|
26
26
|
"alert_status_rejected": "The payment gateway refused to process this transaction based on its internal policy. You may be able to get more information about this error by logging in to your gateway’s dashboard and looking for this transaction.",
|
|
27
27
|
"alert_status_declined": "The payment method used for this transaction was declined. This could be due to insufficient funds, an expired card, or a different reason. You may be able to get more information about this error in your gateway’s dashboard.",
|
|
28
|
+
"badges": {
|
|
29
|
+
"test": "Test",
|
|
30
|
+
"archived": "Archived"
|
|
31
|
+
},
|
|
28
32
|
"copy-id": {
|
|
29
33
|
"failed_to_copy": "Failed to copy",
|
|
30
34
|
"click_to_copy": "Copy ID",
|
|
@@ -1713,6 +1717,10 @@
|
|
|
1713
1717
|
},
|
|
1714
1718
|
"receipt": {
|
|
1715
1719
|
"caption": "View receipt"
|
|
1720
|
+
},
|
|
1721
|
+
"archive": {
|
|
1722
|
+
"caption_archive": "Archive",
|
|
1723
|
+
"caption_unarchive": "Unarchive"
|
|
1716
1724
|
}
|
|
1717
1725
|
},
|
|
1718
1726
|
"spinner": {
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
"description": "Description",
|
|
5
5
|
"price": "{{amount, price}}",
|
|
6
6
|
"time": "{{value, date}} at {{value, time}}",
|
|
7
|
+
"test": "Test",
|
|
8
|
+
"hidden_hint": "This transaction is archived",
|
|
7
9
|
"status_capturing": "Capturing",
|
|
8
10
|
"status_captured": "Captured",
|
|
9
11
|
"status_approved": "Approved",
|
|
@@ -30,4 +32,4 @@
|
|
|
30
32
|
"loading_empty": "No data",
|
|
31
33
|
"loading_error": "Unknown error"
|
|
32
34
|
}
|
|
33
|
-
}
|
|
35
|
+
}
|
|
@@ -33,6 +33,10 @@ export declare class InternalForm<TData extends HALJSONResource> extends Base<TD
|
|
|
33
33
|
get headerSubtitleKey(): string;
|
|
34
34
|
/** I18next options to pass to the header subtitle translation function. Note that subtitle is shown only when data is avaiable. */
|
|
35
35
|
get headerSubtitleOptions(): Record<string, unknown>;
|
|
36
|
+
/** Getter that returns a list of the optional badges to put into the subtitle. The badges are shown only if subtitle is visible. */
|
|
37
|
+
get headerSubtitleBadges(): {
|
|
38
|
+
key: string;
|
|
39
|
+
}[];
|
|
36
40
|
/** ID that will be written to clipboard when Copy ID button in header is clicked. */
|
|
37
41
|
get headerCopyIdValue(): string | number;
|
|
38
42
|
get hiddenSelector(): BooleanSelector;
|
|
@@ -53,6 +53,10 @@ export class InternalForm extends Base {
|
|
|
53
53
|
var _a;
|
|
54
54
|
return (_a = this.data) !== null && _a !== void 0 ? _a : {};
|
|
55
55
|
}
|
|
56
|
+
/** Getter that returns a list of the optional badges to put into the subtitle. The badges are shown only if subtitle is visible. */
|
|
57
|
+
get headerSubtitleBadges() {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
56
60
|
/** ID that will be written to clipboard when Copy ID button in header is clicked. */
|
|
57
61
|
get headerCopyIdValue() {
|
|
58
62
|
var _a;
|
|
@@ -119,13 +123,24 @@ export class InternalForm extends Base {
|
|
|
119
123
|
</span>
|
|
120
124
|
${data
|
|
121
125
|
? html `
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
<div class="flex items-center gap-s text-secondary leading-s">
|
|
127
|
+
${this.headerSubtitleBadges.map(badge => {
|
|
128
|
+
return html `
|
|
129
|
+
<foxy-i18n
|
|
130
|
+
class="border border-contrast-60 font-medium uppercase tracking-wider block rounded-s px-xs text-xs"
|
|
131
|
+
infer="header badges"
|
|
132
|
+
key=${badge.key}
|
|
133
|
+
>
|
|
134
|
+
</foxy-i18n>
|
|
135
|
+
`;
|
|
136
|
+
})}
|
|
137
|
+
<foxy-i18n
|
|
138
|
+
infer="header"
|
|
139
|
+
key=${this.headerSubtitleKey}
|
|
140
|
+
.options=${this.headerSubtitleOptions}
|
|
141
|
+
>
|
|
142
|
+
</foxy-i18n>
|
|
143
|
+
</div>
|
|
129
144
|
${actions ? html `<div class="mt-xs flex gap-m">${actions}</div>` : ''}
|
|
130
145
|
`
|
|
131
146
|
: ''}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalForm.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/InternalForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,cAAc,EAAE,sDAAmD;AAC5E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,OAAO,YAA4C,SAAQ,IAAW;IAA5E;;QAWE,yFAAyF;QACzF,WAAM,GAAkB,IAAI,CAAC;IA8N/B,CAAC;IAtOC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACzB,CAAC;IACJ,CAAC;IAKD;;;OAGG;IACH,6DAA6D;IAC7D,mBAAmB,CAAC,IAAW;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yEAAyE;IACzE,IAAI,cAAc;QAChB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,wEAAwE;IACxE,I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,OAAO,CAAC,CAAC,CAAC,MAAM;;;;YAI1C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;YAC5B,CAAC,CAAC,IAAI,CAAA;+DAC6C,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;;;eAGpE;YACH,CAAC,CAAC,EAAE;;;KAGX,CAAC;IACJ,CAAC;IAED,IAAY,eAAe;QACzB,MAAM,MAAM,GAAI,IAAI,CAAC,WAAmC,CAAC,kBAAkB,CAAC;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAEO,oBAAoB,CAAC,GAAW;QACtC,OAAO,IAAI,CAAA;;;;;cAKD,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;;;KAGlC,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,EAAE,GAAG,EAAE,OAAO,EAAU;QAC7C,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;YAAE,OAAO;QACxD,OAAO,IAAI,CAAA;;;;;;uDAMwC,GAAG,aAAa,OAAO;;;;mBAI3D,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;KAKxC,CAAC;IACJ,CAAC;;AAxOD,8EAA8E;AACvE,+BAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { HALJSONResource } from '../../public/NucleonElement/types';\nimport type { TemplateResult } from 'lit-html';\nimport type { Status } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { NucleonElement } from '../../public/NucleonElement/NucleonElement';\nimport { classMap } from '../../../utils/class-map';\nimport { html } from 'lit-html';\n\nconst Base = ConfigurableMixin(ThemeableMixin(NucleonElement));\n\n/**\n * An internal base class for any nucleon-powered form. Renders create/delete\n * buttons and timestamps by default, displays a spinner in non-idle states.\n *\n * @element foxy-internal-form\n * @since 1.17.0\n */\nexport class InternalForm<TData extends HALJSONResource> extends Base<TData> {\n /** Validation errors with this prefix will show up at the top of the form. */\n static generalErrorPrefix = 'error:';\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n status: { type: Object },\n };\n }\n\n /** Status message to render at the top of the form. If `null`, the message is hidden. */\n status: null | Status = null;\n\n /**\n * Renders header actions when the optional header is rendered.\n * Empty by default.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n renderHeaderActions(data: TData): TemplateResult | null {\n return null;\n }\n\n /** Getter that returns a i18n key for the optional form header title. */\n get headerTitleKey(): string {\n return 'title';\n }\n\n /** I18next options to pass to the header title translation function. */\n get headerTitleOptions(): Record<string, unknown> {\n return {\n ...this.data,\n context: this.data ? 'existing' : 'new',\n id: this.data ? getResourceId(this.data._links.self.href) : null,\n };\n }\n\n /** Getter that returns a i18n key for the optional form header subtitle. Note that subtitle is shown only when data is avaiable. */\n get headerSubtitleKey(): string {\n return 'subtitle';\n }\n\n /** I18next options to pass to the header subtitle translation function. Note that subtitle is shown only when data is avaiable. */\n get headerSubtitleOptions(): Record<string, unknown> {\n return this.data ?? {};\n }\n\n /** ID that will be written to clipboard when Copy ID button in header is clicked. */\n get headerCopyIdValue(): string | number {\n return this.data ? getResourceId(this.data._links.self.href) ?? '' : '';\n }\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = [super.hiddenSelector.toString()];\n if (this.href) alwaysMatch.unshift('create');\n if (!this.href) alwaysMatch.unshift('delete', 'timestamps', 'submit');\n if (!this.in({ idle: { snapshot: 'dirty' } })) alwaysMatch.unshift('undo', 'submit');\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n /**\n * Renders optional form header.\n * - Customize which actions are rendered with `.renderHeaderActions()` method.\n * - Customize the header title and subtitle with `.headerTitleKey` and `.headerSubtitleKey` getters.\n * - Customize the header title and subtitle options with `.headerTitleOptions` and `.headerSubtitleOptions` getters.\n * - To hide the header completely, add `header` to `hidden-controls` attribute.\n */\n renderHeader(): TemplateResult {\n if (this.hiddenSelector.matches('header', true)) return html``;\n\n const data = this.data;\n const actions = data ? this.renderHeaderActions(data) : null;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('header:before')}\n <h2>\n <span class=\"flex items-center gap-s leading-xs text-xl font-medium break-all\">\n <foxy-i18n\n options=${JSON.stringify(this.headerTitleOptions)}\n infer=\"header\"\n key=${this.headerTitleKey}\n >\n </foxy-i18n>\n ${data\n ? html`\n ${this.hiddenSelector.matches('header:copy-id', true)\n ? ''\n : html`\n <foxy-copy-to-clipboard\n infer=\"header copy-id\"\n class=\"text-m\"\n text=${this.headerCopyIdValue}\n >\n </foxy-copy-to-clipboard>\n `}\n ${this.hiddenSelector.matches('header:copy-json', true)\n ? ''\n : html`\n <foxy-copy-to-clipboard\n infer=\"header copy-json\"\n class=\"text-m\"\n icon=\"icons:code\"\n text=${JSON.stringify(data, null, 2)}\n >\n </foxy-copy-to-clipboard>\n `}\n `\n : ''}\n </span>\n ${data\n ? html`\n <foxy-i18n\n infer=\"header\"\n class=\"text-m text-secondary\"\n key=${this.headerSubtitleKey}\n .options=${this.headerSubtitleOptions}\n >\n </foxy-i18n>\n ${actions ? html`<div class=\"mt-xs flex gap-m\">${actions}</div>` : ''}\n `\n : ''}\n </h2>\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n }\n\n /**\n * Renders form body. This is the method you should implement in your forms\n * instead of `.render()`. If you'd like to keep the submit button and the timestamps,\n * don't forget to add `super.renderBody()` to your template.\n */\n renderBody(): TemplateResult {\n const nested = ['delete', 'undo', 'submit', 'create'];\n\n return html`\n <foxy-internal-timestamps-control infer=\"timestamps\"></foxy-internal-timestamps-control>\n\n <div class=\"flex gap-m\" ?hidden=${nested.every(v => this.hiddenSelector.matches(v, true))}>\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n\n <div class=\"w-full\"></div>\n\n <foxy-internal-undo-control infer=\"undo\"> </foxy-internal-undo-control>\n <foxy-internal-submit-control infer=\"submit\"> </foxy-internal-submit-control>\n <foxy-internal-submit-control infer=\"create\" theme=\"primary success\">\n </foxy-internal-submit-control>\n </div>\n `;\n }\n\n /**\n * Renders the entire form. You should probably implement `.renderBody()`\n * instead of this method in your form to keep the spinner and the common layout features.\n */\n render(): TemplateResult {\n const isSpinnerVisible = !this.in('idle') && (!this.in({ busy: 'fetching' }) || !this.data);\n\n return html`\n <div aria-busy=${this.in('busy')} aria-live=\"polite\" class=\"relative\">\n <div\n class=${classMap({\n 'space-y-m': true,\n 'transition-all filter': true,\n 'opacity-30 blur-sm pointer-events-none': isSpinnerVisible,\n })}\n >\n ${this.__generalErrors.map(err => this.__renderGeneralError(err))}\n ${this.status ? this.__renderStatus(this.status) : ''} ${this.renderBody()}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'flex flex-col items-center justify-center gap-m': true,\n 'transition-opacity absolute inset-0': true,\n 'opacity-0 pointer-events-none': !isSpinnerVisible,\n })}\n >\n <foxy-spinner\n layout=${this.in('fail') ? 'vertical' : 'no-label'}\n state=${this.in('fail') ? 'error' : 'busy'}\n infer=\"spinner\"\n >\n </foxy-spinner>\n ${this.href && this.in('fail')\n ? html`\n <vaadin-button theme=\"small contrast\" @click=${() => this.refresh()}>\n <foxy-i18n infer=\"spinner\" key=\"refresh\"></foxy-i18n>\n </vaadin-button>\n `\n : ''}\n </div>\n </div>\n `;\n }\n\n private get __generalErrors() {\n const prefix = (this.constructor as typeof InternalForm).generalErrorPrefix;\n return this.errors.filter(v => v.startsWith(prefix));\n }\n\n private __renderGeneralError(err: string) {\n return html`\n <foxy-i18n\n class=\"leading-xs text-body rounded bg-error-10 block\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n infer=\"error\"\n key=${err.replace('error:', '')}\n >\n </foxy-i18n>\n `;\n }\n\n private __renderStatus({ key, options }: Status) {\n if (this.hiddenSelector.matches('status', true)) return;\n return html`\n <p\n data-testid=\"status\"\n class=\"leading-xs text-body rounded bg-success-10 flex items-start gap-m\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <foxy-i18n class=\"flex-1\" infer=\"status\" key=${key} .options=${options}></foxy-i18n>\n <vaadin-button\n class=\"flex-shrink-0\"\n theme=\"success tertiary-inline\"\n @click=${() => (this.status = null)}\n >\n <foxy-i18n class=\"flex-1\" infer=\"status\" key=\"close\"></foxy-i18n>\n </vaadin-button>\n </p>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalForm.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalForm/InternalForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,cAAc,EAAE,sDAAmD;AAC5E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,OAAO,YAA4C,SAAQ,IAAW;IAA5E;;QAWE,yFAAyF;QACzF,WAAM,GAAkB,IAAI,CAAC;IA8O/B,CAAC;IAtPC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACzB,CAAC;IACJ,CAAC;IAKD;;;OAGG;IACH,6DAA6D;IAC7D,mBAAmB,CAAC,IAAW;QAC7B,OAA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,8EAA8E;AACvE,+BAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { HALJSONResource } from '../../public/NucleonElement/types';\nimport type { TemplateResult } from 'lit-html';\nimport type { Status } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { NucleonElement } from '../../public/NucleonElement/NucleonElement';\nimport { classMap } from '../../../utils/class-map';\nimport { html } from 'lit-html';\n\nconst Base = ConfigurableMixin(ThemeableMixin(NucleonElement));\n\n/**\n * An internal base class for any nucleon-powered form. Renders create/delete\n * buttons and timestamps by default, displays a spinner in non-idle states.\n *\n * @element foxy-internal-form\n * @since 1.17.0\n */\nexport class InternalForm<TData extends HALJSONResource> extends Base<TData> {\n /** Validation errors with this prefix will show up at the top of the form. */\n static generalErrorPrefix = 'error:';\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n status: { type: Object },\n };\n }\n\n /** Status message to render at the top of the form. If `null`, the message is hidden. */\n status: null | Status = null;\n\n /**\n * Renders header actions when the optional header is rendered.\n * Empty by default.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n renderHeaderActions(data: TData): TemplateResult | null {\n return null;\n }\n\n /** Getter that returns a i18n key for the optional form header title. */\n get headerTitleKey(): string {\n return 'title';\n }\n\n /** I18next options to pass to the header title translation function. */\n get headerTitleOptions(): Record<string, unknown> {\n return {\n ...this.data,\n context: this.data ? 'existing' : 'new',\n id: this.data ? getResourceId(this.data._links.self.href) : null,\n };\n }\n\n /** Getter that returns a i18n key for the optional form header subtitle. Note that subtitle is shown only when data is avaiable. */\n get headerSubtitleKey(): string {\n return 'subtitle';\n }\n\n /** I18next options to pass to the header subtitle translation function. Note that subtitle is shown only when data is avaiable. */\n get headerSubtitleOptions(): Record<string, unknown> {\n return this.data ?? {};\n }\n\n /** Getter that returns a list of the optional badges to put into the subtitle. The badges are shown only if subtitle is visible. */\n get headerSubtitleBadges(): { key: string }[] {\n return [];\n }\n\n /** ID that will be written to clipboard when Copy ID button in header is clicked. */\n get headerCopyIdValue(): string | number {\n return this.data ? getResourceId(this.data._links.self.href) ?? '' : '';\n }\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = [super.hiddenSelector.toString()];\n if (this.href) alwaysMatch.unshift('create');\n if (!this.href) alwaysMatch.unshift('delete', 'timestamps', 'submit');\n if (!this.in({ idle: { snapshot: 'dirty' } })) alwaysMatch.unshift('undo', 'submit');\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n /**\n * Renders optional form header.\n * - Customize which actions are rendered with `.renderHeaderActions()` method.\n * - Customize the header title and subtitle with `.headerTitleKey` and `.headerSubtitleKey` getters.\n * - Customize the header title and subtitle options with `.headerTitleOptions` and `.headerSubtitleOptions` getters.\n * - To hide the header completely, add `header` to `hidden-controls` attribute.\n */\n renderHeader(): TemplateResult {\n if (this.hiddenSelector.matches('header', true)) return html``;\n\n const data = this.data;\n const actions = data ? this.renderHeaderActions(data) : null;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('header:before')}\n <h2>\n <span class=\"flex items-center gap-s leading-xs text-xl font-medium break-all\">\n <foxy-i18n\n options=${JSON.stringify(this.headerTitleOptions)}\n infer=\"header\"\n key=${this.headerTitleKey}\n >\n </foxy-i18n>\n ${data\n ? html`\n ${this.hiddenSelector.matches('header:copy-id', true)\n ? ''\n : html`\n <foxy-copy-to-clipboard\n infer=\"header copy-id\"\n class=\"text-m\"\n text=${this.headerCopyIdValue}\n >\n </foxy-copy-to-clipboard>\n `}\n ${this.hiddenSelector.matches('header:copy-json', true)\n ? ''\n : html`\n <foxy-copy-to-clipboard\n infer=\"header copy-json\"\n class=\"text-m\"\n icon=\"icons:code\"\n text=${JSON.stringify(data, null, 2)}\n >\n </foxy-copy-to-clipboard>\n `}\n `\n : ''}\n </span>\n ${data\n ? html`\n <div class=\"flex items-center gap-s text-secondary leading-s\">\n ${this.headerSubtitleBadges.map(badge => {\n return html`\n <foxy-i18n\n class=\"border border-contrast-60 font-medium uppercase tracking-wider block rounded-s px-xs text-xs\"\n infer=\"header badges\"\n key=${badge.key}\n >\n </foxy-i18n>\n `;\n })}\n <foxy-i18n\n infer=\"header\"\n key=${this.headerSubtitleKey}\n .options=${this.headerSubtitleOptions}\n >\n </foxy-i18n>\n </div>\n ${actions ? html`<div class=\"mt-xs flex gap-m\">${actions}</div>` : ''}\n `\n : ''}\n </h2>\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n }\n\n /**\n * Renders form body. This is the method you should implement in your forms\n * instead of `.render()`. If you'd like to keep the submit button and the timestamps,\n * don't forget to add `super.renderBody()` to your template.\n */\n renderBody(): TemplateResult {\n const nested = ['delete', 'undo', 'submit', 'create'];\n\n return html`\n <foxy-internal-timestamps-control infer=\"timestamps\"></foxy-internal-timestamps-control>\n\n <div class=\"flex gap-m\" ?hidden=${nested.every(v => this.hiddenSelector.matches(v, true))}>\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n\n <div class=\"w-full\"></div>\n\n <foxy-internal-undo-control infer=\"undo\"> </foxy-internal-undo-control>\n <foxy-internal-submit-control infer=\"submit\"> </foxy-internal-submit-control>\n <foxy-internal-submit-control infer=\"create\" theme=\"primary success\">\n </foxy-internal-submit-control>\n </div>\n `;\n }\n\n /**\n * Renders the entire form. You should probably implement `.renderBody()`\n * instead of this method in your form to keep the spinner and the common layout features.\n */\n render(): TemplateResult {\n const isSpinnerVisible = !this.in('idle') && (!this.in({ busy: 'fetching' }) || !this.data);\n\n return html`\n <div aria-busy=${this.in('busy')} aria-live=\"polite\" class=\"relative\">\n <div\n class=${classMap({\n 'space-y-m': true,\n 'transition-all filter': true,\n 'opacity-30 blur-sm pointer-events-none': isSpinnerVisible,\n })}\n >\n ${this.__generalErrors.map(err => this.__renderGeneralError(err))}\n ${this.status ? this.__renderStatus(this.status) : ''} ${this.renderBody()}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'flex flex-col items-center justify-center gap-m': true,\n 'transition-opacity absolute inset-0': true,\n 'opacity-0 pointer-events-none': !isSpinnerVisible,\n })}\n >\n <foxy-spinner\n layout=${this.in('fail') ? 'vertical' : 'no-label'}\n state=${this.in('fail') ? 'error' : 'busy'}\n infer=\"spinner\"\n >\n </foxy-spinner>\n ${this.href && this.in('fail')\n ? html`\n <vaadin-button theme=\"small contrast\" @click=${() => this.refresh()}>\n <foxy-i18n infer=\"spinner\" key=\"refresh\"></foxy-i18n>\n </vaadin-button>\n `\n : ''}\n </div>\n </div>\n `;\n }\n\n private get __generalErrors() {\n const prefix = (this.constructor as typeof InternalForm).generalErrorPrefix;\n return this.errors.filter(v => v.startsWith(prefix));\n }\n\n private __renderGeneralError(err: string) {\n return html`\n <foxy-i18n\n class=\"leading-xs text-body rounded bg-error-10 block\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n infer=\"error\"\n key=${err.replace('error:', '')}\n >\n </foxy-i18n>\n `;\n }\n\n private __renderStatus({ key, options }: Status) {\n if (this.hiddenSelector.matches('status', true)) return;\n return html`\n <p\n data-testid=\"status\"\n class=\"leading-xs text-body rounded bg-success-10 flex items-start gap-m\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <foxy-i18n class=\"flex-1\" infer=\"status\" key=${key} .options=${options}></foxy-i18n>\n <vaadin-button\n class=\"flex-shrink-0\"\n theme=\"success tertiary-inline\"\n @click=${() => (this.status = null)}\n >\n <foxy-i18n class=\"flex-1\" infer=\"status\" key=\"close\"></foxy-i18n>\n </vaadin-button>\n </p>\n `;\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { PropertyDeclarations } from 'lit-element';
|
|
1
2
|
import type { TemplateResult } from 'lit-html';
|
|
2
3
|
import type { Data } from './types';
|
|
3
4
|
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
4
5
|
import { InternalForm } from '../../internal/InternalForm/InternalForm';
|
|
5
|
-
import { PropertyDeclarations } from 'lit-element';
|
|
6
6
|
declare const Base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
|
|
7
7
|
defaultNS: string;
|
|
8
8
|
};
|
|
@@ -2,7 +2,7 @@ import { TranslatableMixin } from "../../../mixins/translatable.js";
|
|
|
2
2
|
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
3
3
|
import { InternalForm } from "../../internal/InternalForm/InternalForm.js";
|
|
4
4
|
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
5
|
-
import { html } from 'lit-html';
|
|
5
|
+
import { html, svg } from 'lit-html';
|
|
6
6
|
const NS = 'admin-subscription-form';
|
|
7
7
|
const Base = TranslatableMixin(InternalForm, NS);
|
|
8
8
|
export class AdminSubscriptionForm extends Base {
|
|
@@ -94,20 +94,26 @@ export class AdminSubscriptionForm extends Base {
|
|
|
94
94
|
>
|
|
95
95
|
</foxy-internal-admin-subscription-form-link-control>
|
|
96
96
|
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
<div
|
|
98
|
+
class="flex items-start leading-xs text-xs text-secondary"
|
|
99
|
+
style="gap: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
100
|
+
>
|
|
101
|
+
${svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`}
|
|
102
|
+
<p>
|
|
103
|
+
<foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n>
|
|
104
|
+
${this.uoeSettingsPage
|
|
100
105
|
? html `
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
<a
|
|
107
|
+
target="_blank"
|
|
108
|
+
class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50"
|
|
109
|
+
href=${this.uoeSettingsPage}
|
|
110
|
+
>
|
|
111
|
+
<foxy-i18n infer="" key="uoe_link_text"></foxy-i18n>
|
|
112
|
+
</a>
|
|
113
|
+
`
|
|
109
114
|
: ''}
|
|
110
|
-
|
|
115
|
+
</p>
|
|
116
|
+
</div>
|
|
111
117
|
</foxy-internal-summary-control>
|
|
112
118
|
|
|
113
119
|
${this.renderTemplateOrSlot()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminSubscriptionForm.js","sourceRoot":"","sources":["../../../../src/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminSubscriptionForm.js","sourceRoot":"","sources":["../../../../src/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,EAAE,GAAG,yBAAyB,CAAC;AACrC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD,MAAM,OAAO,qBAAsB,SAAQ,IAAU;IAArD;;QAQE,yHAAyH;QACzH,oBAAe,GAAkB,IAAI,CAAC;IA+HxC,CAAC;IAvIC,M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B,EAAE,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiC/E,GAAG,CAAA,qWAAqW;;;cAGtW,IAAI,CAAC,eAAe;YACpB,CAAC,CAAC,IAAI,CAAA;;;;2BAIO,IAAI,CAAC,eAAe;;;;iBAI9B;YACH,CAAC,CAAC,EAAE;;;;;QAKV,IAAI,CAAC,oBAAoB,EAAE;;;;;gBAKnB,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,0CAAG,eAAe,EAAE,IAAI,CAAC;;;;;;;;;;gBAUpD,SAAS,CAAC,gBAAgB,CAAC;;;;;;;;;;QAUnC,KAAK,CAAC,UAAU,EAAE;KACrB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, svg } from 'lit-html';\n\nconst NS = 'admin-subscription-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class AdminSubscriptionForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n uoeSettingsPage: { attribute: 'uoe-settings-page' },\n };\n }\n\n /** URL of the UOE settings page in the admin. If set, displays a link to that page in the self-service links section. */\n uoeSettingsPage: string | null = null;\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['delete', super.hiddenSelector.toString()];\n if (!this.data?.error_message) alwaysMatch.unshift('error-message');\n if (!this.data?.is_active) alwaysMatch.unshift('view-action', 'cancel-action');\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get headerSubtitleOptions(): Record<string, unknown> {\n return { context: this.data?.is_active ? 'active' : 'inactive' };\n }\n\n renderBody(): TemplateResult {\n let transactionsHref: string | undefined;\n\n try {\n const url = new URL(this.data?._links['fx:transactions'].href ?? '');\n url.searchParams.set('zoom', 'items');\n transactionsHref = url.toString();\n } catch {\n transactionsHref = undefined;\n }\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-admin-subscription-form-error infer=\"error-message\">\n </foxy-internal-admin-subscription-form-error>\n\n <foxy-internal-summary-control infer=\"general\">\n <foxy-internal-date-control layout=\"summary-item\" infer=\"start-date\">\n </foxy-internal-date-control>\n <foxy-internal-frequency-control\n layout=\"summary-item\"\n infer=\"frequency\"\n allow-twice-a-month\n >\n </foxy-internal-frequency-control>\n <foxy-internal-date-control layout=\"summary-item\" infer=\"next-transaction-date\">\n </foxy-internal-date-control>\n <foxy-internal-date-control layout=\"summary-item\" infer=\"end-date\">\n </foxy-internal-date-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"overdue\">\n <foxy-internal-number-control\n layout=\"summary-item\"\n suffix=${ifDefined(this.data?._embedded['fx:transaction_template'].currency_code)}\n infer=\"past-due-amount\"\n min=\"0\"\n >\n </foxy-internal-number-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"self-service-links\">\n <foxy-internal-admin-subscription-form-link-control infer=\"load-in-cart\">\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"cart=checkout\"\n infer=\"load-on-checkout\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"sub_cancel=next_transaction_date\"\n infer=\"cancel-at-end-of-billing-period\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"sub_cancel=true\"\n infer=\"cancel-next-day\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <div\n class=\"flex items-start leading-xs text-xs text-secondary\"\n style=\"gap: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" class=\"flex-shrink-0\" style=\"width: 1.25em\"><path fill-rule=\"evenodd\" d=\"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z\" clip-rule=\"evenodd\" /></svg>`}\n <p>\n <foxy-i18n infer=\"\" key=\"uoe_hint_text\"></foxy-i18n>\n ${this.uoeSettingsPage\n ? html`\n <a\n target=\"_blank\"\n class=\"inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${this.uoeSettingsPage}\n >\n <foxy-i18n infer=\"\" key=\"uoe_link_text\"></foxy-i18n>\n </a>\n `\n : ''}\n </p>\n </div>\n </foxy-internal-summary-control>\n\n ${this.renderTemplateOrSlot()}\n\n <foxy-internal-async-list-control\n infer=\"attributes\"\n class=\"min-w-0\"\n first=${ifDefined(this.data?._links?.['fx:attributes'].href)}\n item=\"foxy-attribute-card\"\n form=\"foxy-attribute-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"transactions\"\n class=\"min-w-0\"\n first=${ifDefined(transactionsHref)}\n item=\"foxy-transaction-card\"\n form=\"foxy-transaction\"\n hide-create-button\n hide-delete-button\n alert\n wide\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n `;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResponsiveMixin } from "../../../../../mixins/responsive.js";
|
|
2
2
|
import { InternalControl } from "../../../../internal/InternalControl/InternalControl.js";
|
|
3
|
-
import { html
|
|
3
|
+
import { html } from 'lit-html';
|
|
4
4
|
export class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(InternalControl) {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
@@ -29,49 +29,28 @@ export class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(In
|
|
|
29
29
|
href = undefined;
|
|
30
30
|
}
|
|
31
31
|
return html `
|
|
32
|
-
<div class="leading-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
<div class="leading-xs flex items-center gap-s">
|
|
33
|
+
<a
|
|
34
|
+
target="_blank"
|
|
35
|
+
class="truncate min-w-0 font-medium rounded cursor-pointer text-primary hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50"
|
|
36
|
+
href=${href}
|
|
37
37
|
>
|
|
38
|
-
|
|
38
|
+
<foxy-i18n infer="" key="label"></foxy-i18n>
|
|
39
|
+
</a>
|
|
39
40
|
|
|
40
|
-
<
|
|
41
|
-
<a
|
|
42
|
-
target="_blank"
|
|
43
|
-
class="min-w-0 flex-1 truncate font-medium rounded cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50"
|
|
44
|
-
style="max-width: 25rem"
|
|
45
|
-
href=${href}
|
|
46
|
-
>
|
|
47
|
-
${href}
|
|
48
|
-
</a>
|
|
41
|
+
<span> • </span>
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<div
|
|
58
|
-
class="transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body"
|
|
59
|
-
id="trigger"
|
|
60
|
-
>
|
|
61
|
-
${svg `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`}
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<vcf-tooltip
|
|
65
|
-
position="bottom"
|
|
66
|
-
theme="light"
|
|
67
|
-
style="--lumo-base-color: black; max-width: 30rem"
|
|
68
|
-
class="mt-s"
|
|
69
|
-
for="trigger"
|
|
70
|
-
>
|
|
71
|
-
<foxy-i18n class="text-s" style="color: white" infer="" key="helper_text"></foxy-i18n>
|
|
72
|
-
</vcf-tooltip>
|
|
73
|
-
</div>
|
|
43
|
+
<foxy-copy-to-clipboard
|
|
44
|
+
layout="text"
|
|
45
|
+
theme="tertiary-inline contrast"
|
|
46
|
+
infer="copy-to-clipboard"
|
|
47
|
+
text=${href}
|
|
48
|
+
>
|
|
49
|
+
</foxy-copy-to-clipboard>
|
|
74
50
|
</div>
|
|
51
|
+
|
|
52
|
+
<foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text">
|
|
53
|
+
</foxy-i18n>
|
|
75
54
|
`;
|
|
76
55
|
}
|
|
77
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAdminSubscriptionFormLinkControl.js","sourceRoot":"","sources":["../../../../../../src/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,4CAAyC;AACnE,OAAO,EAAE,eAAe,EAAE,gEAA6D;AACvF,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"InternalAdminSubscriptionFormLinkControl.js","sourceRoot":"","sources":["../../../../../../src/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,4CAAyC;AACnE,OAAO,EAAE,eAAe,EAAE,gEAA6D;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,OAAO,wCAAyC,SAAQ,eAAe,CAAC,eAAe,CAAC;IAA9F;;QAQE,WAAM,GAAkB,IAAI,CAAC;IA6C/B,CAAC;IApDC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAID,aAAa;;QACX,MAAM,IAAI,GAAG,IAAI,CAAC,OAAuC,CAAC;QAC1D,IAAI,IAAwB,CAAC;QAE7B,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YAEvE,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,MAAM,cAAc,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACvD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;gBACzB,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;aAC1E;YAED,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;SACvB;QAAC,WAAM;YACN,IAAI,GAAG,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,CAAA;;;;;iBAKE,IAAI;;;;;;;;;;;iBAWJ,IAAI;;;;;;;KAOhB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { AdminSubscriptionForm } from '../../AdminSubscriptionForm';\nimport type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\n\nimport { ResponsiveMixin } from '../../../../../mixins/responsive';\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { html } from 'lit-html';\n\nexport class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(InternalControl) {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n search: {},\n };\n }\n\n search: string | null = null;\n\n renderControl(): TemplateResult {\n const form = this.nucleon as AdminSubscriptionForm | null;\n let href: string | undefined;\n\n try {\n const url = new URL(form?.data?._links['fx:sub_token_url'].href ?? '');\n\n if (this.search) {\n const originalParams = new URLSearchParams(url.search);\n url.search = this.search;\n originalParams.forEach((value, key) => url.searchParams.set(key, value));\n }\n\n href = url.toString();\n } catch {\n href = undefined;\n }\n\n return html`\n <div class=\"leading-xs flex items-center gap-s\">\n <a\n target=\"_blank\"\n class=\"truncate min-w-0 font-medium rounded cursor-pointer text-primary hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${href}\n >\n <foxy-i18n infer=\"\" key=\"label\"></foxy-i18n>\n </a>\n\n <span> • </span>\n\n <foxy-copy-to-clipboard\n layout=\"text\"\n theme=\"tertiary-inline contrast\"\n infer=\"copy-to-clipboard\"\n text=${href}\n >\n </foxy-copy-to-clipboard>\n </div>\n\n <foxy-i18n class=\"leading-xs block text-xs text-secondary\" infer=\"\" key=\"helper_text\">\n </foxy-i18n>\n `;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/index.ts"],"names":[],"mappings":"AAAA,uDAAoD;AACpD,2CAAwC;AACxC,gCAA6B;AAE7B,OAAO,EAAE,wCAAwC,IAAI,MAAM,EAAE,sDAAmD;AAEhH,cAAc,CAAC,MAAM,CAAC,oDAAoD,EAAE,MAAM,CAAC,CAAC;AAEpF,OAAO,EAAE,MAAM,IAAI,wCAAwC,EAAE,CAAC","sourcesContent":["import '../../../../internal/InternalControl/index';\nimport '../../../CopyToClipboard/index';\nimport '../../../I18n/index';\n\nimport { InternalAdminSubscriptionFormLinkControl as Action } from './InternalAdminSubscriptionFormLinkControl';\n\ncustomElements.define('foxy-internal-admin-subscription-form-link-control', Action);\n\nexport { Action as InternalAdminSubscriptionFormLinkControl };\n"]}
|
|
@@ -4,6 +4,7 @@ import { InternalForm } from "../../internal/InternalForm/InternalForm.js";
|
|
|
4
4
|
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
5
5
|
import { html } from 'lit-html';
|
|
6
6
|
import slugify from '@sindresorhus/slugify';
|
|
7
|
+
import merge from 'lodash-es/merge';
|
|
7
8
|
const NS = 'store-form';
|
|
8
9
|
const Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));
|
|
9
10
|
/**
|
|
@@ -964,7 +965,6 @@ export class StoreForm extends Base {
|
|
|
964
965
|
this.edit({ webhook_key: JSON.stringify(parsedKey) });
|
|
965
966
|
}
|
|
966
967
|
__getCustomDisplayIdConfig() {
|
|
967
|
-
var _a;
|
|
968
968
|
const defaultConfig = {
|
|
969
969
|
enabled: false,
|
|
970
970
|
start: '0',
|
|
@@ -982,7 +982,7 @@ export class StoreForm extends Base {
|
|
|
982
982
|
},
|
|
983
983
|
},
|
|
984
984
|
};
|
|
985
|
-
return (
|
|
985
|
+
return merge(defaultConfig, this.form.custom_display_id_config || void 0);
|
|
986
986
|
}
|
|
987
987
|
__setCustomDisplayIdConfig(key, value) {
|
|
988
988
|
const currentConfig = this.__getCustomDisplayIdConfig();
|