1 |
- import{x as A,E as g,aS as v,z as o,aT as I,W as x,aU as w,d as y,i as a,a3 as T,aw as B,aQ as K,J as O,aV as E,aP as N,S as _,K as D}from"./index.74021dd7.js";const[H,t]=A("action-sheet"),U=g({},v,{title:String,round:o,actions:I(),closeIcon:x("cross"),closeable:o,cancelText:String,description:String,closeOnPopstate:o,closeOnClickAction:Boolean,safeAreaInsetBottom:o}),V=[...w,"round","closeOnPopstate","safeAreaInsetBottom"];var z=y({name:H,props:U,emits:["select","cancel","update:show"],setup(n,{slots:c,emit:i}){const r=e=>i("update:show",e),l=()=>{r(!1),i("cancel")},m=()=>{if(n.title)return a("div",{class:t("header")},[n.title,n.closeable&&a(O,{name:n.closeIcon,class:[t("close"),E],onClick:l},null)])},f=()=>{if(c.cancel||n.cancelText)return[a("div",{class:t("gap")},null),a("button",{type:"button",class:t("cancel"),onClick:l},[c.cancel?c.cancel():n.cancelText])]},b=(e,s)=>e.loading?a(N,{class:t("loading-icon")},null):c.action?c.action({action:e,index:s}):[a("span",{class:t("name")},[e.name]),e.subname&&a("div",{class:t("subname")},[e.subname])],h=(e,s)=>{const{color:P,loading:d,callback:u,disabled:p,className:S}=e,k=()=>{p||d||(u&&u(e),n.closeOnClickAction&&r(!1),_(()=>i("select",e,s)))};return a("button",{type:"button",style:{color:P},class:[t("item",{loading:d,disabled:p}),S],onClick:k},[b(e,s)])},C=()=>{if(n.description||c.description){const e=c.description?c.description():n.description;return a("div",{class:t("description")},[e])}};return()=>a(K,T({class:t(),position:"bottom","onUpdate:show":r},B(n,V)),{default:()=>{var e;return[m(),C(),a("div",{class:t("content")},[n.actions.map(h),(e=c.default)==null?void 0:e.call(c)]),f()]}})}});const J=D(z);export{J as A};
|