@deepfuture/dui-cdn 1.4.2 → 1.4.4
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 +5 -3
- package/dui.min.js +4 -4
- 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", "");
|
|
@@ -12447,6 +12448,7 @@ var DuiPopoverPopupPrimitive = class extends (_a32 = i8, _showArrow_dec = [n7({
|
|
|
12447
12448
|
offset: 8,
|
|
12448
12449
|
styles: portalPopupStyles3,
|
|
12449
12450
|
contentContainer: ".Content",
|
|
12451
|
+
forwardProperties: ["--popover-popup-padding"],
|
|
12450
12452
|
onPosition: ({ placement }) => {
|
|
12451
12453
|
const actualSide = placement.split("-")[0];
|
|
12452
12454
|
if (actualSide !== __privateGet(this, _DuiPopoverPopupPrimitive_instances, side_get)) {
|
|
@@ -12965,7 +12967,7 @@ var DuiPreviewCardPopupPrimitive = class extends (_a35 = i8, _showArrow_dec2 = [
|
|
|
12965
12967
|
offset: 8,
|
|
12966
12968
|
styles: portalPopupStyles4,
|
|
12967
12969
|
contentContainer: ".PreviewCardContent",
|
|
12968
|
-
forwardProperties: ["--preview-card-popup-padding"],
|
|
12970
|
+
forwardProperties: ["--preview-card-popup-padding", "--preview-card-popup-max-width"],
|
|
12969
12971
|
onPosition: ({ placement }) => {
|
|
12970
12972
|
const actualSide = placement.split("-")[0];
|
|
12971
12973
|
if (actualSide !== __privateGet(this, _DuiPreviewCardPopupPrimitive_instances, side_get2)) {
|
|
@@ -13051,7 +13053,7 @@ var styles77 = i`
|
|
|
13051
13053
|
line-height: var(--text-sm--line-height);
|
|
13052
13054
|
box-shadow: var(--shadow-lg);
|
|
13053
13055
|
border: var(--border-width-thin) solid var(--border);
|
|
13054
|
-
max-width: var(--max-width, var(--space-80));
|
|
13056
|
+
max-width: var(--preview-card-popup-max-width, var(--space-80));
|
|
13055
13057
|
transition-duration: var(--duration-faster);
|
|
13056
13058
|
transition-timing-function: var(--ease-out-3);
|
|
13057
13059
|
}
|
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
|
}
|
|
@@ -4674,7 +4674,7 @@ label, legend, caption, figcaption, th, td {
|
|
|
4674
4674
|
left: 50%;
|
|
4675
4675
|
transform: translateX(-50%) rotate(180deg);
|
|
4676
4676
|
}
|
|
4677
|
-
`],jM,KM,WM,YM,yr,PE,UE,qE,jE,Af,GM,wr,ps,kl,Bs,_f,XM,Go=class extends(YM=x,WM=[u({type:Boolean,attribute:"show-arrow"})],KM=[u({type:Boolean,attribute:"close-on-click"})],jM=[C()],YM){constructor(){super(...arguments);a(this,wr);a(this,PE,n(yr,8,this,!0)),n(yr,11,this);a(this,UE,n(yr,12,this,!1)),n(yr,15,this);a(this,qE,n(yr,16,this,"bottom")),n(yr,19,this);a(this,ps,new q(this,{context:Hs,subscribe:!0}));a(this,kl,!1);a(this,Bs,new Te(this,{getAnchor:()=>o(this,ps).value?.triggerEl,matchWidth:!1,placement:"bottom",offset:8,styles:FP,contentContainer:".Content",onPosition:({placement:t})=>{let e=t.split("-")[0];e!==o(this,wr,Af)&&h(this,wr,e,GM)},renderPopup:t=>{let e=o(this,ps).value?.popupId??"";return f`
|
|
4677
|
+
`],jM,KM,WM,YM,yr,PE,UE,qE,jE,Af,GM,wr,ps,kl,Bs,_f,XM,Go=class extends(YM=x,WM=[u({type:Boolean,attribute:"show-arrow"})],KM=[u({type:Boolean,attribute:"close-on-click"})],jM=[C()],YM){constructor(){super(...arguments);a(this,wr);a(this,PE,n(yr,8,this,!0)),n(yr,11,this);a(this,UE,n(yr,12,this,!1)),n(yr,15,this);a(this,qE,n(yr,16,this,"bottom")),n(yr,19,this);a(this,ps,new q(this,{context:Hs,subscribe:!0}));a(this,kl,!1);a(this,Bs,new Te(this,{getAnchor:()=>o(this,ps).value?.triggerEl,matchWidth:!1,placement:"bottom",offset:8,styles:FP,contentContainer:".Content",forwardProperties:["--popover-popup-padding"],onPosition:({placement:t})=>{let e=t.split("-")[0];e!==o(this,wr,Af)&&h(this,wr,e,GM)},renderPopup:t=>{let e=o(this,ps).value?.popupId??"";return f`
|
|
4678
4678
|
<div
|
|
4679
4679
|
class="Popup"
|
|
4680
4680
|
id="${e}"
|
|
@@ -4800,7 +4800,7 @@ label, legend, caption, figcaption, th, td {
|
|
|
4800
4800
|
left: 50%;
|
|
4801
4801
|
transform: translateX(-50%) rotate(180deg);
|
|
4802
4802
|
}
|
|
4803
|
-
`],g5,v5,b5,Zi,pC,hC,uC,Hf,x5,Tr,Cr,_l,tn,Bf,Ff,y5,$r=class extends(b5=x,v5=[u({type:Boolean,attribute:"show-arrow"})],g5=[C()],b5){constructor(){super(...arguments);a(this,Tr);a(this,pC,n(Zi,8,this,!0)),n(Zi,11,this);a(this,hC,n(Zi,12,this,"top")),n(Zi,15,this);a(this,Cr,new q(this,{context:Al,subscribe:!0}));a(this,_l,!1);a(this,tn,new Te(this,{getAnchor:()=>o(this,Cr).value?.triggerEl,matchWidth:!1,placement:"top",offset:8,styles:XP,contentContainer:".PreviewCardContent",forwardProperties:["--preview-card-popup-padding"],onPosition:({placement:t})=>{let e=t.split("-")[0];e!==o(this,Tr,Hf)&&h(this,Tr,e,x5)},renderPopup:t=>{let e=o(this,Cr).value?.popupId??"";return f`
|
|
4803
|
+
`],g5,v5,b5,Zi,pC,hC,uC,Hf,x5,Tr,Cr,_l,tn,Bf,Ff,y5,$r=class extends(b5=x,v5=[u({type:Boolean,attribute:"show-arrow"})],g5=[C()],b5){constructor(){super(...arguments);a(this,Tr);a(this,pC,n(Zi,8,this,!0)),n(Zi,11,this);a(this,hC,n(Zi,12,this,"top")),n(Zi,15,this);a(this,Cr,new q(this,{context:Al,subscribe:!0}));a(this,_l,!1);a(this,tn,new Te(this,{getAnchor:()=>o(this,Cr).value?.triggerEl,matchWidth:!1,placement:"top",offset:8,styles:XP,contentContainer:".PreviewCardContent",forwardProperties:["--preview-card-popup-padding","--preview-card-popup-max-width"],onPosition:({placement:t})=>{let e=t.split("-")[0];e!==o(this,Tr,Hf)&&h(this,Tr,e,x5)},renderPopup:t=>{let e=o(this,Cr).value?.popupId??"";return f`
|
|
4804
4804
|
<div
|
|
4805
4805
|
class="Popup"
|
|
4806
4806
|
id="${e}"
|
|
@@ -4825,7 +4825,7 @@ label, legend, caption, figcaption, th, td {
|
|
|
4825
4825
|
line-height: var(--text-sm--line-height);
|
|
4826
4826
|
box-shadow: var(--shadow-lg);
|
|
4827
4827
|
border: var(--border-width-thin) solid var(--border);
|
|
4828
|
-
max-width: var(--max-width, var(--space-80));
|
|
4828
|
+
max-width: var(--preview-card-popup-max-width, var(--space-80));
|
|
4829
4829
|
transition-duration: var(--duration-faster);
|
|
4830
4830
|
transition-timing-function: var(--ease-out-3);
|
|
4831
4831
|
}
|