UNPKG

sci-pro

Version:
96 lines (95 loc) 3.4 kB
import { defineComponent as y, resolveComponent as C, openBlock as o, createBlock as b, Teleport as z, createVNode as n, Transition as B, withCtx as c, createElementBlock as t, normalizeStyle as r, createElementVNode as s, renderSlot as m, toDisplayString as I, createCommentVNode as d, createTextVNode as p } from "vue"; import "./style/index.css"; const S = { key: 0 }, $ = { key: 0 }, N = { key: 1, class: "sci-modal-header" }, F = { class: "sci-modal-header-title" }, T = { class: "sci-modal-main" }, V = { key: 1 }, w = { key: 0, class: "sci-define-footer" }, E = { key: 1, class: "sci-modal-footer" }, H = y({ name: "sci-modal" }), D = /* @__PURE__ */ y({ ...H, 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(v, { emit: k }) { const l = v, a = k, i = () => { a("update:visible", !1), a("cancel"); }, _ = () => { a("update:visible", !1), a("confirm"); }, h = () => l.modalStyle ? l.modalStyle() : {}; return (e, u) => { const f = C("sci-button"); return o(), b(z, { to: "body" }, [ n(B, { name: "sci-slide-fade" }, { default: c(() => [ e.visible ? (o(), t("div", { key: 0, class: "sci-modal-wrap", style: r({ zIndex: e.zIndex }) }, [ s("div", { class: "sci-modal-mask", style: r({ zIndex: Number(l.zIndex) + 1 }), onClick: u[0] || (u[0] = (M) => e.closeOnClickModal && i()) }, null, 4), s("div", { class: "sci-modal-full", style: r({ zIndex: Number(l.zIndex) + 2, ...h() }) }, [ e.noHeader ? d("", !0) : (o(), t("div", S, [ e.$slots.header ? (o(), t("div", $, [ m(e.$slots, "header") ])) : (o(), t("div", N, [ s("div", F, I(l.title), 1), s("div", { class: "sci-modal-header-close", onClick: i }, "×") ])) ])), s("div", T, [ e.$slots.default ? m(e.$slots, "default", { key: 0 }) : d("", !0) ]), e.noFooter ? d("", !0) : (o(), t("div", V, [ e.$slots.footer ? (o(), t("div", w, [ m(e.$slots, "footer") ])) : (o(), t("div", E, [ n(f, { onClick: i }, { default: c(() => [ p("Cancel") ]), _: 1 }), n(f, { type: "primary", onClick: _ }, { default: c(() => [ p("Confirm") ]), _: 1 }) ])) ])) ], 4) ], 4)) : d("", !0) ]), _: 3 }) ]); }; } }); export { D as default };