@foxy.io/elements 1.13.0 → 1.14.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-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-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 +10 -10
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -0
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.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-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-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +26 -9
- 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 +14 -0
- package/dist/cdn/foxy-template-form.js +1 -0
- 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-d4dad105.js → shared-00563cb0.js} +1 -1
- package/dist/cdn/shared-0ced76a0.js +358 -0
- package/dist/cdn/{shared-f47647ac.js → shared-106daaca.js} +1 -1
- package/dist/cdn/{shared-145cc9eb.js → shared-10bdb6b9.js} +1 -1
- package/dist/cdn/{shared-91a9e922.js → shared-1469c1c4.js} +4 -4
- package/dist/cdn/{shared-f4119f12.js → shared-16f72e27.js} +1 -1
- package/dist/cdn/shared-1761daef.js +15 -0
- package/dist/cdn/shared-18459dcd.js +264 -0
- package/dist/cdn/{shared-e55b6bb7.js → shared-1b7e65e4.js} +1 -1
- package/dist/cdn/{shared-5fedf5e4.js → shared-200f613b.js} +2 -2
- package/dist/cdn/{shared-d9159fe1.js → shared-2174bcd4.js} +1 -1
- package/dist/cdn/{shared-4059f633.js → shared-218ba06e.js} +1 -1
- package/dist/cdn/{shared-e9920617.js → shared-34b2c1e2.js} +1 -1
- package/dist/cdn/{shared-036a8b21.js → shared-3d868b17.js} +1 -1
- package/dist/cdn/{shared-cf248335.js → shared-44cfc617.js} +1 -1
- package/dist/cdn/{shared-45d647e4.js → shared-46ee137f.js} +1 -1
- package/dist/cdn/{shared-b0b1d248.js → shared-4a52d9b5.js} +1 -1
- package/dist/cdn/shared-4be4e513.js +314 -0
- package/dist/cdn/{shared-f0199313.js → shared-593f7e2c.js} +1 -1
- package/dist/cdn/shared-59e44f29.js +1 -0
- package/dist/cdn/{shared-cd700eac.js → shared-60126eee.js} +1 -1
- package/dist/cdn/{shared-67157a25.js → shared-614e1a4e.js} +1 -1
- package/dist/cdn/{shared-17968c53.js → shared-63eaded9.js} +3 -3
- package/dist/cdn/shared-6b7602c7.js +1 -0
- package/dist/cdn/{shared-98ee7fad.js → shared-6d45a07b.js} +1 -1
- package/dist/cdn/{shared-a99dea97.js → shared-7a39a41f.js} +1 -1
- package/dist/cdn/{shared-84fa75d9.js → shared-9221e6b2.js} +1 -1
- package/dist/cdn/{shared-2860a3d3.js → shared-94b0ae99.js} +2 -2
- package/dist/cdn/{shared-f2cf6cfb.js → shared-9d779f46.js} +1 -1
- package/dist/cdn/shared-a46edf4b.js +1 -0
- package/dist/cdn/{shared-54702b33.js → shared-b0f0e8b5.js} +1 -1
- package/dist/cdn/shared-b28a59de.js +1 -0
- package/dist/cdn/{shared-ed4ed7a5.js → shared-b710881a.js} +2 -2
- package/dist/cdn/{shared-3ae39e52.js → shared-bb824ab4.js} +3 -3
- package/dist/cdn/shared-c4b96261.js +1 -0
- package/dist/cdn/shared-d94ffc2b.js +1 -0
- package/dist/cdn/shared-df573cea.js +12 -0
- package/dist/cdn/{shared-e5de8675.js → shared-e7f8ffe9.js} +1 -1
- package/dist/cdn/{shared-54c485d2.js → shared-ec861f31.js} +21 -21
- package/dist/cdn/{shared-e0248713.js → shared-f0a83bd6.js} +1 -1
- package/dist/cdn/{shared-b77179fd.js → shared-fb90e05c.js} +1 -1
- package/dist/cdn/{shared-747b0842.js → shared-ff79f3f9.js} +1 -1
- package/dist/cdn/translations/shared/en.json +52 -1
- package/dist/elements/private/Choice/Choice.js +0 -2
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/Group/Group.js +1 -1
- package/dist/elements/private/Group/Group.js.map +1 -1
- package/dist/elements/private/I18N/I18N.js +1 -1
- package/dist/elements/private/I18N/I18N.js.map +1 -1
- package/dist/elements/public/AddressForm/AddressForm.js +8 -4
- package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js +8 -4
- package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +8 -4
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
- package/dist/elements/public/CustomerForm/CustomerForm.js +8 -4
- package/dist/elements/public/CustomerForm/CustomerForm.js.map +1 -1
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +24 -0
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +311 -0
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -0
- package/dist/elements/public/EmailTemplateForm/index.d.ts +9 -0
- package/dist/elements/public/EmailTemplateForm/index.js +11 -0
- package/dist/elements/public/EmailTemplateForm/index.js.map +1 -0
- package/dist/elements/public/EmailTemplateForm/types.d.ts +3 -0
- package/dist/elements/public/EmailTemplateForm/types.js +2 -0
- package/dist/elements/public/EmailTemplateForm/types.js.map +1 -0
- package/dist/elements/public/ItemsForm/ItemsForm.js +2 -2
- package/dist/elements/public/ItemsForm/ItemsForm.js.map +1 -1
- package/dist/elements/public/NucleonElement/serveFromCache.js +1 -0
- package/dist/elements/public/NucleonElement/serveFromCache.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +8 -4
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/CountriesList.d.ts +23 -0
- package/dist/elements/public/TemplateConfigForm/CountriesList.js +129 -0
- package/dist/elements/public/TemplateConfigForm/CountriesList.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/CountryCard.d.ts +20 -0
- package/dist/elements/public/TemplateConfigForm/CountryCard.js +125 -0
- package/dist/elements/public/TemplateConfigForm/CountryCard.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +25 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +529 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/defaults.d.ts +2 -0
- package/dist/elements/public/TemplateConfigForm/defaults.js +95 -0
- package/dist/elements/public/TemplateConfigForm/defaults.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/index.d.ts +9 -0
- package/dist/elements/public/TemplateConfigForm/index.js +11 -0
- package/dist/elements/public/TemplateConfigForm/index.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/types.d.ts +116 -0
- package/dist/elements/public/TemplateConfigForm/types.js +2 -0
- package/dist/elements/public/TemplateConfigForm/types.js.map +1 -0
- package/dist/elements/public/TemplateForm/TemplateForm.d.ts +23 -0
- package/dist/elements/public/TemplateForm/TemplateForm.js +303 -0
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -0
- package/dist/elements/public/TemplateForm/index.d.ts +9 -0
- package/dist/elements/public/TemplateForm/index.js +11 -0
- package/dist/elements/public/TemplateForm/index.js.map +1 -0
- package/dist/elements/public/TemplateForm/types.d.ts +3 -0
- package/dist/elements/public/TemplateForm/types.js +2 -0
- package/dist/elements/public/TemplateForm/types.js.map +1 -0
- package/dist/elements/public/index.d.ts +3 -0
- package/dist/elements/public/index.defined.d.ts +3 -0
- package/dist/elements/public/index.defined.js +3 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +3 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +94 -12
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -7
- package/dist/cdn/shared-296637c5.js +0 -1
- package/dist/cdn/shared-4a990126.js +0 -1
- package/dist/cdn/shared-50744508.js +0 -15
- package/dist/cdn/shared-b98f88c9.js +0 -369
- package/dist/cdn/shared-bf09e011.js +0 -572
- package/dist/cdn/shared-c0161e6a.js +0 -1
- package/dist/cdn/shared-c1e0e11f.js +0 -1
- package/dist/cdn/shared-dbcffd8e.js +0 -1
- package/dist/cdn/shared-e21a2aac.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import"./foxy-i18n.js";import{S as s}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import"./foxy-i18n.js";import{S as s}from"./shared-10bdb6b9.js";export{S as SubscriptionsTable}from"./shared-10bdb6b9.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-63eaded9.js";import"./shared-d94ffc2b.js";import"./shared-1761daef.js";import"./shared-2174bcd4.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";import"./foxy-nucleon-element.js";import"./shared-44cfc617.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";import"./shared-a46edf4b.js";import"./shared-4e709717.js";import"./shared-6b7602c7.js";import"./shared-87ca7818.js";customElements.define("foxy-subscriptions-table",s);
|
package/dist/cdn/foxy-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9221e6b2.js";import"./foxy-spinner.js";import{T as e}from"./shared-2174bcd4.js";export{T as Table}from"./shared-2174bcd4.js";import"./shared-63eaded9.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./foxy-i18n.js";import"./shared-d94ffc2b.js";import"./shared-1761daef.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";import"./foxy-nucleon-element.js";import"./shared-44cfc617.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";import"./shared-a46edf4b.js";import"./shared-4e709717.js";customElements.define("foxy-table",e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as e}from"./shared-63eaded9.js";import{a as r}from"./shared-d94ffc2b.js";import{T as t}from"./shared-614e1a4e.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-1761daef.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";import"./shared-44cfc617.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";import"./shared-a46edf4b.js";import"./shared-4e709717.js";let a,s,i=e=>e;class o extends(r(t,"tax-card")){render(){return super.render({title:({name:r})=>e(a||(a=i`${0}`),r),subtitle:()=>e(s||(s=i`${0} • ${0}`),this.__typeLabel,this.__rateLabel)})}get __typeLabel(){var e;const{type:r,country:t,region:a,city:s}=null!==(e=this.data)&&void 0!==e?e:{};return"global"===r?this.t("tax_global"):"union"===r?this.t("tax_union"):"country"===r?t:"region"===r?`${t}, ${a}`:"local"===r?`${t}, ${a}, ${s}`:void 0}get __rateLabel(){var e,r;if(!1===(null===(e=this.data)||void 0===e?void 0:e.is_live))return this.t("percent",{fraction:this.data.rate/100});const t=null===(r=this.data)||void 0===r?void 0:r.service_provider;return"onesource"===t?"Thomson Reuters ONESOURCE":"avalara"===t?"Avalara AvaTax 15":"taxjar"===t?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",o);export{o as TaxCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-036a8b21.js";import"./shared-84fa75d9.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{D as e}from"./shared-bf09e011.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-b98f88c9.js";import{_ as t,h as i}from"./shared-17968c53.js";import{C as r}from"./shared-e55b6bb7.js";import"./shared-b0b1d248.js";import{T as s,S as a,a as n}from"./shared-c1e0e11f.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import{P as o}from"./shared-b77179fd.js";import{c as d}from"./shared-4e709717.js";import{m as l}from"./shared-50744508.js";import{C as h}from"./shared-f0199313.js";import{N as c}from"./shared-cf248335.js";import{i as _}from"./shared-98ee7fad.js";import{i as u}from"./shared-c0161e6a.js";import"./shared-cd700eac.js";import"./shared-747b0842.js";import"./shared-87ca7818.js";import"./shared-54702b33.js";import"./shared-d4dad105.js";import"./shared-7684cb05.js";let m,p,y,g,v,f,$,b,x,S,T,E,k,O,C=e=>e;const w=["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"],H=[...w,"AU"],j=h(s(a(n(c,"tax-form"))));class A extends j{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=u(l.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=u(l.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-property-table":o,"x-checkbox":r,"x-dropdown":e}}static get properties(){return t(t({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return i(m||(m=C` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),d({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!this.in("busy")&&!this.in("fail")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&w.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return i(p||(p=C` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),this.in("busy")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),i(y||(y=C` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),this.in("busy")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__countriesService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(g||(g=C` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),n,0===n.length,s||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__regionsService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(v||(v=C` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),n,0===n.length,s||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return i(f||(f=C` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),this.in("busy")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||w.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),H.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),i($||($=C` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),this.in("busy")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return i(b||(b=C` <div> ${0} <vaadin-integer-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" prevent-invalid-input has-controls .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-integer-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),this.in("busy")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseInt(e.currentTarget.value);this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return i(x||(x=C` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),this.in("busy")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return i(S||(S=C` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),this.in("busy")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return i(T||(T=C` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,this.in("busy")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return i(E||(E=C` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>({name:this.t(e),value:this.data?this.t("date",{value:new Date(this.data[e])}):""}))),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),r=this.in({idle:{snapshot:{clean:"invalid"}}}),s=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(r||s),n=this.in("busy");return i(k||(k=C` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return i(O||(O=C` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="primary error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),this.in("busy")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|
|
1
|
+
import"./shared-3d868b17.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import"./shared-18459dcd.js";import"./shared-bb824ab4.js";import"./shared-ec861f31.js";import"./shared-0ced76a0.js";import{D as e}from"./shared-4be4e513.js";import{_ as t,h as i}from"./shared-63eaded9.js";import{C as r}from"./shared-1b7e65e4.js";import"./shared-4a52d9b5.js";import{T as s,S as a,a as n}from"./shared-d94ffc2b.js";import"./shared-df573cea.js";import"./shared-46ee137f.js";import"./shared-f0a83bd6.js";import{P as o}from"./shared-fb90e05c.js";import{c as d}from"./shared-4e709717.js";import{a as l}from"./shared-1761daef.js";import{C as h}from"./shared-593f7e2c.js";import{N as c}from"./shared-44cfc617.js";import{i as _}from"./shared-6d45a07b.js";import{i as u}from"./shared-a46edf4b.js";import"./shared-60126eee.js";import"./shared-ff79f3f9.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";let m,p,y,g,v,f,b,$,x,S,T,E,k,O,C=e=>e;const w=["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"],H=[...w,"AU"],j=h(s(a(n(c,"tax-form"))));class A extends j{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=u(l.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=u(l.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-property-table":o,"x-checkbox":r,"x-dropdown":e}}static get properties(){return t(t({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return i(m||(m=C` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),d({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!this.in("busy")&&!this.in("fail")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&w.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return i(p||(p=C` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),this.in("busy")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),i(y||(y=C` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),this.in("busy")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__countriesService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(g||(g=C` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),n,0===n.length,s||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),r=this.in("busy"),s=t||r,a=this.__regionsService.state.context.data,n=Object.values(null!==(e=null==a?void 0:a.values)&&void 0!==e?e:{});return i(v||(v=C` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),n,0===n.length,s||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return i(f||(f=C` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),this.in("busy")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||w.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),H.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),i(b||(b=C` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),this.in("busy")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return i($||($=C` <div> ${0} <vaadin-integer-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" prevent-invalid-input has-controls .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-integer-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),this.in("busy")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseInt(e.currentTarget.value);this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return i(x||(x=C` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),this.in("busy")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return i(S||(S=C` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),this.in("busy")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return i(T||(T=C` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,this.in("busy")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return i(E||(E=C` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),r=this.in({idle:{snapshot:{clean:"invalid"}}}),s=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(r||s),n=this.in("busy");return i(k||(k=C` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return i(O||(O=C` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="primary error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),this.in("busy")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-bb824ab4.js";import{C as e,a as t}from"./shared-18459dcd.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{_ as s,h as i,k as o,E as n,N as r,B as a,P as l,A as c}from"./shared-63eaded9.js";import{C as d}from"./shared-1b7e65e4.js";import{C as u}from"./shared-593f7e2c.js";import{N as h}from"./shared-44cfc617.js";import{T as p,a as f,S as g,R as _}from"./shared-d94ffc2b.js";import{c as m}from"./shared-4e709717.js";import{i as y}from"./shared-6d45a07b.js";import{G as b}from"./shared-7a39a41f.js";import"./shared-ff79f3f9.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import"./shared-ec861f31.js";import"./shared-1761daef.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-a46edf4b.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";let x,$,v,w,k,j=e=>e;const S=u(p(f(h)));class O extends S{constructor(){super(...arguments),this.regions=[],this.region="",this.name="",this.code=""}static get properties(){return s(s({},super.properties),{},{regions:{type:Array},region:{type:String},name:{type:String},code:{type:String}})}render(){var e,t;return i(x||(x=j` <div class="border border-contrast-10 rounded text-s"> <div class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button class="mr-xs flex items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div class="flex flex-wrap p-xs"> ${0} <div class="h-s m-xs flex items-center transition-colors border border-contrast-10 hover-border-contrast-40 focus-within-ring-1 focus-within-ring-primary-50 focus-within-border-primary-50" style="border-radius:var(--lumo-size-s)"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),this.name||this.code,this.name?i($||($=j`<span class="text-secondary">${0}</span>`),this.code):"",(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const o=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return i(v||(v=j` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button class="flex items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),o||e,o?i(w||(w=j`<span class="text-secondary">${0}</span>`),e):"",(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),this.t("add_region"),this.region,(e=>{"Enter"===e.key&&this.region&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.region=t.value}),m({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.region,"bg-success-10 text-success cursor-pointer":!!this.region,"hover-bg-success hover-text-success-contrast":!!this.region,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.region}),!this.region,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(k||(k=j`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.region])],this.region="",this.dispatchEvent(new CustomEvent("update:regions"))}}let F,E,T,N=e=>e;const H=g(p(f(h)));class J extends H{constructor(){super(...arguments),this.countries={},this.disabled=!1,this.readonly=!1,this.regions="",this.country=""}static get scopedElements(){return{"x-country-card":O,"iron-icon":customElements.get("iron-icon")}}static get properties(){return s(s({},super.properties),{},{countries:{type:Object},disabled:{type:Boolean},readonly:{type:Boolean},regions:{type:String},country:{type:String}})}render(){var e,t;return i(F||(F=N` <div> <div class="space-y-s"> ${0} <div class="h-m flex items-center rounded transition-colors border border-contrast-10 hover-border-contrast-40 focus-within-ring-1 focus-within-ring-primary-50 focus-within-border-primary-50"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" @keydown="${0}" @input="${0}"> <button class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([e,t])=>{var o,n;let r;try{const t=new URL(this.regions);t.searchParams.set("country_code",e),r=t.toString()}catch(e){r=""}return i(E||(E=N` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===t?[]:t),e,y(null===(n=null===(o=this.data)||void 0===o?void 0:o.values[e])||void 0===n?void 0:n.default),r,this.lang,this.ns,this.disabled,this.readonly,(t=>{const i=s({},this.countries),o=t.currentTarget.regions;i[e]=o.length?o:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const t=s({},this.countries);delete t[e],this.countries=t,this.dispatchEvent(new CustomEvent("update:countries"))}))})),this.t("add_country"),this.country,(e=>{"Enter"===e.key&&this.country&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.country=t.value}),m({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.country,"bg-success-10 text-success cursor-pointer":!!this.country,"hover-bg-success hover-text-success-contrast":!!this.country,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.country}),!this.country,this.__addCountry,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(T||(T=N`<option value="${0}">${0}</option>`),e.cc2,e.default))))}__addCountry(){this.countries=s(s({},this.countries),{},{[this.country]:"*"}),this.country="",this.dispatchEvent(new CustomEvent("update:countries"))}}const q=o((e=>t=>{let s;if(t instanceof n||t instanceof r)throw new Error("The `live` directive is not allowed on text or event bindings");if(t instanceof a)C(t.strings),s=t.element.hasAttribute(t.name),t.value=s;else{const{element:i,name:o,strings:n}=t.committer;if(C(n),t instanceof l){if(s=i[o],s===e)return}else t instanceof c&&(s=i.getAttribute(o));if(s===String(e))return}t.setValue(e)})),C=e=>{if(2!==e.length||""!==e[0]||""!==e[1])throw new Error("`live` bindings can only contain a single expression")};
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
5
|
+
* This code may only be used under the BSD style license found at
|
|
6
|
+
* http://polymer.github.io/LICENSE.txt
|
|
7
|
+
* The complete set of authors may be found at
|
|
8
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
9
|
+
* The complete set of contributors may be found at
|
|
10
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
11
|
+
* Code distributed by Google as part of the polymer project is also
|
|
12
|
+
* subject to an additional IP rights grant found at
|
|
13
|
+
* http://polymer.github.io/PATENTS.txt
|
|
14
|
+
*/let V,I,z,R,A,B,D,L,P,G,U,W,K,M,Q,X=e=>e;const Y=g(_(u(p(f(h,"template-config-form")))));class Z extends Y{constructor(){super(...arguments),this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":J,"x-checkbox":d,"x-choice":e,"x-group":b}}static get properties(){return s(s({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenControls,o=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},segment_io:{usage:"none",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return i(V||(V=X` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="${0}"> ${0} ${0} ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),m({"space-y-l transition-opacity":!0,"opacity-50":!this.in("idle")}),s.matches("cart-type",!0)?"":this.__renderCartType(o),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(o),s.matches("locations",!0)?"":this.__renderLocations(o),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(o),s.matches("header",!0)?"":this.__renderHeader(o),s.matches("footer",!0)?"":this.__renderFooter(o),m({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(e){const{lang:t,ns:o}=this,n=["default","fullpage","custom"];return i(I||(I=X` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="cart_type" ns="${0}"></foxy-i18n> <x-choice .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),t,o,e.cart_type,n,this.disabledSelector.matches("cart-type",!0),this.readonlySelector.matches("cart-type",!0),(t=>{this.edit({json:JSON.stringify(s(s({},e),{},{cart_type:t.detail}))})}),n.map((e=>i(z||(z=X` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-tertiary text-s" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,o,t,e,o))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:o,ns:n}=this,r=this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),l=["combobox","search","disabled"],c="none"===e.foxycomplete.usage?"disabled":e.foxycomplete.show_combobox?"combobox":"search",d=()=>i(R||(R=X` <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),r,a,e.foxycomplete.show_flags,(t=>{const i=s(s({},e.foxycomplete),{},{show_flags:t.detail});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:i}))})}),o,n);return i(A||(A=X` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="foxycomplete" ns="${0}"></foxy-i18n> <x-choice .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}"> ${0} </div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),o,n,c,l,r,a,(i=>{if(!(i instanceof t))return;const o=s(s({},e.foxycomplete),{},{usage:"disabled"===i.detail?"none":"required",show_combobox:"combobox"===i.detail});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:o}))})}),l.map((e=>i(B||(B=X` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-tertiary text-s" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,o,e,n,o,e,n))),"combobox"!==c,["open","close"].map((t=>{const o="open"===t?"combobox_open":"combobox_close";return i(D||(D=X` <vaadin-text-field label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-field> `),this.t(`${t}_icon`),e.foxycomplete[o],r,a,(t=>{const i=t.currentTarget,n=s(s({},e.foxycomplete),{},{[o]:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:n}))})}))})),d(),"search"!==c,d(),r,a,"enabled"===e.postal_code_lookup.usage,(t=>{const i={usage:t.detail?"enabled":"none"};this.edit({json:JSON.stringify(s(s({},e),{},{postal_code_lookup:i}))})}),o,n,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,o=e.location_filtering,n="blacklist"===o.shipping_filter_type?"block":"allow",r="both"===o.usage?"copy":"blacklist"===o.billing_filter_type?"block":"allow",a=()=>{if("both"===o.usage)o.billing_filter_type=o.shipping_filter_type,o.billing_filter_values=o.shipping_filter_values;else{const e=Object.keys(o.billing_filter_values).length>0,t=Object.keys(o.shipping_filter_values).length>0;o.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return i(L||(L=X` ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="location_plural" ns="${0}"></foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="text-tertiary" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice .items="${0}" .value="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="text-tertiary" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice .items="${0}" .value="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"></foxy-i18n> <x-countries-list countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} `),this.renderTemplateOrSlot("locations:before"),t,s,t,s,["allow","block"],n,(t=>{"both"!==o.usage&&(o.usage="independent"),o.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",a(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(o.shipping_filter_values),this.regions,this.countries,n,t,s,this.disabledSelector.matches("locations",!0),this.readonlySelector.matches("locations",!0),(t=>{o.shipping_filter_values=t.currentTarget.countries,a(),this.edit({json:JSON.stringify(e)})}),t,s,["allow","block","copy"],r,(t=>{"copy"===t.detail?o.usage="both":(o.usage="independent",o.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),a(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(o.billing_filter_values),this.regions,this.countries,r,t,s,this.disabledSelector.matches("locations",!0),this.readonlySelector.matches("locations",!0),"copy"===r,(t=>{o.billing_filter_values=t.currentTarget.countries,a(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,o=[],n=[],r=e.cart_display_config;for(const e in r){if(!e.startsWith("show_"))continue;const t=e.substring(5);o.push(t),"required"!==r.usage||r[e]||n.push(t)}"required"===r.usage&&n.push(...r.hidden_product_options);const a=()=>{r.usage="required",o.includes(this.__addHiddenFieldInputValue)?r[`show_${this.__addHiddenFieldInputValue}`]=!1:r.hidden_product_options.includes(this.__addHiddenFieldInputValue)||r.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},l="calc(var(--lumo-border-radius-l) / 1.2)",c=0===n.length?[l]:["0","0",l,l];return i(P||(P=X` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="hidden_fields" ns="${0}"></foxy-i18n> <div class="divide-y divide-contrast-10"> ${0} </div> <div style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),t,s,n.map((n=>i(G||(G=X` <div class="h-m ml-m pr-xs flex items-center justify-between"> ${0} <button class="flex w-xs h-xs items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),o.includes(n)?i(U||(U=X`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,n,s):i(W||(W=X`<span>${0}</span>`),n),(()=>{"boolean"==typeof r[`show_${n}`]?r[`show_${n}`]=!0:r.hidden_product_options=r.hidden_product_options.filter((e=>e!==n)),this.edit({json:JSON.stringify(e)})})))),c.join(" "),m({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":n.length>0}),this.t("add_field"),q(this.__addHiddenFieldInputValue),(e=>"Enter"===e.key&&a()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),o.filter((e=>!n.includes(e))).map((e=>i(K||(K=X`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),m({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__addHiddenFieldInputValue,"bg-success-10 text-success cursor-pointer":!!this.__addHiddenFieldInputValue,"hover-bg-success hover-text-success-contrast":!!this.__addHiddenFieldInputValue,"focus-outline-none focus-ring-2":!!this.__addHiddenFieldInputValue}),!this.__addHiddenFieldInputValue,a,this.renderTemplateOrSlot("hidden-fields:after"))}__renderHeader(e){return i(M||(M=X` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.t("custom_header"),this.t("custom_header_helper_text"),e.custom_script_values.header,this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const i=t.currentTarget,o=s(s({},e.custom_script_values),{},{header:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:o}))})}),this.renderTemplateOrSlot("header:after"))}__renderFooter(e){return i(Q||(Q=X` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("footer:before"),this.t("custom_footer"),this.t("custom_footer_helper_text"),e.custom_script_values.footer,this.disabledSelector.matches("footer",!0),this.readonlySelector.matches("footer",!0),(t=>{const i=t.currentTarget,o=s(s({},e.custom_script_values),{},{footer:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:o}))})}),this.renderTemplateOrSlot("footer:after"))}}customElements.define("foxy-template-config-form",Z);export{Z as TemplateConfigForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-bb824ab4.js";import{C as e,a as t}from"./shared-18459dcd.js";import"./shared-0ced76a0.js";import"./shared-3d868b17.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{_ as i,j as a,h as s}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{C as r}from"./shared-593f7e2c.js";import{S as n,T as o,a as d}from"./shared-d94ffc2b.js";import"./shared-4a52d9b5.js";import"./shared-4be4e513.js";import"./shared-ec861f31.js";import{G as l}from"./shared-7a39a41f.js";import{P as c}from"./shared-fb90e05c.js";import{c as h}from"./shared-4e709717.js";import{N as m}from"./shared-44cfc617.js";import{i as p}from"./shared-6d45a07b.js";import"./shared-ff79f3f9.js";import"./shared-1761daef.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-a46edf4b.js";import"./shared-60126eee.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";let f,u,v,y,$,b,_,x,g=e=>e;const j=n(o(r(d(m,"template-form"))));class S extends j{constructor(){super(...arguments),this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return i(i({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get styles(){return[...super.styles,a(f||(f=g`#cached-content::part(input-field){max-height:15em}`))]}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"vaadin-button":customElements.get("vaadin-button"),"x-property-table":c,"x-choice":e,"x-group":l}}render(){var e,t;const{hiddenSelector:i,href:a,lang:r,ns:n}=this,o=a?"delete":"create",d=this.in("busy"),l=this.in("fail");return s(u||(u=g` <div class="space-y-m"> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),i.matches("description",!0)?"":this.__renderDescription(),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!a?"":this.__renderTimestamps(),i.matches(o)?"":this.__renderAction(o),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!d&&!l}),l?"error":d?"busy":"empty",r,n,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderDescription(){var e,t;return s(v||(v=g` <div> ${0} <vaadin-text-field class="w-full mb-s" label="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("description:before"),this.t("description"),null!==(t=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==t?t:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot("description:after"))}__renderContent(){var e;const i=this.form.content_url?"url":this.form.content?"clipboard":this.__contentChoice;return s(y||(y=g` <div> ${0} <x-group frame> <foxy-i18n lang="${0}" slot="header" key="template" ns="${0}"></foxy-i18n> <x-choice data-testid="template-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div slot="url" ?hidden="${0}"> <div class="flex items-center mt-0 mb-m"> <vaadin-text-field data-testid="content_url" value="${0}" class="mr-s flex-grow" @input="${0}"> </vaadin-text-field> ${0} </div> </div> <div slot="clipboard" ?hidden="${0}"> <vaadin-text-area id="cached-content" data-testid="content" class="w-full mb-m" .value="${0}" @input="${0}"> </vaadin-text-area> </div> </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("content:before"),this.lang,this.ns,i,["default","url","clipboard"],this.readonlySelector.matches("content",!0),this.in("busy")||this.disabledSelector.matches("content",!0),(e=>{e instanceof t&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>s($||($=g` <div slot="${0}-label" class="py-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s opacity-70" lang="${0}" key="template_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns,this.lang,e,this.ns))),"url"!==i,p(this.form.content_url),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),this.form.content_url===(null===(e=this.data)||void 0===e?void 0:e.content_url)?s(b||(b=g` <vaadin-button class="relative" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> `),"busy"===this.__cacheState,this.__cache,h({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,h({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns):"","clipboard"!==i,this.form.content,(e=>{const t=e.currentTarget.value;this.edit({content:t,content_url:""})}),this.renderTemplateOrSlot("content:after"))}__renderTimestamps(){return s(_||(_=g` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderAction(e){const{disabledSelector:t,href:i,lang:a,ns:r}=this,n=this.in({idle:{template:{dirty:"valid"}}}),o=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||t.matches(e,!0),l=n||o;return s(x||(x=g` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),a,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?"primary "+(i?"error":"success"):"",e,this.in({idle:"template"})&&!l||d,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,a,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const i=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new S.API(this).fetch(i,{method:"POST"});this.__cacheState=a.ok?"idle":"fail"}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",S);export{S as TemplateForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as t}from"./shared-63eaded9.js";import{C as e}from"./shared-593f7e2c.js";import{N as s}from"./shared-44cfc617.js";import{T as i,a as r}from"./shared-d94ffc2b.js";import{c as a}from"./shared-4e709717.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-1761daef.js";import"./shared-6d45a07b.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";import"./shared-a46edf4b.js";let n,o,d,c,l,m,h,p,u,f,v,y,_=t=>t;const $=i(e(r(s,"transaction-card")));class x extends ${constructor(){super(...arguments),this.templates={},this.__currencyDisplay=""}render(){var e,s;const i=this.hiddenSelector,r=!i.matches("total",!0),d=!i.matches("status",!0);return t(n||(n=_` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),a({"transition-opacity":!0,"opacity-0":!this.data}),r||d?t(o||(o=_` <div class="flex items-center justify-between"> ${0} ${0} </div> `),r?this.__renderTotal():"",d?this.__renderStatus():""):"",i.matches("description",!0)?"":this.__renderDescription(),i.matches("customer",!0)?"":this.__renderCustomer(),a({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}async _sendGet(){const t=await super._sendGet(),e=await super._fetch(t._links["fx:store"].href);return this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",t}__renderTotal(){const e=this.data;let s;if(e){const i=`${e.total_order} ${e.currency_code}`,r=this.__currencyDisplay;s=t(d||(d=_` <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({amount:i,currencyDisplay:r}),this.lang,this.ns)}else s=t(c||(c=_`​`));return t(l||(l=_` <div data-testid="total"> ${0} <div class="font-semibold truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,s,i,r;const a=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed";return t(m||(m=_` <div data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-s"> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline text-l ${0}" title="${0}" icon="${0}"> </iron-icon> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:null===(s=this.data)||void 0===s?void 0:s.transaction_date}),this.lang,this.ns,null!==(i={completed:"text-success",rejected:"text-error",declined:"text-error"}[a])&&void 0!==i?i:"text-tertiary",this.t(`transaction_${a}`),null!==(r={completed:"icons:done-all",refunded:"icons:restore",rejected:"icons:highlight-off",declined:"icons:highlight-off",voided:"icons:remove-circle-outline"}[a])&&void 0!==r?r:"icons:schedule",this.renderTemplateOrSlot("status:after"))}__renderDescription(){var e,s;const i=null===(s=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===s?void 0:s["fx:items"];let r;if(i){const e={most_expensive_item:[...i].sort(((t,e)=>t.price-e.price))[0],count:i.length};r=t(h||(h=_` <foxy-i18n options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify(e),this.lang,this.ns)}else r=t(p||(p=_`​`));return t(u||(u=_` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),r,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,s=e?t(f||(f=_`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):t(v||(v=_`​`));return t(y||(y=_` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),s,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",x);export{x as TransactionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{T as s}from"./shared-1469c1c4.js";export{T as TransactionsTable}from"./shared-1469c1c4.js";import"./shared-ff79f3f9.js";import"./shared-63eaded9.js";import"./shared-d94ffc2b.js";import"./shared-1761daef.js";import"./shared-2174bcd4.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";import"./foxy-nucleon-element.js";import"./shared-44cfc617.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";import"./shared-a46edf4b.js";import"./shared-4e709717.js";customElements.define("foxy-transactions-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-bb824ab4.js";import"./shared-0ced76a0.js";import"./shared-3d868b17.js";import"./foxy-spinner.js";import"./foxy-i18n.js";export{U as UserForm}from"./shared-c4b96261.js";import"./shared-df573cea.js";import"./shared-ff79f3f9.js";import"./shared-63eaded9.js";import"./shared-4a52d9b5.js";import"./shared-00563cb0.js";import"./shared-1761daef.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";import"./shared-d94ffc2b.js";import"./shared-4e709717.js";import"./shared-46ee137f.js";import"./shared-60126eee.js";import"./shared-1b7e65e4.js";import"./shared-f0a83bd6.js";import"./shared-18459dcd.js";import"./shared-ec861f31.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-a46edf4b.js";import"./shared-4be4e513.js";import"./shared-7a39a41f.js";import"./shared-44cfc617.js";import"./shared-7684cb05.js";import"./shared-b738ee96.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-0ced76a0.js";import"./foxy-form-dialog.js";import{r as e}from"./shared-c4b96261.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as s}from"./shared-63eaded9.js";import{T as a}from"./shared-2174bcd4.js";import"./shared-df573cea.js";import"./shared-ff79f3f9.js";import"./shared-3d868b17.js";import"./shared-4a52d9b5.js";import"./shared-00563cb0.js";import"./shared-1761daef.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";import"./shared-d94ffc2b.js";import"./shared-4e709717.js";import"./shared-7684cb05.js";import"./shared-bb824ab4.js";import"./shared-1b7e65e4.js";import"./shared-46ee137f.js";import"./shared-f0a83bd6.js";import"./shared-18459dcd.js";import"./shared-ec861f31.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-a46edf4b.js";import"./shared-4be4e513.js";import"./shared-7a39a41f.js";import"./shared-44cfc617.js";import"./shared-b738ee96.js";import"./shared-60126eee.js";import"./foxy-nucleon-element.js";let t,r,o,d,i,m,n,l=e=>e;class p extends a{constructor(){super(...arguments),this.columns=[p.nameColumn,p.emailColumn,p.rolesColumn,p.lastUpdatedColumn,p.actionsColumn]}render(){return s(t||(t=l` <foxy-form-dialog parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.href,this.lang,this.ns,super.render())}}p.nameColumn={cell:e=>s(r||(r=l` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),e.data.first_name,e.data.last_name)},p.emailColumn={hideBelow:"md",cell:e=>s(o||(o=l` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),e.data.email)},p.rolesColumn={cell:a=>s(d||(d=l` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((t=>s(i||(i=l` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),a.data[t]?"":"text-disabled",e.find((e=>e.property===t)).icon))))},p.lastUpdatedColumn={hideBelow:"lg",cell:e=>s(m||(m=l` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:e.data.date_modified}),e.lang,e.ns,JSON.stringify({value:e.data.date_modified}),e.lang,e.ns)},p.actionsColumn={cell:e=>s(n||(n=l` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(s=>{const a=s.target,t=a.getRootNode().querySelector("#form");t.href=e.data._links.self.href,t.show(a)}),e.lang,e.ns)},customElements.define("foxy-users-table",p);export{p as UsersTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,A as t}from"./shared-
|
|
1
|
+
import{F as e,A as t}from"./shared-1761daef.js";class s extends t{constructor(t){super({base:new URL(document.baseURI),fetch:(...n)=>new Promise(((c,a)=>{const o="string"==typeof n[0]?new s.WHATWGRequest(...n):n[0];o.headers.set("Content-Type","application/json"),o.headers.set("FOXY-API-VERSION","1");const r=new e("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:o,resolve:c,reject:a});t.dispatchEvent(r),r.defaultPrevented||fetch(o).then(c).catch(a)}))})}}s.FetchEvent=e;export{s as A};
|