| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import { useSlots as S, ref as v, computed as o, openBlock as l, createElementBlock as a, normalizeStyle as i, normalizeClass as g, createElementVNode as r, renderSlot as n, createTextVNode as _, toDisplayString as w, createCommentVNode as u, createVNode as k, withCtx as $ } from "vue";
- import { n as N } from "./index2.js";
- import { S as x } from "./index9.js";
- const b = { class: "s-panel-layout-title" }, z = {
- key: 0,
- class: "s-panel-layout-extra"
- }, B = { class: "s-panel-layout-content" }, P = {
- key: 1,
- class: "s-panel-layout-footer"
- }, V = /* @__PURE__ */ Object.assign({ name: "SPanelLayout" }, {
- __name: "SPanelLayout",
- props: {
- // 面板标题
- title: {
- type: String,
- default: ""
- },
- // 是否显示标题栏(传了 #extra 插槽时也会显示)
- showTitle: {
- type: Boolean,
- default: !0
- },
- // 面板高度:默认占满父容器,可传 '100vh' / 'calc(100vh - 60px)' / 具体像素值
- height: {
- type: [String, Number],
- default: "100%"
- },
- headerSticky: {
- type: Boolean,
- default: !1
- },
- width: {
- type: [Number, String],
- default: "100%"
- }
- },
- setup(d) {
- const e = d, s = S(), h = v(8), c = o(() => !!(e.title || s.title || s.extra || s.footer)), p = o(() => e.showTitle && !!(e.title || s.title || s.extra)), f = o(() => !c.value || e.height === null || e.height === void 0 || e.height === "" || e.height === "100%" ? null : {
- height: typeof e.height == "number" ? `${e.height}px` : e.height
- }), y = o(() => window.$utils.isNumber(e.width) ? e.width + "px" : e.width);
- return (t, C) => {
- const m = x;
- return l(), a("div", {
- class: g(["s-panel-layout", { "is-panel": c.value }]),
- style: i(f.value)
- }, [
- p.value ? (l(), a("div", {
- key: 0,
- class: "s-panel-layout-header",
- style: i({ position: e.headerSticky ? "sticky" : "" })
- }, [
- r("div", b, [
- n(t.$slots, "title", {}, () => [
- _(w(d.title), 1)
- ], !0)
- ]),
- t.$slots.extra ? (l(), a("div", z, [
- n(t.$slots, "extra", {}, void 0, !0)
- ])) : u("", !0)
- ], 4)) : u("", !0),
- r("div", B, [
- r("div", {
- class: "s-panel-scroll-view",
- style: i({ width: y.value })
- }, [
- n(t.$slots, "default", {}, void 0, !0)
- ], 4)
- ]),
- t.$slots.footer ? (l(), a("div", P, [
- k(m, { size: h.value }, {
- default: $(() => [
- n(t.$slots, "footer", {}, void 0, !0)
- ]),
- _: 3
- }, 8, ["size"])
- ])) : u("", !0)
- ], 6);
- };
- }
- }), j = /* @__PURE__ */ N(V, [["__scopeId", "data-v-d493140f"]]);
- export {
- j as default
- };
|