index.b6a283d2.js 1.7 KB

1
  1. import{E as S,J as g,aX as v,H as o,aY as I,a0 as x,aZ as y,d as T,j as a,a8 as w,aB as B,aS as O,N,aU as E,aT as H,X as K,O as _}from"./ResizeObserver.es.39b48a47.js";const[D,t]=S("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}),X=[...y,"round","closeOnPopstate","safeAreaInsetBottom"];var j=T({name:D,props:U,emits:["select","cancel","update:show"],setup(n,{slots:c,emit:r}){const i=e=>r("update:show",e),l=()=>{i(!1),r("cancel")},m=()=>{if(n.title)return a("div",{class:t("header")},[n.title,n.closeable&&a(N,{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(H,{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:k,loading:d,callback:u,disabled:p,className:A}=e,P=()=>{p||d||(u&&u(e),n.closeOnClickAction&&i(!1),K(()=>r("select",e,s)))};return a("button",{type:"button",style:{color:k},class:[t("item",{loading:d,disabled:p}),A],onClick:P},[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(O,w({class:t(),position:"bottom","onUpdate:show":i},B(n,X)),{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=_(j);export{J as A};