1 |
- import{u as E,aT as Z,d as y,b as P,e as ue,am as ce,j as de,aU as fe,i as V,P as f,t as G,aS as ve}from"./index-122302b9.js";import{d as k,f as u,k as w,p as q,e as ge,c as me,w as J,o as pe,x as he}from"./vue-18ee037d.js";import{i as xe,R as K,L as Q}from"./LeftOutlined-492d0e43.js";var $=function(){return{prefixCls:String,hasSider:{type:Boolean,default:void 0},tagName:String}};function A(t){var e=t.suffixCls,r=t.tagName,i=t.name;return function(c){var v=k({compatConfig:{MODE:3},name:i,props:$(),setup:function(C,m){var a=m.slots,l=E(e,C),d=l.prefixCls;return function(){var j=P(P({},C),{},{prefixCls:d.value,tagName:r});return u(c,j,a)}}});return v}}var D=k({compatConfig:{MODE:3},props:$(),setup:function(e,r){var i=r.slots;return function(){return u(e.tagName,{class:e.prefixCls},i)}}}),ye=k({compatConfig:{MODE:3},props:$(),setup:function(e,r){var i=r.slots,c=E("",e),v=c.direction,g=w([]),C={addSider:function(l){g.value=[].concat(ue(g.value),[l])},removeSider:function(l){g.value=g.value.filter(function(d){return d!==l})}};q(Z,C);var m=ge(function(){var a,l=e.prefixCls,d=e.hasSider;return a={},y(a,"".concat(l),!0),y(a,"".concat(l,"-has-sider"),typeof d=="boolean"?d:g.value.length>0),y(a,"".concat(l,"-rtl"),v.value==="rtl"),a});return function(){var a=e.tagName;return u(a,{class:m.value},i)}}}),Ce=A({suffixCls:"layout",tagName:"section",name:"ALayout"})(ye),L=A({suffixCls:"layout-header",tagName:"header",name:"ALayoutHeader"})(D),T=A({suffixCls:"layout-footer",tagName:"footer",name:"ALayoutFooter"})(D),B=A({suffixCls:"layout-content",tagName:"main",name:"ALayoutContent"})(D);const M=Ce;var be={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"};const Se=be;function X(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(r).filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable}))),i.forEach(function(c){Oe(t,c,r[c])})}return t}function Oe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var F=function(e,r){var i=X({},e,r.attrs);return u(ce,X({},i,{icon:Se}),null)};F.displayName="BarsOutlined";F.inheritAttrs=!1;const we=F;var Y={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px",xxxl:"1999.98px"},Le=function(){return{prefixCls:String,collapsible:{type:Boolean,default:void 0},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean,default:void 0},reverseArrow:{type:Boolean,default:void 0},zeroWidthTriggerStyle:{type:Object,default:void 0},trigger:f.any,width:f.oneOfType([f.number,f.string]),collapsedWidth:f.oneOfType([f.number,f.string]),breakpoint:f.oneOf(G("xs","sm","md","lg","xl","xxl","xxxl")),theme:f.oneOf(G("light","dark")).def("dark"),onBreakpoint:Function,onCollapse:Function}},Be=function(){var t=0;return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t+=1,"".concat(e).concat(t)}}();const N=k({compatConfig:{MODE:3},name:"ALayoutSider",inheritAttrs:!1,props:de(Le(),{collapsible:!1,defaultCollapsed:!1,reverseArrow:!1,width:200,collapsedWidth:80}),emits:["breakpoint","update:collapsed","collapse"],setup:function(e,r){var i=r.emit,c=r.attrs,v=r.slots,g=E("layout-sider",e),C=g.prefixCls,m=me(Z,void 0),a=w(!!(e.collapsed!==void 0?e.collapsed:e.defaultCollapsed)),l=w(!1);J(function(){return e.collapsed},function(){a.value=!!e.collapsed}),q(fe,a);var d=function(o,h){e.collapsed===void 0&&(a.value=o),i("update:collapsed",o),i("collapse",o,h)},j=w(function(n){l.value=n.matches,i("breakpoint",n.matches),a.value!==n.matches&&d(n.matches,"responsive")}),p;function x(n){return j.value(n)}var I=Be("ant-sider-");m&&m.addSider(I),pe(function(){J(function(){return e.breakpoint},function(){try{var n;(n=p)===null||n===void 0||n.removeEventListener("change",x)}catch{var o;(o=p)===null||o===void 0||o.removeListener(x)}if(typeof window<"u"){var h=window,s=h.matchMedia;if(s&&e.breakpoint&&e.breakpoint in Y){p=s("(max-width: ".concat(Y[e.breakpoint],")"));try{p.addEventListener("change",x)}catch{p.addListener(x)}x(p)}}},{immediate:!0})}),he(function(){try{var n;(n=p)===null||n===void 0||n.removeEventListener("change",x)}catch{var o;(o=p)===null||o===void 0||o.removeListener(x)}m&&m.removeSider(I)});var R=function(){d(!a.value,"clickTrigger")};return function(){var n,o,h,s=C.value,S=e.collapsedWidth,ee=e.width,z=e.reverseArrow,te=e.zeroWidthTriggerStyle,U=e.trigger,O=U===void 0?(n=v.trigger)===null||n===void 0?void 0:n.call(v):U,_=e.collapsible,ae=e.theme,H=a.value?S:ee,b=xe(H)?"".concat(H,"px"):String(H),W=parseFloat(String(S||0))===0?u("span",{onClick:R,class:V("".concat(s,"-zero-width-trigger"),"".concat(s,"-zero-width-trigger-").concat(z?"right":"left")),style:te},[O||u(we,null,null)]):null,ne={expanded:z?u(K,null,null):u(Q,null,null),collapsed:z?u(Q,null,null):u(K,null,null)},re=a.value?"collapsed":"expanded",oe=ne[re],ie=O!==null?W||u("div",{class:"".concat(s,"-trigger"),onClick:R,style:{width:b}},[O||oe]):null,le=[c.style,{flex:"0 0 ".concat(b),maxWidth:b,minWidth:b,width:b}],se=V(s,"".concat(s,"-").concat(ae),(o={},y(o,"".concat(s,"-collapsed"),!!a.value),y(o,"".concat(s,"-has-trigger"),_&&O!==null&&!W),y(o,"".concat(s,"-below"),!!l.value),y(o,"".concat(s,"-zero-width"),parseFloat(b)===0),o),c.class);return u("aside",P(P({},c),{},{class:se,style:le}),[u("div",{class:"".concat(s,"-children")},[(h=v.default)===null||h===void 0?void 0:h.call(v)]),_||l.value&&W?ie:null])}}});var Ae=L,je=N,ze=B;const He=ve(M,{Header:L,Footer:T,Content:B,Sider:N,install:function(e){return e.component(M.name,M),e.component(L.name,L),e.component(T.name,T),e.component(N.name,N),e.component(B.name,B),e}});export{je as L,He as a,Ae as b,ze as c};
|