big-screen-library
Version:
2 lines (1 loc) • 5.06 kB
JavaScript
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.BigScreenLibrary={},s.Vue))})(this,function(s,e){"use strict";const a=(t,c)=>{const o=t.__vccOpts||t;for(const[l,r]of c)o[l]=r;return o},p={},S={class:"left-panel"};function u(t,c){return e.openBlock(),e.createElementBlock("aside",S,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const B=a(p,[["render",u],["__scopeId","data-v-87929ad4"]]),_={},k={class:"right-panel"};function y(t,c){return e.openBlock(),e.createElementBlock("aside",k,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const b=a(_,[["render",y],["__scopeId","data-v-eecf0344"]]),C={class:"scene-switcher"},f=a(e.defineComponent({__name:"SceneSwitcher",props:{scenes:{}},emits:["scene-change"],setup(t,{emit:c}){const o=c;function l(r){o("scene-change",{sceneId:r.id,panels:r.panels||{left:!0,right:!0}})}return(r,d)=>(e.openBlock(),e.createElementBlock("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.scenes,h=>e.renderSlot(r.$slots,"scene",{key:h.id,scene:h,handleChange:l},void 0,!0)),128))]))}}),[["__scopeId","data-v-935b7e6b"]]),$={class:"big-screen-layout"},w={class:"center-content"},P={key:0,class:"header"},V={class:"header-left"},E={class:"header-center-group"},N={class:"header-title"},z={key:1,class:"header-title"},L={class:"header-right"},R={key:0,class:"scene-bottom"},g=a(e.defineComponent({__name:"BigScreenLayout",props:{scenes:{type:Array,required:!0},sceneSwitcherPosition:{type:String,default:"header-distributed",validator:t=>["header-distributed","header-bottom"].includes(t)},headerBackgroundColor:{type:String,default:"rgba(16, 24, 52, 0.8)"},headerHeight:{type:String,default:"64px"},headerBlur:{type:Boolean,default:!0},headerShow:{type:Boolean,default:!0},leftWidth:{type:String,default:"350px"},rightWidth:{type:String,default:"350px"},leftPanelVisible:{type:Boolean,default:!0},rightPanelVisible:{type:Boolean,default:!0}},emits:["sceneChange","panelChange"],setup(t,{emit:c}){const o=t,l=c,r=e.ref(!0),d=e.ref(!0),h=e.computed(()=>{if(o.sceneSwitcherPosition==="header-distributed"){const n=Math.ceil(o.scenes.length/2);return o.scenes.slice(0,n)}return[]}),I=e.computed(()=>{if(o.sceneSwitcherPosition==="header-distributed"){const n=Math.ceil(o.scenes.length/2);return o.scenes.slice(n)}return[]});e.watch(()=>o.leftPanelVisible,n=>{r.value=n}),e.watch(()=>o.rightPanelVisible,n=>{d.value=n});function m(n){r.value=n.panels.left,d.value=n.panels.right,l("sceneChange",n),l("panelChange",{panel:"left",visible:n.panels.left}),l("panelChange",{panel:"right",visible:n.panels.right})}return(n,T)=>(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",w,[e.renderSlot(n.$slots,"center-content",{},void 0,!0)]),t.headerShow?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",{class:"header-content",style:e.normalizeStyle({background:t.headerBackgroundColor,backdropFilter:t.headerBlur?"blur(10px)":"none"})},[e.createElementVNode("div",V,[e.renderSlot(n.$slots,"info-area",{},void 0,!0)]),e.createElementVNode("div",E,[t.sceneSwitcherPosition==="header-distributed"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(f,{scenes:h.value,onSceneChange:m},{scene:e.withCtx(i=>[e.renderSlot(n.$slots,"scene",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)]),_:3},8,["scenes"]),e.createElementVNode("div",N,[e.renderSlot(n.$slots,"header-title",{},void 0,!0)]),e.createVNode(f,{scenes:I.value,onSceneChange:m},{scene:e.withCtx(i=>[e.renderSlot(n.$slots,"scene",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)]),_:3},8,["scenes"])],64)):(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(n.$slots,"header-title",{},void 0,!0)]))]),e.createElementVNode("div",L,[e.renderSlot(n.$slots,"control-panel",{},void 0,!0)])],4),t.sceneSwitcherPosition==="header-bottom"?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(f,{scenes:t.scenes,onSceneChange:m},{scene:e.withCtx(i=>[e.renderSlot(n.$slots,"scene",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)]),_:3},8,["scenes"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(B,{key:1,class:"side-panel left-panel",style:e.normalizeStyle({width:t.leftWidth,top:t.headerHeight,height:`calc(100vh - ${t.headerHeight})`})},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"left-panel",{},void 0,!0)]),_:3},8,["style"])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(b,{key:2,class:"side-panel right-panel",style:e.normalizeStyle({width:t.rightWidth,top:t.headerHeight,height:`calc(100vh - ${t.headerHeight})`})},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"right-panel",{},void 0,!0)]),_:3},8,["style"])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-72bc5e64"]]),H={install:t=>{t.component(g.name||"BigScreen",g)}};s.BigScreen=g,s.default=H,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});