@deepfuture/dui-cdn 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dui.js +2 -1
- package/dui.min.js +1 -1
- package/package.json +1 -1
package/dui.js
CHANGED
|
@@ -7452,13 +7452,14 @@ var FloatingPortalController = class {
|
|
|
7452
7452
|
}
|
|
7453
7453
|
#createPositioner() {
|
|
7454
7454
|
if (this.#positioner) {
|
|
7455
|
-
this.#positioner.style.display = "";
|
|
7455
|
+
this.#positioner.style.display = "block";
|
|
7456
7456
|
this.#applyForwardedProperties(this.#positioner);
|
|
7457
7457
|
return;
|
|
7458
7458
|
}
|
|
7459
7459
|
const overlayRoot = this.#getOverlayRoot();
|
|
7460
7460
|
const positioner = document.createElement("div");
|
|
7461
7461
|
positioner.style.position = "fixed";
|
|
7462
|
+
positioner.style.display = "block";
|
|
7462
7463
|
positioner.style.zIndex = "1000";
|
|
7463
7464
|
positioner.style.pointerEvents = "none";
|
|
7464
7465
|
positioner.setAttribute("data-floating-portal", "");
|
package/dui.min.js
CHANGED
|
@@ -2730,7 +2730,7 @@ label, legend, caption, figcaption, th, td {
|
|
|
2730
2730
|
<polygon class="arrow-fill" points="0,0 5,6 10,0" />
|
|
2731
2731
|
<path class="arrow-stroke" d="M 0,0 L 5,6 L 10,0" />
|
|
2732
2732
|
</svg>
|
|
2733
|
-
`,uV={...x0,getOffsetParent:()=>window},mV=i=>({name:"alignInner",fn(r){let t=i.getElement();if(!t)return{};let e=i.padding??8,{rects:s}=r,l=r.elements.floating,d=l.getBoundingClientRect(),m=t.getBoundingClientRect(),g=m.top-d.top+m.height/2,E=i.getReferenceInner?.(),y=(E?E.getBoundingClientRect().top+E.getBoundingClientRect().height/2:s.reference.y+s.reference.height/2)-g,_=globalThis.innerHeight,S=d.height,O=e,B=_-S-e,j=Math.max(O,Math.min(y,B)),K=l.shadowRoot?.querySelector(".Popup")??l.querySelector(".Popup");if(K&&j!==y){let J=y-j;K.scrollTop=Math.max(0,K.scrollTop-J)}y=j;let F=m.left-d.left;return{x:E?E.getBoundingClientRect().left-F:s.reference.x,y,reset:!1}}}),fV=(i,r,t={})=>{let{placement:e="bottom-start",offsetPx:s=4,matchWidth:l=!1,minMatchWidth:d=!1,padding:m=8}=t,E=t.alignToInner?.getElement()!=null?[mV(t.alignToInner)]:[gz(s),bz(),vz({padding:m})];return l?E.push(y0({apply({rects:$,elements:y}){Object.assign(y.floating.style,{width:`${$.reference.width}px`})}})):d&&E.push(y0({apply({rects:$,elements:y}){Object.assign(y.floating.style,{minWidth:`${$.reference.width}px`})}})),xz(i,r,{placement:e,strategy:"fixed",middleware:E,platform:uV})},kz=(i,r,t={})=>{let{onPosition:e,...s}=t;return fz(i,r,()=>{fV(i,r,s).then(l=>{Object.assign(r.style,{left:`${l.x}px`,top:`${l.y}px`}),e?.(l)})})};var Te=class{#t;#e;#o;#n;#d;#c;#a;#f;#g;#l;#s;#m;#p;#h;#w;#x;#k;#v=[];#r=null;#b=null;#i=!1;#u=!1;#y=0;get isOpen(){return this.#i}get isAnimating(){return this.#u}get isStarting(){return this.#i&&this.#u}get isEnding(){return!this.#i&&this.#u}get positionerElement(){return this.#r}get renderRoot(){return this.#r?.shadowRoot??this.#r}set placement(r){this.#d=r}set offset(r){this.#c=r}constructor(r,t){this.#t=r,this.#e=t.getAnchor,this.#o=t.matchWidth??!0,this.#n=t.minMatchWidth??!1,this.#d=t.placement??"bottom-start",this.#c=t.offset??4,this.#a=t.styles,this.#f=t.onOpen,this.#g=t.onClose,this.#l=t.onPosition,this.#s=t.renderPopup,this.#m=t.contentContainer,this.#p=t.contentSelector,this.#h=t.forwardProperties??[],this.#w=t.getOverlayRoot??(()=>document.body),this.#x=t.alignToInner,this.#k=t.alignToInnerReference,r.addController(this)}hostConnected(){document.addEventListener("click",this.#C)}hostDisconnected(){document.removeEventListener("click",this.#C),this.#O(),p0(this.#t)}hostUpdated(){if(this.#i?this.#t.setAttribute("open",""):this.#t.removeAttribute("open"),this.#s&&(this.#i||this.isEnding)){let r=this.renderRoot;r&&Vh(this.#s(this),r)}this.#m&&this.#i&&this.#v.length===0&&this.#L()}open(){if(this.#i)return;this.#y++;let r=this.#y;VL(this.#t,()=>this.close()),this.#i=!0,this.#u=!0,this.#A(),this.#I(),this.#f?.(),this.#t.requestUpdate(),yz().then(()=>{r===this.#y&&(this.#u=!1,this.#t.requestUpdate())})}close(){if(!this.#i)return;this.#y++,this.#u=!0,this.#t.requestUpdate();let r=this.renderRoot?.querySelector(".Popup");if(!r){this.#E();return}wz(r,()=>this.#E())}#E(){this.#i&&(this.#i=!1,this.#u=!1,this.#T(),p0(this.#t),this.#g?.(),this.#_(),this.#t.requestUpdate())}#C=r=>{if(!this.#i)return;let t=r.composedPath();!t.includes(this.#t)&&!this.#S(t)&&this.close()};#S(r){return this.#r?r.includes(this.#r):!1}#A(){if(this.#r){this.#r.style.display="",this.#$(this.#r);return}let r=this.#w(),t=document.createElement("div");t.style.position="fixed",t.style.zIndex="1000",t.style.pointerEvents="none",t.setAttribute("data-floating-portal",""),t.setAttribute("data-dui-portal-for",this.#t.tagName.toLowerCase());let e=this.#t.constructor,s=d=>d?Array.isArray(d)?d.flatMap(s):[d]:[],l=[...s(e.styles),...this.#a??[]];if(l.length>0){let d=t.attachShadow({mode:"open"});Ih(d,l)}this.#$(t),r.appendChild(t),this.#r=t}#$(r){if(this.#h.length===0)return;let t=getComputedStyle(this.#t);for(let e of this.#h){let s=t.getPropertyValue(e).trim();s&&r.style.setProperty(e,s)}}#_(){this.#r&&(this.#r.style.display="none")}#R(){this.#r?.remove(),this.#r=null}#I(){if(this.#b)return;let r=this.#e(),t=this.#r;!r||!t||(this.#b=kz(r,t,{placement:this.#d,offsetPx:this.#c,matchWidth:this.#o,minMatchWidth:this.#n,onPosition:this.#l,alignToInner:this.#x?{getElement:this.#x,getReferenceInner:this.#k}:void 0}))}#T(){this.#b?.(),this.#b=null}#L(){let r=this.renderRoot?.querySelector(this.#m);if(!r)return;let t=this.#p?Array.from(this.#t.querySelectorAll(`:scope > ${this.#p}`)):Array.from(this.#t.childNodes);for(let e of t)r.appendChild(e),this.#v.push(e)}#z(){for(let r of this.#v)this.#t.appendChild(r);this.#v=[]}#O(){this.#T(),this.#z(),this.#R()}};var M0=M("value-change",{bubbles:!0,composed:!0}),Zu=M("values-change",{bubbles:!0,composed:!0}),gV=b`
|
|
2733
|
+
`,uV={...x0,getOffsetParent:()=>window},mV=i=>({name:"alignInner",fn(r){let t=i.getElement();if(!t)return{};let e=i.padding??8,{rects:s}=r,l=r.elements.floating,d=l.getBoundingClientRect(),m=t.getBoundingClientRect(),g=m.top-d.top+m.height/2,E=i.getReferenceInner?.(),y=(E?E.getBoundingClientRect().top+E.getBoundingClientRect().height/2:s.reference.y+s.reference.height/2)-g,_=globalThis.innerHeight,S=d.height,O=e,B=_-S-e,j=Math.max(O,Math.min(y,B)),K=l.shadowRoot?.querySelector(".Popup")??l.querySelector(".Popup");if(K&&j!==y){let J=y-j;K.scrollTop=Math.max(0,K.scrollTop-J)}y=j;let F=m.left-d.left;return{x:E?E.getBoundingClientRect().left-F:s.reference.x,y,reset:!1}}}),fV=(i,r,t={})=>{let{placement:e="bottom-start",offsetPx:s=4,matchWidth:l=!1,minMatchWidth:d=!1,padding:m=8}=t,E=t.alignToInner?.getElement()!=null?[mV(t.alignToInner)]:[gz(s),bz(),vz({padding:m})];return l?E.push(y0({apply({rects:$,elements:y}){Object.assign(y.floating.style,{width:`${$.reference.width}px`})}})):d&&E.push(y0({apply({rects:$,elements:y}){Object.assign(y.floating.style,{minWidth:`${$.reference.width}px`})}})),xz(i,r,{placement:e,strategy:"fixed",middleware:E,platform:uV})},kz=(i,r,t={})=>{let{onPosition:e,...s}=t;return fz(i,r,()=>{fV(i,r,s).then(l=>{Object.assign(r.style,{left:`${l.x}px`,top:`${l.y}px`}),e?.(l)})})};var Te=class{#t;#e;#o;#n;#d;#c;#a;#f;#g;#l;#s;#m;#p;#h;#w;#x;#k;#v=[];#r=null;#b=null;#i=!1;#u=!1;#y=0;get isOpen(){return this.#i}get isAnimating(){return this.#u}get isStarting(){return this.#i&&this.#u}get isEnding(){return!this.#i&&this.#u}get positionerElement(){return this.#r}get renderRoot(){return this.#r?.shadowRoot??this.#r}set placement(r){this.#d=r}set offset(r){this.#c=r}constructor(r,t){this.#t=r,this.#e=t.getAnchor,this.#o=t.matchWidth??!0,this.#n=t.minMatchWidth??!1,this.#d=t.placement??"bottom-start",this.#c=t.offset??4,this.#a=t.styles,this.#f=t.onOpen,this.#g=t.onClose,this.#l=t.onPosition,this.#s=t.renderPopup,this.#m=t.contentContainer,this.#p=t.contentSelector,this.#h=t.forwardProperties??[],this.#w=t.getOverlayRoot??(()=>document.body),this.#x=t.alignToInner,this.#k=t.alignToInnerReference,r.addController(this)}hostConnected(){document.addEventListener("click",this.#C)}hostDisconnected(){document.removeEventListener("click",this.#C),this.#O(),p0(this.#t)}hostUpdated(){if(this.#i?this.#t.setAttribute("open",""):this.#t.removeAttribute("open"),this.#s&&(this.#i||this.isEnding)){let r=this.renderRoot;r&&Vh(this.#s(this),r)}this.#m&&this.#i&&this.#v.length===0&&this.#L()}open(){if(this.#i)return;this.#y++;let r=this.#y;VL(this.#t,()=>this.close()),this.#i=!0,this.#u=!0,this.#A(),this.#I(),this.#f?.(),this.#t.requestUpdate(),yz().then(()=>{r===this.#y&&(this.#u=!1,this.#t.requestUpdate())})}close(){if(!this.#i)return;this.#y++,this.#u=!0,this.#t.requestUpdate();let r=this.renderRoot?.querySelector(".Popup");if(!r){this.#E();return}wz(r,()=>this.#E())}#E(){this.#i&&(this.#i=!1,this.#u=!1,this.#T(),p0(this.#t),this.#g?.(),this.#_(),this.#t.requestUpdate())}#C=r=>{if(!this.#i)return;let t=r.composedPath();!t.includes(this.#t)&&!this.#S(t)&&this.close()};#S(r){return this.#r?r.includes(this.#r):!1}#A(){if(this.#r){this.#r.style.display="block",this.#$(this.#r);return}let r=this.#w(),t=document.createElement("div");t.style.position="fixed",t.style.display="block",t.style.zIndex="1000",t.style.pointerEvents="none",t.setAttribute("data-floating-portal",""),t.setAttribute("data-dui-portal-for",this.#t.tagName.toLowerCase());let e=this.#t.constructor,s=d=>d?Array.isArray(d)?d.flatMap(s):[d]:[],l=[...s(e.styles),...this.#a??[]];if(l.length>0){let d=t.attachShadow({mode:"open"});Ih(d,l)}this.#$(t),r.appendChild(t),this.#r=t}#$(r){if(this.#h.length===0)return;let t=getComputedStyle(this.#t);for(let e of this.#h){let s=t.getPropertyValue(e).trim();s&&r.style.setProperty(e,s)}}#_(){this.#r&&(this.#r.style.display="none")}#R(){this.#r?.remove(),this.#r=null}#I(){if(this.#b)return;let r=this.#e(),t=this.#r;!r||!t||(this.#b=kz(r,t,{placement:this.#d,offsetPx:this.#c,matchWidth:this.#o,minMatchWidth:this.#n,onPosition:this.#l,alignToInner:this.#x?{getElement:this.#x,getReferenceInner:this.#k}:void 0}))}#T(){this.#b?.(),this.#b=null}#L(){let r=this.renderRoot?.querySelector(this.#m);if(!r)return;let t=this.#p?Array.from(this.#t.querySelectorAll(`:scope > ${this.#p}`)):Array.from(this.#t.childNodes);for(let e of t)r.appendChild(e),this.#v.push(e)}#z(){for(let r of this.#v)this.#t.appendChild(r);this.#v=[]}#O(){this.#T(),this.#z(),this.#R()}};var M0=M("value-change",{bubbles:!0,composed:!0}),Zu=M("values-change",{bubbles:!0,composed:!0}),gV=b`
|
|
2734
2734
|
:host {
|
|
2735
2735
|
display: block;
|
|
2736
2736
|
}
|