UNPKG

sci-pro

Version:
2 lines (1 loc) 2.41 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./style/index.css");const m={key:0},u={key:0},f={key:1,class:"sci-modal-header"},k={class:"sci-modal-header-title"},p={class:"sci-modal-main"},y={key:1},v={key:0,class:"sci-define-footer"},B={key:1,class:"sci-modal-footer"},_=e.defineComponent({name:"sci-modal"}),C=e.defineComponent({..._,props:{title:{default:"Tips"},visible:{type:Boolean,default:!0},noHeader:{type:Boolean,default:!1},noFooter:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},zIndex:{default:9e3},modalStyle:{}},emits:["update:visible","confirm","cancel"],setup(d,{emit:c}){const t=d,l=c,n=()=>{l("update:visible",!1),l("cancel")},i=()=>{l("update:visible",!1),l("confirm")},r=()=>t.modalStyle?t.modalStyle():{};return(o,s)=>{const a=e.resolveComponent("sci-button");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"sci-slide-fade"},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sci-modal-wrap",style:e.normalizeStyle({zIndex:o.zIndex})},[e.createElementVNode("div",{class:"sci-modal-mask",style:e.normalizeStyle({zIndex:Number(t.zIndex)+1}),onClick:s[0]||(s[0]=N=>o.closeOnClickModal&&n())},null,4),e.createElementVNode("div",{class:"sci-modal-full",style:e.normalizeStyle({zIndex:Number(t.zIndex)+2,...r()})},[o.noHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",m,[o.$slots.header?(e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(o.$slots,"header")])):(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",k,e.toDisplayString(t.title),1),e.createElementVNode("div",{class:"sci-modal-header-close",onClick:n},"×")]))])),e.createElementVNode("div",p,[o.$slots.default?e.renderSlot(o.$slots,"default",{key:0}):e.createCommentVNode("",!0)]),o.noFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",y,[o.$slots.footer?(e.openBlock(),e.createElementBlock("div",v,[e.renderSlot(o.$slots,"footer")])):(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(a,{onClick:n},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1}),e.createVNode(a,{type:"primary",onClick:i},{default:e.withCtx(()=>[e.createTextVNode("Confirm")]),_:1})]))]))],4)],4)):e.createCommentVNode("",!0)]),_:3})])}}});exports.default=C;