@foxy.io/elements 1.25.0-beta.3 → 1.25.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 +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.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 +1 -1
- 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-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-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- 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-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-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 +2 -2
- 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 +4 -4
- 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-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.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-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +5 -5
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-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 +2 -96
- 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 +95 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-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-b113467e.js → shared-00c2793e.js} +1 -1
- package/dist/cdn/{shared-15dfa16d.js → shared-029816d7.js} +1 -1
- package/dist/cdn/{shared-61b1fd60.js → shared-02bc0368.js} +1 -1
- package/dist/cdn/{shared-87f55237.js → shared-174f37e9.js} +1 -1
- package/dist/cdn/{shared-3f3903d4.js → shared-20ba4cdc.js} +1 -1
- package/dist/cdn/{shared-06916671.js → shared-268571df.js} +1 -1
- package/dist/cdn/{shared-8d99b885.js → shared-2b27e2e7.js} +1 -1
- package/dist/cdn/{shared-979e24ec.js → shared-2bdc99f4.js} +1 -1
- package/dist/cdn/{shared-3d95605f.js → shared-2c8c4b43.js} +3 -3
- package/dist/cdn/shared-2cf08dd4.js +1 -0
- package/dist/cdn/{shared-f8d1abc9.js → shared-2f09d4df.js} +4 -4
- package/dist/cdn/{shared-54cbd346.js → shared-30d00b64.js} +1 -1
- package/dist/cdn/{shared-d9f4138b.js → shared-32e736eb.js} +1 -1
- package/dist/cdn/{shared-a1d39ddd.js → shared-43f449bb.js} +1 -1
- package/dist/cdn/{shared-87824001.js → shared-4462dc70.js} +2 -2
- package/dist/cdn/{shared-02f8245a.js → shared-4aa4d980.js} +1 -1
- package/dist/cdn/{shared-63d11888.js → shared-4c124efc.js} +7 -7
- package/dist/cdn/shared-4c650e5c.js +1 -0
- package/dist/cdn/{shared-b984ab7c.js → shared-4e59fd48.js} +16 -16
- package/dist/cdn/{shared-69c3549d.js → shared-54b0e48f.js} +1 -1
- package/dist/cdn/{shared-ecd5eb1b.js → shared-5fa697c4.js} +1 -1
- package/dist/cdn/shared-61ade33e.js +6 -0
- package/dist/cdn/{shared-3bd99d11.js → shared-6a9ae42e.js} +1 -1
- package/dist/cdn/{shared-a95067d6.js → shared-76400719.js} +1 -1
- package/dist/cdn/{shared-ceec93fa.js → shared-7dd17943.js} +1 -1
- package/dist/cdn/{shared-ea1ab750.js → shared-7deff07c.js} +1 -1
- package/dist/cdn/{shared-fad099e6.js → shared-7e1953f5.js} +1 -1
- package/dist/cdn/shared-8201d0b5.js +1 -0
- package/dist/cdn/{shared-29e74661.js → shared-8952aeac.js} +1 -1
- package/dist/cdn/{shared-320fadbf.js → shared-896982f9.js} +1 -1
- package/dist/cdn/{shared-a5a03f4f.js → shared-8d8bed82.js} +1 -1
- package/dist/cdn/{shared-92dd9964.js → shared-99c0ae04.js} +1 -1
- package/dist/cdn/{shared-6ffa9f84.js → shared-9c08cfab.js} +1 -1
- package/dist/cdn/{shared-0ffe26d8.js → shared-9df8f842.js} +2 -2
- package/dist/cdn/{shared-0961f769.js → shared-a8dc23f1.js} +1 -1
- package/dist/cdn/{shared-3fee360a.js → shared-ac7c5a5e.js} +14 -14
- package/dist/cdn/{shared-5db2fec0.js → shared-ad34b6db.js} +1 -1
- package/dist/cdn/{shared-a1be9c27.js → shared-b1b8ea67.js} +1 -1
- package/dist/cdn/{shared-85712eed.js → shared-b509bc2c.js} +1 -1
- package/dist/cdn/{shared-de8bf756.js → shared-bc0d8d01.js} +2 -2
- package/dist/cdn/{shared-4105aacf.js → shared-be7bfbb0.js} +1 -1
- package/dist/cdn/{shared-745a575c.js → shared-bed7aae1.js} +1 -1
- package/dist/cdn/{shared-5291bdca.js → shared-c7b3d22b.js} +3 -3
- package/dist/cdn/{shared-264c82b8.js → shared-c9ba1b64.js} +3 -3
- package/dist/cdn/{shared-c43cd1fa.js → shared-ca4c5f0f.js} +1 -1
- package/dist/cdn/{shared-efbd62cb.js → shared-cdd2358f.js} +4 -4
- package/dist/cdn/{shared-d8ca5c87.js → shared-d21fa1a6.js} +1 -1
- package/dist/cdn/{shared-835cf735.js → shared-d57fac94.js} +1 -1
- package/dist/cdn/{shared-d600815d.js → shared-dbadd9cf.js} +1 -1
- package/dist/cdn/{shared-452e38da.js → shared-e39807f8.js} +1 -1
- package/dist/cdn/{shared-25edf241.js → shared-e83f2983.js} +1 -1
- package/dist/cdn/{shared-d1265ca0.js → shared-e91453df.js} +1 -1
- package/dist/cdn/{shared-5f1f0d8f.js → shared-ea527e98.js} +1 -1
- package/dist/cdn/shared-f9a3d1ff.js +6 -0
- package/dist/cdn/{shared-324665fd.js → shared-fa4f6cd3.js} +1 -1
- package/dist/cdn/shared-fc15a882.js +1 -0
- package/dist/cdn/{shared-2c92c192.js → shared-ff8ca16b.js} +1 -1
- package/dist/cdn/{shared-6d0be1e4.js → shared-ff9791cf.js} +1 -1
- package/dist/cdn/translations/cart-form/en.json +7 -6
- package/dist/cdn/translations/customer/en.json +23 -14
- package/dist/cdn/translations/customer-portal/en.json +22 -13
- package/dist/cdn/translations/item-card/en.json +1 -0
- package/dist/cdn/translations/item-form/en.json +2 -2
- package/dist/cdn/translations/payments-api-payment-preset-form/en.json +2 -2
- package/dist/cdn/translations/shipment-card/en.json +1 -0
- package/dist/cdn/translations/subscription-form/en.json +23 -14
- package/dist/cdn/translations/transaction/en.json +27 -26
- package/dist/cdn/translations/transaction-card/en.json +22 -22
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +28 -23
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalControl/InternalControl.js +2 -1
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -1
- package/dist/elements/private/Dialog/Dialog.js +7 -1
- package/dist/elements/private/Dialog/Dialog.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +4 -2
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemsForm/private/Item.js +1 -0
- package/dist/elements/public/ItemsForm/private/Item.js.map +1 -1
- package/dist/elements/public/ShipmentCard/ShipmentCard.js +5 -2
- package/dist/elements/public/ShipmentCard/ShipmentCard.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.d.ts +2 -3
- package/dist/elements/public/Transaction/Transaction.js +129 -127
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/types.d.ts +9 -8
- package/dist/elements/public/Transaction/types.js.map +1 -1
- package/dist/elements/public/TransactionCard/TransactionCard.d.ts +8 -10
- package/dist/elements/public/TransactionCard/TransactionCard.js +71 -51
- package/dist/elements/public/TransactionCard/TransactionCard.js.map +1 -1
- package/dist/elements/public/TransactionCard/index.d.ts +2 -1
- package/dist/elements/public/TransactionCard/index.js +2 -1
- package/dist/elements/public/TransactionCard/index.js.map +1 -1
- package/dist/elements/public/TransactionCard/types.d.ts +8 -2
- package/dist/elements/public/TransactionCard/types.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-4761cbda.js +0 -1
- package/dist/cdn/shared-87142858.js +0 -1
- package/dist/cdn/shared-e9276306.js +0 -1
- package/dist/cdn/shared-eacc4539.js +0 -1
- package/dist/cdn/shared-ec59505f.js +0 -12
- package/dist/cdn/shared-f3cd4d07.js +0 -1
|
@@ -4,14 +4,15 @@ import { ResponsiveMixin } from "../../../mixins/responsive.js";
|
|
|
4
4
|
import { InternalForm } from "../../internal/InternalForm/InternalForm.js";
|
|
5
5
|
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
6
6
|
import { html } from 'lit-element';
|
|
7
|
-
|
|
7
|
+
const NS = 'transaction';
|
|
8
|
+
const Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));
|
|
8
9
|
/**
|
|
9
10
|
* Transaction summary page (`fx:transaction`).
|
|
10
11
|
*
|
|
11
12
|
* @element foxy-transaction
|
|
12
13
|
* @since 1.17.0
|
|
13
14
|
*/
|
|
14
|
-
export class Transaction extends
|
|
15
|
+
export class Transaction extends Base {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
17
18
|
/** URL of the `fx:hosted_payment_gateways` property helper resource. */
|
|
@@ -20,122 +21,6 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
20
21
|
this.paymentGatewaysHelper = null;
|
|
21
22
|
this.getSubscriptionPageHref = null;
|
|
22
23
|
this.getCustomerPageHref = null;
|
|
23
|
-
this.__renderHeader = () => {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
25
|
-
const source = (_a = this.data) === null || _a === void 0 ? void 0 : _a.source;
|
|
26
|
-
const type = (_b = this.data) === null || _b === void 0 ? void 0 : _b.type;
|
|
27
|
-
let subtitleKey = 'subtitle';
|
|
28
|
-
if (type === 'updateinfo') {
|
|
29
|
-
if (source === '' || (source === null || source === void 0 ? void 0 : source.startsWith('cit_'))) {
|
|
30
|
-
subtitleKey = 'subtitle_customer_changed_payment_method';
|
|
31
|
-
}
|
|
32
|
-
else if (source === 'mit_uoe') {
|
|
33
|
-
subtitleKey = 'subtitle_admin_changed_payment_method_with_uoe';
|
|
34
|
-
}
|
|
35
|
-
else if (source === 'mit_api') {
|
|
36
|
-
subtitleKey = 'subtitle_integration_changed_payment_method';
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
subtitleKey = 'subtitle_admin_changed_payment_method';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else if (type === 'subscription_modification') {
|
|
43
|
-
if (source === '' || (source === null || source === void 0 ? void 0 : source.startsWith('cit_'))) {
|
|
44
|
-
subtitleKey = 'subtitle_customer_changed_subscription';
|
|
45
|
-
}
|
|
46
|
-
else if (source === 'mit_uoe') {
|
|
47
|
-
subtitleKey = 'subtitle_admin_changed_subscription_with_uoe';
|
|
48
|
-
}
|
|
49
|
-
else if (source === 'mit_api') {
|
|
50
|
-
subtitleKey = 'subtitle_integration_changed_subscription';
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
subtitleKey = 'subtitle_admin_changed_subscription';
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else if (type === 'subscription_renewal') {
|
|
57
|
-
if (source === 'mit_recurring') {
|
|
58
|
-
subtitleKey = 'subtitle_subscription_renewal_attempt';
|
|
59
|
-
}
|
|
60
|
-
else if (source === 'mit_recurring_reattempt_automated') {
|
|
61
|
-
subtitleKey = 'subtitle_subscription_renewal_automated_reattempt';
|
|
62
|
-
}
|
|
63
|
-
else if (source === 'mit_recurring_reattempt_manual') {
|
|
64
|
-
subtitleKey = 'subtitle_subscription_renewal_manual_reattempt';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else if (type === 'subscription_cancellation') {
|
|
68
|
-
if (source === 'cit_recurring_cancellation') {
|
|
69
|
-
subtitleKey = 'subtitle_customer_canceled_subscription';
|
|
70
|
-
}
|
|
71
|
-
else if (source === 'mit_recurring_cancellation') {
|
|
72
|
-
subtitleKey = 'subtitle_admin_canceled_subscription';
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
if ((_c = this.data) === null || _c === void 0 ? void 0 : _c._links['fx:subscription']) {
|
|
77
|
-
if (source === null || source === void 0 ? void 0 : source.startsWith('cit_')) {
|
|
78
|
-
subtitleKey = 'subtitle_customer_subscribed';
|
|
79
|
-
}
|
|
80
|
-
else if (source === 'mit_uoe') {
|
|
81
|
-
subtitleKey = 'subtitle_admin_subscribed_with_uoe';
|
|
82
|
-
}
|
|
83
|
-
else if (source === 'mit_api') {
|
|
84
|
-
subtitleKey = 'subtitle_integration_subscribed';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
if (source === null || source === void 0 ? void 0 : source.startsWith('cit_')) {
|
|
89
|
-
subtitleKey = 'subtitle_customer_placed_order';
|
|
90
|
-
}
|
|
91
|
-
else if (source === 'mit_uoe') {
|
|
92
|
-
subtitleKey = 'subtitle_admin_placed_order_with_uoe';
|
|
93
|
-
}
|
|
94
|
-
else if (source === 'mit_api') {
|
|
95
|
-
subtitleKey = 'subtitle_integration_placed_order';
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return html `
|
|
100
|
-
<h1>
|
|
101
|
-
<div class="flex items-center gap-s leading-xs text-xxl font-medium break-all">
|
|
102
|
-
<foxy-i18n infer="header" key="title" .options=${this.data}></foxy-i18n>
|
|
103
|
-
<foxy-copy-to-clipboard
|
|
104
|
-
infer="header"
|
|
105
|
-
class="inline-block text-m"
|
|
106
|
-
text=${(_d = this.data) === null || _d === void 0 ? void 0 : _d.display_id}
|
|
107
|
-
>
|
|
108
|
-
</foxy-copy-to-clipboard>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<foxy-i18n
|
|
112
|
-
class="block leading-xs text-l text-secondary"
|
|
113
|
-
infer="header"
|
|
114
|
-
key=${subtitleKey}
|
|
115
|
-
.options=${{
|
|
116
|
-
transaction_date: (_e = this.data) === null || _e === void 0 ? void 0 : _e.transaction_date,
|
|
117
|
-
user_agent: uainfer.analyze((_g = (_f = this.data) === null || _f === void 0 ? void 0 : _f.user_agent) !== null && _g !== void 0 ? _g : '').toString(),
|
|
118
|
-
ip_country: (_h = this.data) === null || _h === void 0 ? void 0 : _h.ip_country,
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
</foxy-i18n>
|
|
122
|
-
|
|
123
|
-
<foxy-internal-transaction-actions-control class="mt-xs" infer="actions">
|
|
124
|
-
</foxy-internal-transaction-actions-control>
|
|
125
|
-
</h1>
|
|
126
|
-
|
|
127
|
-
${['problem', 'pending_fraud_review', 'rejected', 'declined'].includes((_k = (_j = this.data) === null || _j === void 0 ? void 0 : _j.status) !== null && _k !== void 0 ? _k : '')
|
|
128
|
-
? html `
|
|
129
|
-
<p
|
|
130
|
-
class="leading-xs text-body rounded bg-error-10 block"
|
|
131
|
-
style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
132
|
-
>
|
|
133
|
-
<foxy-i18n infer="header" key="alert_status_${(_l = this.data) === null || _l === void 0 ? void 0 : _l.status}"></foxy-i18n>
|
|
134
|
-
</p>
|
|
135
|
-
`
|
|
136
|
-
: ''}
|
|
137
|
-
`;
|
|
138
|
-
};
|
|
139
24
|
}
|
|
140
25
|
static get properties() {
|
|
141
26
|
return {
|
|
@@ -170,9 +55,85 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
170
55
|
return new BooleanSelector(`${super.hiddenSelector} ${hidden.join(' ')}`.trim());
|
|
171
56
|
}
|
|
172
57
|
renderBody() {
|
|
173
|
-
var _a, _b, _c, _d;
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
174
59
|
let shipmentsLink = undefined;
|
|
60
|
+
let subtitleKey = 'subtitle';
|
|
175
61
|
let itemsLink = undefined;
|
|
62
|
+
const alertStatuses = ['problem', 'pending_fraud_review', 'rejected', 'declined'];
|
|
63
|
+
const hidden = this.hiddenSelector;
|
|
64
|
+
const source = (_a = this.data) === null || _a === void 0 ? void 0 : _a.source;
|
|
65
|
+
const type = (_b = this.data) === null || _b === void 0 ? void 0 : _b.type;
|
|
66
|
+
if (type === 'updateinfo') {
|
|
67
|
+
if (source === '' || (source === null || source === void 0 ? void 0 : source.startsWith('cit_'))) {
|
|
68
|
+
subtitleKey = 'subtitle_customer_changed_payment_method';
|
|
69
|
+
}
|
|
70
|
+
else if (source === 'mit_uoe') {
|
|
71
|
+
subtitleKey = 'subtitle_admin_changed_payment_method_with_uoe';
|
|
72
|
+
}
|
|
73
|
+
else if (source === 'mit_api') {
|
|
74
|
+
subtitleKey = 'subtitle_integration_changed_payment_method';
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
subtitleKey = 'subtitle_admin_changed_payment_method';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else if (type === 'subscription_modification') {
|
|
81
|
+
if (source === '' || (source === null || source === void 0 ? void 0 : source.startsWith('cit_'))) {
|
|
82
|
+
subtitleKey = 'subtitle_customer_changed_subscription';
|
|
83
|
+
}
|
|
84
|
+
else if (source === 'mit_uoe') {
|
|
85
|
+
subtitleKey = 'subtitle_admin_changed_subscription_with_uoe';
|
|
86
|
+
}
|
|
87
|
+
else if (source === 'mit_api') {
|
|
88
|
+
subtitleKey = 'subtitle_integration_changed_subscription';
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
subtitleKey = 'subtitle_admin_changed_subscription';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (type === 'subscription_renewal') {
|
|
95
|
+
if (source === 'mit_recurring') {
|
|
96
|
+
subtitleKey = 'subtitle_subscription_renewal_attempt';
|
|
97
|
+
}
|
|
98
|
+
else if (source === 'mit_recurring_reattempt_automated') {
|
|
99
|
+
subtitleKey = 'subtitle_subscription_renewal_automated_reattempt';
|
|
100
|
+
}
|
|
101
|
+
else if (source === 'mit_recurring_reattempt_manual') {
|
|
102
|
+
subtitleKey = 'subtitle_subscription_renewal_manual_reattempt';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else if (type === 'subscription_cancellation') {
|
|
106
|
+
if (source === 'cit_recurring_cancellation') {
|
|
107
|
+
subtitleKey = 'subtitle_customer_canceled_subscription';
|
|
108
|
+
}
|
|
109
|
+
else if (source === 'mit_recurring_cancellation') {
|
|
110
|
+
subtitleKey = 'subtitle_admin_canceled_subscription';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
if ((_c = this.data) === null || _c === void 0 ? void 0 : _c._links['fx:subscription']) {
|
|
115
|
+
if (source === null || source === void 0 ? void 0 : source.startsWith('cit_')) {
|
|
116
|
+
subtitleKey = 'subtitle_customer_subscribed';
|
|
117
|
+
}
|
|
118
|
+
else if (source === 'mit_uoe') {
|
|
119
|
+
subtitleKey = 'subtitle_admin_subscribed_with_uoe';
|
|
120
|
+
}
|
|
121
|
+
else if (source === 'mit_api') {
|
|
122
|
+
subtitleKey = 'subtitle_integration_subscribed';
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
if (source === null || source === void 0 ? void 0 : source.startsWith('cit_')) {
|
|
127
|
+
subtitleKey = 'subtitle_customer_placed_order';
|
|
128
|
+
}
|
|
129
|
+
else if (source === 'mit_uoe') {
|
|
130
|
+
subtitleKey = 'subtitle_admin_placed_order_with_uoe';
|
|
131
|
+
}
|
|
132
|
+
else if (source === 'mit_api') {
|
|
133
|
+
subtitleKey = 'subtitle_integration_placed_order';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
176
137
|
if (this.data) {
|
|
177
138
|
try {
|
|
178
139
|
const shipmentsUrl = new URL(this.data._links['fx:shipments'].href);
|
|
@@ -182,17 +143,55 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
182
143
|
shipmentsLink = shipmentsUrl.toString();
|
|
183
144
|
itemsLink = itemsUrl.toString();
|
|
184
145
|
}
|
|
185
|
-
catch (
|
|
146
|
+
catch (_p) {
|
|
186
147
|
//
|
|
187
148
|
}
|
|
188
149
|
}
|
|
189
150
|
return html `
|
|
190
|
-
|
|
151
|
+
<h2>
|
|
152
|
+
<div class="flex items-center gap-s leading-xs text-xxl font-medium break-all">
|
|
153
|
+
<foxy-i18n infer="header" key="title" .options=${this.data}></foxy-i18n>
|
|
154
|
+
<foxy-copy-to-clipboard
|
|
155
|
+
infer="header"
|
|
156
|
+
class="inline-block text-m"
|
|
157
|
+
text=${(_d = this.data) === null || _d === void 0 ? void 0 : _d.display_id}
|
|
158
|
+
>
|
|
159
|
+
</foxy-copy-to-clipboard>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<foxy-i18n
|
|
163
|
+
class="block leading-xs text-l text-secondary"
|
|
164
|
+
infer="header"
|
|
165
|
+
key=${subtitleKey}
|
|
166
|
+
.options=${{
|
|
167
|
+
transaction_date: (_e = this.data) === null || _e === void 0 ? void 0 : _e.transaction_date,
|
|
168
|
+
ip_country: (_f = this.data) === null || _f === void 0 ? void 0 : _f.ip_country,
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
</foxy-i18n>
|
|
172
|
+
|
|
173
|
+
<foxy-internal-transaction-actions-control class="mt-xs" infer="actions">
|
|
174
|
+
</foxy-internal-transaction-actions-control>
|
|
175
|
+
</h2>
|
|
176
|
+
|
|
177
|
+
${alertStatuses.includes((_h = (_g = this.data) === null || _g === void 0 ? void 0 : _g.status) !== null && _h !== void 0 ? _h : '')
|
|
178
|
+
? html `
|
|
179
|
+
<p
|
|
180
|
+
class="leading-xs text-body rounded bg-error-10 block"
|
|
181
|
+
style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
182
|
+
>
|
|
183
|
+
<foxy-i18n infer="header" key="alert_status_${(_j = this.data) === null || _j === void 0 ? void 0 : _j.status}"></foxy-i18n>
|
|
184
|
+
</p>
|
|
185
|
+
`
|
|
186
|
+
: ''}
|
|
191
187
|
|
|
192
188
|
<foxy-internal-transaction-customer-control infer="customer">
|
|
193
189
|
</foxy-internal-transaction-customer-control>
|
|
194
190
|
|
|
195
|
-
<div
|
|
191
|
+
<div
|
|
192
|
+
class="grid gap-s"
|
|
193
|
+
?hidden=${hidden.matches('items', true) && hidden.matches('summary', true)}
|
|
194
|
+
>
|
|
196
195
|
<foxy-internal-async-list-control
|
|
197
196
|
infer="items"
|
|
198
197
|
class="min-w-0"
|
|
@@ -211,7 +210,7 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
211
210
|
|
|
212
211
|
<foxy-internal-async-list-control
|
|
213
212
|
infer="billing-addresses"
|
|
214
|
-
first=${ifDefined((
|
|
213
|
+
first=${ifDefined((_k = this.data) === null || _k === void 0 ? void 0 : _k._links['fx:billing_addresses'].href)}
|
|
215
214
|
item="foxy-billing-address-card"
|
|
216
215
|
form="foxy-address-form"
|
|
217
216
|
hide-create-button
|
|
@@ -222,7 +221,7 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
222
221
|
|
|
223
222
|
<foxy-internal-async-list-control
|
|
224
223
|
infer="payments"
|
|
225
|
-
first=${ifDefined((
|
|
224
|
+
first=${ifDefined((_l = this.data) === null || _l === void 0 ? void 0 : _l._links['fx:payments'].href)}
|
|
226
225
|
item="foxy-payment-card"
|
|
227
226
|
.itemProps=${{
|
|
228
227
|
'hosted-payment-gateways-helper': this.hostedPaymentGatewaysHelper,
|
|
@@ -231,11 +230,14 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
231
230
|
>
|
|
232
231
|
</foxy-internal-async-list-control>
|
|
233
232
|
|
|
234
|
-
<div
|
|
233
|
+
<div
|
|
234
|
+
class="grid gap-m sm-grid-cols-2"
|
|
235
|
+
?hidden=${hidden.matches('custom-fields', true) && hidden.matches('attributes', true)}
|
|
236
|
+
>
|
|
235
237
|
<foxy-internal-async-list-control
|
|
236
238
|
infer="custom-fields"
|
|
237
239
|
class="min-w-0"
|
|
238
|
-
first=${ifDefined((
|
|
240
|
+
first=${ifDefined((_m = this.data) === null || _m === void 0 ? void 0 : _m._links['fx:custom_fields'].href)}
|
|
239
241
|
limit="5"
|
|
240
242
|
form="foxy-custom-field-form"
|
|
241
243
|
item="foxy-custom-field-card"
|
|
@@ -246,7 +248,7 @@ export class Transaction extends ResponsiveMixin(TranslatableMixin(InternalForm,
|
|
|
246
248
|
<foxy-internal-async-list-control
|
|
247
249
|
infer="attributes"
|
|
248
250
|
class="min-w-0"
|
|
249
|
-
first=${ifDefined((
|
|
251
|
+
first=${ifDefined((_o = this.data) === null || _o === void 0 ? void 0 : _o._links['fx:attributes'].href)}
|
|
250
252
|
limit="5"
|
|
251
253
|
form="foxy-attribute-form"
|
|
252
254
|
item="foxy-attribute-card"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/elements/public/Transaction/Transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAA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ClD,aAAa,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;gBACxC,SAAS,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;aACjC;YAAC,WAAM;gBACN,EAAE;aACH;SACF;QAED,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,cAAc,EAAE;;;;;;;;;kBASX,SAAS,CAAC,SAAS,CAAC;;;;;qBAKjB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;gBAUhB,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,sBAAsB,EAAE,IAAI,CAAC;;;;;;;;;;;gBAWzD,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC;;qBAE3C;YACX,gCAAgC,EAAE,IAAI,CAAC,2BAA2B;YAClE,yBAAyB,EAAE,IAAI,CAAC,qBAAqB;SACtD;;;;;;;;kBAQS,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC;;;;;;;;;;;kBAWrD,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC;;;;;;;;;;;gBAWpD,SAAS,CAAC,aAAa,CAAC;;;;KAInC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-element';\n\nimport uainfer from 'uainfer/src/uainfer.js';\n\n/**\n * Transaction summary page (`fx:transaction`).\n *\n * @element foxy-transaction\n * @since 1.17.0\n */\nexport class Transaction extends ResponsiveMixin(\n TranslatableMixin(InternalForm, 'transaction')\n)<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n hostedPaymentGatewaysHelper: { attribute: 'hosted-payment-gateways-helper' },\n paymentGatewaysHelper: { attribute: 'payment-gateways-helper' },\n getSubscriptionPageHref: { attribute: false },\n getCustomerPageHref: { attribute: false },\n };\n }\n\n /** URL of the `fx:hosted_payment_gateways` property helper resource. */\n hostedPaymentGatewaysHelper: string | null = null;\n\n /** URL of the `fx:payment_gateways` property helper resource. */\n paymentGatewaysHelper: string | null = null;\n\n getSubscriptionPageHref: ((href: string) => string) | null = null;\n\n getCustomerPageHref: ((href: string) => string) | null = null;\n\n private readonly __renderHeader = () => {\n const source = this.data?.source;\n const type = this.data?.type;\n\n let subtitleKey = 'subtitle';\n\n if (type === 'updateinfo') {\n if (source === '' || source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_changed_payment_method';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_changed_payment_method_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_changed_payment_method';\n } else {\n subtitleKey = 'subtitle_admin_changed_payment_method';\n }\n } else if (type === 'subscription_modification') {\n if (source === '' || source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_changed_subscription';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_changed_subscription_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_changed_subscription';\n } else {\n subtitleKey = 'subtitle_admin_changed_subscription';\n }\n } else if (type === 'subscription_renewal') {\n if (source === 'mit_recurring') {\n subtitleKey = 'subtitle_subscription_renewal_attempt';\n } else if (source === 'mit_recurring_reattempt_automated') {\n subtitleKey = 'subtitle_subscription_renewal_automated_reattempt';\n } else if (source === 'mit_recurring_reattempt_manual') {\n subtitleKey = 'subtitle_subscription_renewal_manual_reattempt';\n }\n } else if (type === 'subscription_cancellation') {\n if (source === 'cit_recurring_cancellation') {\n subtitleKey = 'subtitle_customer_canceled_subscription';\n } else if (source === 'mit_recurring_cancellation') {\n subtitleKey = 'subtitle_admin_canceled_subscription';\n }\n } else {\n if (this.data?._links['fx:subscription']) {\n if (source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_subscribed';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_subscribed_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_subscribed';\n }\n } else {\n if (source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_placed_order';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_placed_order_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_placed_order';\n }\n }\n }\n\n return html`\n <h1>\n <div class=\"flex items-center gap-s leading-xs text-xxl font-medium break-all\">\n <foxy-i18n infer=\"header\" key=\"title\" .options=${this.data}></foxy-i18n>\n <foxy-copy-to-clipboard\n infer=\"header\"\n class=\"inline-block text-m\"\n text=${this.data?.display_id}\n >\n </foxy-copy-to-clipboard>\n </div>\n\n <foxy-i18n\n class=\"block leading-xs text-l text-secondary\"\n infer=\"header\"\n key=${subtitleKey}\n .options=${{\n transaction_date: this.data?.transaction_date,\n user_agent: uainfer.analyze(this.data?.user_agent ?? '').toString(),\n ip_country: this.data?.ip_country,\n }}\n >\n </foxy-i18n>\n\n <foxy-internal-transaction-actions-control class=\"mt-xs\" infer=\"actions\">\n </foxy-internal-transaction-actions-control>\n </h1>\n\n ${['problem', 'pending_fraud_review', 'rejected', 'declined'].includes(\n this.data?.status ?? ''\n )\n ? html`\n <p\n class=\"leading-xs text-body rounded bg-error-10 block\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <foxy-i18n infer=\"header\" key=\"alert_status_${this.data?.status}\"></foxy-i18n>\n </p>\n `\n : ''}\n `;\n };\n\n get readonlySelector(): BooleanSelector {\n const isEditable = Boolean(this.data?._links['fx:void'] ?? this.data?._links['fx:refund']);\n return isEditable\n ? new BooleanSelector(`${super.readonlySelector} billing-addresses`)\n : new BooleanSelector(\n `${super.readonlySelector} billing-addresses items attributes custom-fields`\n );\n }\n\n get hiddenSelector(): BooleanSelector {\n const hidden = ['billing-addresses:dialog:delete billing-addresses:dialog:timestamps'];\n const type = this.data?.type;\n\n if (!this.data?._links['fx:subscription']) hidden.push('subscription');\n if (type === 'subscription_modification') hidden.push('actions');\n\n if (type === 'updateinfo') {\n hidden.push('not=customer,subscription,payments,custom-fields,attributes');\n }\n\n if (type === 'subscription_cancellation') {\n hidden.push('not=customer,subscription,custom-fields,attributes');\n }\n\n return new BooleanSelector(`${super.hiddenSelector} ${hidden.join(' ')}`.trim());\n }\n\n renderBody(): TemplateResult {\n let shipmentsLink: string | undefined = undefined;\n let itemsLink: string | undefined = undefined;\n\n if (this.data) {\n try {\n const shipmentsUrl = new URL(this.data._links['fx:shipments'].href);\n const itemsUrl = new URL(this.data._links['fx:items'].href);\n shipmentsUrl.searchParams.set('zoom', 'items:item_category');\n itemsUrl.searchParams.set('zoom', 'item_options');\n shipmentsLink = shipmentsUrl.toString();\n itemsLink = itemsUrl.toString();\n } catch {\n //\n }\n }\n\n return html`\n ${this.__renderHeader()}\n\n <foxy-internal-transaction-customer-control infer=\"customer\">\n </foxy-internal-transaction-customer-control>\n\n <div class=\"grid gap-s\">\n <foxy-internal-async-list-control\n infer=\"items\"\n class=\"min-w-0\"\n first=${ifDefined(itemsLink)}\n limit=\"10\"\n item=\"foxy-item-card\"\n form=\"foxy-item-form\"\n alert\n .related=${[this.href]}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-transaction-summary-control infer=\"summary\" class=\"min-w-0\">\n </foxy-internal-transaction-summary-control>\n </div>\n\n <foxy-internal-async-list-control\n infer=\"billing-addresses\"\n first=${ifDefined(this.data?._links['fx:billing_addresses'].href)}\n item=\"foxy-billing-address-card\"\n form=\"foxy-address-form\"\n hide-create-button\n hide-delete-button\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"payments\"\n first=${ifDefined(this.data?._links['fx:payments'].href)}\n item=\"foxy-payment-card\"\n .itemProps=${{\n 'hosted-payment-gateways-helper': this.hostedPaymentGatewaysHelper,\n 'payment-gateways-helper': this.paymentGatewaysHelper,\n }}\n >\n </foxy-internal-async-list-control>\n\n <div class=\"grid gap-m sm-grid-cols-2\">\n <foxy-internal-async-list-control\n infer=\"custom-fields\"\n class=\"min-w-0\"\n first=${ifDefined(this.data?._links['fx:custom_fields'].href)}\n limit=\"5\"\n form=\"foxy-custom-field-form\"\n item=\"foxy-custom-field-card\"\n alert\n >\n </foxy-internal-async-list-control>\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 limit=\"5\"\n form=\"foxy-attribute-form\"\n item=\"foxy-attribute-card\"\n alert\n >\n </foxy-internal-async-list-control>\n </div>\n\n <foxy-internal-async-list-control\n infer=\"shipments\"\n first=${ifDefined(shipmentsLink)}\n item=\"foxy-shipment-card\"\n >\n </foxy-internal-async-list-control>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/elements/public/Transaction/Transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,EAAE,GAAG,aAAa,CAAC;AACzB,MAAM,IAAI,GAAG,eAAe,CAAC,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAU;IAA3C;;QAWE,wEAAwE;QACxE,gCAA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;;;;;qBAKjB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;gBAUhB,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,sBAAsB,EAAE,IAAI,CAAC;;;;;;;;;;;gBAWzD,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC;;qBAE3C;YACX,gCAAgC,EAAE,IAAI,CAAC,2BAA2B;YAClE,yBAAyB,EAAE,IAAI,CAAC,qBAAqB;SACtD;;;;;;kBAMS,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC;;;;;kBAK3E,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC;;;;;;;;;;;kBAWrD,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC;;;;;;;;;;;gBAWpD,SAAS,CAAC,aAAa,CAAC;;;;KAInC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-element';\n\nconst NS = 'transaction';\nconst Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));\n\n/**\n * Transaction summary page (`fx:transaction`).\n *\n * @element foxy-transaction\n * @since 1.17.0\n */\nexport class Transaction extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n hostedPaymentGatewaysHelper: { attribute: 'hosted-payment-gateways-helper' },\n paymentGatewaysHelper: { attribute: 'payment-gateways-helper' },\n getSubscriptionPageHref: { attribute: false },\n getCustomerPageHref: { attribute: false },\n };\n }\n\n /** URL of the `fx:hosted_payment_gateways` property helper resource. */\n hostedPaymentGatewaysHelper: string | null = null;\n\n /** URL of the `fx:payment_gateways` property helper resource. */\n paymentGatewaysHelper: string | null = null;\n\n getSubscriptionPageHref: ((href: string) => string) | null = null;\n\n getCustomerPageHref: ((href: string) => string) | null = null;\n\n get readonlySelector(): BooleanSelector {\n const isEditable = Boolean(this.data?._links['fx:void'] ?? this.data?._links['fx:refund']);\n return isEditable\n ? new BooleanSelector(`${super.readonlySelector} billing-addresses`)\n : new BooleanSelector(\n `${super.readonlySelector} billing-addresses items attributes custom-fields`\n );\n }\n\n get hiddenSelector(): BooleanSelector {\n const hidden = ['billing-addresses:dialog:delete billing-addresses:dialog:timestamps'];\n const type = this.data?.type;\n\n if (!this.data?._links['fx:subscription']) hidden.push('subscription');\n if (type === 'subscription_modification') hidden.push('actions');\n\n if (type === 'updateinfo') {\n hidden.push('not=customer,subscription,payments,custom-fields,attributes');\n }\n\n if (type === 'subscription_cancellation') {\n hidden.push('not=customer,subscription,custom-fields,attributes');\n }\n\n return new BooleanSelector(`${super.hiddenSelector} ${hidden.join(' ')}`.trim());\n }\n\n renderBody(): TemplateResult {\n let shipmentsLink: string | undefined = undefined;\n let subtitleKey = 'subtitle';\n let itemsLink: string | undefined = undefined;\n\n const alertStatuses = ['problem', 'pending_fraud_review', 'rejected', 'declined'];\n const hidden = this.hiddenSelector;\n const source = this.data?.source;\n const type = this.data?.type;\n\n if (type === 'updateinfo') {\n if (source === '' || source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_changed_payment_method';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_changed_payment_method_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_changed_payment_method';\n } else {\n subtitleKey = 'subtitle_admin_changed_payment_method';\n }\n } else if (type === 'subscription_modification') {\n if (source === '' || source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_changed_subscription';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_changed_subscription_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_changed_subscription';\n } else {\n subtitleKey = 'subtitle_admin_changed_subscription';\n }\n } else if (type === 'subscription_renewal') {\n if (source === 'mit_recurring') {\n subtitleKey = 'subtitle_subscription_renewal_attempt';\n } else if (source === 'mit_recurring_reattempt_automated') {\n subtitleKey = 'subtitle_subscription_renewal_automated_reattempt';\n } else if (source === 'mit_recurring_reattempt_manual') {\n subtitleKey = 'subtitle_subscription_renewal_manual_reattempt';\n }\n } else if (type === 'subscription_cancellation') {\n if (source === 'cit_recurring_cancellation') {\n subtitleKey = 'subtitle_customer_canceled_subscription';\n } else if (source === 'mit_recurring_cancellation') {\n subtitleKey = 'subtitle_admin_canceled_subscription';\n }\n } else {\n if (this.data?._links['fx:subscription']) {\n if (source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_subscribed';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_subscribed_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_subscribed';\n }\n } else {\n if (source?.startsWith('cit_')) {\n subtitleKey = 'subtitle_customer_placed_order';\n } else if (source === 'mit_uoe') {\n subtitleKey = 'subtitle_admin_placed_order_with_uoe';\n } else if (source === 'mit_api') {\n subtitleKey = 'subtitle_integration_placed_order';\n }\n }\n }\n\n if (this.data) {\n try {\n const shipmentsUrl = new URL(this.data._links['fx:shipments'].href);\n const itemsUrl = new URL(this.data._links['fx:items'].href);\n shipmentsUrl.searchParams.set('zoom', 'items:item_category');\n itemsUrl.searchParams.set('zoom', 'item_options');\n shipmentsLink = shipmentsUrl.toString();\n itemsLink = itemsUrl.toString();\n } catch {\n //\n }\n }\n\n return html`\n <h2>\n <div class=\"flex items-center gap-s leading-xs text-xxl font-medium break-all\">\n <foxy-i18n infer=\"header\" key=\"title\" .options=${this.data}></foxy-i18n>\n <foxy-copy-to-clipboard\n infer=\"header\"\n class=\"inline-block text-m\"\n text=${this.data?.display_id}\n >\n </foxy-copy-to-clipboard>\n </div>\n\n <foxy-i18n\n class=\"block leading-xs text-l text-secondary\"\n infer=\"header\"\n key=${subtitleKey}\n .options=${{\n transaction_date: this.data?.transaction_date,\n ip_country: this.data?.ip_country,\n }}\n >\n </foxy-i18n>\n\n <foxy-internal-transaction-actions-control class=\"mt-xs\" infer=\"actions\">\n </foxy-internal-transaction-actions-control>\n </h2>\n\n ${alertStatuses.includes(this.data?.status ?? '')\n ? html`\n <p\n class=\"leading-xs text-body rounded bg-error-10 block\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <foxy-i18n infer=\"header\" key=\"alert_status_${this.data?.status}\"></foxy-i18n>\n </p>\n `\n : ''}\n\n <foxy-internal-transaction-customer-control infer=\"customer\">\n </foxy-internal-transaction-customer-control>\n\n <div\n class=\"grid gap-s\"\n ?hidden=${hidden.matches('items', true) && hidden.matches('summary', true)}\n >\n <foxy-internal-async-list-control\n infer=\"items\"\n class=\"min-w-0\"\n first=${ifDefined(itemsLink)}\n limit=\"10\"\n item=\"foxy-item-card\"\n form=\"foxy-item-form\"\n alert\n .related=${[this.href]}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-transaction-summary-control infer=\"summary\" class=\"min-w-0\">\n </foxy-internal-transaction-summary-control>\n </div>\n\n <foxy-internal-async-list-control\n infer=\"billing-addresses\"\n first=${ifDefined(this.data?._links['fx:billing_addresses'].href)}\n item=\"foxy-billing-address-card\"\n form=\"foxy-address-form\"\n hide-create-button\n hide-delete-button\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"payments\"\n first=${ifDefined(this.data?._links['fx:payments'].href)}\n item=\"foxy-payment-card\"\n .itemProps=${{\n 'hosted-payment-gateways-helper': this.hostedPaymentGatewaysHelper,\n 'payment-gateways-helper': this.paymentGatewaysHelper,\n }}\n >\n </foxy-internal-async-list-control>\n\n <div\n class=\"grid gap-m sm-grid-cols-2\"\n ?hidden=${hidden.matches('custom-fields', true) && hidden.matches('attributes', true)}\n >\n <foxy-internal-async-list-control\n infer=\"custom-fields\"\n class=\"min-w-0\"\n first=${ifDefined(this.data?._links['fx:custom_fields'].href)}\n limit=\"5\"\n form=\"foxy-custom-field-form\"\n item=\"foxy-custom-field-card\"\n alert\n >\n </foxy-internal-async-list-control>\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 limit=\"5\"\n form=\"foxy-attribute-form\"\n item=\"foxy-attribute-card\"\n alert\n >\n </foxy-internal-async-list-control>\n </div>\n\n <foxy-internal-async-list-control\n infer=\"shipments\"\n first=${ifDefined(shipmentsLink)}\n item=\"foxy-shipment-card\"\n >\n </foxy-internal-async-list-control>\n `;\n }\n}\n"]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type { Resource } from '@foxy.io/sdk/core';
|
|
2
2
|
import type { Rels } from '@foxy.io/sdk/backend';
|
|
3
|
-
export declare type Data = Resource<Rels.Transaction, {
|
|
3
|
+
export declare type Data = Omit<Resource<Rels.Transaction, {
|
|
4
4
|
zoom: ['applied_taxes', 'shipments'];
|
|
5
|
-
}> & {
|
|
6
|
-
_links?: {
|
|
7
|
-
'fx:subscription'?: {
|
|
8
|
-
href: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
5
|
+
}>, 'type'> & {
|
|
11
6
|
_embedded?: {
|
|
12
|
-
'fx:discounts'?: Resource<Rels.Discount>[];
|
|
13
7
|
'fx:applied_gift_card_codes': Resource<Rels.GiftCardCodeLogs['child'], {
|
|
14
8
|
zoom: 'gift_card';
|
|
15
9
|
}>[];
|
|
10
|
+
'fx:discounts'?: Resource<Rels.Discount>[];
|
|
11
|
+
};
|
|
12
|
+
_links?: {
|
|
13
|
+
'fx:subscription'?: {
|
|
14
|
+
href: string;
|
|
15
|
+
};
|
|
16
16
|
};
|
|
17
17
|
user_agent: string;
|
|
18
18
|
display_id: string | number;
|
|
19
19
|
source: string;
|
|
20
|
+
type: Rels.Transaction['props']['type'] | '';
|
|
20
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/Transaction/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nexport type Data = Resource<Rels.Transaction, { zoom: ['applied_taxes', 'shipments'] }> & {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/Transaction/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\n// TODO: simplify once SDK types are fixed\n\nexport type Data = Omit<\n Resource<Rels.Transaction, { zoom: ['applied_taxes', 'shipments'] }>,\n 'type'\n> & {\n _embedded?: {\n 'fx:applied_gift_card_codes': Resource<Rels.GiftCardCodeLogs['child'], { zoom: 'gift_card' }>[];\n 'fx:discounts'?: Resource<Rels.Discount>[];\n };\n _links?: {\n 'fx:subscription'?: { href: string };\n };\n user_agent: string;\n display_id: string | number;\n source: string;\n type: Rels.Transaction['props']['type'] | '';\n};\n"]}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Data, Templates } from './types';
|
|
2
|
-
import { TemplateResult } from 'lit-html';
|
|
3
|
-
import {
|
|
4
|
-
declare const Base: typeof
|
|
1
|
+
import type { Data, Templates } from './types';
|
|
2
|
+
import type { TemplateResult } from 'lit-html';
|
|
3
|
+
import { InternalCard } from '../../internal/InternalCard/InternalCard';
|
|
4
|
+
declare const Base: typeof InternalCard & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
|
|
5
5
|
defaultNS: string;
|
|
6
|
-
} & import("lit-element").Constructor<import("../../../mixins/configurable").ConfigurableMixinHost
|
|
7
|
-
styles: import("lit-element").CSSResultArray;
|
|
8
|
-
};
|
|
6
|
+
} & import("lit-element").Constructor<import("../../../mixins/configurable").ConfigurableMixinHost>;
|
|
9
7
|
/**
|
|
10
8
|
* Basic card displaying a transaction.
|
|
11
9
|
*
|
|
@@ -24,11 +22,11 @@ declare const Base: typeof NucleonElement & import("lit-element").Constructor<im
|
|
|
24
22
|
declare class TransactionCard extends Base<Data> {
|
|
25
23
|
templates: Templates;
|
|
26
24
|
private __currencyDisplay;
|
|
27
|
-
|
|
25
|
+
renderBody(): TemplateResult;
|
|
28
26
|
protected _sendGet(): Promise<Data>;
|
|
29
|
-
private
|
|
27
|
+
private __renderIdAndTotal;
|
|
30
28
|
private __renderStatus;
|
|
31
|
-
private
|
|
29
|
+
private __renderSummary;
|
|
32
30
|
private __renderCustomer;
|
|
33
31
|
}
|
|
34
32
|
export { TransactionCard };
|