@foxy.io/elements 1.15.0-beta.1 → 1.15.0-beta.10
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 +2 -2
- package/dist/cdn/foxy-address-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-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -0
- package/dist/cdn/foxy-coupon-code-form.js +1 -0
- package/dist/cdn/foxy-coupon-codes-form.js +1 -0
- package/dist/cdn/foxy-coupon-form.js +1 -0
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -972
- package/dist/cdn/foxy-customer-portal.js +13 -13
- package/dist/cdn/foxy-customer.js +2 -2
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-donation.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 -0
- package/dist/cdn/foxy-gift-card-card.js +1 -0
- package/dist/cdn/foxy-gift-card-code-form.js +1 -0
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -0
- package/dist/cdn/foxy-gift-card-form.js +1 -0
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -0
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -69
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +4 -4
- 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-transaction-card.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/shared-00d6a968.js +1 -0
- package/dist/cdn/shared-023a97c2.js +302 -0
- package/dist/cdn/{shared-91e768be.js → shared-027c537d.js} +1 -1
- package/dist/cdn/{shared-f0a83bd6.js → shared-073cb8e9.js} +1 -1
- package/dist/cdn/{shared-8a7bee0d.js → shared-09c5f9f1.js} +1 -1
- package/dist/cdn/{shared-94b0ae99.js → shared-0f38a631.js} +2 -2
- package/dist/cdn/{shared-200f613b.js → shared-1a67bc75.js} +2 -2
- package/dist/cdn/{shared-34b2c1e2.js → shared-21419f10.js} +1 -1
- package/dist/cdn/{shared-b5147166.js → shared-340f7584.js} +3 -3
- package/dist/cdn/{shared-44cfc617.js → shared-39e3ae67.js} +1 -1
- package/dist/cdn/shared-3f0a9c2c.js +1 -0
- package/dist/cdn/shared-3f965dce.js +1 -0
- package/dist/cdn/{shared-e7f8ffe9.js → shared-448781f9.js} +1 -1
- package/dist/cdn/{shared-1761daef.js → shared-5535f38f.js} +1 -1
- package/dist/cdn/{shared-0ced76a0.js → shared-5a54a9bc.js} +1 -1
- package/dist/cdn/shared-5e2fd1c7.js +1 -0
- package/dist/cdn/{shared-5c8b531d.js → shared-60d43523.js} +1 -1
- package/dist/cdn/shared-625c1272.js +69 -0
- package/dist/cdn/shared-65dfd512.js +131 -0
- package/dist/cdn/{shared-a46edf4b.js → shared-756034e4.js} +1 -1
- package/dist/cdn/{shared-00563cb0.js → shared-7f0a9790.js} +1 -1
- package/dist/cdn/shared-84d2d490.js +1 -0
- package/dist/cdn/{shared-df573cea.js → shared-8b20bc23.js} +0 -0
- package/dist/cdn/shared-8c8a910c.js +1 -0
- package/dist/cdn/{shared-5f54e916.js → shared-9cd49a3e.js} +4 -4
- package/dist/cdn/{shared-7a42073a.js → shared-9fc4a896.js} +1 -1
- package/dist/cdn/{shared-bb824ab4.js → shared-a040d79d.js} +2 -2
- package/dist/cdn/{shared-bc2bfe52.js → shared-ab71552b.js} +1 -1
- package/dist/cdn/shared-ae8cd227.js +1 -0
- package/dist/cdn/{shared-322e60b1.js → shared-ba39823e.js} +1 -1
- package/dist/cdn/shared-d58c947c.js +804 -0
- package/dist/cdn/{shared-593f7e2c.js → shared-df730f90.js} +1 -1
- package/dist/cdn/shared-e55088b4.js +1 -0
- package/dist/cdn/shared-ecfd3539.js +1 -0
- package/dist/cdn/shared-f2a69797.js +1 -0
- package/dist/cdn/{shared-16f72e27.js → shared-f4ad24f4.js} +1 -1
- package/dist/cdn/{shared-ec861f31.js → shared-fab8c705.js} +3 -3
- package/dist/cdn/translations/access-recovery-form/en.json +12 -0
- package/dist/cdn/translations/address-card/en.json +11 -0
- package/dist/cdn/translations/address-form/en.json +27 -0
- package/dist/cdn/translations/applied-tax-card/en.json +9 -0
- package/dist/cdn/translations/attribute-card/en.json +7 -0
- package/dist/cdn/translations/attribute-form/en.json +22 -0
- package/dist/cdn/translations/cancellation-form/en.json +10 -0
- package/dist/cdn/translations/country/pl.json +251 -0
- package/dist/cdn/translations/coupon-card/en.json +36 -0
- package/dist/cdn/translations/coupon-code-form/en.json +17 -0
- package/dist/cdn/translations/coupon-codes-form/en.json +20 -0
- package/dist/cdn/translations/coupon-form/en.json +186 -0
- package/dist/cdn/translations/custom-field-card/en.json +7 -0
- package/dist/cdn/translations/custom-field-form/en.json +19 -0
- package/dist/cdn/translations/customer/en.json +247 -0
- package/dist/cdn/translations/customer-card/en.json +7 -0
- package/dist/cdn/translations/customer-form/en.json +21 -0
- package/dist/cdn/translations/customer-portal/de.json +202 -14
- package/dist/cdn/translations/customer-portal/en.json +202 -14
- package/dist/cdn/translations/customer-portal/es.json +202 -14
- package/dist/cdn/translations/customer-portal/pl.json +223 -0
- package/dist/cdn/translations/customer-portal/zh-hk.json +202 -14
- package/dist/cdn/translations/customers-table/en.json +9 -0
- package/dist/cdn/translations/discount-card/en.json +8 -0
- package/dist/cdn/translations/email-template-form/en.json +25 -0
- package/dist/cdn/translations/error-entry-card/en.json +7 -0
- package/dist/cdn/translations/generate-codes-form/en.json +19 -0
- package/dist/cdn/translations/gift-card-card/en.json +9 -0
- package/dist/cdn/translations/gift-card-code-form/en.json +19 -0
- package/dist/cdn/translations/gift-card-codes-form/en.json +25 -0
- package/dist/cdn/translations/gift-card-form/en.json +314 -0
- package/dist/cdn/translations/pagination/en.json +7 -0
- package/dist/cdn/translations/payment-card/en.json +12 -0
- package/dist/cdn/translations/payment-method-card/en.json +13 -0
- package/dist/cdn/translations/query-builder/en.json +32 -0
- package/dist/cdn/translations/sign-in-form/en.json +21 -0
- package/dist/cdn/translations/spinner/en.json +7 -0
- package/dist/cdn/translations/subscription-card/en.json +26 -0
- package/dist/cdn/translations/subscription-form/en.json +76 -0
- package/dist/cdn/translations/subscriptions-table/en.json +26 -0
- package/dist/cdn/translations/tax-card/en.json +11 -0
- package/dist/cdn/translations/tax-form/en.json +38 -0
- package/dist/cdn/translations/template-config-form/en.json +107 -0
- package/dist/cdn/translations/template-form/en.json +23 -0
- package/dist/cdn/translations/transaction-card/en.json +25 -0
- package/dist/cdn/translations/transactions-table/en.json +22 -0
- package/dist/cdn/translations/user-form/en.json +26 -0
- package/dist/cdn/translations/users-table/en.json +44 -0
- package/dist/elements/private/Checkbox/Checkbox.js +36 -22
- package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
- package/dist/elements/private/Choice/Choice.js +1 -0
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/EditableList/EditableList.d.ts +20 -0
- package/dist/elements/private/EditableList/EditableList.js +124 -0
- package/dist/elements/private/EditableList/EditableList.js.map +1 -0
- package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +7 -6
- package/dist/elements/private/FrequencyInput/FrequencyInput.js +10 -23
- package/dist/elements/private/FrequencyInput/FrequencyInput.js.map +1 -1
- package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js +1 -1
- package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js.map +1 -1
- package/dist/elements/public/AttributeCard/types.d.ts +3 -3
- package/dist/elements/public/AttributeCard/types.js.map +1 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js +2 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
- package/dist/elements/public/AttributeForm/types.d.ts +3 -3
- package/dist/elements/public/AttributeForm/types.js.map +1 -1
- package/dist/elements/public/CollectionPage/CollectionPage.js +3 -1
- package/dist/elements/public/CollectionPage/CollectionPage.js.map +1 -1
- package/dist/elements/public/CollectionPage/types.d.ts +2 -0
- package/dist/elements/public/CollectionPage/types.js.map +1 -1
- package/dist/elements/public/CouponCard/CouponCard.d.ts +29 -0
- package/dist/elements/public/CouponCard/CouponCard.js +131 -0
- package/dist/elements/public/CouponCard/CouponCard.js.map +1 -0
- package/dist/elements/public/CouponCard/index.d.ts +5 -0
- package/dist/elements/public/CouponCard/index.js +7 -0
- package/dist/elements/public/CouponCard/index.js.map +1 -0
- package/dist/elements/public/CouponCard/types.d.ts +15 -0
- package/dist/elements/public/CouponCard/types.js +2 -0
- package/dist/elements/public/CouponCard/types.js.map +1 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.d.ts +45 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +218 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -0
- package/dist/elements/public/CouponCodeForm/index.d.ts +8 -0
- package/dist/elements/public/CouponCodeForm/index.js +10 -0
- package/dist/elements/public/CouponCodeForm/index.js.map +1 -0
- package/dist/elements/public/CouponCodeForm/types.d.ts +15 -0
- package/dist/elements/public/CouponCodeForm/types.js +2 -0
- package/dist/elements/public/CouponCodeForm/types.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.d.ts +31 -0
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +218 -0
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/index.d.ts +8 -0
- package/dist/elements/public/CouponCodesForm/index.js +12 -0
- package/dist/elements/public/CouponCodesForm/index.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.d.ts +14 -0
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js +48 -0
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/types.d.ts +17 -0
- package/dist/elements/public/CouponCodesForm/types.js +2 -0
- package/dist/elements/public/CouponCodesForm/types.js.map +1 -0
- package/dist/elements/public/CouponForm/CouponForm.d.ts +77 -0
- package/dist/elements/public/CouponForm/CouponForm.js +1301 -0
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -0
- package/dist/elements/public/CouponForm/index.d.ts +19 -0
- package/dist/elements/public/CouponForm/index.js +21 -0
- package/dist/elements/public/CouponForm/index.js.map +1 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +20 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +99 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +18 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +50 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +18 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +53 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -0
- package/dist/elements/public/CouponForm/types.d.ts +27 -0
- package/dist/elements/public/CouponForm/types.js +2 -0
- package/dist/elements/public/CouponForm/types.js.map +1 -0
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +2 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
- package/dist/elements/public/Customer/Customer.js +1 -1
- package/dist/elements/public/Customer/Customer.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +25 -8
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +20 -6
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +2 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.d.ts +43 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +249 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -0
- package/dist/elements/public/GenerateCodesForm/index.d.ts +8 -0
- package/dist/elements/public/GenerateCodesForm/index.js +10 -0
- package/dist/elements/public/GenerateCodesForm/index.js.map +1 -0
- package/dist/elements/public/GenerateCodesForm/types.d.ts +24 -0
- package/dist/elements/public/GenerateCodesForm/types.js +2 -0
- package/dist/elements/public/GenerateCodesForm/types.js.map +1 -0
- package/dist/elements/public/GiftCardCard/GiftCardCard.d.ts +26 -0
- package/dist/elements/public/GiftCardCard/GiftCardCard.js +95 -0
- package/dist/elements/public/GiftCardCard/GiftCardCard.js.map +1 -0
- package/dist/elements/public/GiftCardCard/index.d.ts +5 -0
- package/dist/elements/public/GiftCardCard/index.js +7 -0
- package/dist/elements/public/GiftCardCard/index.js.map +1 -0
- package/dist/elements/public/GiftCardCard/types.d.ts +11 -0
- package/dist/elements/public/GiftCardCard/types.js +2 -0
- package/dist/elements/public/GiftCardCard/types.js.map +1 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +55 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +292 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -0
- package/dist/elements/public/GiftCardCodeForm/index.d.ts +10 -0
- package/dist/elements/public/GiftCardCodeForm/index.js +12 -0
- package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -0
- package/dist/elements/public/GiftCardCodeForm/types.d.ts +19 -0
- package/dist/elements/public/GiftCardCodeForm/types.js +2 -0
- package/dist/elements/public/GiftCardCodeForm/types.js.map +1 -0
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.d.ts +37 -0
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js +264 -0
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js.map +1 -0
- package/dist/elements/public/GiftCardCodesForm/index.d.ts +9 -0
- package/dist/elements/public/GiftCardCodesForm/index.js +13 -0
- package/dist/elements/public/GiftCardCodesForm/index.js.map +1 -0
- package/dist/elements/public/GiftCardCodesForm/internal/InternalGiftCardCodesFormListItem.d.ts +19 -0
- package/dist/elements/public/GiftCardCodesForm/internal/InternalGiftCardCodesFormListItem.js +48 -0
- package/dist/elements/public/GiftCardCodesForm/internal/InternalGiftCardCodesFormListItem.js.map +1 -0
- package/dist/elements/public/GiftCardCodesForm/types.d.ts +17 -0
- package/dist/elements/public/GiftCardCodesForm/types.js +2 -0
- package/dist/elements/public/GiftCardCodesForm/types.js.map +1 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.d.ts +67 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +684 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -0
- package/dist/elements/public/GiftCardForm/currencies.d.ts +1 -0
- package/dist/elements/public/GiftCardForm/currencies.js +173 -0
- package/dist/elements/public/GiftCardForm/currencies.js.map +1 -0
- package/dist/elements/public/GiftCardForm/index.d.ts +18 -0
- package/dist/elements/public/GiftCardForm/index.js +20 -0
- package/dist/elements/public/GiftCardForm/index.js.map +1 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.d.ts +20 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js +99 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js.map +1 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.d.ts +18 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js +50 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js.map +1 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.d.ts +18 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js +53 -0
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js.map +1 -0
- package/dist/elements/public/GiftCardForm/types.d.ts +28 -0
- package/dist/elements/public/GiftCardForm/types.js +2 -0
- package/dist/elements/public/GiftCardForm/types.js.map +1 -0
- package/dist/elements/public/I18n/I18n.js +1 -1
- package/dist/elements/public/I18n/I18n.js.map +1 -1
- package/dist/elements/public/I18n/format/date.js +7 -6
- package/dist/elements/public/I18n/format/date.js.map +1 -1
- package/dist/elements/public/I18n/format/discount.d.ts +6 -0
- package/dist/elements/public/I18n/format/discount.js +20 -0
- package/dist/elements/public/I18n/format/discount.js.map +1 -0
- package/dist/elements/public/I18n/format/index.js +6 -0
- package/dist/elements/public/I18n/format/index.js.map +1 -1
- package/dist/elements/public/I18n/format/ordinal.d.ts +6 -0
- package/dist/elements/public/I18n/format/ordinal.js +9 -0
- package/dist/elements/public/I18n/format/ordinal.js.map +1 -0
- package/dist/elements/public/I18n/format/relative.d.ts +6 -0
- package/dist/elements/public/I18n/format/relative.js +15 -0
- package/dist/elements/public/I18n/format/relative.js.map +1 -0
- package/dist/elements/public/NucleonElement/NucleonElement.js +4 -4
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/Pagination/Pagination.d.ts +37 -0
- package/dist/elements/public/Pagination/Pagination.js +158 -0
- package/dist/elements/public/Pagination/Pagination.js.map +1 -0
- package/dist/elements/public/Pagination/index.d.ts +6 -0
- package/dist/elements/public/Pagination/index.js +8 -0
- package/dist/elements/public/Pagination/index.js.map +1 -0
- package/dist/elements/public/SignInForm/SignInForm.js +1 -1
- package/dist/elements/public/SignInForm/SignInForm.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/Table/Table.js +20 -5
- package/dist/elements/public/Table/Table.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +16 -14
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
- package/dist/elements/public/UserForm/UserForm.js +2 -1
- package/dist/elements/public/UserForm/UserForm.js.map +1 -1
- package/dist/elements/public/UsersTable/UsersTable.d.ts +5 -1
- package/dist/elements/public/UsersTable/UsersTable.js +2 -1
- package/dist/elements/public/UsersTable/UsersTable.js.map +1 -1
- package/dist/elements/public/index.d.ts +10 -0
- package/dist/elements/public/index.defined.d.ts +10 -0
- package/dist/elements/public/index.defined.js +10 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +10 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +96 -4
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/mixins/translatable.js +1 -1
- package/dist/mixins/translatable.js.map +1 -1
- package/dist/utils/parse-duration.d.ts +1 -1
- package/dist/utils/parse-duration.js +7 -3
- package/dist/utils/parse-duration.js.map +1 -1
- package/package.json +3 -3
- package/dist/cdn/shared-07abcd7b.js +0 -1
- package/dist/cdn/shared-35dbd2c5.js +0 -1
- package/dist/cdn/shared-6b7602c7.js +0 -1
- package/dist/cdn/shared-87ca7818.js +0 -1
- package/dist/cdn/shared-9a40309d.js +0 -1
- package/dist/cdn/shared-ce1da35d.js +0 -1
- package/dist/cdn/shared-d01d809a.js +0 -1
- package/dist/cdn/shared-d8ffb279.js +0 -264
- package/dist/cdn/shared-e5cbf291.js +0 -1
- package/dist/cdn/shared-f1dc1c6c.js +0 -1
- package/dist/cdn/translations/shared/de.json +0 -271
- package/dist/cdn/translations/shared/en.json +0 -272
- package/dist/cdn/translations/shared/es.json +0 -272
|
@@ -171,6 +171,7 @@ export class CustomFieldForm extends Base {
|
|
|
171
171
|
];
|
|
172
172
|
}
|
|
173
173
|
render() {
|
|
174
|
+
var _a, _b;
|
|
174
175
|
const { hiddenSelector, data, lang, ns } = this;
|
|
175
176
|
const isBusy = this.in('busy');
|
|
176
177
|
const isFail = this.in('fail');
|
|
@@ -211,7 +212,7 @@ export class CustomFieldForm extends Base {
|
|
|
211
212
|
class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l"
|
|
212
213
|
state=${isFail ? 'error' : isBusy ? 'busy' : 'empty'}
|
|
213
214
|
lang=${lang}
|
|
214
|
-
ns
|
|
215
|
+
ns="${ns} ${(_b = (_a = customElements.get('foxy-spinner')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
215
216
|
>
|
|
216
217
|
</foxy-spinner>
|
|
217
218
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFieldForm.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomFieldForm/CustomFieldForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,aAAa,EAAE,+BAA4B;AACpD,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,MAAM,EAAE,GAAG,mBAAmB,CAAC;AAC/B,MAAM,IAAI,GAAG,iBAAiB,CAC5B,iBAAiB,CAAC,cAAc,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC,EACtE,EAAE,CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,eAAgB,SAAQ,IAAU;IAA/C;;QAuBE,cAAS,GAAc,EAAE,CAAC;QAET,mBAAc,GAAG,OAAO,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,EAAE;YACjE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEc,gBAAW,GAAG,OAAO,CAAC,CAAC,GAAe,EAAE,EAAE;YACzD,OAAO,CAAC,GAAgB,EAAE,EAAE;gBAC1B,MA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AAiB,CAAC,MAAc;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9D,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,CAAC;IAEO,eAAe,CAAC,GAAkB;QACxC,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IAEO,mBAAmB,CAAC,GAAU;QACpC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,aAA4B,CAAC,CAAC;IAC9D,CAAC;IAEO,mBAAmB,CAAC,GAAoB;QAC9C,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import { Data, Templates, TextFieldParams } from './types';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { CheckboxElement } from '@vaadin/vaadin-checkbox';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyTable } from '../../private/index';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport memoize from 'lodash-es/memoize';\n\nconst NS = 'custom-field-form';\nconst Base = TranslatableMixin(\n ConfigurableMixin(ThemeableMixin(ScopedElementsMixin(NucleonElement))),\n NS\n);\n\n/**\n * Form element for creating or editing custom fields.\n *\n * @slot name:before\n * @slot name:after\n * @slot value:before\n * @slot value:after\n * @slot visibility:before\n * @slot visibility:after\n * @slot timestamps:before\n * @slot timestamps:after\n * @slot create:before\n * @slot create:after\n * @slot delete:before\n * @slot delete:after\n *\n * @element foxy-custom-field-form\n * @since 1.11.0\n */\nexport class CustomFieldForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-checkbox': customElements.get('vaadin-checkbox'),\n 'x-property-table': PropertyTable,\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ value }) => (value && value.length > 0) || 'value_required',\n ({ value }) => (value && value.length <= 1000) || 'value_too_long',\n ({ name }) => (name && name.length > 0) || 'name_required',\n ({ name }) => (name && name.length <= 500) || 'name_too_long',\n ];\n }\n\n templates: Templates = {};\n\n private readonly __getValidator = memoize((prefix: string) => () => {\n return !this.errors.some(err => err.startsWith(prefix));\n });\n\n private readonly __bindField = memoize((key: keyof Data) => {\n return (evt: CustomEvent) => {\n const target = evt.target as HTMLInputElement;\n this.edit({ [key]: target.value });\n };\n });\n\n private readonly __maybeRenderTextField = ({ field }: TextFieldParams) => {\n const bsid = field.replace(/_/, '-');\n if (this.hiddenSelector.matches(bsid)) return '';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${bsid}:before`)}\n\n <vaadin-text-field\n class=\"w-full\"\n label=${this.t(field).toString()}\n value=${ifDefined(this.form?.[field]?.toString())}\n error-message=${this.__getErrorMessage(field)}\n data-testid=${field}\n .checkValidity=${this.__getValidator(field)}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches(bsid)}\n ?readonly=${this.readonlySelector.matches(bsid)}\n @input=${this.__bindField(field)}\n @keydown=${this.__handleKeyDown}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot(`${bsid}:after`)}\n </div>\n `;\n };\n\n private readonly __renderVisibility = () => {\n const { disabledSelector, form, lang, ns } = this;\n const isDisabled = !this.in('idle') || disabledSelector.matches('visibility', true);\n\n return html`\n <div data-testid=\"visibility\">\n ${this.renderTemplateOrSlot('visibility:before')}\n\n <vaadin-checkbox\n ?disabled=${isDisabled}\n ?checked=${!form.is_hidden}\n @change=${(evt: CustomEvent) => {\n const checkbox = evt.currentTarget as CheckboxElement;\n this.edit({ is_hidden: !checkbox.checked });\n }}\n >\n <foxy-i18n lang=${lang} key=\"show_on_receipt\" ns=${ns}></foxy-i18n>\n </vaadin-checkbox>\n\n ${this.renderTemplateOrSlot('visibility:after')}\n </div>\n `;\n };\n\n private readonly __renderTimestamps = () => {\n const items = (['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }));\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n <x-property-table .items=${items} data-testid=\"timestamps\"></x-property-table>\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n };\n\n private readonly __renderDelete = () => {\n return html`\n <div>\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n class=\"w-full\"\n data-testid=\"delete\"\n theme=\"error primary\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}\n @click=${this.__handleDeleteClick}\n >\n <foxy-i18n ns=${this.ns} lang=${this.lang} key=\"delete\"></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n };\n\n private readonly __renderCreate = () => {\n const isTemplateValid = this.in({ idle: { template: { dirty: 'valid' } } });\n const isSnapshotValid = this.in({ idle: { snapshot: { dirty: 'valid' } } });\n const isValid = isTemplateValid || isSnapshotValid;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('create:before')}\n\n <vaadin-button\n data-testid=\"create\"\n class=\"w-full\"\n theme=\"success primary\"\n ?disabled=${!this.in('idle') || !isValid || this.disabledSelector.matches('create', true)}\n @click=${() => this.submit()}\n >\n <foxy-i18n ns=${this.ns} lang=${this.lang} key=\"create\"></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n const { hiddenSelector, data, lang, ns } = this;\n const isBusy = this.in('busy');\n const isFail = this.in('fail');\n\n return html`\n <foxy-internal-confirm-dialog\n data-testid=\"confirm\"\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${lang}\n ns=${ns}\n id=\"confirm\"\n @hide=${this.__handleConfirmHide}\n >\n </foxy-internal-confirm-dialog>\n\n <div class=\"relative\" aria-busy=${this.in('busy')} aria-live=\"polite\">\n <div class=\"grid grid-cols-1 gap-l\">\n ${this.__maybeRenderTextField({ field: 'name' })}\n ${this.__maybeRenderTextField({ field: 'value' })}\n ${hiddenSelector.matches('visibility', true) ? '' : this.__renderVisibility()}\n ${hiddenSelector.matches('timestamps', true) || !data ? '' : this.__renderTimestamps()}\n ${hiddenSelector.matches('delete', true) || !data ? '' : this.__renderDelete()}\n ${hiddenSelector.matches('create', true) || data ? '' : this.__renderCreate()}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !isBusy && !isFail,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${isFail ? 'error' : isBusy ? 'busy' : 'empty'}\n lang=${lang}\n ns=${ns}\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.__bindField.cache.clear?.();\n this.__getValidator.cache.clear?.();\n }\n\n private get __confirmDialog(): InternalConfirmDialog {\n return this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n }\n\n private __getErrorMessage(prefix: string) {\n const error = this.errors.find(err => err.startsWith(prefix));\n return error ? this.t(error.replace(prefix, 'v8n')).toString() : '';\n }\n\n private __handleKeyDown(evt: KeyboardEvent) {\n if (evt.key === 'Enter') this.submit();\n }\n\n private __handleDeleteClick(evt: Event) {\n this.__confirmDialog.show(evt.currentTarget as HTMLElement);\n }\n\n private __handleConfirmHide(evt: DialogHideEvent) {\n if (!evt.detail.cancelled) this.delete();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CustomFieldForm.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomFieldForm/CustomFieldForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,aAAa,EAAE,+BAA4B;AACpD,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,MAAM,EAAE,GAAG,mBAAmB,CAAC;AAC/B,MAAM,IAAI,GAAG,iBAAiB,CAC5B,iBAAiB,CAAC,cAAc,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC,EACtE,EAAE,CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AAC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from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { CheckboxElement } from '@vaadin/vaadin-checkbox';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyTable } from '../../private/index';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport memoize from 'lodash-es/memoize';\n\nconst NS = 'custom-field-form';\nconst Base = TranslatableMixin(\n ConfigurableMixin(ThemeableMixin(ScopedElementsMixin(NucleonElement))),\n NS\n);\n\n/**\n * Form element for creating or editing custom fields.\n *\n * @slot name:before\n * @slot name:after\n * @slot value:before\n * @slot value:after\n * @slot visibility:before\n * @slot visibility:after\n * @slot timestamps:before\n * @slot timestamps:after\n * @slot create:before\n * @slot create:after\n * @slot delete:before\n * @slot delete:after\n *\n * @element foxy-custom-field-form\n * @since 1.11.0\n */\nexport class CustomFieldForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-checkbox': customElements.get('vaadin-checkbox'),\n 'x-property-table': PropertyTable,\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ value }) => (value && value.length > 0) || 'value_required',\n ({ value }) => (value && value.length <= 1000) || 'value_too_long',\n ({ name }) => (name && name.length > 0) || 'name_required',\n ({ name }) => (name && name.length <= 500) || 'name_too_long',\n ];\n }\n\n templates: Templates = {};\n\n private readonly __getValidator = memoize((prefix: string) => () => {\n return !this.errors.some(err => err.startsWith(prefix));\n });\n\n private readonly __bindField = memoize((key: keyof Data) => {\n return (evt: CustomEvent) => {\n const target = evt.target as HTMLInputElement;\n this.edit({ [key]: target.value });\n };\n });\n\n private readonly __maybeRenderTextField = ({ field }: TextFieldParams) => {\n const bsid = field.replace(/_/, '-');\n if (this.hiddenSelector.matches(bsid)) return '';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${bsid}:before`)}\n\n <vaadin-text-field\n class=\"w-full\"\n label=${this.t(field).toString()}\n value=${ifDefined(this.form?.[field]?.toString())}\n error-message=${this.__getErrorMessage(field)}\n data-testid=${field}\n .checkValidity=${this.__getValidator(field)}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches(bsid)}\n ?readonly=${this.readonlySelector.matches(bsid)}\n @input=${this.__bindField(field)}\n @keydown=${this.__handleKeyDown}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot(`${bsid}:after`)}\n </div>\n `;\n };\n\n private readonly __renderVisibility = () => {\n const { disabledSelector, form, lang, ns } = this;\n const isDisabled = !this.in('idle') || disabledSelector.matches('visibility', true);\n\n return html`\n <div data-testid=\"visibility\">\n ${this.renderTemplateOrSlot('visibility:before')}\n\n <vaadin-checkbox\n ?disabled=${isDisabled}\n ?checked=${!form.is_hidden}\n @change=${(evt: CustomEvent) => {\n const checkbox = evt.currentTarget as CheckboxElement;\n this.edit({ is_hidden: !checkbox.checked });\n }}\n >\n <foxy-i18n lang=${lang} key=\"show_on_receipt\" ns=${ns}></foxy-i18n>\n </vaadin-checkbox>\n\n ${this.renderTemplateOrSlot('visibility:after')}\n </div>\n `;\n };\n\n private readonly __renderTimestamps = () => {\n const items = (['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }));\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n <x-property-table .items=${items} data-testid=\"timestamps\"></x-property-table>\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n };\n\n private readonly __renderDelete = () => {\n return html`\n <div>\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n class=\"w-full\"\n data-testid=\"delete\"\n theme=\"error primary\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}\n @click=${this.__handleDeleteClick}\n >\n <foxy-i18n ns=${this.ns} lang=${this.lang} key=\"delete\"></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n };\n\n private readonly __renderCreate = () => {\n const isTemplateValid = this.in({ idle: { template: { dirty: 'valid' } } });\n const isSnapshotValid = this.in({ idle: { snapshot: { dirty: 'valid' } } });\n const isValid = isTemplateValid || isSnapshotValid;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('create:before')}\n\n <vaadin-button\n data-testid=\"create\"\n class=\"w-full\"\n theme=\"success primary\"\n ?disabled=${!this.in('idle') || !isValid || this.disabledSelector.matches('create', true)}\n @click=${() => this.submit()}\n >\n <foxy-i18n ns=${this.ns} lang=${this.lang} key=\"create\"></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n const { hiddenSelector, data, lang, ns } = this;\n const isBusy = this.in('busy');\n const isFail = this.in('fail');\n\n return html`\n <foxy-internal-confirm-dialog\n data-testid=\"confirm\"\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${lang}\n ns=${ns}\n id=\"confirm\"\n @hide=${this.__handleConfirmHide}\n >\n </foxy-internal-confirm-dialog>\n\n <div class=\"relative\" aria-busy=${this.in('busy')} aria-live=\"polite\">\n <div class=\"grid grid-cols-1 gap-l\">\n ${this.__maybeRenderTextField({ field: 'name' })}\n ${this.__maybeRenderTextField({ field: 'value' })}\n ${hiddenSelector.matches('visibility', true) ? '' : this.__renderVisibility()}\n ${hiddenSelector.matches('timestamps', true) || !data ? '' : this.__renderTimestamps()}\n ${hiddenSelector.matches('delete', true) || !data ? '' : this.__renderDelete()}\n ${hiddenSelector.matches('create', true) || data ? '' : this.__renderCreate()}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !isBusy && !isFail,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${isFail ? 'error' : isBusy ? 'busy' : 'empty'}\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.__bindField.cache.clear?.();\n this.__getValidator.cache.clear?.();\n }\n\n private get __confirmDialog(): InternalConfirmDialog {\n return this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n }\n\n private __getErrorMessage(prefix: string) {\n const error = this.errors.find(err => err.startsWith(prefix));\n return error ? this.t(error.replace(prefix, 'v8n')).toString() : '';\n }\n\n private __handleKeyDown(evt: KeyboardEvent) {\n if (evt.key === 'Enter') this.submit();\n }\n\n private __handleDeleteClick(evt: Event) {\n this.__confirmDialog.show(evt.currentTarget as HTMLElement);\n }\n\n private __handleConfirmHide(evt: DialogHideEvent) {\n if (!evt.detail.cancelled) this.delete();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Customer.js","sourceRoot":"","sources":["../../../../src/elements/public/Customer/Customer.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,IAAI,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAKlF,OAAO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AAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,EAAE;YACpF,cAAc,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC3E,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;;;;;kBAK1C,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,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;mBACtD,IAAI;kBACL,EAAE,IAAI,YAAA,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,SAAS,mCAAI,EAAE;;;;;KAKtE,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Attributes, CustomerAddresses, Data, Tab, Templates } from './types';\nimport { CSSResultArray, TemplateResult, html } from 'lit-element';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { Data as Attribute } from '../AttributeCard/types';\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { Column } from '../Table/types';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { Data as CustomerAddress } from '../AddressCard/types';\nimport { FormDialog } from '../FormDialog/FormDialog';\nimport { Group } from '../../private/index';\nimport { ItemRenderer } from '../CollectionPage/types';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PageRenderer } from '../CollectionPages/types';\nimport { Skeleton } from '../../private/Skeleton/Skeleton';\nimport { Data as Subscriptions } from '../SubscriptionsTable/types';\nimport { SubscriptionsTable } from '../SubscriptionsTable/SubscriptionsTable';\nimport { Tabs } from '../../private/Tabs/Tabs';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { styles } from './styles';\n\nconst NS = 'customer';\nconst Base = ScopedElementsMixin(\n ConfigurableMixin(ThemeableMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * All-in-one element for customer management.\n *\n * @slot header:before - **new in v1.4.0**\n * @slot header:after - **new in v1.4.0**\n * @slot header:actions:before - **new in v1.4.0**\n * @slot header:actions:after - **new in v1.4.0**\n * @slot header:actions:edit:before - **new in v1.4.0**\n * @slot header:actions:edit:after - **new in v1.4.0**\n *\n * @slot addresses:before - **new in v1.4.0**\n * @slot addresses:after - **new in v1.4.0**\n * @slot addresses:actions:before - **new in v1.4.0**\n * @slot addresses:actions:after - **new in v1.4.0**\n * @slot addresses:actions:create:before - **new in v1.4.0**\n * @slot addresses:actions:create:after - **new in v1.4.0**\n * @slot addresses:list:before - **new in v1.4.0**\n * @slot addresses:list:after - **new in v1.4.0**\n *\n * @slot payment-methods:before - **new in v1.4.0**\n * @slot payment-methods:after - **new in v1.4.0**\n * @slot payment-methods:list:before - **new in v1.4.0**\n * @slot payment-methods:list:after - **new in v1.4.0**\n *\n * @slot attributes:before - **new in v1.4.0**\n * @slot attributes:after - **new in v1.4.0**\n * @slot attributes:actions:before - **new in v1.4.0**\n * @slot attributes:actions:after - **new in v1.4.0**\n * @slot attributes:actions:create:before - **new in v1.4.0**\n * @slot attributes:actions:create:after - **new in v1.4.0**\n * @slot attributes:list:before - **new in v1.4.0**\n * @slot attributes:list:after - **new in v1.4.0**\n *\n * @slot transactions:before - **new in v1.4.0**\n * @slot transactions:after - **new in v1.4.0**\n *\n * @slot subscriptions:before - **new in v1.4.0**\n * @slot subscriptions:after - **new in v1.4.0**\n *\n * @element foxy-customer\n * @since 1.2.0\n */\nexport class Customer extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-payment-method-card': customElements.get('foxy-payment-method-card'),\n 'foxy-transactions-table': customElements.get('foxy-transactions-table'),\n 'foxy-collection-pages': customElements.get('foxy-collection-pages'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-attribute-card': customElements.get('foxy-attribute-card'),\n 'foxy-address-card': customElements.get('foxy-address-card'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-table': customElements.get('foxy-table'),\n 'x-skeleton': Skeleton,\n 'iron-icon': customElements.get('iron-icon'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'x-group': Group,\n 'x-tabs': Tabs,\n };\n }\n\n static get styles(): CSSResultArray {\n return [super.styles, styles];\n }\n\n templates: Templates = {};\n\n // #region header\n\n private readonly __renderHeaderActionsEdit = () => {\n const { readonlySelector, disabledSelector, hiddenSelector } = this;\n\n const actionId = 'header:actions:edit';\n const formId = 'header:actions:edit:form';\n const dialogId = 'customer-dialog';\n\n const isLoaded = this.in({ idle: 'snapshot' });\n const isEditActionDisabled = !isLoaded || disabledSelector.matches(actionId, true);\n\n return html`\n ${this.renderTemplateOrSlot('header:actions:edit:before')}\n\n <foxy-form-dialog\n data-testid=\"header:actions:edit:form\"\n header=\"update\"\n parent=${this.parent}\n group=${this.group}\n href=${this.href}\n form=\"foxy-customer-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=${dialogId}\n readonlycontrols=${readonlySelector.zoom(formId).toString()}\n disabledcontrols=${disabledSelector.zoom(formId).toString()}\n hiddencontrols=${hiddenSelector.zoom(formId).toString()}\n .templates=${this.getNestedTemplates('header:actions:edit:form')}\n >\n </foxy-form-dialog>\n\n <vaadin-button\n data-testid=\"header:actions:edit\"\n aria-label=${this.t('update').toString()}\n class=\"px-xs rounded-full\"\n theme=\"icon\"\n ?disabled=${isEditActionDisabled}\n @click=${(evt: Event) => {\n const dialog = this.renderRoot.querySelector(`#${dialogId}`) as FormDialog;\n dialog.show(evt.currentTarget as HTMLElement);\n }}\n >\n <iron-icon icon=\"editor:mode-edit\"></iron-icon>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('header:actions:edit:after')}\n `;\n };\n\n private readonly __renderHeaderActions = () => {\n const hiddenSelector = this.hiddenSelector.zoom('header:actions');\n\n return html`\n <div class=\"flex\" data-testid=\"header:actions\">\n ${this.renderTemplateOrSlot('header:actions:before')}\n ${hiddenSelector.matches('edit', true) ? '' : this.__renderHeaderActionsEdit()}\n ${this.renderTemplateOrSlot('header:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderHeader = () => {\n const variant = ifDefined(this.in('busy') ? undefined : 'static');\n\n return html`\n ${this.renderTemplateOrSlot('header:before')}\n\n <header\n class=\"flex items-center justify-between space-x-m pb-s border-b border-contrast-10\"\n data-testid=\"header\"\n >\n <h1 class=\"text-xxl font-bold truncate min-w-0 flex-1\">\n ${this.in({ idle: 'snapshot' })\n ? html`${this.data.first_name} ${this.data.last_name}`\n : html`<x-skeleton class=\"w-full\" variant=${variant}> </x-skeleton>`}\n </h1>\n\n ${this.hiddenSelector.matches('header:actions', true) ? '' : this.__renderHeaderActions()}\n </header>\n\n ${this.renderTemplateOrSlot('header:after')}\n `;\n };\n\n // #endregion\n\n // #region addresses\n\n private readonly __renderAddressesActionsCreate = () => {\n const { data, lang, ns } = this;\n\n const disabledSelector = this.disabledSelector.zoom('addresses:actions');\n const readonlySelector = this.readonlySelector.zoom('addresses:actions');\n const hiddenSelector = this.hiddenSelector.zoom('addresses:actions');\n\n const isLoaded = this.in({ idle: 'snapshot' });\n const isDisabled = !isLoaded || disabledSelector.matches('create', true);\n\n return html`\n ${this.renderTemplateOrSlot('addresses:actions:create:before')}\n\n <vaadin-button\n data-testid=\"addresses:actions:create\"\n aria-label=${this.t('create').toString()}\n class=\"px-xs rounded-full\"\n theme=\"small icon\"\n ?disabled=${isDisabled}\n @click=${(evt: Event) => {\n if (data === null) return;\n const button = evt.target as HTMLButtonElement;\n const dialog = button.firstElementChild as FormDialog;\n dialog.show(button);\n }}\n >\n <foxy-form-dialog\n readonlycontrols=${readonlySelector.zoom('create:form').toString()}\n disabledcontrols=${disabledSelector.zoom('create:form').toString()}\n hiddencontrols=${hiddenSelector.zoom('create:form').toString()}\n data-testid=\"addresses:actions:create:form\"\n parent=${data?._links['fx:customer_addresses'].href ?? ''}\n header=\"create\"\n group=${this.group}\n form=\"foxy-address-form\"\n lang=${lang}\n ns=${ns}\n id=\"address-dialog\"\n .templates=${this.getNestedTemplates('addresses:actions:create:form')}\n >\n </foxy-form-dialog>\n\n <iron-icon slot=\"suffix\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('addresses:actions:create:after')}\n `;\n };\n\n private readonly __renderAddressesActions = () => {\n const hiddenSelector = this.hiddenSelector.zoom('addresses:actions');\n\n return html`\n <div data-testid=\"addresses:actions\">\n ${this.renderTemplateOrSlot('addresses:actions:before')}\n ${hiddenSelector.matches('create', true) ? '' : this.__renderAddressesActionsCreate()}\n ${this.renderTemplateOrSlot('addresses:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderAddressesListCard: ItemRenderer<CustomerAddress> = ctx => {\n const handleClick = (evt: Event) => {\n if (ctx.data === null) return;\n\n const button = evt.target as HTMLButtonElement;\n const root = button.getRootNode() as Element | DocumentFragment;\n const form = root.querySelector('#addresses-list-form') as FormDialog;\n\n form.href = ctx.data._links.self.href;\n form.show(button);\n };\n\n const computedClass = classMap({\n 'snap-start text-left p-m rounded-t-l rounded-b-l flex-shrink-0': true,\n 'border border-contrast-10': true,\n 'hover-border-contrast-30 focus-outline-none focus-border-primary': ctx.data !== null,\n });\n\n const isReadonly = this.readonlySelector.matches('addresses:list:card', true);\n const isDisabled = this.disabledSelector.matches('addresses:list:card', true);\n\n return html`\n <button\n data-testclass=\"addresses:list:card\"\n class=${computedClass}\n ?disabled=${!ctx.data || isReadonly || isDisabled}\n @click=${handleClick}\n >\n <foxy-address-card\n hiddencontrols=${ctx.hiddenControls.toString()}\n parent=${ctx.parent}\n class=\"w-tile\"\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=\"${ctx.ns} ${customElements.get('foxy-address-card')?.defaultNS ?? ''}\"\n .templates=${ctx.templates}\n >\n </foxy-address-card>\n </button>\n `;\n };\n\n private readonly __renderAddressesListPage: PageRenderer<CustomerAddresses> = ctx => {\n return ctx.html`\n <foxy-collection-page\n hiddencontrols=${ctx.hiddenControls.toString()}\n class=\"space-x-m flex\"\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=${ctx.ns}\n .item=${this.__renderAddressesListCard}\n .templates=${ctx.templates}\n >\n </foxy-collection-page>\n `;\n };\n\n private readonly __renderAddressesList = () => {\n const formId = 'addresses:list:form';\n const cardId = 'addresses:list:card';\n\n return html`\n ${this.renderTemplateOrSlot('addresses:list:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom(formId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(formId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(formId).toString()}\n data-testid=\"addresses:list:form\"\n parent=${this.data?._links['fx:customer_addresses'].href ?? ''}\n header=\"update\"\n group=${this.group}\n form=\"foxy-address-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"addresses-list-form\"\n .templates=${this.getNestedTemplates(formId)}\n >\n </foxy-form-dialog>\n\n <foxy-collection-pages\n hiddencontrols=${this.hiddenSelector.zoom(cardId).toString()}\n data-testid=\"addresses:list\"\n first=${this.data?._links['fx:customer_addresses'].href ?? ''}\n class=\"snap-x-mandatory flex items-center space-x-m overflow-auto\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n .page=${this.__renderAddressesListPage}\n .templates=${this.getNestedTemplates(cardId)}\n >\n </foxy-collection-pages>\n\n ${this.renderTemplateOrSlot('addresses:list:after')}\n `;\n };\n\n private readonly __renderAddresses = () => {\n const { lang, ns } = this;\n const hiddenSelector = this.hiddenSelector.zoom('addresses');\n\n return html`\n ${this.renderTemplateOrSlot('addresses:before')}\n\n <section class=\"pt-m\" data-testid=\"addresses\">\n <header class=\"space-x-m flex items-center mb-s\">\n <h2 class=\"text-l font-semibold\">\n <foxy-i18n ns=${ns} lang=${lang} key=\"address_plural\"></foxy-i18n>\n </h2>\n\n ${hiddenSelector.matches('actions', true) ? '' : this.__renderAddressesActions()}\n </header>\n\n ${hiddenSelector.matches('list', true) ? '' : this.__renderAddressesList()}\n </section>\n\n ${this.renderTemplateOrSlot('addresses:after')}\n `;\n };\n\n // #endregion\n\n // #region payment-methods\n\n private readonly __renderPaymentMethodsList = () => {\n const cardId = 'payment-methods:list:card';\n\n return html`\n <div data-testid=\"payment-methods:list\">\n ${this.renderTemplateOrSlot('payment-methods:list:before')}\n\n <foxy-payment-method-card\n readonlycontrols=${this.readonlySelector.zoom(cardId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(cardId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(cardId).toString()}\n data-testid=${cardId}\n group=${this.group}\n class=\"w-payment-method-card border-radius-overflow-fix rounded-t-l rounded-b-l overflow-hidden\"\n href=${this.data?._links['fx:default_payment_method'].href ?? ''}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-payment-method-card')?.defaultNS ?? ''}\"\n .templates=${this.getNestedTemplates(cardId)}\n >\n </foxy-payment-method-card>\n\n ${this.renderTemplateOrSlot('payment-methods:list:after')}\n </div>\n `;\n };\n\n private readonly __renderPaymentMethods = () => {\n const hiddenSelector = this.hiddenSelector.zoom('payment-methods');\n\n return html`\n ${this.renderTemplateOrSlot('payment-methods:before')}\n\n <div class=\"pt-m\" data-testid=\"payment-methods\">\n <h2 class=\"text-l font-semibold mb-s\">\n <foxy-i18n\n data-testclass=\"i18n\"\n lang=${this.lang}\n key=\"payment_method_plural\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </h2>\n\n ${hiddenSelector.matches('list', true) ? '' : this.__renderPaymentMethodsList()}\n </div>\n\n ${this.renderTemplateOrSlot('payment-methods:after')}\n `;\n };\n\n // #endregion\n\n // #region attributes\n\n private readonly __renderAttributesActionsCreate = () => {\n const { data, lang, ns } = this;\n\n const disabledSelector = this.disabledSelector.zoom('attributes:actions');\n const readonlySelector = this.readonlySelector.zoom('attributes:actions');\n const hiddenSelector = this.hiddenSelector.zoom('attributes:actions');\n\n const isLoaded = this.in({ idle: 'snapshot' });\n const isDisabled = !isLoaded || disabledSelector.matches('create', true);\n\n return html`\n ${this.renderTemplateOrSlot('attributes:actions:create:before')}\n\n <vaadin-button\n data-testid=\"attributes:actions:create\"\n aria-label=${this.t('create').toString()}\n class=\"px-xs rounded-full\"\n theme=\"small icon\"\n ?disabled=${isDisabled}\n @click=${(evt: Event) => {\n if (data === null) return;\n const button = evt.target as HTMLButtonElement;\n const dialog = button.firstElementChild as FormDialog;\n dialog.show(button);\n }}\n >\n <foxy-form-dialog\n readonlycontrols=${readonlySelector.zoom('create:form').toString()}\n disabledcontrols=${disabledSelector.zoom('create:form').toString()}\n hiddencontrols=${hiddenSelector.zoom('create:form').toString()}\n data-testid=\"attributes:actions:create:form\"\n parent=${data?._links['fx:attributes'].href ?? ''}\n header=\"create\"\n group=${this.group}\n form=\"foxy-attribute-form\"\n lang=${lang}\n ns=${ns}\n .templates=${this.getNestedTemplates('attributes:actions:create:form')}\n >\n </foxy-form-dialog>\n\n <iron-icon slot=\"suffix\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('attributes:actions:create:after')}\n `;\n };\n\n private readonly __renderAttributesActions = () => {\n const hiddenSelector = this.hiddenSelector.zoom('attributes:actions');\n\n return html`\n <div data-testid=\"attributes:actions\">\n ${this.renderTemplateOrSlot('attributes:actions:before')}\n ${hiddenSelector.matches('create', true) ? '' : this.__renderAttributesActionsCreate()}\n ${this.renderTemplateOrSlot('attributes:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderAttributesListCard: ItemRenderer<Attribute> = ctx => {\n const handleClick = (evt: Event) => {\n if (ctx.data === null) return;\n\n const button = evt.target as HTMLButtonElement;\n const root = button.getRootNode() as Element | DocumentFragment;\n const form = root.querySelector('#attributes-list-form') as FormDialog;\n\n form.href = ctx.data._links.self.href;\n form.show(button);\n };\n\n const computedClass = classMap({\n 'snap-start text-left p-m rounded-t-l rounded-b-l flex-shrink-0 border border-contrast-10':\n true,\n 'hover-border-contrast-30 focus-outline-none focus-border-primary': ctx.data !== null,\n });\n\n return ctx.html`\n <button \n data-testclass=\"attributes:list:card\"\n class=${computedClass}\n ?disabled=${ctx.data === null}\n @click=${handleClick}\n >\n <foxy-attribute-card\n hiddencontrols=${ctx.hiddenControls.toString()}\n parent=${ctx.parent}\n group=${ctx.group}\n class=\"w-tile\"\n lang=${ctx.lang}\n href=${ctx.href}\n ns=\"${ctx.ns} ${customElements.get('foxy-attribute-card')?.defaultNS ?? ''}\"\n .templates=${ctx.templates}\n >\n </foxy-attribute-card>\n </button>\n `;\n };\n\n private readonly __renderAttributesListPage: PageRenderer<Attributes> = ctx => {\n return html`\n <foxy-collection-page\n hiddencontrols=${ctx.hiddenControls.toString()}\n class=\"space-x-m flex\"\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=${ctx.ns}\n .item=${this.__renderAttributesListCard}\n .templates=${ctx.templates}\n >\n </foxy-collection-page>\n `;\n };\n\n private readonly __renderAttributesList = () => {\n const formId = 'attributes:list:form';\n const cardId = 'attributes:list:card';\n\n return html`\n ${this.renderTemplateOrSlot('attributes:list:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom(formId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(formId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(formId).toString()}\n data-testclass=\"i18n\"\n data-testid=\"attributes:list:form\"\n parent=${this.data?._links['fx:attributes'].href ?? ''}\n header=\"update\"\n group=${this.group}\n form=\"foxy-attribute-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"attributes-list-form\"\n .templates=${this.getNestedTemplates(formId)}\n >\n </foxy-form-dialog>\n\n <foxy-collection-pages\n hiddencontrols=${this.hiddenControls.zoom(cardId).toString()}\n data-testid=\"attributes:list\"\n first=${this.data?._links['fx:attributes'].href ?? ''}\n class=\"snap-x-mandatory flex items-center space-x-m overflow-auto\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n .page=${this.__renderAttributesListPage}\n .templates=${this.getNestedTemplates(cardId)}\n >\n </foxy-collection-pages>\n\n ${this.renderTemplateOrSlot('attributes:list:after')}\n `;\n };\n\n private readonly __renderAttributes = () => {\n const { lang, ns } = this;\n const hiddenSelector = this.hiddenSelector.zoom('attributes');\n\n return html`\n ${this.renderTemplateOrSlot('attributes:before')}\n\n <section class=\"pt-m\" data-testid=\"attributes\">\n <header class=\"space-x-m flex items-center mb-s\">\n <h2 class=\"text-l font-semibold\">\n <foxy-i18n ns=${ns} lang=${lang} key=\"attribute_plural\"></foxy-i18n>\n </h2>\n\n ${hiddenSelector.matches('actions', true) ? '' : this.__renderAttributesActions()}\n </header>\n\n ${hiddenSelector.matches('list', true) ? '' : this.__renderAttributesList()}\n </section>\n\n ${this.renderTemplateOrSlot('attributes:after')}\n `;\n };\n\n // #endregion\n\n // #region transactions\n\n private readonly __renderTransactions = () => {\n let transactionsLink = '';\n\n if (this.in({ idle: 'snapshot' })) {\n const transactionsURL = new URL(this.data._links['fx:transactions'].href);\n transactionsURL.searchParams.set('zoom', 'items');\n transactionsLink = transactionsURL.toString();\n }\n\n return html`\n ${this.renderTemplateOrSlot('transactions:before')}\n\n <x-group frame>\n <foxy-collection-pages\n data-testid=\"transactions\"\n spinner=\"foxy-spinner\"\n first=${transactionsLink}\n class=\"divide-y divide-contrast-10 block mx-m\"\n group=${this.group}\n page=\"foxy-transactions-table\"\n lang=${this.lang}\n ns=${this.ns}\n .templates=${this.getNestedTemplates('transactions:table')}\n >\n </foxy-collection-pages>\n </x-group>\n\n ${this.renderTemplateOrSlot('transactions:after')}\n `;\n };\n\n // #endregion\n\n // #region subscriptions\n\n private readonly __subscriptionsTableColumns: Column<Subscriptions>[] = [\n SubscriptionsTable.priceColumn,\n SubscriptionsTable.summaryColumn,\n SubscriptionsTable.statusColumn,\n {\n cell: ({ html, lang, data }) => html`\n <vaadin-button\n data-testclass=\"edit\"\n theme=\"small tertiary-inline\"\n @click=${(evt: Event) => {\n const link = new URL(data._links.self.href);\n const form = this.renderRoot.querySelector('#subscriptions-form') as FormDialog;\n const button = evt.target as ButtonElement;\n\n link.searchParams.set('zoom', 'last_transaction,transaction_template:items');\n form.href = link.toString();\n form.show(button);\n }}\n >\n <foxy-i18n class=\"text-m\" lang=${lang} key=\"update\" ns=${this.ns}></foxy-i18n>\n </vaadin-button>\n `,\n },\n ];\n\n private readonly __renderSubscriptionsPage: PageRenderer<Subscriptions> = ({ html, ...ctx }) => {\n return html`\n <foxy-table\n data-testclass=\"subscriptions:pages:table\"\n group=${ctx.group}\n href=${ctx.href}\n lang=${ctx.lang}\n ns=${ctx.ns}\n .columns=${this.__subscriptionsTableColumns}\n .templates=${ctx.templates}\n >\n </foxy-table>\n `;\n };\n\n private readonly __renderSubscriptions = () => {\n const formId = 'subscriptions:form';\n let subscriptionsLink = '';\n\n if (this.in({ idle: 'snapshot' })) {\n const subscriptionsURL = new URL(this.data._links['fx:subscriptions'].href);\n subscriptionsURL.searchParams.set('zoom', 'last_transaction,transaction_template:items');\n subscriptionsLink = subscriptionsURL.toString();\n }\n\n return html`\n <div data-testid=\"subscriptions\">\n ${this.renderTemplateOrSlot('subscriptions:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom(formId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(formId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(formId).toString()}\n data-testid=${formId}\n header=\"update\"\n group=${this.group}\n form=\"foxy-subscription-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"subscriptions-form\"\n .templates=${this.getNestedTemplates(formId)}\n >\n </foxy-form-dialog>\n\n <x-group frame>\n <foxy-collection-pages\n data-testid=\"subscriptions:pages\"\n spinner=\"foxy-spinner\"\n first=${subscriptionsLink}\n class=\"divide-y divide-contrast-10 block mx-m\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n .page=${this.__renderSubscriptionsPage}\n .templates=${this.getNestedTemplates('subscriptions:table')}\n >\n </foxy-collection-pages>\n </x-group>\n\n ${this.renderTemplateOrSlot('subscriptions:after')}\n </div>\n `;\n };\n\n // #endregion\n\n // #region tabs\n\n private readonly __renderTabs = (tabs: Tab[]) => {\n return html`\n <div class=\"pt-m\">\n <x-tabs size=${tabs.length} ?disabled=${!this.in({ idle: 'snapshot' })}>\n ${tabs.map(\n (tab, index) => html`\n <foxy-i18n\n data-testclass=\"i18n\"\n slot=\"tab-${index}\"\n lang=${this.lang}\n key=${tab.title}\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div slot=\"panel-${index}\">${tab.content}</div>\n `\n )}\n </x-tabs>\n </div>\n `;\n };\n\n // #endregion\n\n render(): TemplateResult {\n const { hiddenSelector, lang, ns } = this;\n const isLoaded = this.in({ idle: 'snapshot' });\n const isBusy = this.in('busy');\n const tabs: Tab[] = [];\n\n if (!hiddenSelector.matches('transactions', true)) {\n tabs.push({ title: 'transaction_plural', content: this.__renderTransactions() });\n }\n\n if (!hiddenSelector.matches('subscriptions', true)) {\n tabs.push({ title: 'subscription_plural', content: this.__renderSubscriptions() });\n }\n\n return html`\n <div class=\"relative\" data-testid=\"wrapper\" aria-busy=${isBusy} aria-live=\"polite\">\n <div\n class=${classMap({\n 'font-lumo text-body text-m leading-m space-y-s': true,\n 'opacity-50': !isLoaded,\n })}\n >\n ${hiddenSelector.matches('header', true) ? '' : this.__renderHeader()}\n ${hiddenSelector.matches('default', true) ? '' : this.renderTemplateOrSlot()}\n ${hiddenSelector.matches('addresses', true) ? '' : this.__renderAddresses()}\n ${hiddenSelector.matches('payment-methods', true) ? '' : this.__renderPaymentMethods()}\n ${hiddenSelector.matches('attributes', true) ? '' : this.__renderAttributes()}\n ${tabs.length === 0 ? '' : this.__renderTabs(tabs)}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': isLoaded,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : isBusy ? 'busy' : 'empty'}\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Customer.js","sourceRoot":"","sources":["../../../../src/elements/public/Customer/Customer.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,IAAI,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAKlF,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,KAAK,EAAE,+BAA4B;AAE5C,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,QAAQ,EAAE,2CAAwC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,oDAAiD;AAC9E,OAAO,EAAE,IAAI,EAAE,mCAAgC;AAC/C,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,oBAAiB;AAElC,MAAM,EAAE,GAAG,UAAU,CAAC;AACtB,MAAM,IAAI,GAAG,mBAAmB,CA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C,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;mBACtD,IAAI;kBACL,EAAE,IAAI,YAAA,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,SAAS,mCAAI,EAAE;;;;;KAKtE,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Attributes, CustomerAddresses, Data, Tab, Templates } from './types';\nimport { CSSResultArray, TemplateResult, html } from 'lit-element';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { Data as Attribute } from '../AttributeCard/types';\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { Column } from '../Table/types';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { Data as CustomerAddress } from '../AddressCard/types';\nimport { FormDialog } from '../FormDialog/FormDialog';\nimport { Group } from '../../private/index';\nimport { ItemRenderer } from '../CollectionPage/types';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PageRenderer } from '../CollectionPages/types';\nimport { Skeleton } from '../../private/Skeleton/Skeleton';\nimport { Data as Subscriptions } from '../SubscriptionsTable/types';\nimport { SubscriptionsTable } from '../SubscriptionsTable/SubscriptionsTable';\nimport { Tabs } from '../../private/Tabs/Tabs';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { styles } from './styles';\n\nconst NS = 'customer';\nconst Base = ScopedElementsMixin(\n ConfigurableMixin(ThemeableMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * All-in-one element for customer management.\n *\n * @slot header:before - **new in v1.4.0**\n * @slot header:after - **new in v1.4.0**\n * @slot header:actions:before - **new in v1.4.0**\n * @slot header:actions:after - **new in v1.4.0**\n * @slot header:actions:edit:before - **new in v1.4.0**\n * @slot header:actions:edit:after - **new in v1.4.0**\n *\n * @slot addresses:before - **new in v1.4.0**\n * @slot addresses:after - **new in v1.4.0**\n * @slot addresses:actions:before - **new in v1.4.0**\n * @slot addresses:actions:after - **new in v1.4.0**\n * @slot addresses:actions:create:before - **new in v1.4.0**\n * @slot addresses:actions:create:after - **new in v1.4.0**\n * @slot addresses:list:before - **new in v1.4.0**\n * @slot addresses:list:after - **new in v1.4.0**\n *\n * @slot payment-methods:before - **new in v1.4.0**\n * @slot payment-methods:after - **new in v1.4.0**\n * @slot payment-methods:list:before - **new in v1.4.0**\n * @slot payment-methods:list:after - **new in v1.4.0**\n *\n * @slot attributes:before - **new in v1.4.0**\n * @slot attributes:after - **new in v1.4.0**\n * @slot attributes:actions:before - **new in v1.4.0**\n * @slot attributes:actions:after - **new in v1.4.0**\n * @slot attributes:actions:create:before - **new in v1.4.0**\n * @slot attributes:actions:create:after - **new in v1.4.0**\n * @slot attributes:list:before - **new in v1.4.0**\n * @slot attributes:list:after - **new in v1.4.0**\n *\n * @slot transactions:before - **new in v1.4.0**\n * @slot transactions:after - **new in v1.4.0**\n *\n * @slot subscriptions:before - **new in v1.4.0**\n * @slot subscriptions:after - **new in v1.4.0**\n *\n * @element foxy-customer\n * @since 1.2.0\n */\nexport class Customer extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-payment-method-card': customElements.get('foxy-payment-method-card'),\n 'foxy-transactions-table': customElements.get('foxy-transactions-table'),\n 'foxy-collection-pages': customElements.get('foxy-collection-pages'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-attribute-card': customElements.get('foxy-attribute-card'),\n 'foxy-address-card': customElements.get('foxy-address-card'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-table': customElements.get('foxy-table'),\n 'x-skeleton': Skeleton,\n 'iron-icon': customElements.get('iron-icon'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'x-group': Group,\n 'x-tabs': Tabs,\n };\n }\n\n static get styles(): CSSResultArray {\n return [super.styles, styles];\n }\n\n templates: Templates = {};\n\n // #region header\n\n private readonly __renderHeaderActionsEdit = () => {\n const { readonlySelector, disabledSelector, hiddenSelector } = this;\n\n const actionId = 'header:actions:edit';\n const formId = 'header:actions:edit:form';\n const dialogId = 'customer-dialog';\n\n const isLoaded = this.in({ idle: 'snapshot' });\n const isEditActionDisabled = !isLoaded || disabledSelector.matches(actionId, true);\n\n return html`\n ${this.renderTemplateOrSlot('header:actions:edit:before')}\n\n <foxy-form-dialog\n data-testid=\"header:actions:edit:form\"\n header=\"update\"\n parent=${this.parent}\n group=${this.group}\n href=${this.href}\n form=\"foxy-customer-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=${dialogId}\n readonlycontrols=${readonlySelector.zoom(formId).toString()}\n disabledcontrols=${disabledSelector.zoom(formId).toString()}\n hiddencontrols=${hiddenSelector.zoom(formId).toString()}\n .templates=${this.getNestedTemplates('header:actions:edit:form')}\n >\n </foxy-form-dialog>\n\n <vaadin-button\n data-testid=\"header:actions:edit\"\n aria-label=${this.t('update').toString()}\n class=\"px-xs rounded-full\"\n theme=\"icon\"\n ?disabled=${isEditActionDisabled}\n @click=${(evt: Event) => {\n const dialog = this.renderRoot.querySelector(`#${dialogId}`) as FormDialog;\n dialog.show(evt.currentTarget as HTMLElement);\n }}\n >\n <iron-icon icon=\"editor:mode-edit\"></iron-icon>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('header:actions:edit:after')}\n `;\n };\n\n private readonly __renderHeaderActions = () => {\n const hiddenSelector = this.hiddenSelector.zoom('header:actions');\n\n return html`\n <div class=\"flex\" data-testid=\"header:actions\">\n ${this.renderTemplateOrSlot('header:actions:before')}\n ${hiddenSelector.matches('edit', true) ? '' : this.__renderHeaderActionsEdit()}\n ${this.renderTemplateOrSlot('header:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderHeader = () => {\n const variant = ifDefined(this.in('busy') ? undefined : 'static');\n\n return html`\n ${this.renderTemplateOrSlot('header:before')}\n\n <header\n class=\"flex items-center justify-between space-x-m pb-s border-b border-contrast-10\"\n data-testid=\"header\"\n >\n <h1 class=\"text-xxl font-bold truncate min-w-0 flex-1\">\n ${this.in({ idle: 'snapshot' })\n ? html`${this.data.first_name} ${this.data.last_name}`\n : html`<x-skeleton class=\"w-full\" variant=${variant}> </x-skeleton>`}\n </h1>\n\n ${this.hiddenSelector.matches('header:actions', true) ? '' : this.__renderHeaderActions()}\n </header>\n\n ${this.renderTemplateOrSlot('header:after')}\n `;\n };\n\n // #endregion\n\n // #region addresses\n\n private readonly __renderAddressesActionsCreate = () => {\n const { data, lang, ns } = this;\n\n const disabledSelector = this.disabledSelector.zoom('addresses:actions');\n const readonlySelector = this.readonlySelector.zoom('addresses:actions');\n const hiddenSelector = this.hiddenSelector.zoom('addresses:actions');\n\n const isLoaded = this.in({ idle: 'snapshot' });\n const isDisabled = !isLoaded || disabledSelector.matches('create', true);\n\n return html`\n ${this.renderTemplateOrSlot('addresses:actions:create:before')}\n\n <vaadin-button\n data-testid=\"addresses:actions:create\"\n aria-label=${this.t('create').toString()}\n class=\"px-xs rounded-full\"\n theme=\"small icon\"\n ?disabled=${isDisabled}\n @click=${(evt: Event) => {\n if (data === null) return;\n const button = evt.target as HTMLButtonElement;\n const dialog = button.firstElementChild as FormDialog;\n dialog.show(button);\n }}\n >\n <foxy-form-dialog\n readonlycontrols=${readonlySelector.zoom('create:form').toString()}\n disabledcontrols=${disabledSelector.zoom('create:form').toString()}\n hiddencontrols=${hiddenSelector.zoom('create:form').toString()}\n data-testid=\"addresses:actions:create:form\"\n parent=${data?._links['fx:customer_addresses'].href ?? ''}\n header=\"create\"\n group=${this.group}\n form=\"foxy-address-form\"\n lang=${lang}\n ns=${ns}\n id=\"address-dialog\"\n .templates=${this.getNestedTemplates('addresses:actions:create:form')}\n >\n </foxy-form-dialog>\n\n <iron-icon slot=\"suffix\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('addresses:actions:create:after')}\n `;\n };\n\n private readonly __renderAddressesActions = () => {\n const hiddenSelector = this.hiddenSelector.zoom('addresses:actions');\n\n return html`\n <div data-testid=\"addresses:actions\">\n ${this.renderTemplateOrSlot('addresses:actions:before')}\n ${hiddenSelector.matches('create', true) ? '' : this.__renderAddressesActionsCreate()}\n ${this.renderTemplateOrSlot('addresses:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderAddressesListCard: ItemRenderer<CustomerAddress> = ctx => {\n const handleClick = (evt: Event) => {\n if (ctx.data === null) return;\n\n const button = evt.target as HTMLButtonElement;\n const root = button.getRootNode() as Element | DocumentFragment;\n const form = root.querySelector('#addresses-list-form') as FormDialog;\n\n form.href = ctx.data._links.self.href;\n form.show(button);\n };\n\n const computedClass = classMap({\n 'snap-start text-left p-m rounded-t-l rounded-b-l flex-shrink-0': true,\n 'border border-contrast-10': true,\n 'hover-border-contrast-30 focus-outline-none focus-border-primary': ctx.data !== null,\n });\n\n const isReadonly = this.readonlySelector.matches('addresses:list:card', true);\n const isDisabled = this.disabledSelector.matches('addresses:list:card', true);\n\n return html`\n <button\n data-testclass=\"addresses:list:card\"\n class=${computedClass}\n ?disabled=${!ctx.data || isReadonly || isDisabled}\n @click=${handleClick}\n >\n <foxy-address-card\n hiddencontrols=${ctx.hiddenControls.toString()}\n parent=${ctx.parent}\n class=\"w-tile\"\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=\"${ctx.ns} ${customElements.get('foxy-address-card')?.defaultNS ?? ''}\"\n .templates=${ctx.templates}\n >\n </foxy-address-card>\n </button>\n `;\n };\n\n private readonly __renderAddressesListPage: PageRenderer<CustomerAddresses> = ctx => {\n return ctx.html`\n <foxy-collection-page\n hiddencontrols=${ctx.hiddenControls.toString()}\n class=\"space-x-m flex\"\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=${ctx.ns}\n .item=${this.__renderAddressesListCard}\n .templates=${ctx.templates}\n >\n </foxy-collection-page>\n `;\n };\n\n private readonly __renderAddressesList = () => {\n const formId = 'addresses:list:form';\n const cardId = 'addresses:list:card';\n\n return html`\n ${this.renderTemplateOrSlot('addresses:list:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom(formId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(formId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(formId).toString()}\n data-testid=\"addresses:list:form\"\n parent=${this.data?._links['fx:customer_addresses'].href ?? ''}\n header=\"update\"\n group=${this.group}\n form=\"foxy-address-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"addresses-list-form\"\n .templates=${this.getNestedTemplates(formId)}\n >\n </foxy-form-dialog>\n\n <foxy-collection-pages\n hiddencontrols=${this.hiddenSelector.zoom(cardId).toString()}\n data-testid=\"addresses:list\"\n first=${this.data?._links['fx:customer_addresses'].href ?? ''}\n class=\"snap-x-mandatory flex items-center space-x-m overflow-auto\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n .page=${this.__renderAddressesListPage}\n .templates=${this.getNestedTemplates(cardId)}\n >\n </foxy-collection-pages>\n\n ${this.renderTemplateOrSlot('addresses:list:after')}\n `;\n };\n\n private readonly __renderAddresses = () => {\n const { lang, ns } = this;\n const hiddenSelector = this.hiddenSelector.zoom('addresses');\n\n return html`\n ${this.renderTemplateOrSlot('addresses:before')}\n\n <section class=\"pt-m\" data-testid=\"addresses\">\n <header class=\"space-x-m flex items-center mb-s\">\n <h2 class=\"text-l font-semibold\">\n <foxy-i18n ns=${ns} lang=${lang} key=\"address_plural\"></foxy-i18n>\n </h2>\n\n ${hiddenSelector.matches('actions', true) ? '' : this.__renderAddressesActions()}\n </header>\n\n ${hiddenSelector.matches('list', true) ? '' : this.__renderAddressesList()}\n </section>\n\n ${this.renderTemplateOrSlot('addresses:after')}\n `;\n };\n\n // #endregion\n\n // #region payment-methods\n\n private readonly __renderPaymentMethodsList = () => {\n const cardId = 'payment-methods:list:card';\n\n return html`\n <div data-testid=\"payment-methods:list\">\n ${this.renderTemplateOrSlot('payment-methods:list:before')}\n\n <foxy-payment-method-card\n readonlycontrols=${this.readonlySelector.zoom(cardId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(cardId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(cardId).toString()}\n data-testid=${cardId}\n group=${this.group}\n class=\"w-payment-method-card border-radius-overflow-fix rounded-t-l rounded-b-l overflow-hidden\"\n href=${this.data?._links['fx:default_payment_method'].href ?? ''}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-payment-method-card')?.defaultNS ?? ''}\"\n .templates=${this.getNestedTemplates(cardId)}\n >\n </foxy-payment-method-card>\n\n ${this.renderTemplateOrSlot('payment-methods:list:after')}\n </div>\n `;\n };\n\n private readonly __renderPaymentMethods = () => {\n const hiddenSelector = this.hiddenSelector.zoom('payment-methods');\n\n return html`\n ${this.renderTemplateOrSlot('payment-methods:before')}\n\n <div class=\"pt-m\" data-testid=\"payment-methods\">\n <h2 class=\"text-l font-semibold mb-s\">\n <foxy-i18n\n data-testclass=\"i18n\"\n lang=${this.lang}\n key=\"payment_method_plural\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </h2>\n\n ${hiddenSelector.matches('list', true) ? '' : this.__renderPaymentMethodsList()}\n </div>\n\n ${this.renderTemplateOrSlot('payment-methods:after')}\n `;\n };\n\n // #endregion\n\n // #region attributes\n\n private readonly __renderAttributesActionsCreate = () => {\n const { data, lang, ns } = this;\n\n const disabledSelector = this.disabledSelector.zoom('attributes:actions');\n const readonlySelector = this.readonlySelector.zoom('attributes:actions');\n const hiddenSelector = this.hiddenSelector.zoom('attributes:actions');\n\n const isLoaded = this.in({ idle: 'snapshot' });\n const isDisabled = !isLoaded || disabledSelector.matches('create', true);\n\n return html`\n ${this.renderTemplateOrSlot('attributes:actions:create:before')}\n\n <vaadin-button\n data-testid=\"attributes:actions:create\"\n aria-label=${this.t('create').toString()}\n class=\"px-xs rounded-full\"\n theme=\"small icon\"\n ?disabled=${isDisabled}\n @click=${(evt: Event) => {\n if (data === null) return;\n const button = evt.target as HTMLButtonElement;\n const dialog = button.firstElementChild as FormDialog;\n dialog.show(button);\n }}\n >\n <foxy-form-dialog\n readonlycontrols=${readonlySelector.zoom('create:form').toString()}\n disabledcontrols=${disabledSelector.zoom('create:form').toString()}\n hiddencontrols=${hiddenSelector.zoom('create:form').toString()}\n data-testid=\"attributes:actions:create:form\"\n parent=${data?._links['fx:attributes'].href ?? ''}\n header=\"create\"\n group=${this.group}\n form=\"foxy-attribute-form\"\n lang=${lang}\n ns=${ns}\n .templates=${this.getNestedTemplates('attributes:actions:create:form')}\n >\n </foxy-form-dialog>\n\n <iron-icon slot=\"suffix\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('attributes:actions:create:after')}\n `;\n };\n\n private readonly __renderAttributesActions = () => {\n const hiddenSelector = this.hiddenSelector.zoom('attributes:actions');\n\n return html`\n <div data-testid=\"attributes:actions\">\n ${this.renderTemplateOrSlot('attributes:actions:before')}\n ${hiddenSelector.matches('create', true) ? '' : this.__renderAttributesActionsCreate()}\n ${this.renderTemplateOrSlot('attributes:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderAttributesListCard: ItemRenderer<Attribute> = ctx => {\n const handleClick = (evt: Event) => {\n if (ctx.data === null) return;\n\n const button = evt.target as HTMLButtonElement;\n const root = button.getRootNode() as Element | DocumentFragment;\n const form = root.querySelector('#attributes-list-form') as FormDialog;\n\n form.href = ctx.data._links.self.href;\n form.show(button);\n };\n\n const computedClass = classMap({\n 'snap-start text-left p-m rounded-t-l rounded-b-l flex-shrink-0 border border-contrast-10':\n true,\n 'hover-border-contrast-30 focus-outline-none focus-border-primary': ctx.data !== null,\n });\n\n return ctx.html`\n <button \n data-testclass=\"attributes:list:card\"\n class=${computedClass}\n ?disabled=${ctx.data === null}\n @click=${handleClick}\n >\n <foxy-attribute-card\n hiddencontrols=${ctx.hiddenControls.toString()}\n parent=${ctx.parent}\n group=${ctx.group}\n class=\"w-tile\"\n lang=${ctx.lang}\n href=${ctx.href}\n ns=\"${ctx.ns} ${customElements.get('foxy-attribute-card')?.defaultNS ?? ''}\"\n .templates=${ctx.templates}\n >\n </foxy-attribute-card>\n </button>\n `;\n };\n\n private readonly __renderAttributesListPage: PageRenderer<Attributes> = ctx => {\n return html`\n <foxy-collection-page\n hiddencontrols=${ctx.hiddenControls.toString()}\n class=\"space-x-m flex\"\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=${ctx.ns}\n .item=${this.__renderAttributesListCard}\n .templates=${ctx.templates}\n >\n </foxy-collection-page>\n `;\n };\n\n private readonly __renderAttributesList = () => {\n const formId = 'attributes:list:form';\n const cardId = 'attributes:list:card';\n\n return html`\n ${this.renderTemplateOrSlot('attributes:list:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom(formId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(formId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(formId).toString()}\n data-testclass=\"i18n\"\n data-testid=\"attributes:list:form\"\n parent=${this.data?._links['fx:attributes'].href ?? ''}\n header=\"update\"\n group=${this.group}\n form=\"foxy-attribute-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"attributes-list-form\"\n .templates=${this.getNestedTemplates(formId)}\n >\n </foxy-form-dialog>\n\n <foxy-collection-pages\n hiddencontrols=${this.hiddenControls.zoom(cardId).toString()}\n data-testid=\"attributes:list\"\n first=${this.data?._links['fx:attributes'].href ?? ''}\n class=\"snap-x-mandatory flex items-center space-x-m overflow-auto\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n .page=${this.__renderAttributesListPage}\n .templates=${this.getNestedTemplates(cardId)}\n >\n </foxy-collection-pages>\n\n ${this.renderTemplateOrSlot('attributes:list:after')}\n `;\n };\n\n private readonly __renderAttributes = () => {\n const { lang, ns } = this;\n const hiddenSelector = this.hiddenSelector.zoom('attributes');\n\n return html`\n ${this.renderTemplateOrSlot('attributes:before')}\n\n <section class=\"pt-m\" data-testid=\"attributes\">\n <header class=\"space-x-m flex items-center mb-s\">\n <h2 class=\"text-l font-semibold\">\n <foxy-i18n ns=${ns} lang=${lang} key=\"attribute_plural\"></foxy-i18n>\n </h2>\n\n ${hiddenSelector.matches('actions', true) ? '' : this.__renderAttributesActions()}\n </header>\n\n ${hiddenSelector.matches('list', true) ? '' : this.__renderAttributesList()}\n </section>\n\n ${this.renderTemplateOrSlot('attributes:after')}\n `;\n };\n\n // #endregion\n\n // #region transactions\n\n private readonly __renderTransactions = () => {\n let transactionsLink = '';\n\n if (this.in({ idle: 'snapshot' })) {\n const transactionsURL = new URL(this.data._links['fx:transactions'].href);\n transactionsURL.searchParams.set('zoom', 'items');\n transactionsLink = transactionsURL.toString();\n }\n\n return html`\n ${this.renderTemplateOrSlot('transactions:before')}\n\n <x-group frame>\n <foxy-collection-pages\n data-testid=\"transactions\"\n spinner=\"foxy-spinner\"\n first=${transactionsLink}\n class=\"divide-y divide-contrast-10 block mx-m\"\n group=${this.group}\n page=\"foxy-transactions-table\"\n lang=${this.lang}\n ns=${this.ns}\n .templates=${this.getNestedTemplates('transactions:table')}\n >\n </foxy-collection-pages>\n </x-group>\n\n ${this.renderTemplateOrSlot('transactions:after')}\n `;\n };\n\n // #endregion\n\n // #region subscriptions\n\n private readonly __subscriptionsTableColumns: Column<Subscriptions>[] = [\n SubscriptionsTable.priceColumn,\n SubscriptionsTable.summaryColumn,\n SubscriptionsTable.statusColumn,\n {\n cell: ({ html, lang, data }) => html`\n <vaadin-button\n data-testclass=\"edit\"\n theme=\"small tertiary-inline\"\n @click=${(evt: Event) => {\n const link = new URL(data._links.self.href);\n const form = this.renderRoot.querySelector('#subscriptions-form') as FormDialog;\n const button = evt.target as ButtonElement;\n\n link.searchParams.set('zoom', 'last_transaction,transaction_template:items');\n form.href = link.toString();\n form.show(button);\n }}\n >\n <foxy-i18n class=\"text-m\" lang=${lang} key=\"update\" ns=${this.ns}></foxy-i18n>\n </vaadin-button>\n `,\n },\n ];\n\n private readonly __renderSubscriptionsPage: PageRenderer<Subscriptions> = ({ html, ...ctx }) => {\n return html`\n <foxy-table\n data-testclass=\"subscriptions:pages:table\"\n group=${ctx.group}\n href=${ctx.href}\n lang=${ctx.lang}\n ns=\"${ctx.ns} subscriptions-table\"\n .columns=${this.__subscriptionsTableColumns}\n .templates=${ctx.templates}\n >\n </foxy-table>\n `;\n };\n\n private readonly __renderSubscriptions = () => {\n const formId = 'subscriptions:form';\n let subscriptionsLink = '';\n\n if (this.in({ idle: 'snapshot' })) {\n const subscriptionsURL = new URL(this.data._links['fx:subscriptions'].href);\n subscriptionsURL.searchParams.set('zoom', 'last_transaction,transaction_template:items');\n subscriptionsLink = subscriptionsURL.toString();\n }\n\n return html`\n <div data-testid=\"subscriptions\">\n ${this.renderTemplateOrSlot('subscriptions:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom(formId).toString()}\n disabledcontrols=${this.disabledSelector.zoom(formId).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(formId).toString()}\n data-testid=${formId}\n header=\"update\"\n group=${this.group}\n form=\"foxy-subscription-form\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"subscriptions-form\"\n .templates=${this.getNestedTemplates(formId)}\n >\n </foxy-form-dialog>\n\n <x-group frame>\n <foxy-collection-pages\n data-testid=\"subscriptions:pages\"\n spinner=\"foxy-spinner\"\n first=${subscriptionsLink}\n class=\"divide-y divide-contrast-10 block mx-m\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n .page=${this.__renderSubscriptionsPage}\n .templates=${this.getNestedTemplates('subscriptions:table')}\n >\n </foxy-collection-pages>\n </x-group>\n\n ${this.renderTemplateOrSlot('subscriptions:after')}\n </div>\n `;\n };\n\n // #endregion\n\n // #region tabs\n\n private readonly __renderTabs = (tabs: Tab[]) => {\n return html`\n <div class=\"pt-m\">\n <x-tabs size=${tabs.length} ?disabled=${!this.in({ idle: 'snapshot' })}>\n ${tabs.map(\n (tab, index) => html`\n <foxy-i18n\n data-testclass=\"i18n\"\n slot=\"tab-${index}\"\n lang=${this.lang}\n key=${tab.title}\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div slot=\"panel-${index}\">${tab.content}</div>\n `\n )}\n </x-tabs>\n </div>\n `;\n };\n\n // #endregion\n\n render(): TemplateResult {\n const { hiddenSelector, lang, ns } = this;\n const isLoaded = this.in({ idle: 'snapshot' });\n const isBusy = this.in('busy');\n const tabs: Tab[] = [];\n\n if (!hiddenSelector.matches('transactions', true)) {\n tabs.push({ title: 'transaction_plural', content: this.__renderTransactions() });\n }\n\n if (!hiddenSelector.matches('subscriptions', true)) {\n tabs.push({ title: 'subscription_plural', content: this.__renderSubscriptions() });\n }\n\n return html`\n <div class=\"relative\" data-testid=\"wrapper\" aria-busy=${isBusy} aria-live=\"polite\">\n <div\n class=${classMap({\n 'font-lumo text-body text-m leading-m space-y-s': true,\n 'opacity-50': !isLoaded,\n })}\n >\n ${hiddenSelector.matches('header', true) ? '' : this.__renderHeader()}\n ${hiddenSelector.matches('default', true) ? '' : this.renderTemplateOrSlot()}\n ${hiddenSelector.matches('addresses', true) ? '' : this.__renderAddresses()}\n ${hiddenSelector.matches('payment-methods', true) ? '' : this.__renderPaymentMethods()}\n ${hiddenSelector.matches('attributes', true) ? '' : this.__renderAttributes()}\n ${tabs.length === 0 ? '' : this.__renderTabs(tabs)}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': isLoaded,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : isBusy ? 'busy' : 'empty'}\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export class InternalCustomerPortalLoggedInView extends Base {
|
|
|
13
13
|
this.loggingOutState = 'idle';
|
|
14
14
|
this.loggingOutStateResetTimeout = null;
|
|
15
15
|
this.__renderHeaderActionsSignOut = () => {
|
|
16
|
-
var _a, _b, _c;
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
17
|
const scope = 'customer:header:actions:sign-out';
|
|
18
18
|
const state = this.loggingOutState;
|
|
19
19
|
const isCustomerLoaded = !!((_a = this.__customerElement) === null || _a === void 0 ? void 0 : _a.in({ idle: 'snapshot' }));
|
|
@@ -51,7 +51,11 @@ export class InternalCustomerPortalLoggedInView extends Base {
|
|
|
51
51
|
state=${state === 'fail' ? 'error' : 'busy'}
|
|
52
52
|
style="margin: auto"
|
|
53
53
|
lang=${this.lang}
|
|
54
|
-
ns
|
|
54
|
+
ns=${[
|
|
55
|
+
this.ns,
|
|
56
|
+
(_c = (_b = customElements.get('foxy-customer')) === null || _b === void 0 ? void 0 : _b.defaultNS) !== null && _c !== void 0 ? _c : '',
|
|
57
|
+
(_e = (_d = customElements.get('foxy-spinner')) === null || _d === void 0 ? void 0 : _d.defaultNS) !== null && _e !== void 0 ? _e : '',
|
|
58
|
+
].join(' ')}
|
|
55
59
|
>
|
|
56
60
|
</foxy-spinner>
|
|
57
61
|
`}
|
|
@@ -114,21 +118,34 @@ export class InternalCustomerPortalLoggedInView extends Base {
|
|
|
114
118
|
render() {
|
|
115
119
|
var _a, _b;
|
|
116
120
|
const hiddenSelector = this.hiddenSelector.zoom('customer');
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
'header:actions:edit:form:delete',
|
|
121
|
+
const optionallyHiddenInCustomer = ['payment-methods'];
|
|
122
|
+
const alwaysHiddenInCustomer = [
|
|
120
123
|
'attributes',
|
|
121
124
|
'transactions',
|
|
122
125
|
'subscriptions',
|
|
123
126
|
'addresses:actions:create',
|
|
124
|
-
'
|
|
127
|
+
'header:actions:edit:form:delete',
|
|
128
|
+
];
|
|
129
|
+
const customerHiddenControls = [
|
|
130
|
+
...optionallyHiddenInCustomer
|
|
131
|
+
.filter(id => hiddenSelector.matches(id))
|
|
132
|
+
.map(id => `${id}:${hiddenSelector.zoom(id)}`),
|
|
133
|
+
...alwaysHiddenInCustomer.map(id => {
|
|
134
|
+
const splitId = id.split(':');
|
|
135
|
+
for (let i = 0; i < splitId.length; ++i) {
|
|
136
|
+
const hostId = splitId.slice(0, i + 1).join(':');
|
|
137
|
+
if (hiddenSelector.matches(hostId, true))
|
|
138
|
+
return hostId;
|
|
139
|
+
}
|
|
140
|
+
return id;
|
|
141
|
+
}),
|
|
125
142
|
];
|
|
126
143
|
const templates = this.getNestedTemplates('customer');
|
|
127
144
|
const originalHeaderActionsAfterTemplate = templates['header:actions:after'];
|
|
128
145
|
const originalTimestampsAfterTemplate = templates['header:actions:edit:form:timestamps:after'];
|
|
129
146
|
const originalDefaultTemplate = templates['default'];
|
|
130
147
|
templates['header:actions:after'] = (html, host) => {
|
|
131
|
-
const isSignOutHidden =
|
|
148
|
+
const isSignOutHidden = hiddenSelector.matches('header:actions:sign-out', true);
|
|
132
149
|
return html `
|
|
133
150
|
<div style="display:flex">
|
|
134
151
|
${isSignOutHidden ? '' : this.__renderHeaderActionsSignOut()}
|
|
@@ -185,7 +202,7 @@ export class InternalCustomerPortalLoggedInView extends Base {
|
|
|
185
202
|
<foxy-customer
|
|
186
203
|
readonlycontrols=${this.readonlySelector.zoom('customer').toString()}
|
|
187
204
|
disabledcontrols=${this.disabledSelector.zoom('customer').toString()}
|
|
188
|
-
hiddencontrols=${
|
|
205
|
+
hiddencontrols=${customerHiddenControls.join(' ')}
|
|
189
206
|
data-testid="customer"
|
|
190
207
|
group=${this.group}
|
|
191
208
|
href=${this.customer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalCustomerPortalLoggedInView.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortal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CAAC,QAAQ;eACb,IAAI,CAAC,IAAI;cACV,IAAI,CAAC,EAAE,IAAI,YAAA,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,0CAAE,SAAS,mCAAI,EAAE;;qBAExD,SAAS;kBACZ,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;;;KAGvC,CAAC;IACJ,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,2BAA2B;YAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACvF,CAAC;IAED,IAAY,iBAAiB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAW,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["import { ConfigurableMixin, Renderer } from '../../../mixins/configurable';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { API } from '../NucleonElement/API';\nimport { Customer } from '../Customer/Customer';\nimport { Templates as CustomerTemplates } from '../Customer/types';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/customer';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { Templates } from './types';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\n\nconst Base = ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement)));\ntype Data = Resource<Rels.CustomerPortalSettings>;\n\nexport class InternalCustomerPortalLoggedInView extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n customer: { type: String },\n loggingOutState: { attribute: false },\n loggingOutStateResetTimeout: { attribute: false },\n };\n }\n\n templates: Templates = {};\n\n customer = '';\n\n loggingOutState: 'idle' | 'busy' | 'fail' = 'idle';\n\n loggingOutStateResetTimeout: NodeJS.Timeout | null = null;\n\n private readonly __renderHeaderActionsSignOut = () => {\n const scope = 'customer:header:actions:sign-out';\n const state = this.loggingOutState;\n const isCustomerLoaded = !!this.__customerElement?.in({ idle: 'snapshot' });\n const handleClick = async () => {\n try {\n this.loggingOutState = 'busy';\n await new API(this).fetch('foxy://customer-api/session', { method: 'DELETE' });\n this.loggingOutState = 'idle';\n } catch {\n this.loggingOutState = 'fail';\n this.loggingOutStateResetTimeout = setTimeout(() => {\n this.loggingOutState = 'idle';\n this.loggingOutStateResetTimeout = null;\n }, 1000);\n }\n };\n\n return html`\n <div style=\"display: flex; margin-left: var(--lumo-space-m)\">\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <vaadin-button\n data-testid=\"sign-out\"\n aria-label=${this.t('sign_out').toString()}\n style=\"padding: var(--lumo-space-xs); margin: 0; border-radius: 100%; display: flex\"\n theme=\"icon\"\n ?disabled=${this.disabledSelector.matches(scope) || !isCustomerLoaded || state !== 'idle'}\n @click=${handleClick}\n >\n ${state === 'idle'\n ? html`<iron-icon icon=\"icons:exit-to-app\"></iron-icon>`\n : html`\n <foxy-spinner\n layout=\"no-label\"\n state=${state === 'fail' ? 'error' : 'busy'}\n style=\"margin: auto\"\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-customer')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n `}\n </vaadin-button>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n };\n\n private readonly __renderSubscriptions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:subscriptions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-subscriptions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .settings=${this.data}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-subscriptions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n private readonly __renderTransactions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:transactions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-transactions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-transactions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n render(): TemplateResult {\n const hiddenSelector = this.hiddenSelector.zoom('customer');\n const extendedhiddencontrolsArray = [\n hiddenSelector.toString(),\n 'header:actions:edit:form:delete',\n 'attributes',\n 'transactions',\n 'subscriptions',\n 'addresses:actions:create',\n 'payment-methods:list:card',\n ];\n\n const templates: CustomerTemplates = this.getNestedTemplates('customer');\n const originalHeaderActionsAfterTemplate = templates['header:actions:after'];\n const originalTimestampsAfterTemplate = templates['header:actions:edit:form:timestamps:after'];\n const originalDefaultTemplate = templates['default'];\n\n templates['header:actions:after'] = (html, host) => {\n const isSignOutHidden = host.hiddenSelector.matches('header:actions:sign-out', true);\n return html`\n <div style=\"display:flex\">\n ${isSignOutHidden ? '' : this.__renderHeaderActionsSignOut()}\n ${originalHeaderActionsAfterTemplate?.(html, host)}\n </div>\n `;\n };\n\n templates['default'] = (html, host) => {\n const renderSubscriptions = this.__renderSubscriptions;\n const renderTransactions = this.__renderTransactions;\n\n return html`\n <style>\n .space-y-m > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(var(--lumo-space-m, 1rem) * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(var(--lumo-space-m, 1rem) * var(--tw-space-y-reverse));\n }\n </style>\n\n ${hiddenSelector.matches('default', true) ? '' : originalDefaultTemplate?.(html, host)}\n\n <div class=\"space-y-m\">\n ${hiddenSelector.matches('subscriptions', true) ? '' : renderSubscriptions(html, host)}\n ${hiddenSelector.matches('transactions', true) ? '' : renderTransactions(html, host)}\n </div>\n `;\n };\n\n templates['header:actions:edit:form:timestamps:after'] = (html, host) => {\n const scope = 'change-password';\n\n return html`\n ${originalTimestampsAfterTemplate?.(html, host)}\n ${host.hiddenSelector.matches(scope, true)\n ? ''\n : html`\n ${host.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-change-password\n customer=${host.href}\n session=\"foxy://customer-api/session\"\n style=\"margin-top: var(--lumo-space-l)\"\n email=${host.data?.email ?? ''}\n lang=${host.lang}\n ns=${host.ns}\n ?disabled=${host.in('busy') || host.disabledSelector.matches(scope, true)}\n >\n </foxy-internal-customer-portal-change-password>\n\n ${host.renderTemplateOrSlot(`${scope}:after`)}\n `}\n `;\n };\n\n return html`\n <foxy-customer\n readonlycontrols=${this.readonlySelector.zoom('customer').toString()}\n disabledcontrols=${this.disabledSelector.zoom('customer').toString()}\n hiddencontrols=${extendedhiddencontrolsArray.join(' ').trim()}\n data-testid=\"customer\"\n group=${this.group}\n href=${this.customer}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-customer')?.defaultNS ?? ''}\"\n id=\"customer\"\n .templates=${templates}\n @update=${() => this.requestUpdate()}\n >\n </foxy-customer>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.loggingOutStateResetTimeout) clearTimeout(this.loggingOutStateResetTimeout);\n }\n\n private get __customerElement() {\n return this.renderRoot.querySelector<Customer>('#customer');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalCustomerPortalLoggedInView.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAY,wCAAqC;AAC3E,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE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-html';\n\nimport { API } from '../NucleonElement/API';\nimport { Customer } from '../Customer/Customer';\nimport { Templates as CustomerTemplates } from '../Customer/types';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/customer';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { Templates } from './types';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\n\nconst Base = ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement)));\ntype Data = Resource<Rels.CustomerPortalSettings>;\n\nexport class InternalCustomerPortalLoggedInView extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n customer: { type: String },\n loggingOutState: { attribute: false },\n loggingOutStateResetTimeout: { attribute: false },\n };\n }\n\n templates: Templates = {};\n\n customer = '';\n\n loggingOutState: 'idle' | 'busy' | 'fail' = 'idle';\n\n loggingOutStateResetTimeout: NodeJS.Timeout | null = null;\n\n private readonly __renderHeaderActionsSignOut = () => {\n const scope = 'customer:header:actions:sign-out';\n const state = this.loggingOutState;\n const isCustomerLoaded = !!this.__customerElement?.in({ idle: 'snapshot' });\n const handleClick = async () => {\n try {\n this.loggingOutState = 'busy';\n await new API(this).fetch('foxy://customer-api/session', { method: 'DELETE' });\n this.loggingOutState = 'idle';\n } catch {\n this.loggingOutState = 'fail';\n this.loggingOutStateResetTimeout = setTimeout(() => {\n this.loggingOutState = 'idle';\n this.loggingOutStateResetTimeout = null;\n }, 1000);\n }\n };\n\n return html`\n <div style=\"display: flex; margin-left: var(--lumo-space-m)\">\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <vaadin-button\n data-testid=\"sign-out\"\n aria-label=${this.t('sign_out').toString()}\n style=\"padding: var(--lumo-space-xs); margin: 0; border-radius: 100%; display: flex\"\n theme=\"icon\"\n ?disabled=${this.disabledSelector.matches(scope) || !isCustomerLoaded || state !== 'idle'}\n @click=${handleClick}\n >\n ${state === 'idle'\n ? html`<iron-icon icon=\"icons:exit-to-app\"></iron-icon>`\n : html`\n <foxy-spinner\n layout=\"no-label\"\n state=${state === 'fail' ? 'error' : 'busy'}\n style=\"margin: auto\"\n lang=${this.lang}\n ns=${[\n this.ns,\n customElements.get('foxy-customer')?.defaultNS ?? '',\n customElements.get('foxy-spinner')?.defaultNS ?? '',\n ].join(' ')}\n >\n </foxy-spinner>\n `}\n </vaadin-button>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n };\n\n private readonly __renderSubscriptions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:subscriptions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-subscriptions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .settings=${this.data}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-subscriptions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n private readonly __renderTransactions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:transactions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-transactions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-transactions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n render(): TemplateResult {\n const hiddenSelector = this.hiddenSelector.zoom('customer');\n const optionallyHiddenInCustomer = ['payment-methods'];\n const alwaysHiddenInCustomer = [\n 'attributes',\n 'transactions',\n 'subscriptions',\n 'addresses:actions:create',\n 'header:actions:edit:form:delete',\n ];\n\n const customerHiddenControls = [\n ...optionallyHiddenInCustomer\n .filter(id => hiddenSelector.matches(id))\n .map(id => `${id}:${hiddenSelector.zoom(id)}`),\n\n ...alwaysHiddenInCustomer.map(id => {\n const splitId = id.split(':');\n\n for (let i = 0; i < splitId.length; ++i) {\n const hostId = splitId.slice(0, i + 1).join(':');\n if (hiddenSelector.matches(hostId, true)) return hostId;\n }\n\n return id;\n }),\n ];\n\n const templates: CustomerTemplates = this.getNestedTemplates('customer');\n const originalHeaderActionsAfterTemplate = templates['header:actions:after'];\n const originalTimestampsAfterTemplate = templates['header:actions:edit:form:timestamps:after'];\n const originalDefaultTemplate = templates['default'];\n\n templates['header:actions:after'] = (html, host) => {\n const isSignOutHidden = hiddenSelector.matches('header:actions:sign-out', true);\n return html`\n <div style=\"display:flex\">\n ${isSignOutHidden ? '' : this.__renderHeaderActionsSignOut()}\n ${originalHeaderActionsAfterTemplate?.(html, host)}\n </div>\n `;\n };\n\n templates['default'] = (html, host) => {\n const renderSubscriptions = this.__renderSubscriptions;\n const renderTransactions = this.__renderTransactions;\n\n return html`\n <style>\n .space-y-m > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(var(--lumo-space-m, 1rem) * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(var(--lumo-space-m, 1rem) * var(--tw-space-y-reverse));\n }\n </style>\n\n ${hiddenSelector.matches('default', true) ? '' : originalDefaultTemplate?.(html, host)}\n\n <div class=\"space-y-m\">\n ${hiddenSelector.matches('subscriptions', true) ? '' : renderSubscriptions(html, host)}\n ${hiddenSelector.matches('transactions', true) ? '' : renderTransactions(html, host)}\n </div>\n `;\n };\n\n templates['header:actions:edit:form:timestamps:after'] = (html, host) => {\n const scope = 'change-password';\n\n return html`\n ${originalTimestampsAfterTemplate?.(html, host)}\n ${host.hiddenSelector.matches(scope, true)\n ? ''\n : html`\n ${host.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-change-password\n customer=${host.href}\n session=\"foxy://customer-api/session\"\n style=\"margin-top: var(--lumo-space-l)\"\n email=${host.data?.email ?? ''}\n lang=${host.lang}\n ns=${host.ns}\n ?disabled=${host.in('busy') || host.disabledSelector.matches(scope, true)}\n >\n </foxy-internal-customer-portal-change-password>\n\n ${host.renderTemplateOrSlot(`${scope}:after`)}\n `}\n `;\n };\n\n return html`\n <foxy-customer\n readonlycontrols=${this.readonlySelector.zoom('customer').toString()}\n disabledcontrols=${this.disabledSelector.zoom('customer').toString()}\n hiddencontrols=${customerHiddenControls.join(' ')}\n data-testid=\"customer\"\n group=${this.group}\n href=${this.customer}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-customer')?.defaultNS ?? ''}\"\n id=\"customer\"\n .templates=${templates}\n @update=${() => this.requestUpdate()}\n >\n </foxy-customer>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.loggingOutStateResetTimeout) clearTimeout(this.loggingOutStateResetTimeout);\n }\n\n private get __customerElement() {\n return this.renderRoot.querySelector<Customer>('#customer');\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
9
9
|
this.group = '';
|
|
10
10
|
this.page = 'sign-in';
|
|
11
11
|
this.__renderAccessRecoveryHeader = () => {
|
|
12
|
+
var _a, _b, _c, _d;
|
|
12
13
|
const { lang, ns } = this;
|
|
13
14
|
const formId = '#access-recovery-form';
|
|
14
15
|
const form = this.renderRoot.querySelector(formId);
|
|
@@ -21,7 +22,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
21
22
|
class="text-xxl font-bold ${isBusy ? 'text-disabled' : 'text-body'}"
|
|
22
23
|
lang=${lang}
|
|
23
24
|
key="recover_access"
|
|
24
|
-
ns
|
|
25
|
+
ns="${ns} ${(_b = (_a = customElements.get('foxy-access-recovery-form')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
25
26
|
>
|
|
26
27
|
</foxy-i18n>
|
|
27
28
|
|
|
@@ -29,7 +30,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
29
30
|
class="text-l ${isBusy ? 'text-disabled' : 'text-secondary'}"
|
|
30
31
|
lang=${lang}
|
|
31
32
|
key="recover_access_hint"
|
|
32
|
-
ns
|
|
33
|
+
ns="${ns} ${(_d = (_c = customElements.get('foxy-access-recovery-form')) === null || _c === void 0 ? void 0 : _c.defaultNS) !== null && _d !== void 0 ? _d : ''}"
|
|
33
34
|
>
|
|
34
35
|
</foxy-i18n>
|
|
35
36
|
|
|
@@ -38,6 +39,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
38
39
|
`;
|
|
39
40
|
};
|
|
40
41
|
this.__renderAccessRecoveryBack = () => {
|
|
42
|
+
var _a, _b;
|
|
41
43
|
const formId = '#access-recovery-form';
|
|
42
44
|
const form = this.renderRoot.querySelector(formId);
|
|
43
45
|
const disabledSelector = this.disabledSelector.zoom('access-recovery');
|
|
@@ -52,7 +54,12 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
52
54
|
?disabled=${!!(form === null || form === void 0 ? void 0 : form.in('busy')) || disabledSelector.matches('back', true)}
|
|
53
55
|
@click=${() => (this.page = 'sign-in')}
|
|
54
56
|
>
|
|
55
|
-
<foxy-i18n
|
|
57
|
+
<foxy-i18n
|
|
58
|
+
lang=${this.lang}
|
|
59
|
+
key="back"
|
|
60
|
+
ns="${this.ns} ${(_b = (_a = customElements.get('foxy-access-recovery-form')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
61
|
+
>
|
|
62
|
+
</foxy-i18n>
|
|
56
63
|
</vaadin-button>
|
|
57
64
|
|
|
58
65
|
${this.renderTemplateOrSlot('access-recovery:back:after')}
|
|
@@ -108,6 +115,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
108
115
|
`;
|
|
109
116
|
};
|
|
110
117
|
this.__renderSignInHeader = () => {
|
|
118
|
+
var _a, _b, _c, _d;
|
|
111
119
|
const { lang, ns } = this;
|
|
112
120
|
const formId = '#sign-in-form';
|
|
113
121
|
const form = this.renderRoot.querySelector(formId);
|
|
@@ -120,7 +128,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
120
128
|
class="text-xxl font-bold ${isBusy ? 'text-disabled' : 'text-body'}"
|
|
121
129
|
lang=${lang}
|
|
122
130
|
key="sign_in"
|
|
123
|
-
ns
|
|
131
|
+
ns="${ns} ${(_b = (_a = customElements.get('foxy-sign-in-form')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
124
132
|
>
|
|
125
133
|
</foxy-i18n>
|
|
126
134
|
|
|
@@ -128,7 +136,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
128
136
|
class="text-l ${isBusy ? 'text-disabled' : 'text-secondary'}"
|
|
129
137
|
lang=${lang}
|
|
130
138
|
key="sign_in_hint"
|
|
131
|
-
ns
|
|
139
|
+
ns="${ns} ${(_d = (_c = customElements.get('foxy-sign-in-form')) === null || _c === void 0 ? void 0 : _c.defaultNS) !== null && _d !== void 0 ? _d : ''}"
|
|
132
140
|
>
|
|
133
141
|
</foxy-i18n>
|
|
134
142
|
|
|
@@ -137,6 +145,7 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
137
145
|
`;
|
|
138
146
|
};
|
|
139
147
|
this.__renderSignInRecover = () => {
|
|
148
|
+
var _a, _b;
|
|
140
149
|
const form = this.renderRoot.querySelector('#sign-in-form');
|
|
141
150
|
const disabledSelector = this.disabledSelector.zoom('sign-in');
|
|
142
151
|
return html `
|
|
@@ -150,7 +159,12 @@ export class InternalCustomerPortalLoggedOutView extends Base {
|
|
|
150
159
|
?disabled=${!!(form === null || form === void 0 ? void 0 : form.in('busy')) || disabledSelector.matches('recover', true)}
|
|
151
160
|
@click=${() => (this.page = 'access-recovery')}
|
|
152
161
|
>
|
|
153
|
-
<foxy-i18n
|
|
162
|
+
<foxy-i18n
|
|
163
|
+
lang=${this.lang}
|
|
164
|
+
key="recover_access"
|
|
165
|
+
ns="${this.ns} ${(_b = (_a = customElements.get('foxy-sign-in-form')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
166
|
+
>
|
|
167
|
+
</foxy-i18n>
|
|
154
168
|
</vaadin-button>
|
|
155
169
|
|
|
156
170
|
${this.renderTemplateOrSlot('sign-in:recover:after')}
|