-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-IEOGBVEC.js
1 lines (1 loc) · 4.63 KB
/
chunk-IEOGBVEC.js
1
import{a as V}from"./chunk-BNP5YAOC.js";import{f as T,g as L,i as W}from"./chunk-W2ITQ2AK.js";import"./chunk-IK75PPQG.js";import"./chunk-KUIU3T4D.js";import{Ab as f,Bb as x,Cb as b,Db as l,Eb as _,Fb as v,Jb as h,Lb as u,Mb as n,Ra as r,Wb as c,Xb as E,Yb as w,db as S,ha as p,hb as z,ia as d,ja as k,jb as m,ub as C,wb as F,zb as g}from"./chunk-GR3MIE2K.js";import"./chunk-UPEGBOOY.js";import"./chunk-4CLCTAJ7.js";function I(t,a){if(t&1){let e=h();l(0,"button",8),u("click",function(){p(e);let i=n().$implicit,s=n().$implicit,y=n(7);return i.visible=!i.visible,d(y.refreshColumnVisibility(s))}),c(1),_()}if(t&2){let e=n().$implicit;F("active",!e.visible),r(),w(" ",e.type," ")}}function D(t,a){if(t&1&&m(0,I,2,3,"button",9),t&2){let e=a.$implicit;g(e.type!=="doc"?0:-1)}}function $(t,a){if(t&1&&x(0,D,1,1,null,null,f),t&2){let e=a.$implicit;b(e.rows)}}function O(t,a){if(t&1){let e=h();l(0,"div",5),v(1,"sp-example-title",7),l(2,"p"),c(3," All areas size and visibility are saved to localStorage."),v(4,"br"),c(5," Toggle areas visibility using following buttons: "),_(),x(6,$,2,0,null,null,f),v(8,"br"),l(9,"button",8),u("click",function(){p(e);let i=n(6);return d(i.toggleDisabled())}),c(10),_(),v(11,"br"),l(12,"button",8),u("click",function(){p(e);let i=n(6);return d(i.resetConfig())}),c(13,"Reset localStorage"),_()()}if(t&2){let e=n(6);r(),C("type",e.exampleEnum.WORKSPACE),r(5),b(e.config.columns),r(3),F("active",!e.config.disabled),r(),w(" ","isDisabled: "+e.config.disabled," ")}}function P(t,a){if(t&1&&(l(0,"div",6)(1,"p"),c(2),_()()),t&2){let e=n(2).$implicit;r(2),E(e.type)}}function M(t,a){if(t&1&&(l(0,"as-split-area",2)(1,"div",4),m(2,O,14,4,"div",5)(3,P,3,1,"div",6),_()()),t&2){let e,o=n().$implicit;C("size",o.size),r(2),g((e=o.type)==="doc"?2:3)}}function N(t,a){if(t&1&&m(0,M,4,2,"as-split-area",2),t&2){let e=a.$implicit;g(e.visible?0:-1)}}function B(t,a){if(t&1){let e=h();l(0,"as-split-area",2)(1,"as-split",3),u("dragEnd",function(i){p(e);let s=n().$index,y=n(2);return d(y.onDragEnd(s,i))}),x(2,N,1,1,null,null,f),_()()}if(t&2){let e=n().$implicit,o=n(2);C("size",e.size),r(),C("disabled",o.config.disabled),r(),b(e.rows)}}function A(t,a){if(t&1&&m(0,B,4,2,"as-split-area",2),t&2){let e=a.$implicit;g(e.visible?0:-1)}}function R(t,a){if(t&1){let e=h();l(0,"as-split",1),u("dragEnd",function(i){p(e);let s=n();return d(s.onDragEnd(-1,i))}),x(1,A,1,1,null,null,f),_()}if(t&2){let e=n();C("disabled",e.config.disabled),r(),b(e.config.columns)}}var J={columns:[{visible:!0,size:25,rows:[{visible:!0,size:25,type:"A"},{visible:!0,size:75,type:"B"}]},{visible:!0,size:50,rows:[{visible:!0,size:60,type:"doc"},{visible:!0,size:40,type:"C"}]},{visible:!0,size:25,rows:[{visible:!0,size:20,type:"D"},{visible:!0,size:30,type:"E"},{visible:!0,size:50,type:"F"}]}],disabled:!1},Q=(()=>{class t extends W{constructor(){super(...arguments),this.localStorageName="angular-split-ws",this.config=null}ngOnInit(){localStorage.getItem(this.localStorageName)?this.config=JSON.parse(localStorage.getItem(this.localStorageName)):this.resetConfig()}resetConfig(){this.config=structuredClone(J),localStorage.removeItem(this.localStorageName)}onDragEnd(e,o){e===-1?this.config.columns.filter(i=>i.visible===!0).forEach((i,s)=>i.size=o.sizes[s]):this.config.columns[e].rows.filter(i=>i.visible===!0).forEach((i,s)=>i.size=o.sizes[s]),this.saveLocalStorage()}toggleDisabled(){this.config.disabled=!this.config.disabled,this.saveLocalStorage()}refreshColumnVisibility(e){let o=e.rows.filter(i=>i.visible);o.forEach(i=>i.size=100/o.length),e.visible=e.rows.some(i=>i.visible===!0),this.saveLocalStorage()}saveLocalStorage(){localStorage.setItem(this.localStorageName,JSON.stringify(this.config))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=k(t)))(i||t)}})()}static{this.\u0275cmp=S({type:t,selectors:[["sp-ex-workspace-localstorage"]],features:[z],decls:1,vars:1,consts:[["direction","horizontal",3,"disabled"],["direction","horizontal",3,"dragEnd","disabled"],[3,"size"],["direction","vertical",3,"dragEnd","disabled"],[1,"bloc"],[1,"explanations"],[1,"panel"],[3,"type"],[1,"btn","btn-warning",3,"click"],[1,"btn","btn-warning",3,"active"]],template:function(o,i){o&1&&m(0,R,3,1,"as-split",0),o&2&&g(i.config?0:-1)},dependencies:[L,V,T],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.bloc[_ngcontent-%COMP%]{height:100%}.explanations[_ngcontent-%COMP%]{padding:15px}.panel[_ngcontent-%COMP%]{font-size:100px;font-weight:700;color:#ccc;display:flex;justify-content:center;align-items:center;height:100%;overflow:hidden}.panel[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin:0}button[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0})}}return t})();export{Q as WorkspaceLocalstorageComponent};