import { ref as a, computed as x, watch as ee, resolveComponent as O, resolveDirective as te, openBlock as n, createElementBlock as i, createElementVNode as d, toDisplayString as b, createBlock as m, withCtx as s, createVNode as u, createTextVNode as h, createCommentVNode as r, Fragment as $, renderList as T, withDirectives as V, resolveDynamicComponent as ne, vShow as oe, renderSlot as g, normalizeStyle as le } from "vue"; import { n as se, y as ae, B as ie } from "./index2.js"; import { S as ue } from "./index9.js"; import { _ as re, S as ce } from "./index12.js"; import { T as de, _ as fe } from "./index13.js"; const me = { class: "title" }, pe = { style: { "margin-right": "10px" } }, ye = { class: "btns" }, ve = { class: "skeleton-layout-main" }, be = { key: 1, class: "side-bar s-theme-bg" }, _e = { class: "skeleton-content" }, ke = { class: "skeleton-container" }, he = 0, ge = /* @__PURE__ */ Object.assign({ name: "SSkeletonLayout" }, { __name: "SSkeletonLayout", props: { // 页面标题 title: { type: String, required: !0 }, // 页面副标题 subTitle: { type: String, default: "" }, // 工具条按钮:[{ key, name, icon, type, show, disabled, action }] buttons: { type: Array, default: () => [] }, tabs: { type: Array, default: () => [] }, tabKey: { type: Object, default: () => ({ label: "label", value: "value" }) }, steps: { type: Array, default: () => [] } }, emits: ["tabsChange", "btnCallback", "stepChange", "stepConfirm"], setup(o, { emit: B }) { const C = B, _ = o, K = a(null), P = a(null), E = a(null), I = a(null), S = a(232), k = a(""), N = a(null), R = a(null), p = a(0), D = a(8), W = () => { const e = _.tabs || []; if (!e.length) { k.value = ""; return; } const l = w.value; e.some((c) => c && c[l] === k.value) || (k.value = e[0][l]); }, w = x(() => _.tabKey && _.tabKey.value || "value"); ee(() => _.tabs, W, { immediate: !0, deep: !0 }); function X(e) { k.value = e; const l = _.tabs.find((c) => c[w.value] === e); C("tabsChange", l); } function z(e) { p.value += e === "prev" ? -1 : 1, C("stepChange", e, p.value); } function j() { C("stepConfirm", p.value); } const F = { add: "PlusCircleOutlined", edit: "FormOutlined", delete: "DeleteOutlined", remove: "DeleteOutlined", import: "UploadOutlined", export: "DownloadOutlined", assign: "ClusterOutlined", execute: "PlayCircleOutlined", pause: "PauseCircleOutlined", resume: "PoweroffOutlined", approve: "HighlightOutlined", setting: "SettingOutlined", TopOfType: "VerticalAlignTopOutlined", TOP: "VerticalAlignTopOutlined", synchronize: "SyncOutlined" }; function q(e) { C("btnCallback", e.key); } function A(e) { return typeof e.icon == "string" ? e.icon : typeof e.icon == "boolean" && e.icon && F[e.key] || ""; } const H = { mounted(e) { e.style.cursor = "e-resize", document.addEventListener("selectstart", (l) => { l.preventDefault(); }), e.onmousedown = (l) => { const c = l.clientX, y = S.value; document.onmousemove = (v) => { const f = v.clientX - c; if (f < 0) { if (y + f <= 232) return; S.value = y + f; } else { if (y + f >= 500) return; S.value = y + f; } }, document.onmouseup = () => { document.onmousemove = document.onmousedown = null; }; }; } }; return (e, l) => { const c = O("InfoCircleOutlined"), y = ae, v = ie, f = O("arrow-left-outlined"), M = O("arrow-right-outlined"), U = O("save-outlined"), L = ue, G = ce, J = re, Q = fe, Y = de, Z = te("action"); return n(), i("div", { class: "s-skeleton-layout", ref_key: "layout", ref: K }, [ d("div", { class: "tools", ref_key: "tools", ref: P }, [ d("div", me, [ d("span", pe, b(o.title), 1), o.subTitle ? (n(), m(y, { key: 0, placement: "topLeft", mouseEnterDelay: 0.5, mouseLeaveDelay: 0.5 }, { title: s(() => [ h(b(o.subTitle), 1) ]), default: s(() => [ u(c) ]), _: 1 })) : r("", !0) ]), d("div", ye, [ u(L, { size: D.value }, { default: s(() => [ (n(!0), i($, null, T(o.buttons, (t) => (n(), i("span", { class: "item-btn", key: t.key }, [ V((n(), m(v, { class: "btn", disabled: !!t.disabled, type: t.type || t.key === "add" ? "primary" : "default", onClick: (Ce) => q(t) }, { icon: s(() => [ A(t) ? (n(), m(ne(A(t)), { key: 0 })) : r("", !0) ]), default: s(() => [ h(" " + b(e.$l(t.name)), 1) ]), _: 2 }, 1032, ["disabled", "type", "onClick"])), [ [Z, t.action || t.key], [oe, t.show !== !1] ]) ]))), 128)), g(e.$slots, "otherBtns", {}, void 0, !0), o.steps.length ? (n(), m(v, { key: 0, class: "btn", disabled: p.value === he, onClick: l[0] || (l[0] = (t) => z("prev")) }, { default: s(() => [ u(f), h(b(e.$l("上一步")), 1) ]), _: 1 }, 8, ["disabled"])) : r("", !0), o.steps.length ? (n(), m(v, { key: 1, class: "btn", type: "primary", disabled: p.value === o.steps.length - 1, onClick: l[1] || (l[1] = (t) => z("next")) }, { default: s(() => [ u(M), h(b(e.$l("下一步")), 1) ]), _: 1 }, 8, ["disabled"])) : r("", !0), u(v, { type: "primary", onClick: j }, { default: s(() => [ u(U), h(" " + b(e.$l("确认")), 1) ]), _: 1 }) ]), _: 3 }, 8, ["size"]) ]) ], 512), d("div", ve, [ e.$slots.tree ? (n(), i("div", { key: 0, class: "side s-side-tree", ref: "side", style: le({ width: S.value + "px" }) }, [ g(e.$slots, "tree", {}, void 0, !0) ], 4)) : r("", !0), e.$slots.tree ? V((n(), i("div", be, null, 512)), [ [H] ]) : r("", !0), d("div", _e, [ o.steps && o.steps.length ? (n(), i("div", { key: 0, class: "step-wrap", ref_key: "stepRef", ref: R }, [ u(J, { current: p.value, type: "navigation", size: "small" }, { default: s(() => [ (n(!0), i($, null, T(o.steps, (t) => (n(), m(G, { title: t, key: t, disabled: !0 }, null, 8, ["title"]))), 128)) ]), _: 1 }, 8, ["current"]) ], 512)) : r("", !0), o.tabs && o.tabs.length ? (n(), i("div", { key: 1, class: "tabs-wrap", ref_key: "tabsRef", ref: N }, [ u(Y, { "active-key": k.value, onChange: X }, { default: s(() => [ (n(!0), i($, null, T(o.tabs, (t) => (n(), m(Q, { tab: t[o.tabKey.label], key: t[w.value] }, null, 8, ["tab"]))), 128)) ]), _: 1 }, 8, ["active-key"]) ], 512)) : r("", !0), d("div", ke, [ g(e.$slots, "default", {}, void 0, !0) ]) ]) ]), d("div", { class: "other", ref_key: "other", ref: E }, [ g(e.$slots, "other", {}, void 0, !0) ], 512), e.$slots.footer ? (n(), i("div", { key: 0, class: "skeleton-footer", ref_key: "footer", ref: I }, [ u(L, { size: D.value }, { default: s(() => [ g(e.$slots, "footer", {}, void 0, !0) ]), _: 3 }, 8, ["size"]) ], 512)) : r("", !0) ], 512); }; } }), De = /* @__PURE__ */ se(ge, [["__scopeId", "data-v-84fe04ef"]]); export { De as default };