import{v as e,o as t,d as l,w as s,L as o,e as a,f as i,t as u,x as p,I as n,K as r,J as d,X as c,H as m,h,i as f}from"./index-BmFqbkjX.js";import{_ as b}from"./u-popup.BbgJpZCZ.js";import{r as y}from"./uni-app.es.DPszd7S_.js";import{_ as x}from"./_plugin-vue_export-helper.BCo6x5W8.js";const k=x({name:"u-action-sheet",emits:["update:modelValue","input","click","close"],props:{value:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},tips:{type:Object,default:()=>({text:"",color:"",fontSize:"26"})},cancelBtn:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!1},borderRadius:{type:[String,Number],default:0},zIndex:{type:[String,Number],default:0},cancelText:{type:String,default:"取消"},labelName:{type:String,default:"text"},blur:{type:[Number,String],default:0}},computed:{valueCom(){return this.modelValue},tipsStyle(){let e={};return this.tips.color&&(e.color=this.tips.color),this.tips.fontSize&&(e.fontSize=this.tips.fontSize+"rpx"),e},itemStyle(){return e=>{let t={};return this.list[e].color&&(t.color=this.list[e].color),this.list[e].fontSize&&(t.fontSize=this.list[e].fontSize+"rpx"),this.list[e].disabled&&(t.color="#c0c4cc"),t}},uZIndex(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},data:()=>({popupValue:!1}),watch:{valueCom(e,t){this.popupValue=e}},methods:{close(){this.popupClose(),this.$emit("close")},popupClose(){this.$emit("input",!1),this.$emit("update:modelValue",!1)},itemClick(e){this.list[e].disabled||(this.$emit("click",e),this.$emit("input",!1),this.$emit("update:modelValue",!1))}}},[["render",function(x,k,C,S,_,v){const z=h,B=f,I=y(e("u-popup"),b);return t(),l(I,{blur:C.blur,mode:"bottom","border-radius":C.borderRadius,popup:!1,modelValue:_.popupValue,"onUpdate:modelValue":k[2]||(k[2]=e=>_.popupValue=e),maskCloseAble:C.maskCloseAble,length:"auto",safeAreaInsetBottom:C.safeAreaInsetBottom,onClose:v.popupClose,"z-index":v.uZIndex},{default:s((()=>[C.tips.text?(t(),l(B,{key:0,class:"u-tips u-border-bottom",style:o([v.tipsStyle])},{default:s((()=>[a(z,null,{default:s((()=>[i(u(C.tips.text),1)])),_:1})])),_:1},8,["style"])):p("",!0),(t(!0),n(r,null,d(C.list,((e,n)=>(t(),l(B,{key:n,onTouchmove:k[0]||(k[0]=c((()=>{}),["stop","prevent"])),onClick:e=>v.itemClick(n),style:o([v.itemStyle(n)]),class:m(["u-action-sheet-item u-line-1",[n[a(z,null,{default:s((()=>[i(u(e[C.labelName]),1)])),_:2},1024),e.subText?(t(),l(z,{key:0,class:"u-action-sheet-item__subtext u-line-1"},{default:s((()=>[i(u(e.subText),1)])),_:2},1024)):p("",!0)])),_:2},1032,["onClick","style","class"])))),128)),C.cancelBtn?(t(),l(B,{key:1,class:"u-gab"})):p("",!0),C.cancelBtn?(t(),l(B,{key:2,onTouchmove:k[1]||(k[1]=c((()=>{}),["stop","prevent"])),class:"u-actionsheet-cancel u-action-sheet-item","hover-class":"u-hover-class","hover-stay-time":150,onClick:v.close},{default:s((()=>[i(u(C.cancelText),1)])),_:1},8,["onClick"])):p("",!0)])),_:1},8,["blur","border-radius","modelValue","maskCloseAble","safeAreaInsetBottom","onClose","z-index"])}],["__scopeId","data-v-eedc674a"]]);export{k as _};