whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
components
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/plugins/surecart/dist/components/components/sc-form2.js
import{proxyCustomElement,HTMLElement,createEvent,h}from"@stencil/core/internal/client";function serialize(t){const e=new FormData(t),s={};return e.forEach(((t,e)=>{s[e]=t})),s}const scFormCss=":host{display:block}::slotted(*:not(:last-child)){margin-bottom:var(--sc-form-row-spacing, 0.75em)}::slotted(*:not(:last-child)).wp-block-spacer{margin-bottom:0}::slotted(*:focus-within),::slotted(*:active){position:relative;z-index:var(--sc-form-focus-within-z-index, auto);}",ScFormStyle0=scFormCss,ScForm=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.scSubmit=createEvent(this,"scSubmit",7),this.scFormSubmit=createEvent(this,"scFormSubmit",7),this.scFormChange=createEvent(this,"scFormChange",7),this.novalidate=!1}async getFormData(){return new FormData(this.formElement)}async getFormJson(){return serialize(this.formElement)}async handleChange(){this.scFormChange.emit(serialize(this.formElement))}async submit(){return this.submitForm()}getFormControls(){return[...this.form.querySelectorAll("*")]}async validate(){const t=this.getFormControls().filter((t=>"function"==typeof t.reportValidity));if(!this.novalidate)for(const e of t)if((e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&!await e.reportValidity())return!1;return!0}submitForm(){const t=document.createElement("button");this.formElement&&(t.type="submit",t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.clip="rect(0 0 0 0)",t.style.clipPath="inset(50%)",t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.formElement.append(t),t.click(),t.remove())}render(){return h("div",{key:"b380b28b875e6f418bbfa9918ed392e7d5eb734e",part:"base",class:"form",role:"form"},h("form",{key:"ca520b262b26e48edc9841d90a6ec412f9161b58",part:"form",ref:t=>this.formElement=t,class:"test",onSubmit:async t=>{if(t.preventDefault(),!await this.validate())return!1;this.scSubmit.emit(),this.scFormSubmit.emit()},novalidate:this.novalidate},h("slot",{key:"61b752cf90d94c9640f840fd77b1fe757d3418ec"})))}get form(){return this}static get style(){return ScFormStyle0}},[1,"sc-form",{novalidate:[1540],getFormData:[64],getFormJson:[64],submit:[64],validate:[64]},[[0,"scChange","handleChange"]]]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-form"].forEach((t=>{"sc-form"===t&&(customElements.get(t)||customElements.define(t,ScForm))}))}export{ScForm as S,defineCustomElement as d};
Copyright ©2021 || Defacer Indonesia