@foxy.io/elements 1.42.0-beta.4 → 1.42.0-beta.6

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.
Files changed (79) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-api-browser.js +1 -1
  4. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  5. package/dist/cdn/foxy-attribute-form.js +1 -1
  6. package/dist/cdn/foxy-cart-form.js +1 -1
  7. package/dist/cdn/foxy-client-form.js +1 -1
  8. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  10. package/dist/cdn/foxy-coupon-form.js +1 -1
  11. package/dist/cdn/foxy-custom-field-form.js +1 -1
  12. package/dist/cdn/foxy-customer-form.js +1 -1
  13. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  14. package/dist/cdn/foxy-customer-portal.js +1 -1
  15. package/dist/cdn/foxy-customer.js +1 -1
  16. package/dist/cdn/foxy-downloadable-form.js +1 -1
  17. package/dist/cdn/foxy-email-template-form.js +1 -1
  18. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  19. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  20. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  21. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  22. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  23. package/dist/cdn/foxy-gift-card-form.js +1 -1
  24. package/dist/cdn/foxy-integration-form.js +1 -1
  25. package/dist/cdn/foxy-item-category-form.js +1 -1
  26. package/dist/cdn/foxy-item-form.js +1 -1
  27. package/dist/cdn/foxy-item-option-form.js +1 -1
  28. package/dist/cdn/foxy-native-integration-form.js +1 -1
  29. package/dist/cdn/foxy-pagination.js +1 -1
  30. package/dist/cdn/foxy-passkey-form.js +1 -1
  31. package/dist/cdn/foxy-payment-method-card.js +1 -1
  32. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  33. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  34. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  35. package/dist/cdn/foxy-store-form.js +1 -1
  36. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  37. package/dist/cdn/foxy-subscription-form.js +1 -1
  38. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  39. package/dist/cdn/foxy-tax-form.js +1 -1
  40. package/dist/cdn/foxy-template-config-form.js +1 -1
  41. package/dist/cdn/foxy-template-form.js +1 -1
  42. package/dist/cdn/foxy-template-set-form.js +1 -1
  43. package/dist/cdn/foxy-transaction.js +1 -1
  44. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  45. package/dist/cdn/foxy-user-form.js +1 -1
  46. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  47. package/dist/cdn/foxy-users-table.js +1 -1
  48. package/dist/cdn/foxy-webhook-form.js +1 -1
  49. package/dist/cdn/{shared-f15af5d1.js → shared-076f086a.js} +1 -1
  50. package/dist/cdn/{shared-6286efb1.js → shared-0e1ad508.js} +1 -1
  51. package/dist/cdn/shared-21fba20d.js +1 -0
  52. package/dist/cdn/{shared-63b647a8.js → shared-2a5d1cdf.js} +1 -1
  53. package/dist/cdn/{shared-9f4f8e95.js → shared-3ca95e21.js} +1 -1
  54. package/dist/cdn/{shared-ef98e595.js → shared-56d91134.js} +1 -1
  55. package/dist/cdn/{shared-6332db39.js → shared-5960c279.js} +1 -1
  56. package/dist/cdn/{shared-32883b02.js → shared-663794ff.js} +1 -1
  57. package/dist/cdn/shared-677953e0.js +1 -0
  58. package/dist/cdn/{shared-42a4540f.js → shared-77f39a8a.js} +1 -1
  59. package/dist/cdn/{shared-0643656a.js → shared-7995cbcf.js} +1 -1
  60. package/dist/cdn/{shared-bfdbe217.js → shared-7f5f6657.js} +1 -1
  61. package/dist/cdn/{shared-93c8789e.js → shared-90754404.js} +1 -1
  62. package/dist/cdn/{shared-79a6aa1a.js → shared-a1f654fc.js} +1 -1
  63. package/dist/cdn/{shared-38eb8858.js → shared-a3a18e8d.js} +1 -1
  64. package/dist/cdn/{shared-dd2a66a5.js → shared-df369311.js} +1 -1
  65. package/dist/cdn/{shared-bf5b2106.js → shared-e653b80e.js} +1 -1
  66. package/dist/cdn/{shared-c92d72ba.js → shared-eb086cef.js} +1 -1
  67. package/dist/cdn/{shared-d6f46d44.js → shared-fc66cb5d.js} +1 -1
  68. package/dist/cdn/{shared-91bf0fa2.js → shared-fca3a317.js} +1 -1
  69. package/dist/cdn/translations/payments-api-payment-method-form/en.json +76 -36
  70. package/dist/cdn/translations/payments-api-payment-preset-form/en.json +76 -36
  71. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +15 -4
  72. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  73. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +89 -78
  74. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
  75. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +1 -0
  76. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
  77. package/package.json +1 -1
  78. package/dist/cdn/shared-303dc2a6.js +0 -1
  79. package/dist/cdn/shared-cc5e4c06.js +0 -1
@@ -1 +0,0 @@
1
- import"./shared-68a5368a.js";import"./shared-bfdbe217.js";import{I as e}from"./shared-cc5e4c06.js";import{I as t}from"./shared-0643656a.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-70380f94.js";import{_ as s,m as i}from"./shared-cb58dfcd.js";import{h as r,s as o}from"./shared-ba5c42c7.js";import{s as l}from"./shared-53e476fd.js";import{g as a}from"./shared-bab2ea2c.js";import{F as n}from"./shared-343d1fd7.js";import{i as d}from"./shared-53e42a77.js";import{c as h}from"./shared-4e709717.js";import{u as c}from"./shared-f83207fb.js";let u,f=e=>e;let p,y,m,v,x,b,g,$,_=e=>e;customElements.define("foxy-internal-resource-picker-control-form",class extends t{constructor(){super(...arguments),this.selectionProps={}}static get properties(){return s(s({},super.properties),{},{selectionProps:{attribute:!1}})}renderBody(){return r(u||(u=f` <foxy-internal-async-list-control infer="selection" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),l(this.selectionProps))}}),customElements.define("foxy-internal-resource-picker-control",class extends e{constructor(){super(...arguments),this.getDisplayValueOptions=e=>({resource:e}),this.showCopyIdButton=!1,this.virtualHost=c("internal-resource-picker-control-"),this.getItemUrl=null,this.formProps={},this.filters=[],this.layout=null,this.first=null,this.item=null,this.form=null,this.__getItemRenderer=i((e=>new Function("ctx",`return ctx.html\`\n <${null!=e?e:"foxy-null"}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n infer="card"\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${null!=e?e:"foxy-null"}>\``)))}static get properties(){return s(s({},super.properties),{},{getDisplayValueOptions:{attribute:!1},showCopyIdButton:{type:Boolean,attribute:"show-copy-id-button"},virtualHost:{},getItemUrl:{attribute:!1},formProps:{type:Object},filters:{type:Array},layout:{},first:{},item:{},form:{}})}renderControl(){var e;const t=s(s({},this.formProps),{},{".selectionProps":{".filters":this.filters,".first":this.first,".item":this.item}});return r(p||(p=_` <foxy-form-dialog parent="foxy://${0}/select" header="header" infer="dialog" alert .props="${0}" .form="${0}" @fetch="${0}"> </foxy-form-dialog> ${0} `),this.virtualHost,t,null!==(e=this.form)&&void 0!==e?e:"foxy-internal-resource-picker-control-form",this.__handleFetchEvent,"summary-item"===this.layout?this.__renderSummaryItemLayout():this.__renderStandaloneLayout())}updated(e){var t,s;super.updated(e),e.has("item")&&(null===(s=(t=this.__getItemRenderer.cache).clear)||void 0===s||s.call(t))}__clear(){this._value="",this.dispatchEvent(new CustomEvent("clear"))}__renderSummaryItemLayout(){const e=this.renderRoot.querySelector("#value");return r(y||(y=_` <div class="leading-xs"> <div class="flex items-center gap-xs"> <div class="text-m text-body whitespace-nowrap flex-1">${0}</div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div class="truncate min-w-0"> ${0} </div> </button> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> <div style="max-width:32rem"> <div class="text-xs text-secondary">${0}</div> <div class="text-xs text-error" ?hidden="${0}"> ${0} </div> </div> </div> <foxy-nucleon infer="" href="${0}" id="value" @update="${0}"> </foxy-nucleon> `),this.label,this.t("select"),h({"text-right min-w-0 transition-colors transition-opacity":!0,"rounded-s focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"cursor-pointer text-body hover-opacity-80":!this.disabled&&!this.readonly,"font-medium":!this.readonly}),this.disabled||this.readonly,(e=>{if(this.disabled||this.readonly)return;const t=e.currentTarget,s=this.renderRoot.querySelector("foxy-form-dialog");s.href="",s.show(t)}),this._value?r(m||(m=_` <foxy-i18n infer="" key="value" .options="${0}"> </foxy-i18n> `),(null==e?void 0:e.data)?this.getDisplayValueOptions(e.data):{context:(null==e?void 0:e.in("fail"))?"fail":"busy"}):this.placeholder,this.t("clear"),h({"rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,this.__clear,o(v||(v=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)),this.helperText,this.disabled||this.readonly,this._errorMessage,d(this._value||void 0),(()=>this.requestUpdate()))}__renderStandaloneLayout(){var e,t,s,i,o;const n=this.__valueLoader,c="string"==typeof this._value?a(this._value):void 0,u="string"==typeof this._value?null===(e=this.getItemUrl)||void 0===e?void 0:e.call(this,this._value,null!==(t=null==n?void 0:n.data)&&void 0!==t?t:null):void 0;return r(x||(x=_` <div class="block group"> <div class="${0}"> <span class="mr-auto text-l">${0}</span> ${0} ${0} ${0} </div> <div class="text-secondary text-s" ?hidden="${0}">${0}</div> <button class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" ?disabled="${0}" @click="${0}"> <div class="${0}"> <foxy-nucleon class="block" infer="" href="${0}" id="valueLoader" @update="${0}"> ${0} </foxy-nucleon> </div> </button> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> </div> `),h({"flex items-center gap-s transition-colors font-medium":!0,"text-disabled":this.disabled}),this.label,u?r(b||(b=_` <a class="text-body rounded transition-opacity hover-opacity-90 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="view"></foxy-i18n> </a> `),u):"",this.showCopyIdButton&&null!==c?r(g||(g=_` <foxy-copy-to-clipboard layout="text" theme="contrast tertiary-inline" infer="copy-id" text="${0}"> </foxy-copy-to-clipboard> `),c):"",this.readonly||!this._value?"":r($||($=_` <vaadin-button theme="error tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="clear"></foxy-i18n> </vaadin-button> `),this.disabled,this.__clear),!this.helperText,this.helperText,h({"block w-full bg-contrast-5 rounded text-left transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer hover-bg-contrast-10":!this.disabled&&!this.readonly,"cursor-default":this.disabled||this.readonly,"mt-s":!!this.label||!!this.helperText}),this.disabled||this.readonly,(e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("foxy-form-dialog");s.href="",s.show(t)}),h({"transition-opacity":!0,"opacity-50":this.disabled}),d(this._value||void 0),(()=>this.requestUpdate()),this.__getItemRenderer(this.item)({html:r,data:null!==(s=null==n?void 0:n.data)&&void 0!==s?s:null,href:this._value||"",related:[],parent:"",props:{},spread:l,simplifyNsLoading:this.simplifyNsLoading,disabled:this.disabled,disabledControls:this.disabledControls,readonly:this.readonly,readonlyControls:this.readonlyControls,hidden:this.hidden,hiddenControls:this.hiddenControls,templates:this.templates,previous:null,next:null,group:null!==(o=null===(i=this.nucleon)||void 0===i?void 0:i.group)&&void 0!==o?o:"",lang:this.lang,ns:this.ns}),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}__handleFetchEvent(e){if(!(e instanceof n))return;if(e.defaultPrevented)return;const{url:t,method:s}=e.request;return t===`foxy://${this.virtualHost}/select`&&"POST"===s?e.respondWith(this.__handleSelect(e.request)):t===`foxy://${this.virtualHost}/empty`&&"GET"===s?e.respondWith(this.__handleEmpty()):void 0}async __handleSelect(e){const t=await e.clone().json();return this._value=t.selection,new Response(JSON.stringify({_links:{self:{href:`foxy://${this.virtualHost}/empty`}},message:"Resource selected."}))}async __handleEmpty(){return new Response(JSON.stringify({_links:{self:{href:`foxy://${this.virtualHost}/empty`}},message:"Resource selected."}))}get __valueLoader(){return this.renderRoot.querySelector("#valueLoader")}});
@@ -1 +0,0 @@
1
- import"./shared-5212ef4f.js";import"./shared-70380f94.js";import{_ as e,l as t}from"./shared-cb58dfcd.js";import{C as r}from"./shared-5afb584d.js";import{a as s,T as i,w as n}from"./shared-1ce5b073.js";import{h as l,r as o,L as h}from"./shared-ba5c42c7.js";import{I as a}from"./shared-2aa23b5f.js";import{N as p}from"./shared-f83207fb.js";import{s as u}from"./shared-0aedd809.js";let c,d,_,f,v=e=>e;class y extends(r(s(i(a(h))))){constructor(){super(...arguments),this.nucleon=null}static get inferredProperties(){return[...super.inferredProperties,"nucleon"]}static get properties(){return e(e({},super.properties),{},{nucleon:{attribute:!1}})}inferFromElement(e,t){return"nucleon"===e&&t instanceof p?t:super.inferFromElement(e,t)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),this.nucleon=null!==(t=e.get("nucleon"))&&void 0!==t?t:null,!1===(null===(r=this.nucleon)||void 0===r?void 0:r.in("idle"))&&(this.disabled=!0)}renderLightDom(){if("string"!=typeof this.infer)return;const e=l(c||(c=v` <slot name="${0}:before" slot="before"></slot> <slot name="${0}:after" slot="after"></slot> `),this.infer,this.infer);o(e,this)}updated(e){super.updated(e),this.renderLightDom()}renderControl(){return l(d||(d=v``))}render(){return this.hidden?l(_||(_=v``)):l(f||(f=v` ${0} ${0} ${0} `),this.renderTemplateOrSlot("before",this.nucleon),this.renderControl(),this.renderTemplateOrSlot("after",this.nucleon))}}customElements.define("foxy-internal-control",y);class m extends y{constructor(){var e;super(...arguments),e=this,this.checkValidityAsync=null,this.jsonTemplate=null,this.jsonPath=null,this.getValue=()=>{var e;const r=t(null===(e=this.nucleon)||void 0===e?void 0:e.form,this.property);return this.jsonPath?t(JSON.parse(null!=r?r:this.jsonTemplate),this.jsonPath):r},this.setValue=e=>{var t,r,s,i,n,l,o,h,a;const[p,...c]=this.property.split(".");if(c.length){const l=null!==(r=null===(t=this.nucleon)||void 0===t?void 0:t.form[p])&&void 0!==r?r:{};if(this.jsonPath){const t=JSON.parse(null!==(i=null===(s=this.nucleon)||void 0===s?void 0:s.form[p])&&void 0!==i?i:this.jsonTemplate);u(t,this.jsonPath,e),u(l,c,JSON.stringify(t))}else u(l,c,e);null===(n=this.nucleon)||void 0===n||n.edit({[p]:l})}else if(this.jsonPath){const t=JSON.parse(null!==(o=null===(l=this.nucleon)||void 0===l?void 0:l.form[p])&&void 0!==o?o:this.jsonTemplate);u(t,this.jsonPath,e),null===(h=this.nucleon)||void 0===h||h.edit({[p]:JSON.stringify(t)})}else null===(a=this.nucleon)||void 0===a||a.edit({[p]:e})},this.__debouncedCheckValidityAsync=n((async function(t){var r;const s=await(null===(r=e.checkValidityAsync)||void 0===r?void 0:r.call(e,t));e._value===t&&(e.__asyncError=!0===s?null:null!=s?s:null)}),300),this.__previousValue=null,this.__placeholder=null,this.__helperText=null,this.__asyncError=null,this.__v8nPrefix=null,this.__property=null,this.__label=null}static get properties(){return e(e({},super.properties),{},{checkValidityAsync:{attribute:!1},jsonTemplate:{attribute:"json-template"},placeholder:{type:String,noAccessor:!0},helperText:{type:String,attribute:"helper-text",noAccessor:!0},v8nPrefix:{type:String,attribute:"v8n-prefix",noAccessor:!0},jsonPath:{attribute:"json-path"},getValue:{attribute:!1},setValue:{attribute:!1},property:{type:String,noAccessor:!0},label:{type:String,noAccessor:!0},__asyncError:{attribute:!1}})}get placeholder(){return"string"==typeof this.__placeholder?this.__placeholder:this.t("placeholder")}set placeholder(e){const t=this.__placeholder;this.__placeholder=e,this.requestUpdate("placeholder",t)}get helperText(){return"string"==typeof this.__helperText?this.__helperText:this.t("helper_text")}set helperText(e){const t=this.__helperText;this.__helperText=e,this.requestUpdate("helperText",t)}get v8nPrefix(){return"string"==typeof this.__v8nPrefix?this.__v8nPrefix:"string"==typeof this.infer?`${this.infer}:`:""}set v8nPrefix(e){const t=this.__v8nPrefix;this.__v8nPrefix=e,this.requestUpdate("v8nPrefix",t)}get property(){return"string"==typeof this.__property?this.__property:"string"==typeof this.infer?this.infer.replace(/-/g,"_"):""}set property(e){const t=this.__property;this.__property=e,this.requestUpdate("property",t)}get label(){return"string"==typeof this.__label?this.__label:this.t("label")}set label(e){const t=this.__label;this.__label=e,this.requestUpdate("label",t)}resetPlaceholder(){const e=this.__placeholder;this.__placeholder=null,this.requestUpdate("placeholder",e)}resetHelperText(){const e=this.__helperText;this.__helperText=null,this.requestUpdate("helperText",e)}resetV8nPrefix(){const e=this.__v8nPrefix;this.__v8nPrefix=null,this.requestUpdate("v8nPrefix",e)}resetProperty(){const e=this.__property;this.__property=null,this.requestUpdate("property",e)}resetLabel(){const e=this.__label;this.__label=null,this.requestUpdate("label",e)}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,r=["reportValidity","validate"];for(const e of r)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode())}get _value(){return this.getValue()}set _value(e){this.__previousValue=this._value,this.__asyncError=null,this._error||this.__previousValue===e||this.__debouncedCheckValidityAsync(e);const t=new CustomEvent("change",{cancelable:!0,detail:e});this.dispatchEvent(t)&&this.setValue(e)}get _error(){var e,t;const r=null===(e=this.nucleon)||void 0===e?void 0:e.errors.find((e=>e.startsWith(this.v8nPrefix)));return null!==(t=null!=r?r:this.__asyncError)&&void 0!==t?t:void 0}get _errorMessage(){return this._error?this.t(this._error.substring(this.v8nPrefix.length)):void 0}get _checkValidity(){return()=>!this._error}}customElements.define("foxy-internal-editable-control",m);export{m as I,y as a};