@foxy.io/elements 1.15.0-beta.7 → 1.16.0-beta.1
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-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 +7 -7
- 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-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-e209cb55.js → shared-061f64fc.js} +1 -1
- package/dist/cdn/{shared-4dc6d228.js → shared-15f2aeb5.js} +1 -1
- package/dist/cdn/{shared-f4ad24f4.js → shared-24064bd3.js} +1 -1
- package/dist/cdn/{shared-46ee137f.js → shared-278a8b9d.js} +1 -1
- package/dist/cdn/{shared-ff79f3f9.js → shared-29db2caa.js} +1 -1
- package/dist/cdn/{shared-b5754a42.js → shared-2a89f737.js} +1 -1
- package/dist/cdn/{shared-0f38a631.js → shared-31166bdc.js} +1 -1
- package/dist/cdn/{shared-a7b6feb2.js → shared-312fdfb6.js} +1 -1
- package/dist/cdn/{shared-60126eee.js → shared-3821923d.js} +1 -1
- package/dist/cdn/shared-385ab830.js +1 -0
- package/dist/cdn/{shared-c5de42f7.js → shared-4190da71.js} +1 -1
- package/dist/cdn/{shared-07049bfe.js → shared-4792a0b8.js} +1 -1
- package/dist/cdn/{shared-dcc9c325.js → shared-56646cd3.js} +1 -1
- package/dist/cdn/{shared-1934524e.js → shared-5d169043.js} +2 -2
- package/dist/cdn/{shared-5a54a9bc.js → shared-666e8a90.js} +1 -1
- package/dist/cdn/{shared-223508ae.js → shared-7f463a38.js} +7 -7
- package/dist/cdn/{shared-66633ff7.js → shared-9783e5ce.js} +1 -1
- package/dist/cdn/{shared-8b20bc23.js → shared-9da4822a.js} +1 -1
- package/dist/cdn/{shared-b9f18aaa.js → shared-a81a95e8.js} +1 -1
- package/dist/cdn/shared-b07ef791.js +1 -0
- package/dist/cdn/{shared-65dfd512.js → shared-b20f463a.js} +1 -1
- package/dist/cdn/{shared-073cb8e9.js → shared-bf6c685e.js} +1 -1
- package/dist/cdn/{shared-1a67bc75.js → shared-cb71ddbc.js} +4 -4
- package/dist/cdn/{shared-a040d79d.js → shared-d9aed64e.js} +1 -1
- package/dist/cdn/{shared-02945b27.js → shared-da709e9d.js} +1 -1
- package/dist/cdn/{shared-a23cf7c8.js → shared-db4aacb2.js} +1 -1
- package/dist/cdn/shared-dd4971b5.js +1 -0
- package/dist/cdn/{shared-fab8c705.js → shared-e367b5fc.js} +2 -2
- package/dist/cdn/{shared-08c63028.js → shared-e5937698.js} +2 -2
- package/dist/cdn/{shared-20b9ce70.js → shared-e8abe6c6.js} +5 -5
- package/dist/cdn/shared-e94c2670.js +1 -0
- package/dist/cdn/{shared-09069d7c.js → shared-edfe5274.js} +1 -1
- package/dist/cdn/{shared-e2c878c7.js → shared-ee53f7e5.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 +26 -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/CouponCodesForm/CouponCodesForm.js +6 -3
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.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/GenerateCodesForm/GenerateCodesForm.js +6 -6
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.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/GiftCardCodesForm/GiftCardCodesForm.js +8 -3
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.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 +305 -0
- package/dist/elements/public/ReportForm/ReportForm.js.map +1 -0
- package/dist/elements/public/ReportForm/index.d.ts +8 -0
- package/dist/elements/public/ReportForm/index.js +10 -0
- package/dist/elements/public/ReportForm/index.js.map +1 -0
- package/dist/elements/public/ReportForm/types.d.ts +19 -0
- package/dist/elements/public/ReportForm/types.js +2 -0
- package/dist/elements/public/ReportForm/types.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 +22 -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-11708514.js +0 -1
- package/dist/cdn/shared-253e59d2.js +0 -1
- package/dist/cdn/shared-805d18a2.js +0 -1
- package/dist/cdn/shared-e68b9c83.js +0 -1
- 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
|
@@ -170,7 +170,7 @@ export class CouponForm extends Base {
|
|
|
170
170
|
data-testid="spinner"
|
|
171
171
|
class=${classMap({
|
|
172
172
|
'transition duration-500 ease-in-out absolute inset-0 flex': true,
|
|
173
|
-
'opacity-0 pointer-events-none':
|
|
173
|
+
'opacity-0 pointer-events-none': this.in('idle'),
|
|
174
174
|
})}
|
|
175
175
|
>
|
|
176
176
|
<foxy-spinner
|
|
@@ -213,7 +213,7 @@ export class CouponForm extends Base {
|
|
|
213
213
|
label=${this.t('name')}
|
|
214
214
|
.checkValidity=${this.__getValidator('name')}
|
|
215
215
|
.value=${this.form.name}
|
|
216
|
-
?disabled=${this.in('
|
|
216
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('name', true)}
|
|
217
217
|
?readonly=${this.readonlySelector.matches('name', true)}
|
|
218
218
|
required
|
|
219
219
|
@keydown=${(evt) => evt.key === 'Enter' && this.submit()}
|
|
@@ -246,6 +246,7 @@ export class CouponForm extends Base {
|
|
|
246
246
|
const selectedPreset = presets.find(p => p.details === details && p.type === type);
|
|
247
247
|
return html `
|
|
248
248
|
<label
|
|
249
|
+
data-testid="rules:preset"
|
|
249
250
|
class=${classMap({
|
|
250
251
|
'whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors': true,
|
|
251
252
|
'text-body hover-text-primary focus-within-ring-2': !isDisabled && !isReadonly,
|
|
@@ -258,13 +259,15 @@ export class CouponForm extends Base {
|
|
|
258
259
|
<span class="relative font-medium flex items-center">
|
|
259
260
|
<span class="truncate">
|
|
260
261
|
${selectedPreset
|
|
261
|
-
? this.t('discount_summary', { params: selectedPreset })
|
|
262
|
+
? this.t('discount_summary', { params: { ...selectedPreset, ns: this.ns } })
|
|
262
263
|
: this.t('custom_discount')}
|
|
263
264
|
</span>
|
|
264
265
|
|
|
265
266
|
<iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon>
|
|
266
267
|
|
|
267
268
|
<select
|
|
269
|
+
data-testclass="interactive editable"
|
|
270
|
+
data-testid="rules:preset:select"
|
|
268
271
|
class="opacity-0 absolute inset-0 focus-outline-none"
|
|
269
272
|
?disabled=${isDisabled || isReadonly}
|
|
270
273
|
@change=${(evt) => {
|
|
@@ -280,7 +283,7 @@ export class CouponForm extends Base {
|
|
|
280
283
|
${presets.map(option => {
|
|
281
284
|
return html `
|
|
282
285
|
<option value=${option.details} ?selected=${option === selectedPreset}>
|
|
283
|
-
${this.t('discount_summary', { params: option })}
|
|
286
|
+
${this.t('discount_summary', { params: { ...option, ns: this.ns } })}
|
|
284
287
|
</option>
|
|
285
288
|
`;
|
|
286
289
|
})}
|
|
@@ -314,6 +317,7 @@ export class CouponForm extends Base {
|
|
|
314
317
|
<iron-icon class="icon-inline text-xl ml-xs" icon="icons:expand-more"></iron-icon>
|
|
315
318
|
|
|
316
319
|
<select
|
|
320
|
+
data-testclass="interactive editable"
|
|
317
321
|
class="opacity-0 absolute inset-0 focus-outline-none"
|
|
318
322
|
?disabled=${!isInteractive}
|
|
319
323
|
@change=${(evt) => {
|
|
@@ -370,6 +374,7 @@ export class CouponForm extends Base {
|
|
|
370
374
|
</foxy-i18n>
|
|
371
375
|
|
|
372
376
|
<input
|
|
377
|
+
data-testclass="interactive editable"
|
|
373
378
|
class="sr-only"
|
|
374
379
|
value=${option}
|
|
375
380
|
name=${name}
|
|
@@ -402,6 +407,7 @@ export class CouponForm extends Base {
|
|
|
402
407
|
<label>
|
|
403
408
|
<foxy-i18n class="sr-only" lang=${this.lang} key=${label} ns=${this.ns}></foxy-i18n>
|
|
404
409
|
<input
|
|
410
|
+
data-testclass="interactive editable"
|
|
405
411
|
class=${classMap({
|
|
406
412
|
'transition-colors border p-xs h-xs font-medium text-m rounded w-xl': true,
|
|
407
413
|
'ring-primary-50 text-body bg-contrast-10': isInteractive,
|
|
@@ -433,6 +439,7 @@ export class CouponForm extends Base {
|
|
|
433
439
|
const [from, adjustment] = tier.split(/[-+]/).map(v => parseFloat(v));
|
|
434
440
|
return html `
|
|
435
441
|
<div
|
|
442
|
+
data-testclass="rules:tier"
|
|
436
443
|
aria-label=${this.t('tier')}
|
|
437
444
|
class=${classMap({
|
|
438
445
|
'flex items-start justify-between rounded-t-l rounded-b-l': true,
|
|
@@ -523,6 +530,7 @@ export class CouponForm extends Base {
|
|
|
523
530
|
${params.tier
|
|
524
531
|
? html `
|
|
525
532
|
<button
|
|
533
|
+
data-testclass="interactive"
|
|
526
534
|
aria-label=${this.t('delete')}
|
|
527
535
|
class=${classMap({
|
|
528
536
|
'w-s h-s m-s flex-shrink-0 rounded transition-colors ring-primary-50': true,
|
|
@@ -548,7 +556,7 @@ export class CouponForm extends Base {
|
|
|
548
556
|
const urlParameter = `discount_${type}=${encodeURIComponent(`${name}{${details}}`)}`;
|
|
549
557
|
const isDisabled = !this.in('idle') || this.disabledSelector.matches('rules', true);
|
|
550
558
|
return html `
|
|
551
|
-
<div class="text-xs flex space-x-xs leading-m">
|
|
559
|
+
<div data-testid="rules:url" class="text-xs flex space-x-xs leading-m">
|
|
552
560
|
<span
|
|
553
561
|
class=${classMap({
|
|
554
562
|
'flex-shrink-0 transition-colors': true,
|
|
@@ -570,6 +578,8 @@ export class CouponForm extends Base {
|
|
|
570
578
|
</code>
|
|
571
579
|
|
|
572
580
|
<button
|
|
581
|
+
data-testclass="interactive"
|
|
582
|
+
data-testid="rules:url:copy"
|
|
573
583
|
class=${classMap({
|
|
574
584
|
'flex-shrink-0 transition-colors font-medium rounded px-xs': true,
|
|
575
585
|
'ring-primary-50 bg-primary-10 text-primary': !isDisabled,
|
|
@@ -597,13 +607,13 @@ export class CouponForm extends Base {
|
|
|
597
607
|
const details = (_b = this.form.coupon_discount_details) !== null && _b !== void 0 ? _b : '';
|
|
598
608
|
const isDisabled = !this.in('idle') || this.disabledSelector.matches('rules', true);
|
|
599
609
|
return html `
|
|
600
|
-
<div class="text-xs leading-m">
|
|
610
|
+
<div data-testid="rules:description" class="text-xs leading-m">
|
|
601
611
|
<span class="transition-colors ${isDisabled ? 'text-disabled' : 'text-tertiary'}">
|
|
602
612
|
<foxy-i18n lang=${this.lang} key="description" ns=${this.ns}></foxy-i18n>:
|
|
603
613
|
</span>
|
|
604
614
|
|
|
605
615
|
<foxy-i18n
|
|
606
|
-
options=${JSON.stringify({ params: { details, type } })}
|
|
616
|
+
options=${JSON.stringify({ params: { details, type, ns: this.ns } })}
|
|
607
617
|
class="transition-colors ${isDisabled ? 'text-disabled' : 'text-secondary'}"
|
|
608
618
|
lang=${this.lang}
|
|
609
619
|
key="discount_summary"
|
|
@@ -619,10 +629,11 @@ export class CouponForm extends Base {
|
|
|
619
629
|
const details = (_a = this.form.coupon_discount_details) !== null && _a !== void 0 ? _a : '';
|
|
620
630
|
const tiers = details.split('|').filter(v => !!v.trim());
|
|
621
631
|
const method = (_b = (/[-+]/.test(tiers[0]) ? null : tiers.shift())) !== null && _b !== void 0 ? _b : 'single';
|
|
632
|
+
const renderedTiers = method === 'repeat' ? [tiers[0]] : [...tiers, undefined];
|
|
622
633
|
const type = (_c = this.form.coupon_discount_type) !== null && _c !== void 0 ? _c : 'quantity_amount';
|
|
623
634
|
const [source, units] = type.split('_');
|
|
624
635
|
return html `
|
|
625
|
-
<div>
|
|
636
|
+
<div data-testid="rules">
|
|
626
637
|
${this.renderTemplateOrSlot('rules:before')}
|
|
627
638
|
|
|
628
639
|
<div>
|
|
@@ -643,7 +654,7 @@ export class CouponForm extends Base {
|
|
|
643
654
|
</div>
|
|
644
655
|
|
|
645
656
|
<div class="space-y-s">
|
|
646
|
-
${repeat(
|
|
657
|
+
${repeat(renderedTiers, (tier, tierIndex) => {
|
|
647
658
|
const onChange = (changedParams) => {
|
|
648
659
|
var _a, _b, _c;
|
|
649
660
|
const newMethod = (_a = changedParams.method) !== null && _a !== void 0 ? _a : method;
|
|
@@ -679,7 +690,7 @@ export class CouponForm extends Base {
|
|
|
679
690
|
`;
|
|
680
691
|
}
|
|
681
692
|
__renderCodes() {
|
|
682
|
-
var _a;
|
|
693
|
+
var _a, _b, _c, _d, _e;
|
|
683
694
|
const { disabledSelector, group, data, lang, ns } = this;
|
|
684
695
|
const isDisabled = !this.in('idle') || disabledSelector.matches('codes', true);
|
|
685
696
|
const filters = this.__codesTableQuery;
|
|
@@ -689,53 +700,54 @@ export class CouponForm extends Base {
|
|
|
689
700
|
const filterButtonLabel = filters === null ? 'filter' : 'clear_filters';
|
|
690
701
|
const filterButtonIcon = `icons:${filters === null ? 'filter-list' : 'clear'}`;
|
|
691
702
|
return html `
|
|
692
|
-
<
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
703
|
+
<div data-testid="codes">
|
|
704
|
+
<foxy-form-dialog
|
|
705
|
+
disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}
|
|
706
|
+
readonlycontrols=${this.readonlySelector.zoom('codes:generate:form').toString()}
|
|
707
|
+
hiddencontrols="save-button current-balance ${this.hiddenSelector
|
|
696
708
|
.zoom('codes:generate:form')
|
|
697
709
|
.toString()}"
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
710
|
+
related=${JSON.stringify([url.toString()])}
|
|
711
|
+
header="generate"
|
|
712
|
+
parent=${(_a = data === null || data === void 0 ? void 0 : data._links['fx:generate_codes'].href) !== null && _a !== void 0 ? _a : ''}
|
|
713
|
+
group=${group}
|
|
714
|
+
lang=${lang}
|
|
715
|
+
form="foxy-generate-codes-form"
|
|
716
|
+
ns=${ns}
|
|
717
|
+
id="generate-codes-dialog"
|
|
718
|
+
alert
|
|
719
|
+
.related=${[url.toString()]}
|
|
720
|
+
>
|
|
721
|
+
</foxy-form-dialog>
|
|
722
|
+
|
|
723
|
+
<foxy-form-dialog
|
|
724
|
+
disabledcontrols=${disabledSelector.zoom('codes:form').toString()}
|
|
725
|
+
readonlycontrols=${this.readonlySelector.zoom('codes:form').toString()}
|
|
726
|
+
hiddencontrols=${this.hiddenSelector.zoom('codes:form').toString()}
|
|
727
|
+
header="code"
|
|
728
|
+
parent=${url.toString()}
|
|
729
|
+
group=${group}
|
|
730
|
+
lang=${lang}
|
|
731
|
+
form="foxy-coupon-code-form"
|
|
732
|
+
ns=${ns}
|
|
733
|
+
id="code-dialog"
|
|
734
|
+
>
|
|
735
|
+
</foxy-form-dialog>
|
|
736
|
+
|
|
737
|
+
<foxy-form-dialog
|
|
738
|
+
disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}
|
|
739
|
+
readonlycontrols=${this.readonlySelector.zoom('codes:import:form').toString()}
|
|
740
|
+
hiddencontrols="save-button ${this.hiddenSelector.zoom('codes:import:form').toString()}"
|
|
741
|
+
header="import"
|
|
742
|
+
parent=${data._links['fx:coupon_codes'].href}
|
|
743
|
+
group=${group}
|
|
744
|
+
lang=${lang}
|
|
745
|
+
form="foxy-coupon-codes-form"
|
|
746
|
+
ns=${ns}
|
|
747
|
+
id="import-dialog"
|
|
748
|
+
>
|
|
749
|
+
</foxy-form-dialog>
|
|
737
750
|
|
|
738
|
-
<div>
|
|
739
751
|
${this.renderTemplateOrSlot('codes:before')}
|
|
740
752
|
|
|
741
753
|
<div class="flex items-center justify-between mb-xs space-x-s">
|
|
@@ -748,6 +760,7 @@ export class CouponForm extends Base {
|
|
|
748
760
|
</foxy-i18n>
|
|
749
761
|
|
|
750
762
|
<vaadin-button
|
|
763
|
+
data-testid="codes:generate-button"
|
|
751
764
|
theme="success tertiary small"
|
|
752
765
|
?disabled=${isDisabled}
|
|
753
766
|
@click=${(evt) => {
|
|
@@ -761,6 +774,7 @@ export class CouponForm extends Base {
|
|
|
761
774
|
</vaadin-button>
|
|
762
775
|
|
|
763
776
|
<vaadin-button
|
|
777
|
+
data-testid="codes:import-button"
|
|
764
778
|
theme="contrast tertiary small"
|
|
765
779
|
?disabled=${isDisabled}
|
|
766
780
|
@click=${(evt) => {
|
|
@@ -774,6 +788,7 @@ export class CouponForm extends Base {
|
|
|
774
788
|
</vaadin-button>
|
|
775
789
|
|
|
776
790
|
<vaadin-button
|
|
791
|
+
data-testid="codes:filter-button"
|
|
777
792
|
theme="contrast ${filters === null ? 'tertiary' : ''} small"
|
|
778
793
|
?disabled=${isDisabled}
|
|
779
794
|
@click=${() => (this.__codesTableQuery = filters === null ? '' : null)}
|
|
@@ -786,7 +801,7 @@ export class CouponForm extends Base {
|
|
|
786
801
|
<foxy-query-builder
|
|
787
802
|
class="bg-contrast-5 rounded-tl-l rounded-tr-s rounded-b-l p-m mb-s"
|
|
788
803
|
lang=${lang}
|
|
789
|
-
ns
|
|
804
|
+
ns="${ns} ${(_c = (_b = customElements.get('foxy-query-builder')) === null || _b === void 0 ? void 0 : _b.defaultNS) !== null && _c !== void 0 ? _c : ''}"
|
|
790
805
|
?disabled=${isDisabled}
|
|
791
806
|
?hidden=${filters === null}
|
|
792
807
|
.options=${CouponForm.__codesQueryOptions}
|
|
@@ -798,7 +813,12 @@ export class CouponForm extends Base {
|
|
|
798
813
|
>
|
|
799
814
|
</foxy-query-builder>
|
|
800
815
|
|
|
801
|
-
<foxy-pagination
|
|
816
|
+
<foxy-pagination
|
|
817
|
+
first=${url.toString()}
|
|
818
|
+
lang=${lang}
|
|
819
|
+
ns="${ns} ${(_e = (_d = customElements.get('foxy-pagination')) === null || _d === void 0 ? void 0 : _d.defaultNS) !== null && _e !== void 0 ? _e : ''}"
|
|
820
|
+
?disabled=${isDisabled}
|
|
821
|
+
>
|
|
802
822
|
<foxy-table
|
|
803
823
|
class="px-m mb-s border border-contrast-10 rounded-t-l rounded-b-l"
|
|
804
824
|
group=${group}
|
|
@@ -821,96 +841,101 @@ export class CouponForm extends Base {
|
|
|
821
841
|
const usesPerCustomer = (_b = this.form.number_of_uses_allowed_per_customer) !== null && _b !== void 0 ? _b : 0;
|
|
822
842
|
const usesPerCouponCode = (_c = this.form.number_of_uses_allowed_per_code) !== null && _c !== void 0 ? _c : 0;
|
|
823
843
|
return html `
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
<div class="
|
|
828
|
-
<
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
844
|
+
<div data-testid="usage">
|
|
845
|
+
${this.renderTemplateOrSlot('usage:before')}
|
|
846
|
+
|
|
847
|
+
<div class="space-y-s">
|
|
848
|
+
<div class="grid gap-m grid-cols-3">
|
|
849
|
+
<vaadin-integer-field
|
|
850
|
+
placeholder=${this.t('unlimited')}
|
|
851
|
+
data-testid="usage:per-coupon"
|
|
852
|
+
label=${this.t('uses_per_coupon')}
|
|
853
|
+
class="w-full"
|
|
854
|
+
min="0"
|
|
855
|
+
prevent-invalid-input
|
|
856
|
+
has-controls
|
|
857
|
+
.value=${usesPerCoupon || ''}
|
|
858
|
+
?disabled=${isDisabled}
|
|
859
|
+
?readonly=${isReadonly}
|
|
860
|
+
@change=${(evt) => {
|
|
839
861
|
const field = evt.currentTarget;
|
|
840
862
|
this.edit({ number_of_uses_allowed: parseInt(field.value) });
|
|
841
863
|
}}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
864
|
+
>
|
|
865
|
+
</vaadin-integer-field>
|
|
866
|
+
|
|
867
|
+
<vaadin-integer-field
|
|
868
|
+
placeholder=${this.t('unlimited')}
|
|
869
|
+
data-testid="usage:per-coupon-code"
|
|
870
|
+
label=${this.t('uses_per_coupon_code')}
|
|
871
|
+
class="w-full"
|
|
872
|
+
min="0"
|
|
873
|
+
prevent-invalid-input
|
|
874
|
+
has-controls
|
|
875
|
+
.value=${usesPerCouponCode || ''}
|
|
876
|
+
?disabled=${isDisabled}
|
|
877
|
+
?readonly=${isReadonly}
|
|
878
|
+
@change=${(evt) => {
|
|
856
879
|
const field = evt.currentTarget;
|
|
857
880
|
this.edit({ number_of_uses_allowed_per_code: parseInt(field.value) });
|
|
858
881
|
}}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
882
|
+
>
|
|
883
|
+
</vaadin-integer-field>
|
|
884
|
+
|
|
885
|
+
<vaadin-integer-field
|
|
886
|
+
placeholder=${this.t('unlimited')}
|
|
887
|
+
data-testid="usage:per-customer"
|
|
888
|
+
label=${this.t('uses_per_customer')}
|
|
889
|
+
class="w-full"
|
|
890
|
+
min="0"
|
|
891
|
+
prevent-invalid-input
|
|
892
|
+
has-controls
|
|
893
|
+
.value=${usesPerCustomer || ''}
|
|
894
|
+
?disabled=${isDisabled}
|
|
895
|
+
?readonly=${isReadonly}
|
|
896
|
+
@change=${(evt) => {
|
|
873
897
|
const field = evt.currentTarget;
|
|
874
898
|
this.edit({ number_of_uses_allowed_per_customer: parseInt(field.value) });
|
|
875
899
|
}}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
900
|
+
>
|
|
901
|
+
</vaadin-integer-field>
|
|
902
|
+
</div>
|
|
879
903
|
|
|
880
|
-
|
|
881
|
-
|
|
904
|
+
<div
|
|
905
|
+
class=${classMap({
|
|
882
906
|
'transition-colors text-xs leading-s': true,
|
|
883
907
|
'text-secondary': !isDisabled,
|
|
884
908
|
'text-disabled': isDisabled,
|
|
885
909
|
})}
|
|
886
|
-
>
|
|
887
|
-
<foxy-i18n
|
|
888
|
-
options=${JSON.stringify({ count: usesPerCoupon })}
|
|
889
|
-
lang=${this.lang}
|
|
890
|
-
key="uses_per_coupon_summary${usesPerCoupon ? '' : '_0'}"
|
|
891
|
-
ns=${this.ns}
|
|
892
910
|
>
|
|
893
|
-
|
|
911
|
+
<foxy-i18n
|
|
912
|
+
options=${JSON.stringify({ count: usesPerCoupon })}
|
|
913
|
+
lang=${this.lang}
|
|
914
|
+
key="uses_per_coupon_summary${usesPerCoupon ? '' : '_0'}"
|
|
915
|
+
ns=${this.ns}
|
|
916
|
+
>
|
|
917
|
+
</foxy-i18n>
|
|
894
918
|
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
919
|
+
<foxy-i18n
|
|
920
|
+
options=${JSON.stringify({ count: usesPerCouponCode })}
|
|
921
|
+
lang=${this.lang}
|
|
922
|
+
key="uses_per_coupon_code_summary${usesPerCouponCode ? '' : '_0'}"
|
|
923
|
+
ns=${this.ns}
|
|
924
|
+
>
|
|
925
|
+
</foxy-i18n>
|
|
902
926
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
927
|
+
<foxy-i18n
|
|
928
|
+
options=${JSON.stringify({ count: usesPerCustomer })}
|
|
929
|
+
lang=${this.lang}
|
|
930
|
+
key="uses_per_customer_summary${usesPerCustomer ? '' : '_0'}"
|
|
931
|
+
ns=${this.ns}
|
|
932
|
+
>
|
|
933
|
+
</foxy-i18n>
|
|
934
|
+
</div>
|
|
910
935
|
</div>
|
|
911
|
-
</div>
|
|
912
936
|
|
|
913
|
-
|
|
937
|
+
${this.renderTemplateOrSlot('usage:after')}
|
|
938
|
+
</div>
|
|
914
939
|
`;
|
|
915
940
|
}
|
|
916
941
|
__renderProductRestrictions() {
|
|
@@ -932,7 +957,7 @@ export class CouponForm extends Base {
|
|
|
932
957
|
});
|
|
933
958
|
}
|
|
934
959
|
return html `
|
|
935
|
-
<div>
|
|
960
|
+
<div data-testid="product-restrictions">
|
|
936
961
|
${this.renderTemplateOrSlot('product-restrictions:before')}
|
|
937
962
|
|
|
938
963
|
<div class="space-y-s">
|
|
@@ -960,6 +985,7 @@ export class CouponForm extends Base {
|
|
|
960
985
|
</foxy-i18n>
|
|
961
986
|
|
|
962
987
|
<x-editable-list
|
|
988
|
+
data-testid="product-restrictions:${group.header}"
|
|
963
989
|
lang=${this.lang}
|
|
964
990
|
ns=${this.ns}
|
|
965
991
|
?disabled=${isDisabled}
|
|
@@ -1005,51 +1031,54 @@ export class CouponForm extends Base {
|
|
|
1005
1031
|
`;
|
|
1006
1032
|
}
|
|
1007
1033
|
__renderCategoryRestrictions() {
|
|
1008
|
-
var _a;
|
|
1034
|
+
var _a, _b, _c;
|
|
1009
1035
|
const scope = 'category-restrictions';
|
|
1010
1036
|
const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);
|
|
1011
1037
|
const isReadonly = this.readonlySelector.matches(scope, true);
|
|
1012
1038
|
return html `
|
|
1013
|
-
|
|
1039
|
+
<div data-testid="category-restrictions">
|
|
1040
|
+
${this.renderTemplateOrSlot('category-restrictions:before')}
|
|
1014
1041
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
lang=${this.lang}
|
|
1019
|
-
ns=${this.ns}
|
|
1020
|
-
?disabled=${isDisabled}
|
|
1021
|
-
>
|
|
1022
|
-
<foxy-i18n
|
|
1023
|
-
class="block text-s font-medium text-secondary leading-none mb-s"
|
|
1042
|
+
<div class="space-y-xs">
|
|
1043
|
+
<foxy-pagination
|
|
1044
|
+
first=${this.__itemCategories}
|
|
1024
1045
|
lang=${this.lang}
|
|
1025
|
-
|
|
1026
|
-
|
|
1046
|
+
ns="${this.ns} ${(_b = (_a = customElements.get('foxy-pagination')) === null || _a === void 0 ? void 0 : _a.defaultNS) !== null && _b !== void 0 ? _b : ''}"
|
|
1047
|
+
?disabled=${isDisabled}
|
|
1027
1048
|
>
|
|
1028
|
-
|
|
1049
|
+
<foxy-i18n
|
|
1050
|
+
class="block text-s font-medium text-secondary leading-none mb-s"
|
|
1051
|
+
lang=${this.lang}
|
|
1052
|
+
key="category_restrictions"
|
|
1053
|
+
ns=${this.ns}
|
|
1054
|
+
>
|
|
1055
|
+
</foxy-i18n>
|
|
1056
|
+
|
|
1057
|
+
<x-category-restrictions-page
|
|
1058
|
+
coupon-item-categories=${ifDefined((_c = this.data) === null || _c === void 0 ? void 0 : _c._links['fx:coupon_item_categories'].href)}
|
|
1059
|
+
data-testid="category-restrictions:page"
|
|
1060
|
+
coupon=${this.href}
|
|
1061
|
+
class="border border-contrast-10 rounded-t-l rounded-b-l mb-s"
|
|
1062
|
+
group=${this.group}
|
|
1063
|
+
lang=${this.lang}
|
|
1064
|
+
ns=${this.ns}
|
|
1065
|
+
?disabled=${isDisabled}
|
|
1066
|
+
?readonly=${isReadonly}
|
|
1067
|
+
>
|
|
1068
|
+
</x-category-restrictions-page>
|
|
1069
|
+
</foxy-pagination>
|
|
1029
1070
|
|
|
1030
|
-
<
|
|
1031
|
-
|
|
1032
|
-
coupon=${this.href}
|
|
1033
|
-
class="border border-contrast-10 rounded-t-l rounded-b-l mb-s"
|
|
1034
|
-
group=${this.group}
|
|
1071
|
+
<foxy-i18n
|
|
1072
|
+
class="block text-xs leading-s text-tertiary"
|
|
1035
1073
|
lang=${this.lang}
|
|
1074
|
+
key="category_restrictions_helper_text"
|
|
1036
1075
|
ns=${this.ns}
|
|
1037
|
-
?disabled=${isDisabled}
|
|
1038
|
-
?readonly=${isReadonly}
|
|
1039
1076
|
>
|
|
1040
|
-
</
|
|
1041
|
-
</
|
|
1077
|
+
</foxy-i18n>
|
|
1078
|
+
</div>
|
|
1042
1079
|
|
|
1043
|
-
|
|
1044
|
-
class="block text-xs leading-s text-tertiary"
|
|
1045
|
-
lang=${this.lang}
|
|
1046
|
-
key="category_restrictions_helper_text"
|
|
1047
|
-
ns=${this.ns}
|
|
1048
|
-
>
|
|
1049
|
-
</foxy-i18n>
|
|
1080
|
+
${this.renderTemplateOrSlot('category-restrictions:after')}
|
|
1050
1081
|
</div>
|
|
1051
|
-
|
|
1052
|
-
${this.renderTemplateOrSlot('category-restrictions:after')}
|
|
1053
1082
|
`;
|
|
1054
1083
|
}
|
|
1055
1084
|
__renderOptions() {
|
|
@@ -1063,7 +1092,7 @@ export class CouponForm extends Base {
|
|
|
1063
1092
|
{ param: 'is_taxable', label: 'apply_taxes_before_coupon' },
|
|
1064
1093
|
];
|
|
1065
1094
|
return html `
|
|
1066
|
-
<div>
|
|
1095
|
+
<div data-testid="options">
|
|
1067
1096
|
${this.renderTemplateOrSlot('options:before')}
|
|
1068
1097
|
|
|
1069
1098
|
<x-group frame>
|
|
@@ -1083,6 +1112,8 @@ export class CouponForm extends Base {
|
|
|
1083
1112
|
const color = isDisabled ? 'text-disabled' : 'text-secondary';
|
|
1084
1113
|
return html `
|
|
1085
1114
|
<x-checkbox
|
|
1115
|
+
data-testclass="inputs"
|
|
1116
|
+
data-testid="options:${option.param.replace(/_/g, '-')}"
|
|
1086
1117
|
?disabled=${isDisabled}
|
|
1087
1118
|
?readonly=${isReadonly}
|
|
1088
1119
|
?checked=${option.flip ? !value : value}
|
|
@@ -1110,6 +1141,8 @@ export class CouponForm extends Base {
|
|
|
1110
1141
|
})}
|
|
1111
1142
|
|
|
1112
1143
|
<x-checkbox
|
|
1144
|
+
data-testclass="inputs"
|
|
1145
|
+
data-testid="options:dates"
|
|
1113
1146
|
?disabled=${isDisabled}
|
|
1114
1147
|
?readonly=${isReadonly}
|
|
1115
1148
|
?checked=${this.form.start_date || this.form.end_date}
|
|
@@ -1147,6 +1180,8 @@ export class CouponForm extends Base {
|
|
|
1147
1180
|
const pickerValue = formValue ? serializeDate(new Date(formValue)) : '';
|
|
1148
1181
|
return html `
|
|
1149
1182
|
<vaadin-date-picker
|
|
1183
|
+
data-testclass="inputs"
|
|
1184
|
+
data-testid="options:${property.replace('_', '-')}"
|
|
1150
1185
|
placeholder=${this.t('select')}
|
|
1151
1186
|
label=${this.t(property)}
|
|
1152
1187
|
clear-button-visible
|
|
@@ -1201,7 +1236,7 @@ export class CouponForm extends Base {
|
|
|
1201
1236
|
const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;
|
|
1202
1237
|
const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;
|
|
1203
1238
|
const isInvalid = isTemplateInvalid || isSnaphotInvalid;
|
|
1204
|
-
const
|
|
1239
|
+
const isIdle = this.in('idle');
|
|
1205
1240
|
return html `
|
|
1206
1241
|
<div>
|
|
1207
1242
|
${this.renderTemplateOrSlot('create:before')}
|
|
@@ -1210,7 +1245,7 @@ export class CouponForm extends Base {
|
|
|
1210
1245
|
data-testid="create"
|
|
1211
1246
|
class="w-full"
|
|
1212
1247
|
theme="primary success"
|
|
1213
|
-
?disabled=${
|
|
1248
|
+
?disabled=${!isIdle || isInvalid || this.disabledSelector.matches('create', true)}
|
|
1214
1249
|
@click=${this.submit}
|
|
1215
1250
|
>
|
|
1216
1251
|
<foxy-i18n ns=${this.ns} key="create" lang=${this.lang}></foxy-i18n>
|
|
@@ -1243,7 +1278,7 @@ export class CouponForm extends Base {
|
|
|
1243
1278
|
data-testid="delete"
|
|
1244
1279
|
theme="primary error"
|
|
1245
1280
|
class="w-full"
|
|
1246
|
-
?disabled=${this.in('
|
|
1281
|
+
?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}
|
|
1247
1282
|
@click=${(evt) => {
|
|
1248
1283
|
const confirm = this.renderRoot.querySelector('#confirm');
|
|
1249
1284
|
confirm.show(evt.currentTarget);
|