UNPKG

snowy-designer

Version:

基于Epic-Designer-Pro版本的设计器,可视化开发页面表单

67 lines (66 loc) 1.91 kB
import { shallowRef as u, ref as l, computed as c } from "vue"; import { loadAsyncComponent as f } from "../../../utils/src/common/component.js"; import "@vueuse/core"; import "../store/index.js"; import "lodash"; import "../../../utils/src/manager/pluginManager.js"; import "monaco-editor"; import "../../../utils/src/request/index.js"; function O() { const n = { activitybars: u([]), // 活动栏配置列表 rightSidebars: u([]) // 右侧边栏配置列表 }, t = l([]), o = l([]), d = c(() => n.activitybars.value.filter( (e) => !t.value.includes(e.title) )), r = c(() => n.rightSidebars.value.filter( (e) => !o.value.includes(e.title) )); function v(e) { typeof e.component == "function" && (e.component = f( e.component )), e.visible === void 0 && (e.visible = !0), e.sort === void 0 && (e.sort = 1e3); const i = n.activitybars.value.findIndex( (s) => s.id === e.id ); i === -1 ? n.activitybars.value.push(e) : n.activitybars.value[i] = e; } function p(e) { typeof e.component == "function" && (e.component = f( e.component )), e.visible === void 0 && (e.visible = !0), e.sort === void 0 && (e.sort = 1e3); const i = n.rightSidebars.value.findIndex( (s) => s.id === e.id ); i === -1 ? n.rightSidebars.value.push(e) : n.rightSidebars.value[i] = e; } function a(e) { t.value.push(e); } function m(e) { o.value.push(e); } function h(e) { const i = t.value.indexOf(e); i !== -1 && t.value.splice(i, 1); } function x(e) { const i = o.value.indexOf(e); i !== -1 && o.value.splice(i, 1); } return { getActivitybars: d, getRightSidebars: r, hideActivitybar: a, hideRightSidebar: m, registerActivitybar: v, registerRightSidebar: p, showActivitybar: h, showRightSidebar: x, viewsContainers: n }; } export { O as usePanel };