PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.20
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.20
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / assets / chunks / Badge.js

Badge.js in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.20, at assets/chunks/Badge.js

2 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{c as x,o as a,w,e as r,b as y,m as g,T as B,F as u,a as T,f as h,t as f,n as C,r as E}from"./vue.esm-bundler.js?ver=1.3.20";import{_ as v}from"./_plugin-vue_export-helper.js?ver=1.3.20";import{_ as k}from"./DynamicIcon.js?ver=1.3.20";import{S as m}from"./Str.js?ver=1.3.20";import{t}from"./Translator.js?ver=1.3.20";const D={key:0},L={__name:"TransitionAccordion",props:{visible:{type:Boolean,default:!1},duration:{type:Number,default:300}},setup(i){const s=i.duration,l=e=>{e.style.height="0",e.style.opacity="0",e.style.overflow="hidden"},p=(e,c)=>{const o=e.scrollHeight+"px";e.style.transition=`height ${s}ms ease, opacity ${s}ms ease`,requestAnimationFrame(()=>{e.style.height=o,e.style.opacity="1"}),setTimeout(()=>c(),s)},n=e=>{e.style.height="auto",e.style.overflow=""},d=e=>{e.style.height=e.scrollHeight+"px",e.style.opacity="1",e.style.overflow="hidden"},S=(e,c)=>{e.offsetHeight,e.style.transition=`height ${s}ms ease, opacity ${s}ms ease`,e.style.height="0",e.style.opacity="0";const o=()=>{e.style.transition="",e.style.height="",e.style.opacity="",e.style.overflow="",e.removeEventListener("transitionend",o),c()};e.addEventListener("transitionend",o)},b=e=>{};return(e,c)=>(a(),x(B,{onBeforeEnter:l,onEnter:p,onAfterEnter:n,onBeforeLeave:d,onLeave:S,onAfterLeave:b,mode:"in-out"},{default:w(()=>[i.visible?(a(),r("div",D,[g(e.$slots,"default",{},void 0,!0)])):y("",!0)]),_:3}))}},V=v(L,[["__scopeId","data-v-3c33d60d"]]),I={name:"Badge",components:{DynamicIcon:k},props:{status:String,text:{type:String,default:null,required:!1},hideIcon:{type:Boolean,default:!1},size:String,highContrast:{type:Boolean,default:!1},type:String,icon:String},computed:{Str(){return m},computedStatus(){return this.status||this.type},badgeType(){switch(this.computedStatus){case"completed":case"paid":case"active":case"publish":case"shipped":case"success":case"licensed":case"succeeded":return"success";case"failed":case"error":case"canceled":case"expired":return"danger";case"partially_paid":case"intended":return"blue";case"scheduled":case"on-hold":case"pending":case"unpaid":case"warning":case"processing":case"future":return"warning";case"inactive":return"warning";case"dispute":return"warning";default:return"info"}},badgeSize(){return this.size?this.size:""},HighContrast(){return this.highContrast?"is-high-contrast":""}},methods:{getStatusText(){switch(this.computedStatus){case"completed":return t("Completed");case"paid":return t("Paid");case"active":return t("Active");case"publish":return t("Published");case"draft":return t("Draft");case"shipped":return t("Shipped");case"success":return t("Success");case"licensed":return t("Licensed");case"succeeded":return t("Succeeded");case"failed":return t("Failed");case"error":return t("Error");case"canceled":return t("Canceled");case"expired":return t("Expired");case"partially_paid":return t("Partially Paid");case"intended":return t("Intended");case"scheduled":return t("Scheduled");case"on-hold":return t("On Hold");case"pending":return t("Pending");case"unpaid":return t("Unpaid");case"warning":return t("Warning");case"processing":return t("Processing");case"future":return t("Future");case"inactive":return t("Inactive");case"dispute":return t("Dispute");case"disabled":return t("Disabled");case"beta":return t("Beta");default:return m.headline(this.computedStatus)}}}},$={key:0};function z(i,_,s,l,p,n){const d=E("DynamicIcon");return a(),r("span",{class:C(`badge ${n.badgeType} ${n.badgeSize} ${n.HighContrast}`)},[s.status?(a(),r(u,{key:0},[s.icon?(a(),r("span",$,[T(d,{name:s.icon},null,8,["name"])])):y("",!0),s.text?(a(),r(u,{key:1},[h(f(s.text),1)],64)):(a(),r(u,{key:2},[h(f(n.getStatusText()),1)],64))],64)):g(i.$slots,"default",{key:1})],2)}const q=v(I,[["render",z]]);export{q as B,V as T};
2