import { ref as s, watch as w, watchEffect as y, openBlock as b, createBlock as g, withCtx as l, createElementVNode as d, renderSlot as c, createVNode as u, createTextVNode as m, toDisplayString as f } from "vue"; import { n as C, B as S } from "./index2.js"; import { _ as N } from "./index8.js"; const $ = { class: "s-drawer-body" }, k = { class: "s-drawer-footer" }, B = { __name: "SDrawer", props: { value: { type: Boolean, default: !1 }, title: { type: String, default: "" }, mode: { type: String, default: "right" }, width: { type: Number, default: 500 }, height: { type: Number, default: 378 } }, emits: ["update:value", "confirm"], setup(o, { emit: p }) { const a = p, t = o, n = s(t.value); w( () => t.value, (e) => { n.value = e; }, { immediate: !0 } ); const h = s(t.mode); y(() => { const e = { left: "", right: "", top: "", bottom: "" }; Object.keys(e).includes(t.mode) || (console.warn(`当前设置mode【${t.mode}】不在【${e}】中,已默认为【right】`), h.value = "right"); }); const r = () => { a("update:value", !1); }, _ = () => { a("update:value", !1), a("confirm"); }; return (e, D) => { const i = S, v = N; return b(), g(v, { rootClassName: "s-drawer-wrap", title: o.title, placement: o.mode, width: o.width, visible: n.value, onClose: r, bodyStyle: { padding: 0, display: "flex", flexDirection: "column" } }, { default: l(() => [ d("div", $, [ c(e.$slots, "default", {}, void 0, !0) ]), d("div", k, [ c(e.$slots, "footer", {}, () => [ u(i, { onClick: r }, { default: l(() => [ m(f(e.$l("取消")), 1) ]), _: 1 }), u(i, { type: "primary", onClick: _ }, { default: l(() => [ m(f(e.$l("确定")), 1) ]), _: 1 }) ], !0) ]) ]), _: 3 }, 8, ["title", "placement", "width", "visible"]); }; } }, j = /* @__PURE__ */ C(B, [["__scopeId", "data-v-688ce811"]]); export { j as default };