Files
aiot-platform-ui/apps/web-antd/dist/js/use-tabs-CyNGChRD.js

2 lines
1.9 KiB
JavaScript

var n=(i,e,t)=>new Promise((f,b)=>{var r=s=>{try{o(t.next(s))}catch(c){b(c)}},u=s=>{try{o(t.throw(s))}catch(c){b(c)}},o=s=>s.done?f(s.value):Promise.resolve(s.value).then(r,u);o((t=t.apply(i,e)).next())});import{V as N,ae as P}from"./bootstrap-DsjPfOC_.js";import{u as U}from"./tabbar-BxiNE9JJ.js";function j(){const i=N(),e=P(),t=U();function f(a){return n(this,null,function*(){yield t.closeLeftTabs(a||e)})}function b(){return n(this,null,function*(){yield t.closeAllTabs(i)})}function r(a){return n(this,null,function*(){yield t.closeRightTabs(a||e)})}function u(a){return n(this,null,function*(){yield t.closeOtherTabs(a||e)})}function o(a){return n(this,null,function*(){yield t.closeTab(a||e,i)})}function s(a){return n(this,null,function*(){yield t.pinTab(a||e)})}function c(a){return n(this,null,function*(){yield t.unpinTab(a||e)})}function g(a){return n(this,null,function*(){yield t.toggleTabPin(a||e)})}function C(a){return n(this,null,function*(){yield t.refresh(a||i)})}function x(a){return n(this,null,function*(){yield t.openTabInNewWindow(a||e)})}function R(a){return n(this,null,function*(){yield t.closeTabByKey(a,i)})}function m(a){return n(this,null,function*(){t.setUpdateTime(),yield t.setTabTitle(e,a)})}function A(){return n(this,null,function*(){t.setUpdateTime(),yield t.resetTabTitle(e)})}function I(a=e){var p;const l=t.getTabs,y=t.affixTabs,d=l.findIndex(K=>K.path===a.path),h=l.length<=1,{meta:w}=a,L=(p=w==null?void 0:w.affixTab)!=null?p:!1,T=e.path===a.path,O=d===0||d-y.length<=0||!T,S=!T||d===l.length-1,B=h||!T||l.length-y.length<=1;return{disabledCloseAll:h,disabledCloseCurrent:!!L||h,disabledCloseLeft:O,disabledCloseOther:B,disabledCloseRight:S,disabledRefresh:!T}}return{closeAllTabs:b,closeCurrentTab:o,closeLeftTabs:f,closeOtherTabs:u,closeRightTabs:r,closeTabByKey:R,getTabDisableState:I,openTabInNewWindow:x,pinTab:s,refreshTab:C,resetTabTitle:A,setTabTitle:m,toggleTabPin:g,unpinTab:c}}export{j as u};