@foxy.io/elements 1.15.0-beta.8 → 1.16.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-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 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +13 -13
- package/dist/cdn/foxy-customer.js +3 -3
- 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 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- 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 -1
- 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 -1
- package/dist/cdn/foxy-report-form.js +195 -0
- package/dist/cdn/foxy-reports-table.js +41 -0
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +5 -5
- 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-46ee137f.js → shared-01cbd43c.js} +10 -10
- package/dist/cdn/{shared-b710881a.js → shared-0389f098.js} +2 -2
- package/dist/cdn/{shared-1a67bc75.js → shared-147e571b.js} +4 -4
- package/dist/cdn/{shared-c5de42f7.js → shared-1d2cc2fb.js} +1 -1
- package/dist/cdn/shared-1e57180b.js +1 -0
- package/dist/cdn/{shared-02945b27.js → shared-1fa5f9a9.js} +1 -1
- package/dist/cdn/{shared-07134f93.js → shared-2558daa0.js} +1 -1
- package/dist/cdn/{shared-59e44f29.js → shared-25f67779.js} +1 -1
- package/dist/cdn/{shared-fab8c705.js → shared-269fb742.js} +10 -10
- package/dist/cdn/shared-27277bbb.js +1 -0
- package/dist/cdn/{shared-218ba06e.js → shared-2b3f17cf.js} +1 -1
- package/dist/cdn/{shared-60126eee.js → shared-2f8bf5d9.js} +1 -1
- package/dist/cdn/{shared-a23cf7c8.js → shared-312131d3.js} +1 -1
- package/dist/cdn/{shared-448781f9.js → shared-34f68715.js} +1 -1
- package/dist/cdn/{shared-b5754a42.js → shared-3a06bd7f.js} +1 -1
- package/dist/cdn/{shared-1934524e.js → shared-3c85dcd8.js} +2 -2
- package/dist/cdn/{shared-e209cb55.js → shared-3f26cae2.js} +1 -1
- package/dist/cdn/{shared-a040d79d.js → shared-41272a67.js} +1 -1
- package/dist/cdn/shared-41f3f823.js +29 -0
- package/dist/cdn/{shared-f4ad24f4.js → shared-44633760.js} +1 -1
- package/dist/cdn/{shared-223508ae.js → shared-4dc82211.js} +7 -7
- package/dist/cdn/{shared-63eaded9.js → shared-4ec62366.js} +6 -6
- package/dist/cdn/{shared-09069d7c.js → shared-57a8ee05.js} +1 -1
- package/dist/cdn/{shared-253e59d2.js → shared-5e9d8142.js} +1 -1
- package/dist/cdn/shared-5fd50b58.js +1 -0
- package/dist/cdn/{shared-21419f10.js → shared-65cfddfd.js} +1 -1
- package/dist/cdn/shared-6974569c.js +201 -0
- package/dist/cdn/{shared-9221e6b2.js → shared-701d5a7c.js} +1 -1
- package/dist/cdn/{shared-7f0a9790.js → shared-7cf914d7.js} +1 -1
- package/dist/cdn/{shared-4dc6d228.js → shared-7d337241.js} +1 -1
- package/dist/cdn/{shared-dcc9c325.js → shared-7e107668.js} +1 -1
- package/dist/cdn/shared-85b8ae57.js +12 -0
- package/dist/cdn/{shared-6d45a07b.js → shared-8695b424.js} +1 -1
- package/dist/cdn/{shared-39e3ae67.js → shared-8fc0b3ee.js} +1 -1
- package/dist/cdn/{shared-756034e4.js → shared-916ef4d3.js} +1 -1
- package/dist/cdn/{shared-08c63028.js → shared-9728b5f8.js} +1 -1
- package/dist/cdn/{shared-b9f18aaa.js → shared-a42088ee.js} +1 -1
- package/dist/cdn/{shared-5a54a9bc.js → shared-a82f8b58.js} +1 -1
- package/dist/cdn/{shared-65dfd512.js → shared-b161b269.js} +1 -1
- package/dist/cdn/{shared-5535f38f.js → shared-bad032de.js} +1 -1
- package/dist/cdn/{shared-20b9ce70.js → shared-bec9e9ce.js} +5 -5
- package/dist/cdn/{shared-a7b6feb2.js → shared-c722fc23.js} +1 -1
- package/dist/cdn/{shared-e2c878c7.js → shared-cd262e68.js} +10 -10
- package/dist/cdn/{shared-df730f90.js → shared-d2228670.js} +1 -1
- package/dist/cdn/{shared-b0f0e8b5.js → shared-d3cf78c1.js} +1 -1
- package/dist/cdn/{shared-073cb8e9.js → shared-e69e1ca3.js} +1 -1
- package/dist/cdn/shared-f0515999.js +1 -0
- package/dist/cdn/{shared-0f38a631.js → shared-f1107e25.js} +1 -1
- 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/report-form/en.json +38 -0
- package/dist/cdn/translations/reports-table/en.json +21 -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/Choice/Choice.js +1 -0
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +5 -5
- package/dist/elements/private/FrequencyInput/FrequencyInput.js +7 -22
- 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/CouponCard/CouponCard.js +2 -1
- package/dist/elements/public/CouponCard/CouponCard.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +5 -5
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +199 -164
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +4 -3
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +5 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -1
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +3 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +3 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -1
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +3 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +3 -2
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
- 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 +18 -5
- 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/ErrorEntryCard/ErrorEntryCard.js +2 -1
- package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +6 -6
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +103 -85
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.d.ts +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js +3 -3
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js.map +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.d.ts +1 -3
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js +2 -4
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js.map +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.d.ts +1 -3
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js +2 -2
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
- package/dist/elements/public/I18n/format/discount.js +2 -2
- package/dist/elements/public/I18n/format/discount.js.map +1 -1
- package/dist/elements/public/Pagination/Pagination.js +4 -0
- package/dist/elements/public/Pagination/Pagination.js.map +1 -1
- package/dist/elements/public/ReportForm/ReportForm.d.ts +48 -0
- package/dist/elements/public/ReportForm/ReportForm.js +391 -0
- package/dist/elements/public/ReportForm/ReportForm.js.map +1 -0
- package/dist/elements/public/ReportForm/index.d.ts +11 -0
- package/dist/elements/public/ReportForm/index.js +13 -0
- package/dist/elements/public/ReportForm/index.js.map +1 -0
- package/dist/elements/public/ReportForm/types.d.ts +17 -0
- package/dist/elements/public/ReportForm/types.js +2 -0
- package/dist/elements/public/ReportForm/types.js.map +1 -0
- package/dist/elements/public/ReportForm/utils.d.ts +16 -0
- package/dist/elements/public/ReportForm/utils.js +73 -0
- package/dist/elements/public/ReportForm/utils.js.map +1 -0
- package/dist/elements/public/ReportsTable/ReportsTable.d.ts +21 -0
- package/dist/elements/public/ReportsTable/ReportsTable.js +101 -0
- package/dist/elements/public/ReportsTable/ReportsTable.js.map +1 -0
- package/dist/elements/public/ReportsTable/index.d.ts +4 -0
- package/dist/elements/public/ReportsTable/index.js +6 -0
- package/dist/elements/public/ReportsTable/index.js.map +1 -0
- package/dist/elements/public/ReportsTable/types.d.ts +3 -0
- package/dist/elements/public/ReportsTable/types.js +2 -0
- package/dist/elements/public/ReportsTable/types.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/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 +2 -0
- package/dist/elements/public/index.defined.d.ts +2 -0
- package/dist/elements/public/index.defined.js +2 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +2 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +6523 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/mixins/translatable.js +1 -1
- package/dist/mixins/translatable.js.map +1 -1
- package/package.json +3 -3
- package/dist/cdn/shared-07049bfe.js +0 -1
- package/dist/cdn/shared-11708514.js +0 -1
- package/dist/cdn/shared-66633ff7.js +0 -1
- package/dist/cdn/shared-805d18a2.js +0 -1
- package/dist/cdn/shared-8b20bc23.js +0 -12
- package/dist/cdn/shared-e68b9c83.js +0 -1
- package/dist/cdn/shared-ff79f3f9.js +0 -230
- package/dist/cdn/translations/shared/de.json +0 -271
- package/dist/cdn/translations/shared/en.json +0 -557
- package/dist/cdn/translations/shared/es.json +0 -272
- package/dist/cdn/translations/shared/zh-hk.json +0 -179
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionForm.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionForm/SubscriptionForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,+BAA4B;AAE9D,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,cAAc,EAAE,mCAAgC;AAEzD,OAAO,EAAE,OAAO,EAAE,wCAAqC;AAEvD,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,kDAA+C;AAE3E,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAChE,OAAO,EAAE,aAAa,EAAE,yCAAsC;AAE9D,MAAM,EAAE,GAAG,mBAAmB,CAAC;AAC/B,MAAM,IAAI,GAAG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qB,CAAC;YAC/C,YAAY,EAAE,IAAI,CAAC,IAAI;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC;IACzC,CAAC;IAED,IAAY,aAAa;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAE7D,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;YAC/C,YAAY,EAAE,IAAI,CAAC,IAAI;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import { Choice, Group, Skeleton } from '../../private/index';\nimport { Data, Item, Settings, Templates } from './types';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\nimport {\n getAllowedFrequencies,\n getNextTransactionDateConstraints,\n isNextTransactionDate,\n} from '@foxy.io/sdk/customer';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { CellContext } from '../Table/types';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { FormDialog } from '../FormDialog';\nimport { InternalCalendar } from '../../internal/InternalCalendar';\nimport { NucleonElement } from '../NucleonElement/index';\nimport { PageRendererContext } from '../CollectionPages/types';\nimport { Preview } from '../ItemsForm/private/Preview';\nimport { PropertyDeclarations } from 'lit-element';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TransactionsTable } from '../TransactionsTable/TransactionsTable';\nimport { Data as TransactionsTableData } from '../TransactionsTable/types';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { parseFrequency } from '../../../utils/parse-frequency';\nimport { serializeDate } from '../../../utils/serialize-date';\n\nconst NS = 'subscription-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * Form element for creating or editing subscriptions.\n *\n * @slot header:before - **new in v1.4.0**\n * @slot header:after - **new in v1.4.0**\n *\n * @slot items:before - **new in v1.4.0**\n * @slot items:after - **new in v1.4.0**\n * @slot items:actions:before - **new in v1.4.0**\n * @slot items:actions:after - **new in v1.4.0**\n *\n * @slot end-date:before - **new in v1.4.0**\n * @slot end-date:after - **new in v1.4.0**\n *\n * @slot next-transaction-date:before - **new in v1.4.0**\n * @slot next-transaction-date:after - **new in v1.4.0**\n *\n * @slot frequency:before - **new in v1.4.0**\n * @slot frequency: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 * @element foxy-subscription-form\n * @since 1.2.0\n */\nexport class SubscriptionForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-internal-calendar': customElements.get('foxy-internal-calendar'),\n 'foxy-collection-pages': customElements.get('foxy-collection-pages'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'vcf-tooltip': customElements.get('vcf-tooltip'),\n 'foxy-table': customElements.get('foxy-table'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'iron-icon': customElements.get('iron-icon'),\n 'x-skeleton': Skeleton,\n 'x-preview': Preview,\n 'x-choice': Choice,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n settings: { type: Object },\n };\n }\n\n settings: Settings | null = null;\n\n templates: Templates = {};\n\n private readonly __renderHeaderSubtitle = () => {\n const { data, lang, ns } = this;\n\n if (data) {\n let color = 'text-secondary';\n let date: string;\n let key: string;\n\n if (data.first_failed_transaction_date) {\n color = 'text-error';\n date = data.first_failed_transaction_date;\n key = 'subscription_failed';\n } else if (data.end_date) {\n date = data.end_date;\n const hasEnded = new Date(date).getTime() > Date.now();\n key = hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled';\n } else {\n date = data.next_transaction_date ?? new Date().toISOString();\n key = `subscription_${data.is_active ? 'active' : 'inactive'}`;\n }\n\n const text = html`\n <foxy-i18n\n data-testid=\"header-subtitle\"\n options=${JSON.stringify({ date })}\n class=${color}\n lang=${lang}\n key=${key}\n ns=${ns}\n >\n </foxy-i18n>\n `;\n\n if (data.first_failed_transaction_date) {\n return html`\n <span id=\"status\" class=\"flex items-center space-x-xs ${color}\">\n ${text}<iron-icon icon=\"icons:info-outline\" class=\"icon-inline\"></iron-icon>\n </span>\n <vcf-tooltip for=\"status\" position=\"bottom\">\n <span class=\"text-s\">${data.error_message}</span>\n </vcf-tooltip>\n `;\n }\n\n return text;\n }\n\n return html`<x-skeleton class=\"w-full\" variant=\"static\"> </x-skeleton>`;\n };\n\n private readonly __renderHeaderTitle = () => {\n const { data, lang, ns } = this;\n\n if (data) {\n const frequency = parseFrequency(data.frequency);\n const currency = data._embedded['fx:last_transaction'].currency_code;\n const total = data._embedded['fx:last_transaction'].total_order;\n\n return html`\n <foxy-i18n\n data-testid=\"header-title\"\n options=${JSON.stringify({ ...frequency, amount: `${total} ${currency}` })}\n lang=${lang}\n key=\"price_${data.frequency === '.5m' ? 'twice_a_month' : 'recurring'}\"\n ns=${ns}\n >\n </foxy-i18n>\n `;\n }\n\n return html`<x-skeleton class=\"w-full\" variant=\"static\"> </x-skeleton>`;\n };\n\n private readonly __renderHeader = () => {\n return html`\n <div data-testid=\"header\">\n ${this.renderTemplateOrSlot('header:before')}\n <div class=\"leading-xs text-xxl font-bold\">${this.__renderHeaderTitle()}</div>\n <div class=\"leading-xs text-l\">${this.__renderHeaderSubtitle()}</div>\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n };\n\n private readonly __renderItemsActions = () => {\n return html`\n <div class=\"flex\" data-testid=\"items:actions\">\n ${this.renderTemplateOrSlot('items:actions:before')}\n\n <foxy-i18n\n data-testid=\"items:actions-label\"\n class=\"flex-1\"\n lang=${this.lang}\n key=\"item_plural\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n ${this.renderTemplateOrSlot('items:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderItemsItem = (item: Item) => {\n const price = item.price.toLocaleString(this.lang || 'en', {\n style: 'currency',\n currency: this.data!._embedded['fx:last_transaction'].currency_code,\n });\n\n let quantity: TemplateResult;\n\n if (item.quantity > 1) {\n quantity = html`\n <div\n data-testclass=\"item-quantity\"\n class=\"px-s h-xs rounded bg-contrast-5 flex items-center font-tnum text-contrast text-s font-bold\"\n >\n ${item.quantity}\n </div>\n `;\n } else {\n quantity = html``;\n }\n\n return html`\n <figure class=\"flex items-center space-x-m py-s pr-m\" data-testclass=\"item\">\n <x-preview\n data-testclass=\"item-preview\"\n class=\"w-l h-l\"\n .quantity=${item.quantity}\n .image=${item.image}\n >\n </x-preview>\n\n <figcaption class=\"leading-s flex-1 flex justify-between items-center\">\n <div class=\"flex flex-col\">\n <span class=\"font-medium\" data-testclass=\"item-name\">${item.name}</span>\n <span class=\"text-secondary text-s\" data-testclass=\"item-price\">${price}</span>\n </div>\n\n ${quantity}\n </figcaption>\n </figure>\n `;\n };\n\n private readonly __renderItems = () => {\n const hiddenSelector = this.hiddenSelector;\n const items = this.data?._embedded['fx:transaction_template']._embedded['fx:items'] ?? [];\n const label = hiddenSelector.matches('items:actions', true) ? '' : this.__renderItemsActions();\n\n return html`\n <div data-testid=\"items\">\n ${this.renderTemplateOrSlot('items:before')}\n <x-group frame>\n <div slot=\"header\">${label}</div>\n <div class=\"divide-y divide-contrast-10 pl-s\">${items.map(this.__renderItemsItem)}</div>\n </x-group>\n ${this.renderTemplateOrSlot('items:after')}\n </div>\n `;\n };\n\n private readonly __renderEndDate = () => {\n const { disabledSelector, lang, ns } = this;\n const formHiddenSelector = this.hiddenSelector.zoom('end-date:form').toString();\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('end-date:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom('end-date:form').toString()}\n disabledcontrols=${disabledSelector.zoom('end-date:form').toString()}\n hiddencontrols=\"save-button ${formHiddenSelector}\"\n data-testid=\"cancellation-form\"\n parent=${this.parent}\n header=\"end_subscription\"\n alert\n form=\"foxy-cancellation-form\"\n href=${this.href}\n lang=${lang}\n id=\"end-date-form\"\n ns=${ns}\n .templates=${this.getNestedTemplates('end-date:form')}\n >\n </foxy-form-dialog>\n\n <vaadin-button\n data-testid=\"end-date\"\n theme=\"error\"\n class=\"w-full\"\n ?disabled=${!this.data || disabledSelector.matches('end-date', true)}\n @click=${(evt: Event) => {\n const form = this.renderRoot.querySelector('#end-date-form') as FormDialog;\n form.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n key=\"end_subscription\" ns=${ns} lang=${lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('end-date:after')}\n </div>\n `;\n };\n\n private readonly __checkNextTransactionDateAvailability = (date: Date) => {\n const { settings, data: subscription } = this;\n\n if (settings && subscription) {\n const value = serializeDate(date);\n return isNextTransactionDate({ value, settings, subscription });\n }\n\n return date.getTime() >= Date.now();\n };\n\n private readonly __renderNextTransactionDate = () => {\n const { data, lang, ns } = this;\n const isActive = !!data?.is_active;\n\n return html`\n <div data-testid=\"next-transaction-date\">\n ${this.renderTemplateOrSlot('next-transaction-date:before')}\n\n <x-group frame>\n <foxy-i18n key=\"next_transaction_date\" ns=${ns} lang=${lang} slot=\"header\"></foxy-i18n>\n <foxy-internal-calendar\n start=${ifDefined(data?.next_transaction_date.substr(0, 10))}\n value=${ifDefined(data?.next_transaction_date)}\n lang=${lang}\n ?readonly=${!isActive || this.readonlySelector.matches('next-transaction-date', true)}\n ?disabled=${!data || this.disabledSelector.matches('next-transaction-date', true)}\n .checkAvailability=${this.__checkNextTransactionDateAvailability}\n @change=${(evt: Event) => {\n const target = evt.target as InternalCalendar;\n this.edit({ next_transaction_date: target.value });\n }}\n >\n </foxy-internal-calendar>\n </x-group>\n\n ${this.renderTemplateOrSlot('next-transaction-date:after')}\n </div>\n `;\n };\n\n private readonly __renderFrequencyAsDropdown = () => {\n const { data } = this;\n const active = !!data?.is_active;\n const items = this.__frequencies.map(v => ({\n label: this.t(v === '.5m' ? 'twice_a_month' : 'frequency', parseFrequency(v)),\n value: v,\n }));\n\n return html`\n <vaadin-combo-box\n item-value-path=\"value\"\n item-label-path=\"label\"\n data-testid=\"frequency\"\n ?disabled=${!data || this.disabledSelector.matches('frequency', true)}\n ?readonly=${data && (!active || this.readonlySelector.matches('frequency', true))}\n class=\"w-full\"\n label=${this.t('frequency_label').toString()}\n value=${ifDefined(this.form.frequency)}\n .items=${items}\n @change=${(evt: Event) => {\n this.edit({ frequency: (evt.target as HTMLInputElement).value });\n }}\n >\n </vaadin-combo-box>\n `;\n };\n\n private readonly __renderFrequencyAsRadioList = () => {\n const { data, lang, ns } = this;\n\n return html`\n <x-group frame>\n <foxy-i18n key=\"frequency_label\" ns=${ns} lang=${lang} slot=\"header\"></foxy-i18n>\n\n <x-choice\n default-custom-value=\"1d\"\n data-testid=\"frequency\"\n type=\"frequency\"\n ns=${SubscriptionForm.defaultNS}\n ?custom=${this.settings === null}\n .items=${this.__frequencies}\n .value=${this.form.frequency ?? null}\n ?disabled=${!data || this.disabledSelector.matches('frequency', true)}\n ?readonly=${data && (!data.is_active || this.readonlySelector.matches('frequency', true))}\n @change=${(evt: Event) => {\n this.edit({ frequency: (evt.target as HTMLInputElement).value });\n }}\n >\n ${this.__frequencies.map(\n frequency => html`\n <foxy-i18n\n options=${JSON.stringify(parseFrequency(frequency))}\n slot=\"${frequency}-label\"\n lang=${lang}\n key=${frequency === '.5m' ? 'twice_a_month' : 'frequency'}\n ns=${ns}\n >\n </foxy-i18n>\n `\n )}\n </x-choice>\n </x-group>\n `;\n };\n\n private readonly __renderFrequency = () => {\n return html`\n <div>\n ${this.renderTemplateOrSlot('frequency:before')}\n ${this.settings && this.__frequencies.length > 4\n ? this.__renderFrequencyAsDropdown()\n : this.__renderFrequencyAsRadioList()}\n ${this.renderTemplateOrSlot('frequency:after')}\n </div>\n `;\n };\n\n private readonly __transactionsTableColumns = [\n {\n cell(ctx: CellContext<TransactionsTableData>) {\n const colors: Record<string, string> = {\n declined: 'text-error',\n rejected: 'text-error',\n };\n\n const status = TransactionsTable.statusColumn.cell!(ctx);\n const price = TransactionsTable.priceColumn.cell!(ctx);\n const color = colors[ctx.data.status] ?? 'text-body';\n\n return ctx.html`\n <span class=\"sr-only\">${status}</span>\n <span class=\"${color} text-s\">${price}</span>\n `;\n },\n },\n { cell: TransactionsTable.idColumn.cell, hideBelow: 'sm' },\n { cell: TransactionsTable.dateColumn.cell },\n { cell: TransactionsTable.receiptColumn.cell },\n ];\n\n private readonly __renderTransactionsPage = ({ html, ...ctx }: PageRendererContext) => {\n return html`\n <foxy-table\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=\"${ctx.ns} ${customElements.get('foxy-transactions-table')?.defaultNS ?? ''}\"\n .columns=${this.__transactionsTableColumns}\n >\n </foxy-table>\n `;\n };\n\n private readonly __renderTransactions = () => {\n const { lang, ns } = this;\n\n return html`\n <div data-testid=\"transactions\">\n ${this.renderTemplateOrSlot('transactions:before')}\n\n <x-group frame>\n <foxy-i18n lang=${lang} slot=\"header\" key=\"transaction_plural\" ns=${ns}></foxy-i18n>\n <foxy-collection-pages\n group=${this.group}\n class=\"block divide-y divide-contrast-10 px-m\"\n first=${this.data?._links['fx:transactions'].href ?? ''}\n lang=${lang}\n ns=${ns}\n .page=${this.__renderTransactionsPage}\n >\n </foxy-collection-pages>\n </x-group>\n\n ${this.renderTemplateOrSlot('transactions:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n const isBusy = this.in('busy');\n const isFail = this.in('fail');\n\n return html`\n <div\n data-testid=\"wrapper\"\n aria-busy=${isBusy}\n aria-live=\"polite\"\n class=\"relative space-y-l text-body font-lumo text-m leading-m\"\n >\n ${this.hiddenSelector.matches('header', true) ? '' : this.__renderHeader()}\n ${this.hiddenSelector.matches('items', true) ? '' : this.__renderItems()}\n ${this.hiddenSelector.matches('end-date', true) ? '' : this.__renderEndDate()}\n ${this.__isNextTransactionDateVisible ? this.__renderNextTransactionDate() : ''}\n ${this.__isFrequencyVisible ? this.__renderFrequency() : ''}\n ${this.hiddenSelector.matches('transactions', true) ? '' : this.__renderTransactions()}\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=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private get __isNextTransactionDateVisible() {\n if (this.hiddenSelector.matches('next-transaction-date', true)) return false;\n if (this.data === null) return false;\n if (this.data.end_date && new Date(this.data.end_date).getTime() <= Date.now()) return false;\n if (this.data.is_active === false) return false;\n if (this.settings === null) return true;\n\n const rules = this.settings.subscriptions.allow_next_date_modification;\n return !!getNextTransactionDateConstraints(this.data, rules);\n }\n\n private get __isFrequencyVisible() {\n if (this.hiddenSelector.matches('frequency', true)) return false;\n if (this.data === null) return false;\n if (this.data.end_date && new Date(this.data.end_date).getTime() <= Date.now()) return false;\n if (this.data.is_active === false) return false;\n if (this.settings === null) return true;\n\n const allowedFrequencies = getAllowedFrequencies({\n subscription: this.data,\n settings: this.settings,\n });\n\n return !allowedFrequencies.next().done;\n }\n\n private get __frequencies() {\n if (!this.settings || !this.data) return ['.5m', '1m', '1y'];\n\n const allowedFrequencies = getAllowedFrequencies({\n subscription: this.data,\n settings: this.settings,\n });\n\n return Array.from(allowedFrequencies);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SubscriptionForm.js","sourceRoot":"","sources":["../../../../src/elements/public/SubscriptionForm/SubscriptionForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,+BAA4B;AAE9D,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,cAAc,EAAE,mCAAgC;AAEzD,OAAO,EAAE,OAAO,EAAE,wCAAqC;AAEvD,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,kDAA+C;AAE3E,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAChE,OAAO,EAAE,aAAa,EAAE,yCAAsC;AAE9D,MAAM,EAAE,GAAG,mBAAmB,CAAC;AAC/B,MAAM,IAAI,GAAG,mBAAmB,CAC9B,cAAc,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,CACzE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,gBAAiB,SAAQ,IAAU;IAAhD;;QA4BE,aAAQ,GAAoB,IAAI,CAAC;QAEjC,cAAS,GAAc,E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AE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAE7D,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;YAC/C,YAAY,EAAE,IAAI,CAAC,IAAI;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import { Choice, Group, Skeleton } from '../../private/index';\nimport { Data, Item, Settings, Templates } from './types';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\nimport {\n getAllowedFrequencies,\n getNextTransactionDateConstraints,\n isNextTransactionDate,\n} from '@foxy.io/sdk/customer';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { CellContext } from '../Table/types';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { FormDialog } from '../FormDialog';\nimport { InternalCalendar } from '../../internal/InternalCalendar';\nimport { NucleonElement } from '../NucleonElement/index';\nimport { PageRendererContext } from '../CollectionPages/types';\nimport { Preview } from '../ItemsForm/private/Preview';\nimport { PropertyDeclarations } from 'lit-element';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TransactionsTable } from '../TransactionsTable/TransactionsTable';\nimport { Data as TransactionsTableData } from '../TransactionsTable/types';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { parseFrequency } from '../../../utils/parse-frequency';\nimport { serializeDate } from '../../../utils/serialize-date';\n\nconst NS = 'subscription-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * Form element for creating or editing subscriptions.\n *\n * @slot header:before - **new in v1.4.0**\n * @slot header:after - **new in v1.4.0**\n *\n * @slot items:before - **new in v1.4.0**\n * @slot items:after - **new in v1.4.0**\n * @slot items:actions:before - **new in v1.4.0**\n * @slot items:actions:after - **new in v1.4.0**\n *\n * @slot end-date:before - **new in v1.4.0**\n * @slot end-date:after - **new in v1.4.0**\n *\n * @slot next-transaction-date:before - **new in v1.4.0**\n * @slot next-transaction-date:after - **new in v1.4.0**\n *\n * @slot frequency:before - **new in v1.4.0**\n * @slot frequency: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 * @element foxy-subscription-form\n * @since 1.2.0\n */\nexport class SubscriptionForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-internal-calendar': customElements.get('foxy-internal-calendar'),\n 'foxy-collection-pages': customElements.get('foxy-collection-pages'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'vcf-tooltip': customElements.get('vcf-tooltip'),\n 'foxy-table': customElements.get('foxy-table'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'iron-icon': customElements.get('iron-icon'),\n 'x-skeleton': Skeleton,\n 'x-preview': Preview,\n 'x-choice': Choice,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n settings: { type: Object },\n };\n }\n\n settings: Settings | null = null;\n\n templates: Templates = {};\n\n private readonly __renderHeaderSubtitle = () => {\n const { data, lang, ns } = this;\n\n if (data) {\n let color = 'text-secondary';\n let date: string;\n let key: string;\n\n if (data.first_failed_transaction_date) {\n color = 'text-error';\n date = data.first_failed_transaction_date;\n key = 'subscription_failed';\n } else if (data.end_date) {\n date = data.end_date;\n const hasEnded = new Date(date).getTime() > Date.now();\n key = hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled';\n } else {\n date = data.next_transaction_date ?? new Date().toISOString();\n key = `subscription_${data.is_active ? 'active' : 'inactive'}`;\n }\n\n const text = html`\n <foxy-i18n\n data-testid=\"header-subtitle\"\n options=${JSON.stringify({ date })}\n class=${color}\n lang=${lang}\n key=${key}\n ns=${ns}\n >\n </foxy-i18n>\n `;\n\n if (data.first_failed_transaction_date) {\n return html`\n <span id=\"status\" class=\"flex items-center space-x-xs ${color}\">\n ${text}<iron-icon icon=\"icons:info-outline\" class=\"icon-inline\"></iron-icon>\n </span>\n <vcf-tooltip for=\"status\" position=\"bottom\">\n <span class=\"text-s\">${data.error_message}</span>\n </vcf-tooltip>\n `;\n }\n\n return text;\n }\n\n return html`<x-skeleton class=\"w-full\" variant=\"static\"> </x-skeleton>`;\n };\n\n private readonly __renderHeaderTitle = () => {\n const { data, lang, ns } = this;\n\n if (data) {\n const frequency = parseFrequency(data.frequency);\n const currency = data._embedded['fx:last_transaction'].currency_code;\n const total = data._embedded['fx:last_transaction'].total_order;\n\n return html`\n <foxy-i18n\n data-testid=\"header-title\"\n options=${JSON.stringify({ ...frequency, amount: `${total} ${currency}` })}\n lang=${lang}\n key=\"price_${data.frequency === '.5m' ? 'twice_a_month' : 'recurring'}\"\n ns=${ns}\n >\n </foxy-i18n>\n `;\n }\n\n return html`<x-skeleton class=\"w-full\" variant=\"static\"> </x-skeleton>`;\n };\n\n private readonly __renderHeader = () => {\n return html`\n <div data-testid=\"header\">\n ${this.renderTemplateOrSlot('header:before')}\n <div class=\"leading-xs text-xxl font-bold\">${this.__renderHeaderTitle()}</div>\n <div class=\"leading-xs text-l\">${this.__renderHeaderSubtitle()}</div>\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n };\n\n private readonly __renderItemsActions = () => {\n return html`\n <div class=\"flex\" data-testid=\"items:actions\">\n ${this.renderTemplateOrSlot('items:actions:before')}\n\n <foxy-i18n\n data-testid=\"items:actions-label\"\n class=\"flex-1\"\n lang=${this.lang}\n key=\"item_plural\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n ${this.renderTemplateOrSlot('items:actions:after')}\n </div>\n `;\n };\n\n private readonly __renderItemsItem = (item: Item) => {\n const price = item.price.toLocaleString(this.lang || 'en', {\n style: 'currency',\n currency: this.data!._embedded['fx:last_transaction'].currency_code,\n });\n\n let quantity: TemplateResult;\n\n if (item.quantity > 1) {\n quantity = html`\n <div\n data-testclass=\"item-quantity\"\n class=\"px-s h-xs rounded bg-contrast-5 flex items-center font-tnum text-contrast text-s font-bold\"\n >\n ${item.quantity}\n </div>\n `;\n } else {\n quantity = html``;\n }\n\n return html`\n <figure class=\"flex items-center space-x-m py-s pr-m\" data-testclass=\"item\">\n <x-preview\n data-testclass=\"item-preview\"\n class=\"w-l h-l\"\n .quantity=${item.quantity}\n .image=${item.image}\n >\n </x-preview>\n\n <figcaption class=\"leading-s flex-1 flex justify-between items-center\">\n <div class=\"flex flex-col\">\n <span class=\"font-medium\" data-testclass=\"item-name\">${item.name}</span>\n <span class=\"text-secondary text-s\" data-testclass=\"item-price\">${price}</span>\n </div>\n\n ${quantity}\n </figcaption>\n </figure>\n `;\n };\n\n private readonly __renderItems = () => {\n const hiddenSelector = this.hiddenSelector;\n const items = this.data?._embedded['fx:transaction_template']._embedded['fx:items'] ?? [];\n const label = hiddenSelector.matches('items:actions', true) ? '' : this.__renderItemsActions();\n\n return html`\n <div data-testid=\"items\">\n ${this.renderTemplateOrSlot('items:before')}\n <x-group frame>\n <div slot=\"header\">${label}</div>\n <div class=\"divide-y divide-contrast-10 pl-s\">${items.map(this.__renderItemsItem)}</div>\n </x-group>\n ${this.renderTemplateOrSlot('items:after')}\n </div>\n `;\n };\n\n private readonly __renderEndDate = () => {\n const { disabledSelector, lang, ns } = this;\n const formHiddenSelector = this.hiddenSelector.zoom('end-date:form').toString();\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('end-date:before')}\n\n <foxy-form-dialog\n readonlycontrols=${this.readonlySelector.zoom('end-date:form').toString()}\n disabledcontrols=${disabledSelector.zoom('end-date:form').toString()}\n hiddencontrols=\"save-button ${formHiddenSelector}\"\n data-testid=\"cancellation-form\"\n parent=${this.parent}\n header=\"end_subscription\"\n alert\n form=\"foxy-cancellation-form\"\n href=${this.href}\n lang=${lang}\n id=\"end-date-form\"\n ns=${ns}\n .templates=${this.getNestedTemplates('end-date:form')}\n >\n </foxy-form-dialog>\n\n <vaadin-button\n data-testid=\"end-date\"\n theme=\"error\"\n class=\"w-full\"\n ?disabled=${!this.data || disabledSelector.matches('end-date', true)}\n @click=${(evt: Event) => {\n const form = this.renderRoot.querySelector('#end-date-form') as FormDialog;\n form.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n key=\"end_subscription\" ns=${ns} lang=${lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('end-date:after')}\n </div>\n `;\n };\n\n private readonly __checkNextTransactionDateAvailability = (date: Date) => {\n const { settings, data: subscription } = this;\n\n if (settings && subscription) {\n const value = serializeDate(date);\n return isNextTransactionDate({ value, settings, subscription });\n }\n\n return date.getTime() >= Date.now();\n };\n\n private readonly __renderNextTransactionDate = () => {\n const { data, lang, ns } = this;\n const isActive = !!data?.is_active;\n\n return html`\n <div data-testid=\"next-transaction-date\">\n ${this.renderTemplateOrSlot('next-transaction-date:before')}\n\n <x-group frame>\n <foxy-i18n key=\"next_transaction_date\" ns=${ns} lang=${lang} slot=\"header\"></foxy-i18n>\n <foxy-internal-calendar\n start=${ifDefined(data?.next_transaction_date.substr(0, 10))}\n value=${ifDefined(data?.next_transaction_date)}\n lang=${lang}\n ?readonly=${!isActive || this.readonlySelector.matches('next-transaction-date', true)}\n ?disabled=${!data || this.disabledSelector.matches('next-transaction-date', true)}\n .checkAvailability=${this.__checkNextTransactionDateAvailability}\n @change=${(evt: Event) => {\n const target = evt.target as InternalCalendar;\n this.edit({ next_transaction_date: target.value });\n }}\n >\n </foxy-internal-calendar>\n </x-group>\n\n ${this.renderTemplateOrSlot('next-transaction-date:after')}\n </div>\n `;\n };\n\n private readonly __renderFrequencyAsDropdown = () => {\n const { data } = this;\n const active = !!data?.is_active;\n const items = this.__frequencies.map(v => ({\n label: this.t(v === '.5m' ? 'twice_a_month' : 'frequency', parseFrequency(v)),\n value: v,\n }));\n\n return html`\n <vaadin-combo-box\n item-value-path=\"value\"\n item-label-path=\"label\"\n data-testid=\"frequency\"\n ?disabled=${!data || this.disabledSelector.matches('frequency', true)}\n ?readonly=${data && (!active || this.readonlySelector.matches('frequency', true))}\n class=\"w-full\"\n label=${this.t('frequency_label').toString()}\n value=${ifDefined(this.form.frequency)}\n .items=${items}\n @change=${(evt: Event) => {\n this.edit({ frequency: (evt.target as HTMLInputElement).value });\n }}\n >\n </vaadin-combo-box>\n `;\n };\n\n private readonly __renderFrequencyAsRadioList = () => {\n const { data, lang, ns } = this;\n\n return html`\n <x-group frame>\n <foxy-i18n key=\"frequency_label\" ns=${ns} lang=${lang} slot=\"header\"></foxy-i18n>\n\n <x-choice\n default-custom-value=\"1d\"\n data-testid=\"frequency\"\n type=\"frequency\"\n ns=${ns}\n ?custom=${this.settings === null}\n .items=${this.__frequencies}\n .value=${this.form.frequency ?? null}\n ?disabled=${!data || this.disabledSelector.matches('frequency', true)}\n ?readonly=${data && (!data.is_active || this.readonlySelector.matches('frequency', true))}\n @change=${(evt: Event) => {\n this.edit({ frequency: (evt.target as HTMLInputElement).value });\n }}\n >\n ${this.__frequencies.map(\n frequency => html`\n <foxy-i18n\n options=${JSON.stringify(parseFrequency(frequency))}\n slot=\"${frequency}-label\"\n lang=${lang}\n key=${frequency === '.5m' ? 'twice_a_month' : 'frequency'}\n ns=${ns}\n >\n </foxy-i18n>\n `\n )}\n </x-choice>\n </x-group>\n `;\n };\n\n private readonly __renderFrequency = () => {\n return html`\n <div>\n ${this.renderTemplateOrSlot('frequency:before')}\n ${this.settings && this.__frequencies.length > 4\n ? this.__renderFrequencyAsDropdown()\n : this.__renderFrequencyAsRadioList()}\n ${this.renderTemplateOrSlot('frequency:after')}\n </div>\n `;\n };\n\n private readonly __transactionsTableColumns = [\n {\n cell(ctx: CellContext<TransactionsTableData>) {\n const colors: Record<string, string> = {\n declined: 'text-error',\n rejected: 'text-error',\n };\n\n const status = TransactionsTable.statusColumn.cell!(ctx);\n const price = TransactionsTable.priceColumn.cell!(ctx);\n const color = colors[ctx.data.status] ?? 'text-body';\n\n return ctx.html`\n <span class=\"sr-only\">${status}</span>\n <span class=\"${color} text-s\">${price}</span>\n `;\n },\n },\n { cell: TransactionsTable.idColumn.cell, hideBelow: 'sm' },\n { cell: TransactionsTable.dateColumn.cell },\n { cell: TransactionsTable.receiptColumn.cell },\n ];\n\n private readonly __renderTransactionsPage = ({ html, ...ctx }: PageRendererContext) => {\n return html`\n <foxy-table\n group=${ctx.group}\n lang=${ctx.lang}\n href=${ctx.href}\n ns=\"${ctx.ns} ${customElements.get('foxy-transactions-table')?.defaultNS ?? ''}\"\n .columns=${this.__transactionsTableColumns}\n >\n </foxy-table>\n `;\n };\n\n private readonly __renderTransactions = () => {\n const { lang, ns } = this;\n\n return html`\n <div data-testid=\"transactions\">\n ${this.renderTemplateOrSlot('transactions:before')}\n\n <x-group frame>\n <foxy-i18n lang=${lang} slot=\"header\" key=\"transaction_plural\" ns=${ns}></foxy-i18n>\n <foxy-collection-pages\n group=${this.group}\n class=\"block divide-y divide-contrast-10 px-m\"\n first=${this.data?._links['fx:transactions'].href ?? ''}\n lang=${lang}\n ns=${ns}\n .page=${this.__renderTransactionsPage}\n >\n </foxy-collection-pages>\n </x-group>\n\n ${this.renderTemplateOrSlot('transactions:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n const isBusy = this.in('busy');\n const isFail = this.in('fail');\n\n return html`\n <div\n data-testid=\"wrapper\"\n aria-busy=${isBusy}\n aria-live=\"polite\"\n class=\"relative space-y-l text-body font-lumo text-m leading-m\"\n >\n ${this.hiddenSelector.matches('header', true) ? '' : this.__renderHeader()}\n ${this.hiddenSelector.matches('items', true) ? '' : this.__renderItems()}\n ${this.hiddenSelector.matches('end-date', true) ? '' : this.__renderEndDate()}\n ${this.__isNextTransactionDateVisible ? this.__renderNextTransactionDate() : ''}\n ${this.__isFrequencyVisible ? this.__renderFrequency() : ''}\n ${this.hiddenSelector.matches('transactions', true) ? '' : this.__renderTransactions()}\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=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private get __isNextTransactionDateVisible() {\n if (this.hiddenSelector.matches('next-transaction-date', true)) return false;\n if (this.data === null) return false;\n if (this.data.end_date && new Date(this.data.end_date).getTime() <= Date.now()) return false;\n if (this.data.is_active === false) return false;\n if (this.settings === null) return true;\n\n const rules = this.settings.subscriptions.allow_next_date_modification;\n return !!getNextTransactionDateConstraints(this.data, rules);\n }\n\n private get __isFrequencyVisible() {\n if (this.hiddenSelector.matches('frequency', true)) return false;\n if (this.data === null) return false;\n if (this.data.end_date && new Date(this.data.end_date).getTime() <= Date.now()) return false;\n if (this.data.is_active === false) return false;\n if (this.settings === null) return true;\n\n const allowedFrequencies = getAllowedFrequencies({\n subscription: this.data,\n settings: this.settings,\n });\n\n return !allowedFrequencies.next().done;\n }\n\n private get __frequencies() {\n if (!this.settings || !this.data) return ['.5m', '1m', '1y'];\n\n const allowedFrequencies = getAllowedFrequencies({\n subscription: this.data,\n settings: this.settings,\n });\n\n return Array.from(allowedFrequencies);\n }\n}\n"]}
|
|
@@ -184,7 +184,7 @@ export class TaxForm extends Base {
|
|
|
184
184
|
data-testid="spinner"
|
|
185
185
|
class=${classMap({
|
|
186
186
|
'transition duration-500 ease-in-out absolute inset-0 flex': true,
|
|
187
|
-
'opacity-0 pointer-events-none':
|
|
187
|
+
'opacity-0 pointer-events-none': this.in('idle'),
|
|
188
188
|
})}
|
|
189
189
|
>
|
|
190
190
|
<foxy-spinner
|
|
@@ -298,7 +298,7 @@ export class TaxForm extends Base {
|
|
|
298
298
|
value=${ifDefined(this.form.name)}
|
|
299
299
|
.checkValidity=${this.__getValidator('name')}
|
|
300
300
|
.errorMessage=${this.__getErrorMessage('name')}
|
|
301
|
-
?disabled=${this.in('
|
|
301
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('name', true)}
|
|
302
302
|
?readonly=${this.readonlySelector.matches('name', true)}
|
|
303
303
|
required
|
|
304
304
|
@keydown=${this.__submitOnEnter}
|
|
@@ -327,7 +327,7 @@ export class TaxForm extends Base {
|
|
|
327
327
|
class="w-full"
|
|
328
328
|
.items=${['global', 'union', 'country', 'region', 'local']}
|
|
329
329
|
.getText=${(value) => this.t(`tax_${value}`)}
|
|
330
|
-
?disabled=${this.in('
|
|
330
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('type', true)}
|
|
331
331
|
?readonly=${this.readonlySelector.matches('type', true)}
|
|
332
332
|
@change=${(evt) => {
|
|
333
333
|
this.edit({
|
|
@@ -355,6 +355,7 @@ export class TaxForm extends Base {
|
|
|
355
355
|
const isLoadingItems = this.__countriesService.state.matches('busy');
|
|
356
356
|
const isLoadingData = this.in('busy');
|
|
357
357
|
const isLoading = isLoadingItems || isLoadingData;
|
|
358
|
+
const isFail = this.in('fail');
|
|
358
359
|
const json = this.__countriesService.state.context.data;
|
|
359
360
|
const items = Object.values((_a = json === null || json === void 0 ? void 0 : json.values) !== null && _a !== void 0 ? _a : {});
|
|
360
361
|
return html `
|
|
@@ -373,7 +374,7 @@ export class TaxForm extends Base {
|
|
|
373
374
|
.errorMessage=${this.__getErrorMessage('country')}
|
|
374
375
|
.items=${items}
|
|
375
376
|
?allow-custom-value=${items.length === 0}
|
|
376
|
-
?disabled=${isLoading || this.disabledSelector.matches('country', true)}
|
|
377
|
+
?disabled=${isFail || isLoading || this.disabledSelector.matches('country', true)}
|
|
377
378
|
?readonly=${this.readonlySelector.matches('country', true)}
|
|
378
379
|
required
|
|
379
380
|
@change=${(evt) => {
|
|
@@ -400,6 +401,7 @@ export class TaxForm extends Base {
|
|
|
400
401
|
const isLoadingItems = this.__regionsService.state.matches('busy');
|
|
401
402
|
const isLoadingData = this.in('busy');
|
|
402
403
|
const isLoading = isLoadingItems || isLoadingData;
|
|
404
|
+
const isFail = this.in('fail');
|
|
403
405
|
const json = this.__regionsService.state.context.data;
|
|
404
406
|
const items = Object.values((_a = json === null || json === void 0 ? void 0 : json.values) !== null && _a !== void 0 ? _a : {});
|
|
405
407
|
return html `
|
|
@@ -418,7 +420,7 @@ export class TaxForm extends Base {
|
|
|
418
420
|
.errorMessage=${this.__getErrorMessage('region')}
|
|
419
421
|
.items=${items}
|
|
420
422
|
?allow-custom-value=${items.length === 0}
|
|
421
|
-
?disabled=${isLoading || this.disabledSelector.matches('region', true)}
|
|
423
|
+
?disabled=${isFail || isLoading || this.disabledSelector.matches('region', true)}
|
|
422
424
|
?readonly=${this.readonlySelector.matches('region', true)}
|
|
423
425
|
required
|
|
424
426
|
@change=${(evt) => {
|
|
@@ -444,7 +446,7 @@ export class TaxForm extends Base {
|
|
|
444
446
|
value=${ifDefined(this.form.city)}
|
|
445
447
|
.checkValidity=${this.__getValidator('city')}
|
|
446
448
|
.errorMessage=${this.__getErrorMessage('city')}
|
|
447
|
-
?disabled=${this.in('
|
|
449
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('city', true)}
|
|
448
450
|
?readonly=${this.readonlySelector.matches('city', true)}
|
|
449
451
|
required
|
|
450
452
|
@keydown=${this.__submitOnEnter}
|
|
@@ -482,7 +484,7 @@ export class TaxForm extends Base {
|
|
|
482
484
|
class="w-full"
|
|
483
485
|
.items=${items.map(item => item.value)}
|
|
484
486
|
.getText=${(value) => { var _a; return (_a = items.find(item => item.value === value)) === null || _a === void 0 ? void 0 : _a.label; }}
|
|
485
|
-
?disabled=${this.in('
|
|
487
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('provider', true)}
|
|
486
488
|
?readonly=${this.readonlySelector.matches('provider', true)}
|
|
487
489
|
@change=${(evt) => {
|
|
488
490
|
const newValue = evt.detail;
|
|
@@ -521,7 +523,7 @@ export class TaxForm extends Base {
|
|
|
521
523
|
has-controls
|
|
522
524
|
.checkValidity=${this.__getValidator('rate')}
|
|
523
525
|
.errorMessage=${this.__getErrorMessage('rate')}
|
|
524
|
-
?disabled=${this.in('
|
|
526
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('rate', true)}
|
|
525
527
|
?readonly=${this.readonlySelector.matches('rate', true)}
|
|
526
528
|
required
|
|
527
529
|
@keydown=${this.__submitOnEnter}
|
|
@@ -544,7 +546,7 @@ export class TaxForm extends Base {
|
|
|
544
546
|
<x-checkbox
|
|
545
547
|
data-testid="apply-to-shipping"
|
|
546
548
|
class="leading-s"
|
|
547
|
-
?disabled=${this.in('
|
|
549
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('apply-to-shipping', true)}
|
|
548
550
|
?readonly=${this.readonlySelector.matches('apply-to-shipping', true)}
|
|
549
551
|
?checked=${!!this.form.apply_to_shipping}
|
|
550
552
|
@change=${(evt) => this.edit({ apply_to_shipping: evt.detail })}
|
|
@@ -578,7 +580,7 @@ export class TaxForm extends Base {
|
|
|
578
580
|
<x-checkbox
|
|
579
581
|
data-testid="use-origin-rates"
|
|
580
582
|
class="leading-s"
|
|
581
|
-
?disabled=${this.in('
|
|
583
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('use-origin-rates', true)}
|
|
582
584
|
?readonly=${this.readonlySelector.matches('use-origin-rates', true)}
|
|
583
585
|
?checked=${!!this.form.use_origin_rates}
|
|
584
586
|
@change=${(evt) => this.edit({ use_origin_rates: evt.detail })}
|
|
@@ -613,7 +615,7 @@ export class TaxForm extends Base {
|
|
|
613
615
|
<x-checkbox
|
|
614
616
|
data-testid="${scope}"
|
|
615
617
|
class="leading-s"
|
|
616
|
-
?disabled=${this.in('
|
|
618
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches(scope, true)}
|
|
617
619
|
?readonly=${this.readonlySelector.matches(scope, true)}
|
|
618
620
|
?checked=${!!this.form.exempt_all_customer_tax_ids}
|
|
619
621
|
@change=${(evt) => {
|
|
@@ -671,7 +673,7 @@ export class TaxForm extends Base {
|
|
|
671
673
|
const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;
|
|
672
674
|
const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;
|
|
673
675
|
const isInvalid = isTemplateInvalid || isSnaphotInvalid;
|
|
674
|
-
const
|
|
676
|
+
const isIdle = this.in('idle');
|
|
675
677
|
return html `
|
|
676
678
|
<div>
|
|
677
679
|
${this.renderTemplateOrSlot('create:before')}
|
|
@@ -680,7 +682,7 @@ export class TaxForm extends Base {
|
|
|
680
682
|
data-testid="create"
|
|
681
683
|
class="w-full"
|
|
682
684
|
theme="primary success"
|
|
683
|
-
?disabled=${
|
|
685
|
+
?disabled=${!isIdle || isInvalid || this.disabledSelector.matches('create', true)}
|
|
684
686
|
@click=${this.submit}
|
|
685
687
|
>
|
|
686
688
|
<foxy-i18n ns=${this.ns} key="create" lang=${this.lang}></foxy-i18n>
|
|
@@ -713,7 +715,7 @@ export class TaxForm extends Base {
|
|
|
713
715
|
data-testid="delete"
|
|
714
716
|
theme="primary error"
|
|
715
717
|
class="w-full"
|
|
716
|
-
?disabled=${this.in('
|
|
718
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}
|
|
717
719
|
@click=${(evt) => {
|
|
718
720
|
const confirm = this.renderRoot.querySelector('#confirm');
|
|
719
721
|
confirm.show(evt.currentTarget);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaxForm.js","sourceRoot":"","sources":["../../../../src/elements/public/TaxForm/TaxForm.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;mBACnE,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAA0B,CAAC;YACnF,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,aAA8B,CAAC,CAAC;QACnD,CAAC;;0BAEe,IAAI,CAAC,EAAE,sBAAsB,IAAI,CAAC,IAAI;;;UAGtD,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;KAE9C,CAAC;IACJ,CAAC;IAEO,eAAe,CAAC,GAAkB;QACxC,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;CACF","sourcesContent":["import { Checkbox, Dropdown, PropertyTable } from '../../private/index';\nimport { CheckboxChangeEvent, DropdownChangeEvent } from '../../private/events';\nimport { Data, Templates } from './types';\nimport { Nucleon, Resource } from '@foxy.io/sdk/core';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { ComboBoxElement } from '@vaadin/vaadin-combo-box';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { IntegerFieldElement } from '@vaadin/vaadin-text-field/vaadin-integer-field';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\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 { interpret } from 'xstate';\n\n// prettier-ignore\nconst defaultLiveRateCountries: (string | undefined)[] = ['US', 'CA', 'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IM', 'IT', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK'];\nconst taxJarLiveRateCountries = [...defaultLiveRateCountries, 'AU'];\n\nconst NS = 'tax-form';\nconst Base = ConfigurableMixin(\n ThemeableMixin(ScopedElementsMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * Form element for creating or editing taxes (`fx:tax`).\n *\n * @slot name:before\n * @slot name:after\n *\n * @slot type:before\n * @slot type:after\n *\n * @slot country:before\n * @slot country:after\n *\n * @slot region:before\n * @slot region:after\n *\n * @slot city:before\n * @slot city:after\n *\n * @slot provider:before\n * @slot provider:after\n *\n * @slot rate:before\n * @slot rate:after\n *\n * @slot apply-to-shipping:before\n * @slot apply-to-shipping:after\n *\n * @slot use-origin-rates:before\n * @slot use-origin-rates:after\n *\n * @slot exempt-all-customer-tax-ids:before\n * @slot exempt-all-customer-tax-ids:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @element foxy-tax-form\n * @since 1.13.0\n */\nexport class TaxForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-integer-field': customElements.get('vaadin-integer-field'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'x-property-table': PropertyTable,\n 'x-checkbox': Checkbox,\n 'x-dropdown': Dropdown,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n countries: { type: String, noAccessor: true },\n regions: { type: String, noAccessor: true },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name_required',\n ({ name: v }) => !v || v.length <= 30 || 'name_too_long',\n ({ country: c, type: t }) => t !== 'country' || !!c || 'country_required',\n ({ country: c, type: t }) => t !== 'region' || !!c || 'country_required',\n ({ country: c, use_origin_rates: r }) => !r || !!c || 'country_required',\n ({ country: v }) => !v || !!v.match(/[A-Z]{2}/) || 'country_invalid',\n ({ region: v, type: t }) => t != 'region' || !!v || 'region_required',\n ({ region: v }) => !v || v.length <= 20 || 'region_too_long',\n ({ city: v }) => !v || v.length <= 50 || 'city_too_long',\n ({ city: c, type: t }) => t != 'local' || !!c || 'city_required',\n ({ rate: v }) => !v || v <= 100 || 'rate_invalid',\n ];\n }\n\n templates: Templates = {};\n\n private __previousCountry: string | undefined = undefined;\n\n private __countries = '';\n\n private __regions = '';\n\n private __countriesService = interpret(\n Nucleon.machine.withConfig({\n services: {\n sendGet: async () => {\n const response = await new TaxForm.API(this).fetch(this.countries);\n if (!response.ok) throw new Error(await response.text());\n return await response.json();\n },\n },\n })\n );\n\n private __regionsService = interpret(\n Nucleon.machine.withConfig({\n services: {\n sendGet: async () => {\n const url = new URL(this.regions);\n url.searchParams.set('country_code', this.form.country ?? 'US');\n const response = await new TaxForm.API(this).fetch(url.toString());\n if (!response.ok) throw new Error(await response.text());\n return await response.json();\n },\n },\n })\n );\n\n /** URI of the `fx:countries` hAPI resource. */\n get countries(): string {\n return this.__countries;\n }\n\n set countries(value: string) {\n this.__countries = value;\n\n if (value) {\n this.__countriesService.send({ type: 'FETCH' });\n } else {\n this.__countriesService.send({ type: 'SET_DATA', data: null });\n }\n }\n\n /** URI of the `fx:regions` hAPI resource. */\n get regions(): string {\n return this.__regions;\n }\n\n set regions(value: string) {\n this.__regions = value;\n\n if (value) {\n this.__regionsService.send({ type: 'FETCH' });\n } else {\n this.__regionsService.send({ type: 'SET_DATA', data: null });\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.__countriesService.onTransition(({ changed }) => changed && this.requestUpdate());\n this.__countriesService.onChange(() => this.requestUpdate());\n this.__countriesService.start();\n\n this.__regionsService.onTransition(({ changed }) => changed && this.requestUpdate());\n this.__regionsService.onChange(() => this.requestUpdate());\n this.__regionsService.start();\n }\n\n render(): TemplateResult {\n return html`\n <div class=\"relative space-y-m\">\n ${this.__isNameHidden ? null : this.__renderName()}\n ${this.__isTypeHidden ? null : this.__renderType()}\n ${this.__isCountryHidden ? null : this.__renderCountry()}\n ${this.__isRegionHidden ? null : this.__renderRegion()}\n ${this.__isCityHidden ? null : this.__renderCity()}\n ${this.__isProviderHidden ? null : this.__renderProvider()}\n ${this.__isRateHidden ? null : this.__renderRate()}\n ${this.__isApplyToShippingHidden ? null : this.__renderApplyToShipping()}\n ${this.__isUseOriginRatesHidden ? null : this.__renderUseOriginRates()}\n ${this.__isExemptAllCustomerTaxIdsHidden ? null : this.__renderExemptAllCustomerTaxIds()}\n ${this.__isTimestampsHidden ? null : this.__renderTimestamps()}\n ${this.__isCreateHidden ? null : this.__renderCreate()}\n ${this.__isDeleteHidden ? null : this.__renderDelete()}\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': !this.in('busy') && !this.in('fail'),\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' : this.in('busy') ? 'busy' : 'empty'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n\n if (this.form.country !== this.__previousCountry) {\n this.__previousCountry = this.form.country;\n this.__regionsService.send({ type: 'FETCH' });\n }\n\n // vaadin's combo box doesn't seem to validate on its own\n this.renderRoot.querySelectorAll('vaadin-combo-box').forEach(e => e.validate());\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.__countriesService.stop();\n this.__regionsService.stop();\n }\n\n private get __isNameHidden(): boolean {\n return this.hiddenSelector.matches('name', true);\n }\n\n private get __isTypeHidden(): boolean {\n return this.hiddenSelector.matches('type', true);\n }\n\n private get __isCountryHidden(): boolean {\n if (this.hiddenSelector.matches('country', true)) return true;\n if (this.form.type === 'union') return !this.form.use_origin_rates;\n return !(['country', 'region', 'local'] as unknown[]).includes(this.form.type);\n }\n\n private get __isRegionHidden(): boolean {\n if (this.hiddenSelector.matches('region', true)) return true;\n return this.form.type !== 'local' && this.form.type !== 'region';\n }\n\n private get __isCityHidden(): boolean {\n if (this.hiddenSelector.matches('city', true)) return true;\n return this.form.type !== 'local';\n }\n\n private get __isProviderHidden(): boolean {\n if (this.hiddenSelector.matches('provider', true)) return true;\n return !this.form.type || this.form.type === 'global' || this.form.type === 'local';\n }\n\n private get __isRateHidden(): boolean {\n if (this.hiddenSelector.matches('rate', true)) return true;\n return !this.form.type || this.form.is_live === true;\n }\n\n private get __isApplyToShippingHidden(): boolean {\n if (this.hiddenSelector.matches('apply-to-shipping', true)) return true;\n if (this.form.type === undefined) return true;\n return !!this.form.is_live && defaultLiveRateCountries.includes(this.form.country);\n }\n\n private get __isUseOriginRatesHidden(): boolean {\n if (this.hiddenSelector.matches('use-origin-rates', true)) return true;\n return this.form.type !== 'union' || !this.form.is_live || !!this.form.service_provider;\n }\n\n private get __isExemptAllCustomerTaxIdsHidden(): boolean {\n if (this.hiddenSelector.matches('exempt-all-customer-tax-ids', true)) return true;\n const provider = this.form.service_provider as string | undefined;\n return provider === undefined || provider === 'onesource' || provider === 'avalara';\n }\n\n private get __isTimestampsHidden(): boolean {\n if (this.hiddenSelector.matches('timestamps', true)) return true;\n return !this.data;\n }\n\n private get __isCreateHidden(): boolean {\n if (this.hiddenSelector.matches('create', true)) return true;\n return !!this.data;\n }\n\n private get __isDeleteHidden(): boolean {\n if (this.hiddenSelector.matches('delete', true)) return true;\n return !this.data;\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 __getValidator(prefix: string) {\n return () => !this.errors.some(err => err.startsWith(prefix));\n }\n\n private __renderName(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <vaadin-text-field\n data-testid=\"name\"\n class=\"w-full\"\n label=${this.t('name')}\n value=${ifDefined(this.form.name)}\n .checkValidity=${this.__getValidator('name')}\n .errorMessage=${this.__getErrorMessage('name')}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('name', true)}\n ?readonly=${this.readonlySelector.matches('name', true)}\n required\n @keydown=${this.__submitOnEnter}\n @input=${(evt: CustomEvent) => {\n const newName = (evt.currentTarget as TextFieldElement).value;\n this.edit({ name: newName });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n }\n\n private __renderType(): TemplateResult {\n if (!this.form.type) this.edit({ type: 'global' });\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('type:before')}\n\n <x-dropdown\n data-testid=\"type\"\n label=${this.t('type')}\n value=${ifDefined(this.form.type)}\n class=\"w-full\"\n .items=${['global', 'union', 'country', 'region', 'local']}\n .getText=${(value: string) => this.t(`tax_${value}`)}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('type', true)}\n ?readonly=${this.readonlySelector.matches('type', true)}\n @change=${(evt: DropdownChangeEvent) => {\n this.edit({\n type: evt.detail as Data['type'],\n country: '',\n region: '',\n city: '',\n service_provider: '',\n apply_to_shipping: false,\n use_origin_rates: false,\n exempt_all_customer_tax_ids: false,\n is_live: false,\n rate: 0,\n });\n }}\n >\n </x-dropdown>\n\n ${this.renderTemplateOrSlot('type:after')}\n </div>\n `;\n }\n\n private __renderCountry(): TemplateResult {\n const isLoadingItems = this.__countriesService.state.matches('busy');\n const isLoadingData = this.in('busy');\n const isLoading = isLoadingItems || isLoadingData;\n const json = this.__countriesService.state.context.data as Resource<Rels.Countries> | null;\n const items = Object.values(json?.values ?? {});\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('country:before')}\n\n <vaadin-combo-box\n item-value-path=\"cc2\"\n item-label-path=\"default\"\n item-id-path=\"cc2\"\n data-testid=\"country\"\n label=\"${this.t('country')}${isLoadingItems ? ` • ${this.t('loading_busy')}` : ''}\"\n value=${ifDefined(isLoadingItems ? undefined : this.form.country)}\n class=\"w-full\"\n .checkValidity=${this.__getValidator('country')}\n .errorMessage=${this.__getErrorMessage('country')}\n .items=${items}\n ?allow-custom-value=${items.length === 0}\n ?disabled=${isLoading || this.disabledSelector.matches('country', true)}\n ?readonly=${this.readonlySelector.matches('country', true)}\n required\n @change=${(evt: CustomEvent) => {\n this.edit({\n country: (evt.currentTarget as ComboBoxElement).value,\n region: '',\n city: '',\n is_live: false,\n service_provider: '',\n });\n\n if (this.__isApplyToShippingHidden) this.edit({ apply_to_shipping: false });\n this.__regionsService.send({ type: 'FETCH' });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('country:after')}\n </div>\n `;\n }\n\n private __renderRegion(): TemplateResult {\n const isLoadingItems = this.__regionsService.state.matches('busy');\n const isLoadingData = this.in('busy');\n const isLoading = isLoadingItems || isLoadingData;\n const json = this.__regionsService.state.context.data as Resource<Rels.Regions> | null;\n const items = Object.values(json?.values ?? {});\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('region:before')}\n\n <vaadin-combo-box\n item-value-path=\"code\"\n item-label-path=\"default\"\n item-id-path=\"code\"\n data-testid=\"region\"\n label=\"${this.t('region')}${isLoadingItems ? ` • ${this.t('loading_busy')}` : ''}\"\n value=${ifDefined(isLoadingItems ? undefined : this.form.region)}\n class=\"w-full\"\n .checkValidity=${this.__getValidator('region')}\n .errorMessage=${this.__getErrorMessage('region')}\n .items=${items}\n ?allow-custom-value=${items.length === 0}\n ?disabled=${isLoading || this.disabledSelector.matches('region', true)}\n ?readonly=${this.readonlySelector.matches('region', true)}\n required\n @change=${(evt: CustomEvent) => {\n const newRegion = (evt.currentTarget as ComboBoxElement).value;\n this.edit({ region: newRegion, city: '' });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('region:after')}\n </div>\n `;\n }\n\n private __renderCity(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('city:before')}\n\n <vaadin-text-field\n data-testid=\"city\"\n class=\"w-full\"\n label=${this.t('city')}\n value=${ifDefined(this.form.city)}\n .checkValidity=${this.__getValidator('city')}\n .errorMessage=${this.__getErrorMessage('city')}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('city', true)}\n ?readonly=${this.readonlySelector.matches('city', true)}\n required\n @keydown=${this.__submitOnEnter}\n @input=${(evt: CustomEvent) => {\n const newCity = (evt.currentTarget as TextFieldElement).value;\n this.edit({ city: newCity });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('city:after')}\n </div>\n `;\n }\n\n private __renderProvider(): TemplateResult {\n const items = [\n { label: this.t('tax_rate_provider_none'), value: 'none' },\n { label: 'Avalara AvaTax 15', value: 'avalara' },\n { label: 'Thomson Reuters ONESOURCE', value: 'onesource' },\n ];\n\n if (this.form.type === 'union' || defaultLiveRateCountries.includes(this.form.country)) {\n items.push({ label: this.t('tax_rate_provider_default'), value: 'default' });\n }\n\n if (taxJarLiveRateCountries.includes(this.form.country)) {\n items.push({ label: 'TaxJar', value: 'taxjar' });\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('provider:before')}\n\n <x-dropdown\n data-testid=\"provider\"\n label=${this.t('tax_rate_provider')}\n value=${this.form.service_provider || (this.form.is_live ? 'default' : 'none')}\n class=\"w-full\"\n .items=${items.map(item => item.value)}\n .getText=${(value: string) => items.find(item => item.value === value)?.label}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('provider', true)}\n ?readonly=${this.readonlySelector.matches('provider', true)}\n @change=${(evt: DropdownChangeEvent) => {\n const newValue = evt.detail as string;\n const newProvider = ['none', 'default'].includes(newValue) ? '' : newValue;\n\n this.edit({\n service_provider: newProvider as Data['service_provider'],\n is_live: newValue !== 'none',\n });\n\n if (this.__isExemptAllCustomerTaxIdsHidden) {\n this.edit({ exempt_all_customer_tax_ids: false });\n }\n\n if (this.__isApplyToShippingHidden) this.edit({ apply_to_shipping: false });\n if (this.__isUseOriginRatesHidden) this.edit({ use_origin_rates: false });\n }}\n >\n </x-dropdown>\n\n ${this.renderTemplateOrSlot('provider:after')}\n </div>\n `;\n }\n\n private __renderRate(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('rate:before')}\n\n <vaadin-integer-field\n data-testid=\"rate\"\n class=\"w-full\"\n label=${this.t('tax_rate')}\n value=${ifDefined(this.form.rate)}\n min=\"0\"\n prevent-invalid-input\n has-controls\n .checkValidity=${this.__getValidator('rate')}\n .errorMessage=${this.__getErrorMessage('rate')}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('rate', true)}\n ?readonly=${this.readonlySelector.matches('rate', true)}\n required\n @keydown=${this.__submitOnEnter}\n @change=${(evt: CustomEvent) => {\n const newRate = parseInt((evt.currentTarget as IntegerFieldElement).value);\n this.edit({ rate: newRate });\n }}\n >\n </vaadin-integer-field>\n\n ${this.renderTemplateOrSlot('rate:after')}\n </div>\n `;\n }\n\n private __renderApplyToShipping(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('apply-to-shipping:before')}\n\n <x-checkbox\n data-testid=\"apply-to-shipping\"\n class=\"leading-s\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches('apply-to-shipping', true)}\n ?readonly=${this.readonlySelector.matches('apply-to-shipping', true)}\n ?checked=${!!this.form.apply_to_shipping}\n @change=${(evt: CheckboxChangeEvent) => this.edit({ apply_to_shipping: evt.detail })}\n >\n <foxy-i18n\n class=\"block text-m text-body\"\n lang=${this.lang}\n key=\"tax_apply_to_shipping\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s text-secondary\"\n lang=${this.lang}\n key=\"tax_apply_to_shipping_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </x-checkbox>\n\n ${this.renderTemplateOrSlot('apply-to-shipping:after')}\n </div>\n `;\n }\n\n private __renderUseOriginRates(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('use-origin-rates:before')}\n\n <x-checkbox\n data-testid=\"use-origin-rates\"\n class=\"leading-s\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches('use-origin-rates', true)}\n ?readonly=${this.readonlySelector.matches('use-origin-rates', true)}\n ?checked=${!!this.form.use_origin_rates}\n @change=${(evt: CheckboxChangeEvent) => this.edit({ use_origin_rates: evt.detail })}\n >\n <foxy-i18n\n class=\"block text-m text-body\"\n lang=${this.lang}\n key=\"tax_use_origin_rates\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s text-secondary\"\n lang=${this.lang}\n key=\"tax_use_origin_rates_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </x-checkbox>\n\n ${this.renderTemplateOrSlot('use-origin-rates:after')}\n </div>\n `;\n }\n\n private __renderExemptAllCustomerTaxIds(): TemplateResult {\n const scope = 'exempt-all-customer-tax-ids';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <x-checkbox\n data-testid=\"${scope}\"\n class=\"leading-s\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches(scope, true)}\n ?readonly=${this.readonlySelector.matches(scope, true)}\n ?checked=${!!this.form.exempt_all_customer_tax_ids}\n @change=${(evt: CheckboxChangeEvent) => {\n this.edit({ exempt_all_customer_tax_ids: evt.detail });\n }}\n >\n <foxy-i18n\n class=\"block text-m text-body\"\n lang=${this.lang}\n key=\"tax_exempt_all_customer_tax_ids\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s text-secondary\"\n lang=${this.lang}\n key=\"tax_exempt_all_customer_tax_ids_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </x-checkbox>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n }\n\n private __renderTimestamps(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .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 </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderCreate(): TemplateResult {\n const isCleanTemplateInvalid = this.in({ idle: { template: { clean: 'invalid' } } });\n const isDirtyTemplateInvalid = this.in({ idle: { template: { dirty: 'invalid' } } });\n const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });\n const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });\n const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;\n const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;\n const isInvalid = isTemplateInvalid || isSnaphotInvalid;\n const isBusy = this.in('busy');\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=\"primary success\"\n ?disabled=${isBusy || isInvalid || this.disabledSelector.matches('create', true)}\n @click=${this.submit}\n >\n <foxy-i18n ns=${this.ns} key=\"create\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n }\n\n private __renderDelete(): TemplateResult {\n return html`\n <div>\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=${this.lang}\n ns=${this.ns}\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.delete()}\n >\n </foxy-internal-confirm-dialog>\n\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n data-testid=\"delete\"\n theme=\"primary error\"\n class=\"w-full\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches('delete', true)}\n @click=${(evt: CustomEvent) => {\n const confirm = this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n confirm.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n ns=${this.ns} key=\"delete\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n }\n\n private __submitOnEnter(evt: KeyboardEvent) {\n if (evt.key === 'Enter') this.submit();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TaxForm.js","sourceRoot":"","sources":["../../../../src/elements/public/TaxForm/TaxForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,+BAA4B;AAGxE,OAAO,EAAE,OAAO,EAAY,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAIjE,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAKlE,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,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,kBAAkB;AAClB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MAAM,EAAE,CAAC;IACzC,CAAC;CACF","sourcesContent":["import { Checkbox, Dropdown, PropertyTable } from '../../private/index';\nimport { CheckboxChangeEvent, DropdownChangeEvent } from '../../private/events';\nimport { Data, Templates } from './types';\nimport { Nucleon, Resource } from '@foxy.io/sdk/core';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { ComboBoxElement } from '@vaadin/vaadin-combo-box';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { IntegerFieldElement } from '@vaadin/vaadin-text-field/vaadin-integer-field';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\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 { interpret } from 'xstate';\n\n// prettier-ignore\nconst defaultLiveRateCountries: (string | undefined)[] = ['US', 'CA', 'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IM', 'IT', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK'];\nconst taxJarLiveRateCountries = [...defaultLiveRateCountries, 'AU'];\n\nconst NS = 'tax-form';\nconst Base = ConfigurableMixin(\n ThemeableMixin(ScopedElementsMixin(TranslatableMixin(NucleonElement, NS)))\n);\n\n/**\n * Form element for creating or editing taxes (`fx:tax`).\n *\n * @slot name:before\n * @slot name:after\n *\n * @slot type:before\n * @slot type:after\n *\n * @slot country:before\n * @slot country:after\n *\n * @slot region:before\n * @slot region:after\n *\n * @slot city:before\n * @slot city:after\n *\n * @slot provider:before\n * @slot provider:after\n *\n * @slot rate:before\n * @slot rate:after\n *\n * @slot apply-to-shipping:before\n * @slot apply-to-shipping:after\n *\n * @slot use-origin-rates:before\n * @slot use-origin-rates:after\n *\n * @slot exempt-all-customer-tax-ids:before\n * @slot exempt-all-customer-tax-ids:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @element foxy-tax-form\n * @since 1.13.0\n */\nexport class TaxForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-integer-field': customElements.get('vaadin-integer-field'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'vaadin-button': customElements.get('vaadin-button'),\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'x-property-table': PropertyTable,\n 'x-checkbox': Checkbox,\n 'x-dropdown': Dropdown,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n countries: { type: String, noAccessor: true },\n regions: { type: String, noAccessor: true },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name_required',\n ({ name: v }) => !v || v.length <= 30 || 'name_too_long',\n ({ country: c, type: t }) => t !== 'country' || !!c || 'country_required',\n ({ country: c, type: t }) => t !== 'region' || !!c || 'country_required',\n ({ country: c, use_origin_rates: r }) => !r || !!c || 'country_required',\n ({ country: v }) => !v || !!v.match(/[A-Z]{2}/) || 'country_invalid',\n ({ region: v, type: t }) => t != 'region' || !!v || 'region_required',\n ({ region: v }) => !v || v.length <= 20 || 'region_too_long',\n ({ city: v }) => !v || v.length <= 50 || 'city_too_long',\n ({ city: c, type: t }) => t != 'local' || !!c || 'city_required',\n ({ rate: v }) => !v || v <= 100 || 'rate_invalid',\n ];\n }\n\n templates: Templates = {};\n\n private __previousCountry: string | undefined = undefined;\n\n private __countries = '';\n\n private __regions = '';\n\n private __countriesService = interpret(\n Nucleon.machine.withConfig({\n services: {\n sendGet: async () => {\n const response = await new TaxForm.API(this).fetch(this.countries);\n if (!response.ok) throw new Error(await response.text());\n return await response.json();\n },\n },\n })\n );\n\n private __regionsService = interpret(\n Nucleon.machine.withConfig({\n services: {\n sendGet: async () => {\n const url = new URL(this.regions);\n url.searchParams.set('country_code', this.form.country ?? 'US');\n const response = await new TaxForm.API(this).fetch(url.toString());\n if (!response.ok) throw new Error(await response.text());\n return await response.json();\n },\n },\n })\n );\n\n /** URI of the `fx:countries` hAPI resource. */\n get countries(): string {\n return this.__countries;\n }\n\n set countries(value: string) {\n this.__countries = value;\n\n if (value) {\n this.__countriesService.send({ type: 'FETCH' });\n } else {\n this.__countriesService.send({ type: 'SET_DATA', data: null });\n }\n }\n\n /** URI of the `fx:regions` hAPI resource. */\n get regions(): string {\n return this.__regions;\n }\n\n set regions(value: string) {\n this.__regions = value;\n\n if (value) {\n this.__regionsService.send({ type: 'FETCH' });\n } else {\n this.__regionsService.send({ type: 'SET_DATA', data: null });\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.__countriesService.onTransition(({ changed }) => changed && this.requestUpdate());\n this.__countriesService.onChange(() => this.requestUpdate());\n this.__countriesService.start();\n\n this.__regionsService.onTransition(({ changed }) => changed && this.requestUpdate());\n this.__regionsService.onChange(() => this.requestUpdate());\n this.__regionsService.start();\n }\n\n render(): TemplateResult {\n return html`\n <div class=\"relative space-y-m\">\n ${this.__isNameHidden ? null : this.__renderName()}\n ${this.__isTypeHidden ? null : this.__renderType()}\n ${this.__isCountryHidden ? null : this.__renderCountry()}\n ${this.__isRegionHidden ? null : this.__renderRegion()}\n ${this.__isCityHidden ? null : this.__renderCity()}\n ${this.__isProviderHidden ? null : this.__renderProvider()}\n ${this.__isRateHidden ? null : this.__renderRate()}\n ${this.__isApplyToShippingHidden ? null : this.__renderApplyToShipping()}\n ${this.__isUseOriginRatesHidden ? null : this.__renderUseOriginRates()}\n ${this.__isExemptAllCustomerTaxIdsHidden ? null : this.__renderExemptAllCustomerTaxIds()}\n ${this.__isTimestampsHidden ? null : this.__renderTimestamps()}\n ${this.__isCreateHidden ? null : this.__renderCreate()}\n ${this.__isDeleteHidden ? null : this.__renderDelete()}\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': this.in('idle'),\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' : this.in('busy') ? 'busy' : 'empty'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n\n if (this.form.country !== this.__previousCountry) {\n this.__previousCountry = this.form.country;\n this.__regionsService.send({ type: 'FETCH' });\n }\n\n // vaadin's combo box doesn't seem to validate on its own\n this.renderRoot.querySelectorAll('vaadin-combo-box').forEach(e => e.validate());\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.__countriesService.stop();\n this.__regionsService.stop();\n }\n\n private get __isNameHidden(): boolean {\n return this.hiddenSelector.matches('name', true);\n }\n\n private get __isTypeHidden(): boolean {\n return this.hiddenSelector.matches('type', true);\n }\n\n private get __isCountryHidden(): boolean {\n if (this.hiddenSelector.matches('country', true)) return true;\n if (this.form.type === 'union') return !this.form.use_origin_rates;\n return !(['country', 'region', 'local'] as unknown[]).includes(this.form.type);\n }\n\n private get __isRegionHidden(): boolean {\n if (this.hiddenSelector.matches('region', true)) return true;\n return this.form.type !== 'local' && this.form.type !== 'region';\n }\n\n private get __isCityHidden(): boolean {\n if (this.hiddenSelector.matches('city', true)) return true;\n return this.form.type !== 'local';\n }\n\n private get __isProviderHidden(): boolean {\n if (this.hiddenSelector.matches('provider', true)) return true;\n return !this.form.type || this.form.type === 'global' || this.form.type === 'local';\n }\n\n private get __isRateHidden(): boolean {\n if (this.hiddenSelector.matches('rate', true)) return true;\n return !this.form.type || this.form.is_live === true;\n }\n\n private get __isApplyToShippingHidden(): boolean {\n if (this.hiddenSelector.matches('apply-to-shipping', true)) return true;\n if (this.form.type === undefined) return true;\n return !!this.form.is_live && defaultLiveRateCountries.includes(this.form.country);\n }\n\n private get __isUseOriginRatesHidden(): boolean {\n if (this.hiddenSelector.matches('use-origin-rates', true)) return true;\n return this.form.type !== 'union' || !this.form.is_live || !!this.form.service_provider;\n }\n\n private get __isExemptAllCustomerTaxIdsHidden(): boolean {\n if (this.hiddenSelector.matches('exempt-all-customer-tax-ids', true)) return true;\n const provider = this.form.service_provider as string | undefined;\n return provider === undefined || provider === 'onesource' || provider === 'avalara';\n }\n\n private get __isTimestampsHidden(): boolean {\n if (this.hiddenSelector.matches('timestamps', true)) return true;\n return !this.data;\n }\n\n private get __isCreateHidden(): boolean {\n if (this.hiddenSelector.matches('create', true)) return true;\n return !!this.data;\n }\n\n private get __isDeleteHidden(): boolean {\n if (this.hiddenSelector.matches('delete', true)) return true;\n return !this.data;\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 __getValidator(prefix: string) {\n return () => !this.errors.some(err => err.startsWith(prefix));\n }\n\n private __renderName(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <vaadin-text-field\n data-testid=\"name\"\n class=\"w-full\"\n label=${this.t('name')}\n value=${ifDefined(this.form.name)}\n .checkValidity=${this.__getValidator('name')}\n .errorMessage=${this.__getErrorMessage('name')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('name', true)}\n ?readonly=${this.readonlySelector.matches('name', true)}\n required\n @keydown=${this.__submitOnEnter}\n @input=${(evt: CustomEvent) => {\n const newName = (evt.currentTarget as TextFieldElement).value;\n this.edit({ name: newName });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n }\n\n private __renderType(): TemplateResult {\n if (!this.form.type) this.edit({ type: 'global' });\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('type:before')}\n\n <x-dropdown\n data-testid=\"type\"\n label=${this.t('type')}\n value=${ifDefined(this.form.type)}\n class=\"w-full\"\n .items=${['global', 'union', 'country', 'region', 'local']}\n .getText=${(value: string) => this.t(`tax_${value}`)}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('type', true)}\n ?readonly=${this.readonlySelector.matches('type', true)}\n @change=${(evt: DropdownChangeEvent) => {\n this.edit({\n type: evt.detail as Data['type'],\n country: '',\n region: '',\n city: '',\n service_provider: '',\n apply_to_shipping: false,\n use_origin_rates: false,\n exempt_all_customer_tax_ids: false,\n is_live: false,\n rate: 0,\n });\n }}\n >\n </x-dropdown>\n\n ${this.renderTemplateOrSlot('type:after')}\n </div>\n `;\n }\n\n private __renderCountry(): TemplateResult {\n const isLoadingItems = this.__countriesService.state.matches('busy');\n const isLoadingData = this.in('busy');\n const isLoading = isLoadingItems || isLoadingData;\n const isFail = this.in('fail');\n const json = this.__countriesService.state.context.data as Resource<Rels.Countries> | null;\n const items = Object.values(json?.values ?? {});\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('country:before')}\n\n <vaadin-combo-box\n item-value-path=\"cc2\"\n item-label-path=\"default\"\n item-id-path=\"cc2\"\n data-testid=\"country\"\n label=\"${this.t('country')}${isLoadingItems ? ` • ${this.t('loading_busy')}` : ''}\"\n value=${ifDefined(isLoadingItems ? undefined : this.form.country)}\n class=\"w-full\"\n .checkValidity=${this.__getValidator('country')}\n .errorMessage=${this.__getErrorMessage('country')}\n .items=${items}\n ?allow-custom-value=${items.length === 0}\n ?disabled=${isFail || isLoading || this.disabledSelector.matches('country', true)}\n ?readonly=${this.readonlySelector.matches('country', true)}\n required\n @change=${(evt: CustomEvent) => {\n this.edit({\n country: (evt.currentTarget as ComboBoxElement).value,\n region: '',\n city: '',\n is_live: false,\n service_provider: '',\n });\n\n if (this.__isApplyToShippingHidden) this.edit({ apply_to_shipping: false });\n this.__regionsService.send({ type: 'FETCH' });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('country:after')}\n </div>\n `;\n }\n\n private __renderRegion(): TemplateResult {\n const isLoadingItems = this.__regionsService.state.matches('busy');\n const isLoadingData = this.in('busy');\n const isLoading = isLoadingItems || isLoadingData;\n const isFail = this.in('fail');\n const json = this.__regionsService.state.context.data as Resource<Rels.Regions> | null;\n const items = Object.values(json?.values ?? {});\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('region:before')}\n\n <vaadin-combo-box\n item-value-path=\"code\"\n item-label-path=\"default\"\n item-id-path=\"code\"\n data-testid=\"region\"\n label=\"${this.t('region')}${isLoadingItems ? ` • ${this.t('loading_busy')}` : ''}\"\n value=${ifDefined(isLoadingItems ? undefined : this.form.region)}\n class=\"w-full\"\n .checkValidity=${this.__getValidator('region')}\n .errorMessage=${this.__getErrorMessage('region')}\n .items=${items}\n ?allow-custom-value=${items.length === 0}\n ?disabled=${isFail || isLoading || this.disabledSelector.matches('region', true)}\n ?readonly=${this.readonlySelector.matches('region', true)}\n required\n @change=${(evt: CustomEvent) => {\n const newRegion = (evt.currentTarget as ComboBoxElement).value;\n this.edit({ region: newRegion, city: '' });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('region:after')}\n </div>\n `;\n }\n\n private __renderCity(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('city:before')}\n\n <vaadin-text-field\n data-testid=\"city\"\n class=\"w-full\"\n label=${this.t('city')}\n value=${ifDefined(this.form.city)}\n .checkValidity=${this.__getValidator('city')}\n .errorMessage=${this.__getErrorMessage('city')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('city', true)}\n ?readonly=${this.readonlySelector.matches('city', true)}\n required\n @keydown=${this.__submitOnEnter}\n @input=${(evt: CustomEvent) => {\n const newCity = (evt.currentTarget as TextFieldElement).value;\n this.edit({ city: newCity });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('city:after')}\n </div>\n `;\n }\n\n private __renderProvider(): TemplateResult {\n const items = [\n { label: this.t('tax_rate_provider_none'), value: 'none' },\n { label: 'Avalara AvaTax 15', value: 'avalara' },\n { label: 'Thomson Reuters ONESOURCE', value: 'onesource' },\n ];\n\n if (this.form.type === 'union' || defaultLiveRateCountries.includes(this.form.country)) {\n items.push({ label: this.t('tax_rate_provider_default'), value: 'default' });\n }\n\n if (taxJarLiveRateCountries.includes(this.form.country)) {\n items.push({ label: 'TaxJar', value: 'taxjar' });\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('provider:before')}\n\n <x-dropdown\n data-testid=\"provider\"\n label=${this.t('tax_rate_provider')}\n value=${this.form.service_provider || (this.form.is_live ? 'default' : 'none')}\n class=\"w-full\"\n .items=${items.map(item => item.value)}\n .getText=${(value: string) => items.find(item => item.value === value)?.label}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('provider', true)}\n ?readonly=${this.readonlySelector.matches('provider', true)}\n @change=${(evt: DropdownChangeEvent) => {\n const newValue = evt.detail as string;\n const newProvider = ['none', 'default'].includes(newValue) ? '' : newValue;\n\n this.edit({\n service_provider: newProvider as Data['service_provider'],\n is_live: newValue !== 'none',\n });\n\n if (this.__isExemptAllCustomerTaxIdsHidden) {\n this.edit({ exempt_all_customer_tax_ids: false });\n }\n\n if (this.__isApplyToShippingHidden) this.edit({ apply_to_shipping: false });\n if (this.__isUseOriginRatesHidden) this.edit({ use_origin_rates: false });\n }}\n >\n </x-dropdown>\n\n ${this.renderTemplateOrSlot('provider:after')}\n </div>\n `;\n }\n\n private __renderRate(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('rate:before')}\n\n <vaadin-integer-field\n data-testid=\"rate\"\n class=\"w-full\"\n label=${this.t('tax_rate')}\n value=${ifDefined(this.form.rate)}\n min=\"0\"\n prevent-invalid-input\n has-controls\n .checkValidity=${this.__getValidator('rate')}\n .errorMessage=${this.__getErrorMessage('rate')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('rate', true)}\n ?readonly=${this.readonlySelector.matches('rate', true)}\n required\n @keydown=${this.__submitOnEnter}\n @change=${(evt: CustomEvent) => {\n const newRate = parseInt((evt.currentTarget as IntegerFieldElement).value);\n this.edit({ rate: newRate });\n }}\n >\n </vaadin-integer-field>\n\n ${this.renderTemplateOrSlot('rate:after')}\n </div>\n `;\n }\n\n private __renderApplyToShipping(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('apply-to-shipping:before')}\n\n <x-checkbox\n data-testid=\"apply-to-shipping\"\n class=\"leading-s\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('apply-to-shipping', true)}\n ?readonly=${this.readonlySelector.matches('apply-to-shipping', true)}\n ?checked=${!!this.form.apply_to_shipping}\n @change=${(evt: CheckboxChangeEvent) => this.edit({ apply_to_shipping: evt.detail })}\n >\n <foxy-i18n\n class=\"block text-m text-body\"\n lang=${this.lang}\n key=\"tax_apply_to_shipping\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s text-secondary\"\n lang=${this.lang}\n key=\"tax_apply_to_shipping_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </x-checkbox>\n\n ${this.renderTemplateOrSlot('apply-to-shipping:after')}\n </div>\n `;\n }\n\n private __renderUseOriginRates(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('use-origin-rates:before')}\n\n <x-checkbox\n data-testid=\"use-origin-rates\"\n class=\"leading-s\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('use-origin-rates', true)}\n ?readonly=${this.readonlySelector.matches('use-origin-rates', true)}\n ?checked=${!!this.form.use_origin_rates}\n @change=${(evt: CheckboxChangeEvent) => this.edit({ use_origin_rates: evt.detail })}\n >\n <foxy-i18n\n class=\"block text-m text-body\"\n lang=${this.lang}\n key=\"tax_use_origin_rates\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s text-secondary\"\n lang=${this.lang}\n key=\"tax_use_origin_rates_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </x-checkbox>\n\n ${this.renderTemplateOrSlot('use-origin-rates:after')}\n </div>\n `;\n }\n\n private __renderExemptAllCustomerTaxIds(): TemplateResult {\n const scope = 'exempt-all-customer-tax-ids';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <x-checkbox\n data-testid=\"${scope}\"\n class=\"leading-s\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches(scope, true)}\n ?readonly=${this.readonlySelector.matches(scope, true)}\n ?checked=${!!this.form.exempt_all_customer_tax_ids}\n @change=${(evt: CheckboxChangeEvent) => {\n this.edit({ exempt_all_customer_tax_ids: evt.detail });\n }}\n >\n <foxy-i18n\n class=\"block text-m text-body\"\n lang=${this.lang}\n key=\"tax_exempt_all_customer_tax_ids\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=\"block text-s text-secondary\"\n lang=${this.lang}\n key=\"tax_exempt_all_customer_tax_ids_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </x-checkbox>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n }\n\n private __renderTimestamps(): TemplateResult {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .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 </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderCreate(): TemplateResult {\n const isCleanTemplateInvalid = this.in({ idle: { template: { clean: 'invalid' } } });\n const isDirtyTemplateInvalid = this.in({ idle: { template: { dirty: 'invalid' } } });\n const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });\n const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });\n const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;\n const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;\n const isInvalid = isTemplateInvalid || isSnaphotInvalid;\n const isIdle = this.in('idle');\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=\"primary success\"\n ?disabled=${!isIdle || isInvalid || this.disabledSelector.matches('create', true)}\n @click=${this.submit}\n >\n <foxy-i18n ns=${this.ns} key=\"create\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n }\n\n private __renderDelete(): TemplateResult {\n return html`\n <div>\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=${this.lang}\n ns=${this.ns}\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.delete()}\n >\n </foxy-internal-confirm-dialog>\n\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n data-testid=\"delete\"\n theme=\"primary error\"\n class=\"w-full\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}\n @click=${(evt: CustomEvent) => {\n const confirm = this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n confirm.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n ns=${this.ns} key=\"delete\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n }\n\n private __submitOnEnter(evt: KeyboardEvent) {\n if (evt.key === 'Enter') this.submit();\n }\n}\n"]}
|
|
@@ -75,7 +75,7 @@ export class TemplateForm extends Base {
|
|
|
75
75
|
const isBusy = this.in('busy');
|
|
76
76
|
const isFail = this.in('fail');
|
|
77
77
|
return html `
|
|
78
|
-
<div class="space-y-m">
|
|
78
|
+
<div class="space-y-m relative">
|
|
79
79
|
${hiddenSelector.matches('description', true) ? '' : this.__renderDescription()}
|
|
80
80
|
${hiddenSelector.matches('content', true) ? '' : this.__renderContent()}
|
|
81
81
|
${hiddenSelector.matches('timestamps', true) || !href ? '' : this.__renderTimestamps()}
|