FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
collection
/
components
/
ui
/
error
Edit File: sc-error.js
import{h}from"@stencil/core";import{state as errorState}from"../../../store/notices/index";import{getAdditionalErrorMessages}from"../../../store/notices/getters";export class ScFormErrorProvider{constructor(){this.error=void 0}handleErrorUpdate(e){this.scUpdateError.emit(e)}render(){return(null==errorState?void 0:errorState.message)?h("sc-alert",{exportparts:"base, icon, text, title, message, close",type:"danger",scrollOnOpen:!0,open:!!(null==errorState?void 0:errorState.message),closable:!!(null==errorState?void 0:errorState.dismissible)},(null==errorState?void 0:errorState.message)&&h("span",{slot:"title",innerHTML:errorState.message}),(getAdditionalErrorMessages()||[]).map(((e,r)=>h("div",{innerHTML:e,key:r})))):null}static get is(){return"sc-error"}static get encapsulation(){return"shadow"}static get properties(){return{error:{type:"unknown",mutable:!1,complexType:{original:"ResponseError | null",resolved:"ResponseError",references:{ResponseError:{location:"import",path:"../../../types",id:"src/types.ts::ResponseError"}}},required:!1,optional:!1,docs:{tags:[],text:"Error to display."}}}}static get events(){return[{method:"scUpdateError",name:"scUpdateError",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Set the state."},complexType:{original:"ResponseError",resolved:"ResponseError",references:{ResponseError:{location:"import",path:"../../../types",id:"src/types.ts::ResponseError"}}}}]}static get watchers(){return[{propName:"error",methodName:"handleErrorUpdate"}]}}
Save
Back