y9-interface-platform/y9vue-interfacePlatform/interface/assets/dom-zindex-d72a3c32.js

2 lines
1.4 KiB
JavaScript
Raw Normal View History

var o=null,v=null,u=null,y="z-index-manage",i=null,C="z-index-style",x="m",N="s",d={m:1e3,s:1e3};function l(){return o||typeof document<"u"&&(o=document),o}function S(){return o&&!v&&(v=o.body||o.getElementsByTagName("body")[0]),v}function T(){var t=0,e=l();if(e){var r=S();if(r)for(var f=r.getElementsByTagName("*"),n=0;n<f.length;n++){var a=f[n];if(a&&a.style&&a.nodeType===1){var s=a.style.zIndex;s&&/^\d+$/.test(s)&&(t=Math.max(t,Number(s)))}}}return t}function z(){if(!i){var t=l();t&&(i=t.getElementById(C),i||(i=t.createElement("style"),i.id=C,t.getElementsByTagName("head")[0].appendChild(i)))}return i}function E(){var t=z();if(t){var e="--dom-",r="-z-index";t.innerHTML=":root{"+e+"main"+r+":"+g()+";"+e+"sub"+r+":"+b()+"}"}}function D(){if(!u){var t=l();if(t&&(u=t.getElementById(y),!u)){var e=S();e&&(u=t.createElement("div"),u.id=y,u.style.display="none",e.appendChild(u),m(d.m),c(d.s))}}return u}function p(t){return function(e){if(e){e=Number(e),d[t]=e;var r=D();r&&(r.dataset?r.dataset[t]=e+"":r.setAttribute("data-"+t,e+""))}return E(),d[t]}}var m=p(x);function B(t,e){return function(f){var n,a=D();if(a){var s=a.dataset?a.dataset[t]:a.getAttribute("data-"+t);s&&(n=Number(s))}return n||(n=d[t]),f?Number(f)<n?e():f:n}}var g=B(x,I);function I(){return m(g()+1)}var c=p(N),h=B(N,M);function b(){return g()+h()}function M(){return c(h()+1),b()}var H={setCurrent:m,getCurrent:g,getNext:I,setSubCurrent:c,getSubCurrent:b,getSubNext:M,getMax:T};E();export{H as D};