@foxy.io/elements 1.18.0-beta.21 → 1.18.0-beta.22
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/README.md +6 -1
- 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-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-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 +2 -2
- 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-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-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 +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-pagination.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 +2 -2
- package/dist/cdn/foxy-reports-table.js +5 -5
- 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 +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-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-f69afa4b.js → shared-08156595.js} +1 -1
- package/dist/cdn/{shared-fedeb7b2.js → shared-0821cfdc.js} +1 -1
- package/dist/cdn/{shared-6ac71f60.js → shared-08e27fe9.js} +3 -3
- package/dist/cdn/{shared-13e6fe8a.js → shared-0ce006b9.js} +1 -1
- package/dist/cdn/shared-1000b848.js +1 -0
- package/dist/cdn/{shared-d7dfd3d8.js → shared-101d1234.js} +2 -2
- package/dist/cdn/{shared-9643b6c8.js → shared-1c94a156.js} +1 -1
- package/dist/cdn/{shared-e39be772.js → shared-2092d86f.js} +1 -1
- package/dist/cdn/shared-21679ebd.js +1 -0
- package/dist/cdn/{shared-8e6a8a88.js → shared-2add595d.js} +1 -1
- package/dist/cdn/{shared-459a5ec4.js → shared-2cc638ad.js} +1 -1
- package/dist/cdn/{shared-4817dcd1.js → shared-39c10b22.js} +1 -1
- package/dist/cdn/{shared-d0c5c38f.js → shared-404aa9cc.js} +1 -1
- package/dist/cdn/{shared-307382e5.js → shared-4849ef5b.js} +1 -1
- package/dist/cdn/shared-486d7bb5.js +1 -0
- package/dist/cdn/{shared-715ee51e.js → shared-4f9d2417.js} +1 -1
- package/dist/cdn/{shared-daab7e76.js → shared-5378bd8c.js} +1 -1
- package/dist/cdn/{shared-780ead03.js → shared-5a4829e3.js} +1 -1
- package/dist/cdn/{shared-d6a78c23.js → shared-5b177708.js} +1 -1
- package/dist/cdn/{shared-7788977c.js → shared-5ea18e60.js} +1 -1
- package/dist/cdn/{shared-674c1c04.js → shared-62a54a6c.js} +1 -1
- package/dist/cdn/{shared-d7c271d2.js → shared-62c088b7.js} +1 -1
- package/dist/cdn/{shared-71beb422.js → shared-639c666f.js} +1 -1
- package/dist/cdn/{shared-9862ca28.js → shared-6581241a.js} +1 -1
- package/dist/cdn/{shared-206b4ae2.js → shared-6cb1015f.js} +1 -1
- package/dist/cdn/{shared-2bd47510.js → shared-71d8d167.js} +3 -3
- package/dist/cdn/{shared-45db2087.js → shared-71f2ef1f.js} +1 -1
- package/dist/cdn/{shared-25ecdf66.js → shared-744cf66b.js} +1 -1
- package/dist/cdn/{shared-80378a15.js → shared-7d4fb1a2.js} +1 -1
- package/dist/cdn/{shared-a4165acb.js → shared-80fc2b6a.js} +1 -1
- package/dist/cdn/{shared-ef98812b.js → shared-83596b46.js} +1 -1
- package/dist/cdn/shared-868065de.js +1 -0
- package/dist/cdn/{shared-02d4bc14.js → shared-88c4cfec.js} +1 -1
- package/dist/cdn/{shared-e7e0ee80.js → shared-8dd0af4d.js} +1 -1
- package/dist/cdn/{shared-46e22714.js → shared-988ec916.js} +1 -1
- package/dist/cdn/{shared-915e8780.js → shared-9bdacf65.js} +1 -1
- package/dist/cdn/{shared-72279946.js → shared-9f436277.js} +1 -1
- package/dist/cdn/shared-a0c8faf2.js +1 -0
- package/dist/cdn/{shared-0f29fba2.js → shared-a37abe4c.js} +2 -2
- package/dist/cdn/{shared-a6de944b.js → shared-a41234b4.js} +1 -1
- package/dist/cdn/{shared-0a40a749.js → shared-af226a9a.js} +1 -1
- package/dist/cdn/{shared-3b249b20.js → shared-b40cf0dd.js} +1 -1
- package/dist/cdn/{shared-7a739f89.js → shared-bb0e33c3.js} +1 -1
- package/dist/cdn/{shared-18d42566.js → shared-bc814810.js} +1 -1
- package/dist/cdn/{shared-1392183b.js → shared-bd252323.js} +1 -1
- package/dist/cdn/{shared-0d3bec9f.js → shared-be66c2e7.js} +1 -1
- package/dist/cdn/{shared-f821859e.js → shared-c774d080.js} +1 -1
- package/dist/cdn/{shared-78f6e15f.js → shared-c95c17e6.js} +1 -1
- package/dist/cdn/shared-cba08e1c.js +1 -0
- package/dist/cdn/{shared-33912f50.js → shared-d518bd55.js} +1 -1
- package/dist/cdn/shared-d61b3e4f.js +1 -0
- package/dist/cdn/{shared-3e8cd935.js → shared-d8dc97f0.js} +1 -1
- package/dist/cdn/{shared-2d2ce3b1.js → shared-de036570.js} +1 -1
- package/dist/cdn/{shared-7992035c.js → shared-ed0dee03.js} +3 -3
- package/dist/cdn/shared-f7e4cd67.js +1 -0
- package/dist/cdn/{shared-e0615601.js → shared-f80f402a.js} +1 -1
- package/dist/cdn/translations/payments-api-payment-preset-form/en.json +2 -2
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +10 -5
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalControl/InternalControl.js +2 -2
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -1
- package/dist/elements/internal/InternalDetails/InternalDetails.js +3 -3
- package/dist/elements/internal/InternalDetails/InternalDetails.js.map +1 -1
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js +1 -1
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js.map +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +2 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
- package/dist/elements/private/Group/Group.js +1 -1
- package/dist/elements/private/Group/Group.js.map +1 -1
- package/dist/elements/private/Warning/Warning.js +1 -3
- package/dist/elements/private/Warning/Warning.js.map +1 -1
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.d.ts +2 -2
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.js +7 -8
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.js.map +1 -1
- package/dist/elements/public/AppliedTaxCard/AppliedTaxCard.d.ts +1 -1
- package/dist/elements/public/AppliedTaxCard/AppliedTaxCard.js +2 -2
- package/dist/elements/public/AppliedTaxCard/AppliedTaxCard.js.map +1 -1
- package/dist/elements/public/AttributeCard/AttributeCard.js +28 -14
- package/dist/elements/public/AttributeCard/AttributeCard.js.map +1 -1
- package/dist/elements/public/CartForm/CartForm.d.ts +106 -1
- package/dist/elements/public/CartForm/CartForm.js +167 -37
- package/dist/elements/public/CartForm/CartForm.js.map +1 -1
- package/dist/elements/public/CartForm/index.d.ts +2 -0
- package/dist/elements/public/CartForm/index.js +2 -0
- package/dist/elements/public/CartForm/index.js.map +1 -1
- package/dist/elements/public/CartForm/types.d.ts +64 -0
- package/dist/elements/public/CartForm/types.js.map +1 -1
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.d.ts +1 -1
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.js +2 -2
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +13 -9
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CustomFieldCard/CustomFieldCard.d.ts +1 -1
- package/dist/elements/public/CustomFieldCard/CustomFieldCard.js +2 -2
- package/dist/elements/public/CustomFieldCard/CustomFieldCard.js.map +1 -1
- package/dist/elements/public/CustomFieldCard/TwoLineCard.d.ts +6 -12
- package/dist/elements/public/CustomFieldCard/TwoLineCard.js +5 -35
- package/dist/elements/public/CustomFieldCard/TwoLineCard.js.map +1 -1
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js +4 -4
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js.map +1 -1
- package/dist/elements/public/DiscountCard/DiscountCard.d.ts +1 -1
- package/dist/elements/public/DiscountCard/DiscountCard.js +2 -2
- package/dist/elements/public/DiscountCard/DiscountCard.js.map +1 -1
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.d.ts +1 -1
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.js +2 -2
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.js.map +1 -1
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.d.ts +1 -1
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js +2 -2
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js.map +1 -1
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +10 -2
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +3 -3
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/I18nEditor/I18nEditor.d.ts +9 -0
- package/dist/elements/public/I18nEditor/I18nEditor.js +13 -4
- package/dist/elements/public/I18nEditor/I18nEditor.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +14 -15
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.d.ts +1 -1
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js +2 -2
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js.map +1 -1
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.d.ts +1 -1
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js +2 -2
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionCard/PaymentsApiFraudProtectionCard.d.ts +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionCard/PaymentsApiFraudProtectionCard.js +6 -3
- package/dist/elements/public/PaymentsApiFraudProtectionCard/PaymentsApiFraudProtectionCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.d.ts +41 -3
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.js +142 -84
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.d.ts +2 -3
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.js +2 -3
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/types.d.ts +15 -0
- package/dist/elements/public/PaymentsApiFraudProtectionForm/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodCard/PaymentsApiPaymentMethodCard.d.ts +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodCard/PaymentsApiPaymentMethodCard.js +6 -3
- package/dist/elements/public/PaymentsApiPaymentMethodCard/PaymentsApiPaymentMethodCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.d.ts +70 -3
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +314 -263
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.d.ts +2 -0
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.js +2 -0
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/types.d.ts +29 -0
- package/dist/elements/public/PaymentsApiPaymentMethodForm/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.d.ts +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.js +2 -2
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.d.ts +40 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +93 -74
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/types.d.ts +14 -0
- package/dist/elements/public/PaymentsApiPaymentPresetForm/types.js.map +1 -1
- package/dist/elements/public/ReportForm/ReportForm.js +4 -1
- package/dist/elements/public/ReportForm/ReportForm.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.d.ts +153 -1
- package/dist/elements/public/StoreForm/StoreForm.js +191 -27
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/StoreForm/index.d.ts +1 -0
- package/dist/elements/public/StoreForm/index.js +1 -0
- package/dist/elements/public/StoreForm/index.js.map +1 -1
- package/dist/elements/public/StoreForm/types.d.ts +94 -0
- package/dist/elements/public/StoreForm/types.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.d.ts +50 -1
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js +49 -0
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.d.ts +1 -0
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js +1 -0
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +33 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +4 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js +10 -2
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.d.ts +1 -1
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.js +2 -2
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.js.map +1 -1
- package/dist/mixins/themeable.js +19 -8
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -1
- package/dist/cdn/shared-0301f5c5.js +0 -1
- package/dist/cdn/shared-324f9551.js +0 -1
- package/dist/cdn/shared-4cbd9a4f.js +0 -1
- package/dist/cdn/shared-7304a1ab.js +0 -1
- package/dist/cdn/shared-9291d900.js +0 -1
- package/dist/cdn/shared-ad3c1ddc.js +0 -1
- package/dist/cdn/shared-c6567654.js +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { TranslatableMixin } from "../../../mixins/translatable.js";
|
|
2
|
-
import {
|
|
3
|
-
import { InternalCard } from "../../internal/InternalCard/InternalCard.js";
|
|
2
|
+
import { TwoLineCard } from "../CustomFieldCard/TwoLineCard.js";
|
|
4
3
|
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
5
4
|
import { html } from 'lit-html';
|
|
6
5
|
const NS = 'applied-coupon-code-card';
|
|
7
|
-
const Base =
|
|
6
|
+
const Base = TranslatableMixin(TwoLineCard, NS);
|
|
8
7
|
/**
|
|
9
8
|
* Card element displaying an applied coupon code.
|
|
10
9
|
*
|
|
@@ -17,7 +16,7 @@ export class AppliedCouponCodeCard extends Base {
|
|
|
17
16
|
this.__couponLoaderId = 'couponLoader';
|
|
18
17
|
}
|
|
19
18
|
renderBody() {
|
|
20
|
-
var _a
|
|
19
|
+
var _a;
|
|
21
20
|
return html `
|
|
22
21
|
<foxy-nucleon
|
|
23
22
|
infer=""
|
|
@@ -28,10 +27,10 @@ export class AppliedCouponCodeCard extends Base {
|
|
|
28
27
|
>
|
|
29
28
|
</foxy-nucleon>
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
${super.renderBody({
|
|
31
|
+
title: data => html `${data.code}`,
|
|
32
|
+
subtitle: () => { var _a; return html `${(_a = this.__coupon) === null || _a === void 0 ? void 0 : _a.name}`; },
|
|
33
|
+
})}
|
|
35
34
|
`;
|
|
36
35
|
}
|
|
37
36
|
get isBodyReady() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppliedCouponCodeCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AppliedCouponCodeCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,WAAW,EAAE,0CAAuC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,0BAA0B,CAAC;AACtC,MAAM,IAAI,GAAG,iBAAiB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,IAAU;IAArD;;QACU,qBAAgB,GAAG,cAAc,CAAC;IAgC5C,CAAC;IA9BC,UAAU;;QACR,OAAO,IAAI,CAAA;;;;eAIA,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC;aAChD,IAAI,CAAC,gBAAgB;kBAChB,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;;;;QAIpC,KAAK,CAAC,UAAU,CAAC;YACjB,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,GAAG,IAAI,CAAC,IAAI,EAAE;YACjC,QAAQ,EAAE,GAAG,EAAE,WAAC,OAAA,IAAI,CAAA,GAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,EAAE,CAAA,EAAA;SAC7C,CAAC;KACH,CAAC;IACJ,CAAC;IAED,IAAI,WAAW;QACb,OAAO,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC9C,CAAC;IAED,IAAY,cAAc;QAExB,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAS,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,IAAY,QAAQ;;QAClB,aAAO,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC;IACnC,CAAC;CACF","sourcesContent":["import type { TemplateResult } from 'lit-html';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { TwoLineCard } from '../CustomFieldCard/TwoLineCard';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nconst NS = 'applied-coupon-code-card';\nconst Base = TranslatableMixin(TwoLineCard, NS);\n\n/**\n * Card element displaying an applied coupon code.\n *\n * @element foxy-applied-coupon-code-card\n * @since 1.21.0\n */\nexport class AppliedCouponCodeCard extends Base<Data> {\n private __couponLoaderId = 'couponLoader';\n\n renderBody(): TemplateResult {\n return html`\n <foxy-nucleon\n infer=\"\"\n class=\"hidden\"\n href=${ifDefined(this.data?._links['fx:coupon'].href)}\n id=${this.__couponLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n ${super.renderBody({\n title: data => html`${data.code}`,\n subtitle: () => html`${this.__coupon?.name}`,\n })}\n `;\n }\n\n get isBodyReady(): boolean {\n return super.isBodyReady && !!this.__coupon;\n }\n\n private get __couponLoader() {\n type Loader = NucleonElement<Resource<Rels.Coupon>>;\n return this.renderRoot.querySelector<Loader>(`#${this.__couponLoaderId}`);\n }\n\n private get __coupon() {\n return this.__couponLoader?.data;\n }\n}\n"]}
|
|
@@ -19,7 +19,7 @@ declare const AppliedTaxCard_base: typeof TwoLineCard & import("lit-element").Co
|
|
|
19
19
|
export declare class AppliedTaxCard extends AppliedTaxCard_base<Data> {
|
|
20
20
|
private __currencyDisplay;
|
|
21
21
|
private __currency;
|
|
22
|
-
|
|
22
|
+
renderBody(): TemplateResult;
|
|
23
23
|
protected _sendGet(): Promise<Data>;
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -19,8 +19,8 @@ export class AppliedTaxCard extends TranslatableMixin(TwoLineCard, 'applied-tax-
|
|
|
19
19
|
this.__currencyDisplay = '';
|
|
20
20
|
this.__currency = '';
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
return super.
|
|
22
|
+
renderBody() {
|
|
23
|
+
return super.renderBody({
|
|
24
24
|
title: data => html `${data.name}`,
|
|
25
25
|
subtitle: data => {
|
|
26
26
|
return html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppliedTaxCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AppliedTaxCard/AppliedTaxCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAKhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,WAAW,EAAE,0CAAuC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,CAAO;IAA5F;;QACU,sBAAiB,GAAG,EAAE,CAAC;QAEvB,eAAU,GAAG,EAAE,CAAC;IA+C1B,CAAC;IA7CC,
|
|
1
|
+
{"version":3,"file":"AppliedTaxCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AppliedTaxCard/AppliedTaxCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAKhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,WAAW,EAAE,0CAAuC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,CAAO;IAA5F;;QACU,sBAAiB,GAAG,EAAE,CAAC;QAEvB,eAAU,GAAG,EAAE,CAAC;IA+C1B,CAAC;IA7CC,UAAU;QACR,OAAO,KAAK,CAAC,UAAU,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,GAAG,IAAI,CAAC,IAAI,EAAE;YACjC,QAAQ,EAAE,IAAI,CAAC,EAAE;gBACf,OAAO,IAAI,CAAA;;sBAEG,IAAI,CAAC,SAAS,CAAC;oBACvB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,EAAE;oBAC3C,eAAe,EAAE,IAAI,CAAC,iBAAiB;iBACxC,CAAC;mBACK,IAAI,CAAC,IAAI;;iBAEX,IAAI,CAAC,EAAE;;;;;;;sBAOF,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC;mBAChD,IAAI,CAAC,IAAI;;iBAEX,IAAI,CAAC,EAAE;;;SAGf,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,QAAQ;QAItB,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC1C,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC7C,KAAK,CAAC,MAAM,CAAc,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;YACnE,KAAK,CAAC,MAAM,CAAQ,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;SACxD,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QAErF,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","sourcesContent":["import { TemplateResult, html } from 'lit-html';\n\nimport { Data } from './types';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { TwoLineCard } from '../CustomFieldCard/TwoLineCard';\n\n/**\n * Basic card displaying an applied tax.\n *\n * @slot title:before\n * @slot title:after\n *\n * @slot subtitle:before\n * @slot subtitle:after\n *\n * @element foxy-applied-tax-card\n * @since 1.11.0\n */\nexport class AppliedTaxCard extends TranslatableMixin(TwoLineCard, 'applied-tax-card')<Data> {\n private __currencyDisplay = '';\n\n private __currency = '';\n\n renderBody(): TemplateResult {\n return super.renderBody({\n title: data => html`${data.name}`,\n subtitle: data => {\n return html`\n <foxy-i18n\n options=${JSON.stringify({\n amount: `${data.amount} ${this.__currency}`,\n currencyDisplay: this.__currencyDisplay,\n })}\n lang=${this.lang}\n key=\"price\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <span>•</span>\n\n <foxy-i18n\n options=${JSON.stringify({ fraction: data.rate / 100 })}\n lang=${this.lang}\n key=\"percent\"\n ns=${this.ns}\n >\n </foxy-i18n>\n `;\n },\n });\n }\n\n protected async _sendGet(): Promise<Data> {\n type Transaction = Resource<Rels.Transaction>;\n type Store = Resource<Rels.Store>;\n\n const appliedTax = await super._sendGet();\n const [transaction, store] = await Promise.all([\n super._fetch<Transaction>(appliedTax._links['fx:transaction'].href),\n super._fetch<Store>(appliedTax._links['fx:store'].href),\n ]);\n\n this.__currency = transaction.currency_code;\n this.__currencyDisplay = store.use_international_currency_symbol ? 'code' : 'symbol';\n\n return appliedTax;\n }\n}\n"]}
|
|
@@ -26,30 +26,44 @@ export class AttributeCard extends Base {
|
|
|
26
26
|
var _a, _b;
|
|
27
27
|
const { data } = this;
|
|
28
28
|
return html `
|
|
29
|
-
|
|
29
|
+
<div>
|
|
30
|
+
${this.renderTemplateOrSlot('name:before')}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
<div class="flex items-center space-x-xs font-medium">
|
|
33
|
+
<div class="truncate" title=${(_a = data === null || data === void 0 ? void 0 : data.name) !== null && _a !== void 0 ? _a : ''} data-testid="name">
|
|
34
|
+
${(_b = data === null || data === void 0 ? void 0 : data.name) !== null && _b !== void 0 ? _b : html ` `}
|
|
35
|
+
</div>
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
? html
|
|
37
|
+
${data && data.visibility !== 'public'
|
|
38
|
+
? html `
|
|
39
|
+
<div class="flex items-center" style="height: 1px">
|
|
40
|
+
<iron-icon icon="icons:lock" class="icon-inline"></iron-icon>
|
|
41
|
+
</div>
|
|
42
|
+
`
|
|
38
43
|
: ''}
|
|
39
|
-
|
|
44
|
+
</div>
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
${this.renderTemplateOrSlot('name:after')}
|
|
47
|
+
</div>
|
|
42
48
|
`;
|
|
43
49
|
};
|
|
44
50
|
this.__renderValue = () => {
|
|
45
51
|
var _a, _b;
|
|
46
52
|
const { data } = this;
|
|
47
53
|
return html `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
<div>
|
|
55
|
+
${this.renderTemplateOrSlot('value:before')}
|
|
56
|
+
|
|
57
|
+
<div
|
|
58
|
+
class="truncate text-tertiary text-s sm-text-m"
|
|
59
|
+
title=${(_a = data === null || data === void 0 ? void 0 : data.value) !== null && _a !== void 0 ? _a : ''}
|
|
60
|
+
data-testid="value"
|
|
61
|
+
>
|
|
62
|
+
${(_b = data === null || data === void 0 ? void 0 : data.value) !== null && _b !== void 0 ? _b : html ` `}
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
${this.renderTemplateOrSlot('value:after')}
|
|
51
66
|
</div>
|
|
52
|
-
${this.renderTemplateOrSlot('value:after')}
|
|
53
67
|
`;
|
|
54
68
|
};
|
|
55
69
|
}
|
|
@@ -60,9 +74,9 @@ export class AttributeCard extends Base {
|
|
|
60
74
|
const isEmpty = this.in({ idle: 'template' });
|
|
61
75
|
return html `
|
|
62
76
|
<div
|
|
63
|
-
class="relative text-body text-m font-lumo leading-s sm-flex sm-justify-between"
|
|
64
77
|
aria-live="polite"
|
|
65
78
|
aria-busy=${this.in('busy')}
|
|
79
|
+
class="h-s flex flex-col justify-center relative text-body text-m font-lumo leading-xs sm-flex-row sm-items-center sm-justify-between"
|
|
66
80
|
>
|
|
67
81
|
${hiddenSelector.matches('name', true) ? '' : this.__renderName()}
|
|
68
82
|
${hiddenSelector.matches('value', true) ? '' : this.__renderValue()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AttributeCard/AttributeCard.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAClE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAE7D,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAC5B,MAAM,IAAI,GAAG,eAAe,CAC1B,iBAAiB,CAAC,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,CACzE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,aAAc,SAAQ,IAAU;IAA7C;;QACE,cAAS,GAAc,EAAE,CAAC;QAET,iBAAY,GAAG,GAAG,EAAE;;YACnC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;YAEtB,OAAO,IAAI,CAAA
|
|
1
|
+
{"version":3,"file":"AttributeCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AttributeCard/AttributeCard.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAClE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAE7D,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAC5B,MAAM,IAAI,GAAG,eAAe,CAC1B,iBAAiB,CAAC,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,CACzE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,aAAc,SAAQ,IAAU;IAA7C;;QACE,cAAS,GAAc,EAAE,CAAC;QAET,iBAAY,GAAG,GAAG,EAAE;;YACnC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;YAEtB,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC;;;wCAGV,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,mCAAI,EAAE;cAC1C,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,mCAAI,IAAI,CAAA,QAAQ;;;YAG5B,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ;gBACpC,CAAC,CAAC,IAAI,CAAA;;;;eAIH;gBACH,CAAC,CAAC,EAAE;;;UAGN,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC;;KAE5C,CAAC;QACJ,CAAC,CAAC;QAEe,kBAAa,GAAG,GAAG,EAAE;;YACpC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;YAEtB,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;;;kBAIjC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,EAAE;;;YAGvB,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,IAAI,CAAA,QAAQ;;;UAG7B,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC;;KAE7C,CAAC;QACJ,CAAC,CAAC;IAkCJ,CAAC;IAhCC,MAAM;;QACJ,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAA;;;oBAGK,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;;;UAGzB,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE;UAC/D,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE;;;kBAGzD,QAAQ,CAAC;YACf,2DAA2D,EAAE,IAAI;YACjE,+BAA+B,EAAE,QAAQ;SAC1C,CAAC;;;;;oBAKQ,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;mBACvD,IAAI,CAAC,IAAI;kBACV,IAAI,CAAC,EAAE,IAAI,YAAA,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,SAAS,mCAAI,EAAE;;;;;KAK3E,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Data, Templates } from './types';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\n\nconst NS = 'attribute-card';\nconst Base = ResponsiveMixin(\n TranslatableMixin(ConfigurableMixin(ThemeableMixin(NucleonElement)), NS)\n);\n\n/**\n * Basic card displaying an attribute.\n *\n * @slot name:before - **new in v1.4.0**\n * @slot name:after - **new in v1.4.0**\n * @slot value:before - **new in v1.4.0**\n * @slot value:after - **new in v1.4.0**\n *\n * @element foxy-attribute-card\n * @since 1.2.0\n */\nexport class AttributeCard extends Base<Data> {\n templates: Templates = {};\n\n private readonly __renderName = () => {\n const { data } = this;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <div class=\"flex items-center space-x-xs font-medium\">\n <div class=\"truncate\" title=${data?.name ?? ''} data-testid=\"name\">\n ${data?.name ?? html` `}\n </div>\n\n ${data && data.visibility !== 'public'\n ? html`\n <div class=\"flex items-center\" style=\"height: 1px\">\n <iron-icon icon=\"icons:lock\" class=\"icon-inline\"></iron-icon>\n </div>\n `\n : ''}\n </div>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n };\n\n private readonly __renderValue = () => {\n const { data } = this;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('value:before')}\n\n <div\n class=\"truncate text-tertiary text-s sm-text-m\"\n title=${data?.value ?? ''}\n data-testid=\"value\"\n >\n ${data?.value ?? html` `}\n </div>\n\n ${this.renderTemplateOrSlot('value:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n const hiddenSelector = this.hiddenSelector;\n const isLoaded = this.in({ idle: 'snapshot' });\n const isEmpty = this.in({ idle: 'template' });\n\n return html`\n <div\n aria-live=\"polite\"\n aria-busy=${this.in('busy')}\n class=\"h-s flex flex-col justify-center relative text-body text-m font-lumo leading-xs sm-flex-row sm-items-center sm-justify-between\"\n >\n ${hiddenSelector.matches('name', true) ? '' : this.__renderName()}\n ${hiddenSelector.matches('value', true) ? '' : this.__renderValue()}\n\n <div\n class=${classMap({\n 'transition duration-250 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': isLoaded,\n })}\n >\n <foxy-spinner\n data-testid=\"spinner\"\n class=\"m-auto\"\n state=${this.in('fail') ? 'error' : isEmpty ? 'empty' : 'busy'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -1,20 +1,125 @@
|
|
|
1
1
|
import type { PropertyDeclarations } from 'lit-element';
|
|
2
|
+
import type { Templates, Data } from './types';
|
|
2
3
|
import type { TemplateResult } from 'lit-html';
|
|
3
4
|
import type { NucleonV8N } from '../NucleonElement/types';
|
|
4
|
-
import type { Data } from './types';
|
|
5
5
|
import { InternalForm } from '../../internal/InternalForm/InternalForm';
|
|
6
6
|
declare const Base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
|
|
7
7
|
defaultNS: string;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Form element for creating or editing carts (`fx:cart`).
|
|
11
|
+
*
|
|
12
|
+
* @slot customer-type:before
|
|
13
|
+
* @slot customer-type:after
|
|
14
|
+
*
|
|
15
|
+
* @slot customer:before
|
|
16
|
+
* @slot customer:after
|
|
17
|
+
*
|
|
18
|
+
* @slot template-set-uri:before
|
|
19
|
+
* @slot template-set-uri:after
|
|
20
|
+
*
|
|
21
|
+
* @slot items:before
|
|
22
|
+
* @slot items:after
|
|
23
|
+
*
|
|
24
|
+
* @slot applied-coupon-codes:before
|
|
25
|
+
* @slot applied-coupon-codes:after
|
|
26
|
+
*
|
|
27
|
+
* @slot custom-fields:before
|
|
28
|
+
* @slot custom-fields:after
|
|
29
|
+
*
|
|
30
|
+
* @slot attributes:before
|
|
31
|
+
* @slot attributes:after
|
|
32
|
+
*
|
|
33
|
+
* @slot billing-first-name:before
|
|
34
|
+
* @slot billing-first-name:after
|
|
35
|
+
*
|
|
36
|
+
* @slot billing-last-name:before
|
|
37
|
+
* @slot billing-last-name:after
|
|
38
|
+
*
|
|
39
|
+
* @slot billing-company:before
|
|
40
|
+
* @slot billing-company:after
|
|
41
|
+
*
|
|
42
|
+
* @slot billing-phone:before
|
|
43
|
+
* @slot billing-phone:after
|
|
44
|
+
*
|
|
45
|
+
* @slot billing-address-one:before
|
|
46
|
+
* @slot billing-address-one:after
|
|
47
|
+
*
|
|
48
|
+
* @slot billing-address-two:before
|
|
49
|
+
* @slot billing-address-two:after
|
|
50
|
+
*
|
|
51
|
+
* @slot billing-country:before
|
|
52
|
+
* @slot billing-country:after
|
|
53
|
+
*
|
|
54
|
+
* @slot billing-region:before
|
|
55
|
+
* @slot billing-region:after
|
|
56
|
+
*
|
|
57
|
+
* @slot billing-city:before
|
|
58
|
+
* @slot billing-city:after
|
|
59
|
+
*
|
|
60
|
+
* @slot billing-postal-code:before
|
|
61
|
+
* @slot billing-postal-code:after
|
|
62
|
+
*
|
|
63
|
+
* @slot shipping-first-name:before
|
|
64
|
+
* @slot shipping-first-name:after
|
|
65
|
+
*
|
|
66
|
+
* @slot shipping-last-name:before
|
|
67
|
+
* @slot shipping-last-name:after
|
|
68
|
+
*
|
|
69
|
+
* @slot shipping-company:before
|
|
70
|
+
* @slot shipping-company:after
|
|
71
|
+
*
|
|
72
|
+
* @slot shipping-phone:before
|
|
73
|
+
* @slot shipping-phone:after
|
|
74
|
+
*
|
|
75
|
+
* @slot shipping-address-one:before
|
|
76
|
+
* @slot shipping-address-one:after
|
|
77
|
+
*
|
|
78
|
+
* @slot shipping-address-two:before
|
|
79
|
+
* @slot shipping-address-two:after
|
|
80
|
+
*
|
|
81
|
+
* @slot shipping-country:before
|
|
82
|
+
* @slot shipping-country:after
|
|
83
|
+
*
|
|
84
|
+
* @slot shipping-region:before
|
|
85
|
+
* @slot shipping-region:after
|
|
86
|
+
*
|
|
87
|
+
* @slot shipping-city:before
|
|
88
|
+
* @slot shipping-city:after
|
|
89
|
+
*
|
|
90
|
+
* @slot shipping-postal-code:before
|
|
91
|
+
* @slot shipping-postal-code:after
|
|
92
|
+
*
|
|
93
|
+
* @slot view-as-customer:before
|
|
94
|
+
* @slot view-as-customer:after
|
|
95
|
+
*
|
|
96
|
+
* @slot delete:before
|
|
97
|
+
* @slot delete:after
|
|
98
|
+
*
|
|
99
|
+
* @slot create:before
|
|
100
|
+
* @slot create:after
|
|
101
|
+
*
|
|
102
|
+
* @element foxy-cart-form
|
|
103
|
+
* @since 1.21.0
|
|
104
|
+
*/
|
|
9
105
|
export declare class CartForm extends Base<Data> {
|
|
10
106
|
static get properties(): PropertyDeclarations;
|
|
11
107
|
static get v8n(): NucleonV8N<Data>;
|
|
108
|
+
/** URL of the `fx:item_categories` collection for the store. */
|
|
12
109
|
itemCategories: string | null;
|
|
110
|
+
/** URL of the `fx:template_sets` collection for the store. */
|
|
13
111
|
templateSets: string | null;
|
|
112
|
+
/** URL of the `fx:locale_codes` property helper. */
|
|
14
113
|
localeCodes: string | null;
|
|
114
|
+
/** URL of the `fx:customers` collection for the store. */
|
|
15
115
|
customers: string | null;
|
|
116
|
+
/** URL of the `fx:countries` property helper. */
|
|
16
117
|
countries: string | null;
|
|
118
|
+
/** Template render functions mapped to their name. */
|
|
119
|
+
templates: Templates;
|
|
120
|
+
/** URL of the `fx:regions` property helper. */
|
|
17
121
|
regions: string | null;
|
|
122
|
+
/** URL of the `fx:coupons` collection for the store. */
|
|
18
123
|
coupons: string | null;
|
|
19
124
|
private readonly __defaultTemplateSetLoaderId;
|
|
20
125
|
private readonly __localeCodesHelperLoaderId;
|
|
@@ -7,15 +7,120 @@ import set from 'lodash-es/set';
|
|
|
7
7
|
import get from 'lodash-es/get';
|
|
8
8
|
const NS = 'cart-form';
|
|
9
9
|
const Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));
|
|
10
|
+
/**
|
|
11
|
+
* Form element for creating or editing carts (`fx:cart`).
|
|
12
|
+
*
|
|
13
|
+
* @slot customer-type:before
|
|
14
|
+
* @slot customer-type:after
|
|
15
|
+
*
|
|
16
|
+
* @slot customer:before
|
|
17
|
+
* @slot customer:after
|
|
18
|
+
*
|
|
19
|
+
* @slot template-set-uri:before
|
|
20
|
+
* @slot template-set-uri:after
|
|
21
|
+
*
|
|
22
|
+
* @slot items:before
|
|
23
|
+
* @slot items:after
|
|
24
|
+
*
|
|
25
|
+
* @slot applied-coupon-codes:before
|
|
26
|
+
* @slot applied-coupon-codes:after
|
|
27
|
+
*
|
|
28
|
+
* @slot custom-fields:before
|
|
29
|
+
* @slot custom-fields:after
|
|
30
|
+
*
|
|
31
|
+
* @slot attributes:before
|
|
32
|
+
* @slot attributes:after
|
|
33
|
+
*
|
|
34
|
+
* @slot billing-first-name:before
|
|
35
|
+
* @slot billing-first-name:after
|
|
36
|
+
*
|
|
37
|
+
* @slot billing-last-name:before
|
|
38
|
+
* @slot billing-last-name:after
|
|
39
|
+
*
|
|
40
|
+
* @slot billing-company:before
|
|
41
|
+
* @slot billing-company:after
|
|
42
|
+
*
|
|
43
|
+
* @slot billing-phone:before
|
|
44
|
+
* @slot billing-phone:after
|
|
45
|
+
*
|
|
46
|
+
* @slot billing-address-one:before
|
|
47
|
+
* @slot billing-address-one:after
|
|
48
|
+
*
|
|
49
|
+
* @slot billing-address-two:before
|
|
50
|
+
* @slot billing-address-two:after
|
|
51
|
+
*
|
|
52
|
+
* @slot billing-country:before
|
|
53
|
+
* @slot billing-country:after
|
|
54
|
+
*
|
|
55
|
+
* @slot billing-region:before
|
|
56
|
+
* @slot billing-region:after
|
|
57
|
+
*
|
|
58
|
+
* @slot billing-city:before
|
|
59
|
+
* @slot billing-city:after
|
|
60
|
+
*
|
|
61
|
+
* @slot billing-postal-code:before
|
|
62
|
+
* @slot billing-postal-code:after
|
|
63
|
+
*
|
|
64
|
+
* @slot shipping-first-name:before
|
|
65
|
+
* @slot shipping-first-name:after
|
|
66
|
+
*
|
|
67
|
+
* @slot shipping-last-name:before
|
|
68
|
+
* @slot shipping-last-name:after
|
|
69
|
+
*
|
|
70
|
+
* @slot shipping-company:before
|
|
71
|
+
* @slot shipping-company:after
|
|
72
|
+
*
|
|
73
|
+
* @slot shipping-phone:before
|
|
74
|
+
* @slot shipping-phone:after
|
|
75
|
+
*
|
|
76
|
+
* @slot shipping-address-one:before
|
|
77
|
+
* @slot shipping-address-one:after
|
|
78
|
+
*
|
|
79
|
+
* @slot shipping-address-two:before
|
|
80
|
+
* @slot shipping-address-two:after
|
|
81
|
+
*
|
|
82
|
+
* @slot shipping-country:before
|
|
83
|
+
* @slot shipping-country:after
|
|
84
|
+
*
|
|
85
|
+
* @slot shipping-region:before
|
|
86
|
+
* @slot shipping-region:after
|
|
87
|
+
*
|
|
88
|
+
* @slot shipping-city:before
|
|
89
|
+
* @slot shipping-city:after
|
|
90
|
+
*
|
|
91
|
+
* @slot shipping-postal-code:before
|
|
92
|
+
* @slot shipping-postal-code:after
|
|
93
|
+
*
|
|
94
|
+
* @slot view-as-customer:before
|
|
95
|
+
* @slot view-as-customer:after
|
|
96
|
+
*
|
|
97
|
+
* @slot delete:before
|
|
98
|
+
* @slot delete:after
|
|
99
|
+
*
|
|
100
|
+
* @slot create:before
|
|
101
|
+
* @slot create:after
|
|
102
|
+
*
|
|
103
|
+
* @element foxy-cart-form
|
|
104
|
+
* @since 1.21.0
|
|
105
|
+
*/
|
|
10
106
|
export class CartForm extends Base {
|
|
11
107
|
constructor() {
|
|
12
108
|
super(...arguments);
|
|
109
|
+
/** URL of the `fx:item_categories` collection for the store. */
|
|
13
110
|
this.itemCategories = null;
|
|
111
|
+
/** URL of the `fx:template_sets` collection for the store. */
|
|
14
112
|
this.templateSets = null;
|
|
113
|
+
/** URL of the `fx:locale_codes` property helper. */
|
|
15
114
|
this.localeCodes = null;
|
|
115
|
+
/** URL of the `fx:customers` collection for the store. */
|
|
16
116
|
this.customers = null;
|
|
117
|
+
/** URL of the `fx:countries` property helper. */
|
|
17
118
|
this.countries = null;
|
|
119
|
+
/** Template render functions mapped to their name. */
|
|
120
|
+
this.templates = {};
|
|
121
|
+
/** URL of the `fx:regions` property helper. */
|
|
18
122
|
this.regions = null;
|
|
123
|
+
/** URL of the `fx:coupons` collection for the store. */
|
|
19
124
|
this.coupons = null;
|
|
20
125
|
this.__defaultTemplateSetLoaderId = 'defaultTemplateSetLoader';
|
|
21
126
|
this.__localeCodesHelperLoaderId = 'localeCodesLoader';
|
|
@@ -84,28 +189,28 @@ export class CartForm extends Base {
|
|
|
84
189
|
}
|
|
85
190
|
static get v8n() {
|
|
86
191
|
return [
|
|
87
|
-
({ billing_first_name: v }) => !v || v.length <= 50 || '
|
|
88
|
-
({ billing_last_name: v }) => !v || v.length <= 50 || '
|
|
89
|
-
({ billing_region: v }) => !v || v.length <= 50 || '
|
|
90
|
-
({ billing_city: v }) => !v || v.length <= 50 || '
|
|
91
|
-
({ billing_phone: v }) => !v || v.length <= 50 || '
|
|
92
|
-
({ billing_company: v }) => !v || v.length <= 50 || '
|
|
93
|
-
({ billing_address2: v }) => !v || v.length <= 100 || '
|
|
94
|
-
({ billing_address1: v }) => !v || v.length <= 100 || '
|
|
95
|
-
({ billing_postal_code: v }) => !v || v.length <= 50 || '
|
|
96
|
-
({ shipping_first_name: v }) => !v || v.length <= 50 || '
|
|
97
|
-
({ shipping_last_name: v }) => !v || v.length <= 50 || '
|
|
98
|
-
({ shipping_region: v }) => !v || v.length <= 50 || '
|
|
99
|
-
({ shipping_city: v }) => !v || v.length <= 50 || '
|
|
100
|
-
({ shipping_phone: v }) => !v || v.length <= 50 || '
|
|
101
|
-
({ shipping_company: v }) => !v || v.length <= 50 || '
|
|
102
|
-
({ shipping_address2: v }) => !v || v.length <= 100 || '
|
|
103
|
-
({ shipping_address1: v }) => !v || v.length <= 100 || '
|
|
104
|
-
({ shipping_postal_code: v }) => !v || v.length <= 50 || '
|
|
192
|
+
({ billing_first_name: v }) => !v || v.length <= 50 || 'billing-first-name:v8n_too_long',
|
|
193
|
+
({ billing_last_name: v }) => !v || v.length <= 50 || 'billing-last-name:v8n_too_long',
|
|
194
|
+
({ billing_region: v }) => !v || v.length <= 50 || 'billing-region:v8n_too_long',
|
|
195
|
+
({ billing_city: v }) => !v || v.length <= 50 || 'billing-city:v8n_too_long',
|
|
196
|
+
({ billing_phone: v }) => !v || v.length <= 50 || 'billing-phone:v8n_too_long',
|
|
197
|
+
({ billing_company: v }) => !v || v.length <= 50 || 'billing-company:v8n_too_long',
|
|
198
|
+
({ billing_address2: v }) => !v || v.length <= 100 || 'billing-address-two:v8n_too_long',
|
|
199
|
+
({ billing_address1: v }) => !v || v.length <= 100 || 'billing-address-one:v8n_too_long',
|
|
200
|
+
({ billing_postal_code: v }) => !v || v.length <= 50 || 'billing-postal-code:v8n_too_long',
|
|
201
|
+
({ shipping_first_name: v }) => !v || v.length <= 50 || 'shipping-first-name:v8n_too_long',
|
|
202
|
+
({ shipping_last_name: v }) => !v || v.length <= 50 || 'shipping-last-name:v8n_too_long',
|
|
203
|
+
({ shipping_region: v }) => !v || v.length <= 50 || 'shipping-region:v8n_too_long',
|
|
204
|
+
({ shipping_city: v }) => !v || v.length <= 50 || 'shipping-city:v8n_too_long',
|
|
205
|
+
({ shipping_phone: v }) => !v || v.length <= 50 || 'shipping-phone:v8n_too_long',
|
|
206
|
+
({ shipping_company: v }) => !v || v.length <= 50 || 'shipping-company:v8n_too_long',
|
|
207
|
+
({ shipping_address2: v }) => !v || v.length <= 100 || 'shipping-address-two:v8n_too_long',
|
|
208
|
+
({ shipping_address1: v }) => !v || v.length <= 100 || 'shipping-address-one:v8n_too_long',
|
|
209
|
+
({ shipping_postal_code: v }) => !v || v.length <= 50 || 'shipping-postal-code:v8n_too_long',
|
|
105
210
|
];
|
|
106
211
|
}
|
|
107
212
|
renderBody() {
|
|
108
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
213
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
109
214
|
const shippingRegions = Object.values((_a = this.__shippingRegions) !== null && _a !== void 0 ? _a : {});
|
|
110
215
|
const billingRegions = Object.values((_b = this.__billingRegions) !== null && _b !== void 0 ? _b : {});
|
|
111
216
|
const countries = Object.values((_c = this.__countriesHelper) !== null && _c !== void 0 ? _c : {});
|
|
@@ -136,14 +241,18 @@ export class CartForm extends Base {
|
|
|
136
241
|
<foxy-item-card
|
|
137
242
|
locale-codes=${this.localeCodes}
|
|
138
243
|
parent=${ctx.parent}
|
|
139
|
-
style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
140
244
|
infer=""
|
|
141
245
|
href=${ctx.href}
|
|
142
246
|
.related=${ctx.related}
|
|
143
247
|
>
|
|
144
248
|
</foxy-item-card>
|
|
145
249
|
`;
|
|
146
|
-
const
|
|
250
|
+
const store = this.__store;
|
|
251
|
+
const currencyDisplay = store
|
|
252
|
+
? store.use_international_currency_symbol
|
|
253
|
+
? 'code'
|
|
254
|
+
: 'symbol'
|
|
255
|
+
: void 0;
|
|
147
256
|
let currencyCode = null;
|
|
148
257
|
if ('currency_code' in this.form) {
|
|
149
258
|
// TODO: remove the directive below once the SDK is updated
|
|
@@ -152,10 +261,10 @@ export class CartForm extends Base {
|
|
|
152
261
|
}
|
|
153
262
|
else {
|
|
154
263
|
const allLocaleCodes = this.__localeCodesHelper;
|
|
155
|
-
const localeCode = (
|
|
264
|
+
const localeCode = (_f = ((_e = this.__templateSet) !== null && _e !== void 0 ? _e : this.__defaultTemplateSet)) === null || _f === void 0 ? void 0 : _f.locale_code;
|
|
156
265
|
const localeInfo = localeCode ? allLocaleCodes === null || allLocaleCodes === void 0 ? void 0 : allLocaleCodes.values[localeCode] : void 0;
|
|
157
266
|
if (localeInfo)
|
|
158
|
-
currencyCode = (
|
|
267
|
+
currencyCode = (_h = (_g = /Currency: ([A-Z]{3})/g.exec(localeInfo)) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : null;
|
|
159
268
|
}
|
|
160
269
|
return html `
|
|
161
270
|
<foxy-nucleon
|
|
@@ -281,7 +390,7 @@ export class CartForm extends Base {
|
|
|
281
390
|
first=${ifDefined(this.templateSets)}
|
|
282
391
|
class="sm-col-span-2"
|
|
283
392
|
infer="template-set-uri"
|
|
284
|
-
.selectedItem=${(
|
|
393
|
+
.selectedItem=${(_j = this.__templateSet) !== null && _j !== void 0 ? _j : null}
|
|
285
394
|
>
|
|
286
395
|
</foxy-internal-async-combo-box-control>
|
|
287
396
|
|
|
@@ -298,7 +407,7 @@ export class CartForm extends Base {
|
|
|
298
407
|
<foxy-internal-async-list-control
|
|
299
408
|
infer="applied-coupon-codes"
|
|
300
409
|
class="min-w-0 sm-col-span-2"
|
|
301
|
-
first=${ifDefined((
|
|
410
|
+
first=${ifDefined((_k = this.data) === null || _k === void 0 ? void 0 : _k._links['fx:applied_coupon_codes'].href)}
|
|
302
411
|
limit="5"
|
|
303
412
|
item="foxy-applied-coupon-code-card"
|
|
304
413
|
form=${ifDefined(this.data ? 'foxy-applied-coupon-code-form' : void 0)}
|
|
@@ -309,7 +418,7 @@ export class CartForm extends Base {
|
|
|
309
418
|
<foxy-internal-async-list-control
|
|
310
419
|
infer="custom-fields"
|
|
311
420
|
class="min-w-0"
|
|
312
|
-
first=${ifDefined((
|
|
421
|
+
first=${ifDefined((_l = this.data) === null || _l === void 0 ? void 0 : _l._links['fx:custom_fields'].href)}
|
|
313
422
|
limit="5"
|
|
314
423
|
item="foxy-custom-field-card"
|
|
315
424
|
form=${ifDefined(this.data ? 'foxy-custom-field-form' : void 0)}
|
|
@@ -320,7 +429,7 @@ export class CartForm extends Base {
|
|
|
320
429
|
<foxy-internal-async-list-control
|
|
321
430
|
infer="attributes"
|
|
322
431
|
class="min-w-0"
|
|
323
|
-
first=${ifDefined((
|
|
432
|
+
first=${ifDefined((_m = this.data) === null || _m === void 0 ? void 0 : _m._links['fx:attributes'].href)}
|
|
324
433
|
limit="5"
|
|
325
434
|
item="foxy-attribute-card"
|
|
326
435
|
form=${ifDefined(this.data ? 'foxy-attribute-form' : void 0)}
|
|
@@ -351,10 +460,18 @@ export class CartForm extends Base {
|
|
|
351
460
|
<foxy-internal-text-control infer="billing-company"></foxy-internal-text-control>
|
|
352
461
|
<foxy-internal-text-control infer="billing-phone"></foxy-internal-text-control>
|
|
353
462
|
|
|
354
|
-
<foxy-internal-text-control
|
|
463
|
+
<foxy-internal-text-control
|
|
464
|
+
property="billing_address1"
|
|
465
|
+
infer="billing-address-one"
|
|
466
|
+
class="col-span-2"
|
|
467
|
+
>
|
|
355
468
|
</foxy-internal-text-control>
|
|
356
469
|
|
|
357
|
-
<foxy-internal-text-control
|
|
470
|
+
<foxy-internal-text-control
|
|
471
|
+
property="billing_address2"
|
|
472
|
+
infer="billing-address-two"
|
|
473
|
+
class="col-span-2"
|
|
474
|
+
>
|
|
358
475
|
</foxy-internal-text-control>
|
|
359
476
|
|
|
360
477
|
<foxy-internal-select-control infer="billing-country" .options=${countryOptions}>
|
|
@@ -391,10 +508,18 @@ export class CartForm extends Base {
|
|
|
391
508
|
<foxy-internal-text-control infer="shipping-company"></foxy-internal-text-control>
|
|
392
509
|
<foxy-internal-text-control infer="shipping-phone"></foxy-internal-text-control>
|
|
393
510
|
|
|
394
|
-
<foxy-internal-text-control
|
|
511
|
+
<foxy-internal-text-control
|
|
512
|
+
property="shipping_address1"
|
|
513
|
+
infer="shipping-address-one"
|
|
514
|
+
class="col-span-2"
|
|
515
|
+
>
|
|
395
516
|
</foxy-internal-text-control>
|
|
396
517
|
|
|
397
|
-
<foxy-internal-text-control
|
|
518
|
+
<foxy-internal-text-control
|
|
519
|
+
property="shipping_address2"
|
|
520
|
+
infer="shipping-address-two"
|
|
521
|
+
class="col-span-2"
|
|
522
|
+
>
|
|
398
523
|
</foxy-internal-text-control>
|
|
399
524
|
|
|
400
525
|
<foxy-internal-select-control infer="shipping-country" .options=${countryOptions}>
|
|
@@ -567,7 +692,7 @@ export class CartForm extends Base {
|
|
|
567
692
|
}
|
|
568
693
|
__renderTotalOrder(currency, currencyDisplay) {
|
|
569
694
|
const data = this.data;
|
|
570
|
-
if (!data)
|
|
695
|
+
if (!data || !currency || !currencyDisplay)
|
|
571
696
|
return html `--`;
|
|
572
697
|
const options = { amount: `${data.total_order} ${currency}`, currencyDisplay };
|
|
573
698
|
return html `<foxy-i18n infer="totals" key="total_order" .options=${options}></foxy-i18n>`;
|
|
@@ -575,12 +700,13 @@ export class CartForm extends Base {
|
|
|
575
700
|
__renderTotals(currency, currencyDisplay) {
|
|
576
701
|
const keys = ['total_item_price', 'total_shipping', 'total_tax'];
|
|
577
702
|
const data = this.data;
|
|
703
|
+
const isPriceReady = data && currency && currencyDisplay;
|
|
578
704
|
return keys.map(key => {
|
|
579
705
|
const options = { amount: `${data === null || data === void 0 ? void 0 : data[key]} ${currency}`, currencyDisplay };
|
|
580
706
|
return html `
|
|
581
|
-
<div class="flex justify-between text-m text-secondary">
|
|
707
|
+
<div data-testid=${key} class="flex justify-between text-m text-secondary">
|
|
582
708
|
<foxy-i18n key=${key} infer="totals"></foxy-i18n>
|
|
583
|
-
${
|
|
709
|
+
${isPriceReady
|
|
584
710
|
? html `<foxy-i18n infer="totals" key="price" .options=${options}></foxy-i18n>`
|
|
585
711
|
: html `<span>--</span>`}
|
|
586
712
|
</div>
|
|
@@ -589,12 +715,16 @@ export class CartForm extends Base {
|
|
|
589
715
|
}
|
|
590
716
|
__renderDiscounts(currency, currencyDisplay) {
|
|
591
717
|
var _a, _b;
|
|
592
|
-
|
|
718
|
+
const discounts = (_b = (_a = this.__discounts) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b._embedded['fx:discounts'];
|
|
719
|
+
const isPriceReady = currency && currencyDisplay;
|
|
720
|
+
return discounts === null || discounts === void 0 ? void 0 : discounts.map(discount => {
|
|
593
721
|
const options = { amount: `${discount.amount} ${currency}`, currencyDisplay };
|
|
594
722
|
return html `
|
|
595
|
-
<div class="flex justify-between text-m text-secondary">
|
|
723
|
+
<div data-testclass="discount" class="flex justify-between text-m text-secondary">
|
|
596
724
|
<span>${discount.name} • ${discount.code}</span>
|
|
597
|
-
|
|
725
|
+
${isPriceReady
|
|
726
|
+
? html `<foxy-i18n infer="totals" key="price" .options=${options}></foxy-i18n>`
|
|
727
|
+
: html `<span>--</span>`}
|
|
598
728
|
</div>
|
|
599
729
|
`;
|
|
600
730
|
});
|