@fluid-topics/ft-dialog 1.1.9 → 1.1.10
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/build/ft-dialog.light.js +65 -65
- package/build/ft-dialog.min.js +25 -25
- package/package.json +6 -6
package/build/ft-dialog.min.js
CHANGED
|
@@ -643,7 +643,7 @@ const Si=1,Ni=2,wi=t=>(...o)=>({_$litDirective$:t,values:o});class Ci{constructo
|
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
.ft-tooltip {
|
|
646
|
-
position:
|
|
646
|
+
position: fixed;
|
|
647
647
|
box-sizing: border-box;
|
|
648
648
|
overflow: hidden;
|
|
649
649
|
width: max-content;
|
|
@@ -661,7 +661,7 @@ const Si=1,Ni=2,wi=t=>(...o)=>({_$litDirective$:t,values:o});class Ci{constructo
|
|
|
661
661
|
position: relative;
|
|
662
662
|
word-break: break-word;
|
|
663
663
|
}
|
|
664
|
-
`,fr=["start","end"],hr=["top","right","bottom","left"].reduce(((t,o)=>t.concat(o,o+"-"+fr[0],o+"-"+fr[1])),[]),dr=Math.min,ur=Math.max,yr=Math.round,gr=t=>({x:t,y:t}),br={left:"right",right:"left",bottom:"top",top:"bottom"},mr={start:"end",end:"start"};function xr(t,o,e){return ur(t,dr(o,e))}function Or(t,o){return"function"==typeof t?t(o):t}function vr(t){return t.split("-")[0]}function Sr(t){return t.split("-")[1]}function Nr(t){return"x"===t?"y":"x"}function wr(t){return"y"===t?"height":"width"}function Cr(t){return["top","bottom"].includes(vr(t))?"y":"x"}function $r(t){return Nr(Cr(t))}function Rr(t){return t.replace(/left|right|bottom|top/g,(t=>br[t]))}function Er(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ur(t,o,e){let{reference:i,floating:r}=t;const n=Cr(o),a=$r(o),s=wr(a),l=vr(o),c="y"===n,p=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let d;switch(l){case"top":d={x:p,y:i.y-r.height};break;case"bottom":d={x:p,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-r.width,y:f};break;default:d={x:i.x,y:i.y}}switch(Sr(o)){case"start":d[a]-=h*(e&&c?-1:1);break;case"end":d[a]+=h*(e&&c?-1:1)}return d}async function kr(t,o){var e;void 0===o&&(o={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=Or(o,t),u=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(d),y=s[h?"floating"===f?"reference":"floating":f],g=Er(await n.getClippingRect({element:null==(e=await(null==n.isElement?void 0:n.isElement(y)))||e?y:y.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:p,strategy:l})),b="floating"===f?{...a.floating,x:i,y:r}:a.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),x=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},O=Er(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:m,strategy:l}):b);return{top:(g.top-O.top+u.top)/x.y,bottom:(O.bottom-g.bottom+u.bottom)/x.y,left:(g.left-O.left+u.left)/x.x,right:(O.right-g.right+u.right)/x.x}}function Ir(t,o,e){return(t?[...e.filter((o=>Sr(o)===t)),...e.filter((o=>Sr(o)!==t))]:e.filter((t=>vr(t)===t))).filter((e=>!t||(Sr(e)===t||!!o&&function(t){return t.replace(/start|end/g,(t=>mr[t]))}(e)!==e)))}const Lr=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(o){var e,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=o,{crossAxis:p=!1,alignment:f,allowedPlacements:h=hr,autoAlignment:d=!0,...u}=Or(t,o),y=void 0!==f||h===hr?Ir(f||null,d,h):h,g=await kr(o,u),b=(null==(e=a.autoPlacement)?void 0:e.index)||0,m=y[b];if(null==m)return{};const x=function(t,o,e){void 0===e&&(e=!1);const i=Sr(t),r=$r(t),n=wr(r);let a="x"===r?i===(e?"end":"start")?"right":"left":"start"===i?"bottom":"top";return o.reference[n]>o.floating[n]&&(a=Rr(a)),[a,Rr(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:y[0]}};const O=[g[vr(m)],g[x[0]],g[x[1]]],v=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:O}],S=y[b+1];if(S)return{data:{index:b+1,overflows:v},reset:{placement:S}};const N=v.map((t=>{const o=Sr(t.placement);return[t.placement,o&&p?t.overflows.slice(0,2).reduce(((t,o)=>t+o),0):t.overflows[0],t.overflows]})).sort(((t,o)=>t[1]-o[1])),w=N.filter((t=>t[2].slice(0,Sr(t[0])?2:3).every((t=>t<=0)))),C=(null==(r=w[0])?void 0:r[0])||N[0][0];return C!==s?{data:{index:b+1,overflows:v},reset:{placement:C}}:{}}}};function Wr(t){return zr(t)?(t.nodeName||"").toLowerCase():"#document"}function Kr(t){var o;return(null==t||null==(o=t.ownerDocument)?void 0:o.defaultView)||window}function Fr(t){var o;return null==(o=(zr(t)?t.ownerDocument:t.document)||window.document)?void 0:o.documentElement}function zr(t){return t instanceof Node||t instanceof Kr(t).Node}function Zr(t){return t instanceof Element||t instanceof Kr(t).Element}function Br(t){return t instanceof HTMLElement||t instanceof Kr(t).HTMLElement}function Ar(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Kr(t).ShadowRoot)}function Dr(t){const{overflow:o,overflowX:e,overflowY:i,display:r}=Tr(t);return/auto|scroll|overlay|hidden|clip/.test(o+i+e)&&!["inline","contents"].includes(r)}function Mr(t){return["table","td","th"].includes(Wr(t))}function Pr(t){const o=Hr(),e=Tr(t);return"none"!==e.transform||"none"!==e.perspective||!!e.containerType&&"normal"!==e.containerType||!o&&!!e.backdropFilter&&"none"!==e.backdropFilter||!o&&!!e.filter&&"none"!==e.filter||["transform","perspective","filter"].some((t=>(e.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(e.contain||"").includes(t)))}function Hr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function jr(t){return["html","body","#document"].includes(Wr(t))}function Tr(t){return Kr(t).getComputedStyle(t)}function _r(t){return Zr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Gr(t){if("html"===Wr(t))return t;const o=t.assignedSlot||t.parentNode||Ar(t)&&t.host||Fr(t);return Ar(o)?o.host:o}function Yr(t){const o=Gr(t);return jr(o)?t.ownerDocument?t.ownerDocument.body:t.body:Br(o)&&Dr(o)?o:Yr(o)}function Vr(t,o,e){var i;void 0===o&&(o=[]),void 0===e&&(e=!0);const r=Yr(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=Kr(r);return n?o.concat(a,a.visualViewport||[],Dr(r)?r:[],a.frameElement&&e?Vr(a.frameElement):[]):o.concat(r,Vr(r,[],e))}function Jr(t){const o=Tr(t);let e=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const r=Br(t),n=r?t.offsetWidth:e,a=r?t.offsetHeight:i,s=yr(e)!==n||yr(i)!==a;return s&&(e=n,i=a),{width:e,height:i,$:s}}function qr(t){return Zr(t)?t:t.contextElement}function Xr(t){const o=qr(t);if(!Br(o))return gr(1);const e=o.getBoundingClientRect(),{width:i,height:r,$:n}=Jr(o);let a=(n?yr(e.width):e.width)/i,s=(n?yr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Qr=gr(0);function tn(t){const o=Kr(t);return Hr()&&o.visualViewport?{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}:Qr}function on(t,o,e,i){void 0===o&&(o=!1),void 0===e&&(e=!1);const r=t.getBoundingClientRect(),n=qr(t);let a=gr(1);o&&(i?Zr(i)&&(a=Xr(i)):a=Xr(t));const s=function(t,o,e){return void 0===o&&(o=!1),!(!e||o&&e!==Kr(t))&&o}(n,e,i)?tn(n):gr(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,p=r.width/a.x,f=r.height/a.y;if(n){const t=Kr(n),o=i&&Zr(i)?Kr(i):i;let e=t.frameElement;for(;e&&i&&o!==t;){const t=Xr(e),o=e.getBoundingClientRect(),i=Tr(e),r=o.left+(e.clientLeft+parseFloat(i.paddingLeft))*t.x,n=o.top+(e.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,p*=t.x,f*=t.y,l+=r,c+=n,e=Kr(e).frameElement}}return Er({width:p,height:f,x:l,y:c})}function en(t){return on(Fr(t)).left+_r(t).scrollLeft}function rn(t,o,e){let i;if("viewport"===o)i=function(t,o){const e=Kr(t),i=Fr(t),r=e.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=Hr();(!t||t&&"fixed"===o)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,e);else if("document"===o)i=function(t){const o=Fr(t),e=_r(t),i=t.ownerDocument.body,r=ur(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),n=ur(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+en(t);const s=-e.scrollTop;return"rtl"===Tr(i).direction&&(a+=ur(o.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(Fr(t));else if(Zr(o))i=function(t,o){const e=on(t,!0,"fixed"===o),i=e.top+t.clientTop,r=e.left+t.clientLeft,n=Br(t)?Xr(t):gr(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(o,e);else{const e=tn(t);i={...o,x:o.x-e.x,y:o.y-e.y}}return Er(i)}function nn(t,o){const e=Gr(t);return!(e===o||!Zr(e)||jr(e))&&("fixed"===Tr(e).position||nn(e,o))}function an(t,o,e){const i=Br(o),r=Fr(o),n="fixed"===e,a=on(t,!0,n,o);let s={scrollLeft:0,scrollTop:0};const l=gr(0);if(i||!i&&!n)if(("body"!==Wr(o)||Dr(r))&&(s=_r(o)),i){const t=on(o,!0,n,o);l.x=t.x+o.clientLeft,l.y=t.y+o.clientTop}else r&&(l.x=en(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function sn(t,o){return Br(t)&&"fixed"!==Tr(t).position?o?o(t):t.offsetParent:null}function ln(t,o){const e=Kr(t);if(!Br(t))return e;let i=sn(t,o);for(;i&&Mr(i)&&"static"===Tr(i).position;)i=sn(i,o);return i&&("html"===Wr(i)||"body"===Wr(i)&&"static"===Tr(i).position&&!Pr(i))?e:i||function(t){let o=Gr(t);for(;Br(o)&&!jr(o);){if(Pr(o))return o;o=Gr(o)}return null}(t)||e}const cn={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:o,offsetParent:e,strategy:i}=t;const r=Br(e),n=Fr(e);if(e===n)return o;let a={scrollLeft:0,scrollTop:0},s=gr(1);const l=gr(0);if((r||!r&&"fixed"!==i)&&(("body"!==Wr(e)||Dr(n))&&(a=_r(e)),Br(e))){const t=on(e);s=Xr(e),l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-a.scrollLeft*s.x+l.x,y:o.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Fr,getClippingRect:function(t){let{element:o,boundary:e,rootBoundary:i,strategy:r}=t;const n=[..."clippingAncestors"===e?function(t,o){const e=o.get(t);if(e)return e;let i=Vr(t,[],!1).filter((t=>Zr(t)&&"body"!==Wr(t))),r=null;const n="fixed"===Tr(t).position;let a=n?Gr(t):t;for(;Zr(a)&&!jr(a);){const o=Tr(a),e=Pr(a);e||"fixed"!==o.position||(r=null),(n?!e&&!r:!e&&"static"===o.position&&r&&["absolute","fixed"].includes(r.position)||Dr(a)&&!e&&nn(t,a))?i=i.filter((t=>t!==a)):r=o,a=Gr(a)}return o.set(t,i),i}(o,this._c):[].concat(e),i],a=n[0],s=n.reduce(((t,e)=>{const i=rn(o,e,r);return t.top=ur(i.top,t.top),t.right=dr(i.right,t.right),t.bottom=dr(i.bottom,t.bottom),t.left=ur(i.left,t.left),t}),rn(o,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ln,getElementRects:async function(t){let{reference:o,floating:e,strategy:i}=t;const r=this.getOffsetParent||ln,n=this.getDimensions;return{reference:an(o,await r(e),i),floating:{x:0,y:0,...await n(e)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Jr(t)},getScale:Xr,isElement:Zr,isRTL:function(t){return"rtl"===Tr(t).direction}},pn=(t,o,e)=>{const i=new Map,r={platform:cn,...e},n={...r.platform,_c:i};return(async(t,o,e)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=e,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(o));let c=await a.getElementRects({reference:t,floating:o,strategy:r}),{x:p,y:f}=Ur(c,i,l),h=i,d={},u=0;for(let e=0;e<s.length;e++){const{name:n,fn:y}=s[e],{x:g,y:b,data:m,reset:x}=await y({x:p,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:o}});p=null!=g?g:p,f=null!=b?b:f,d={...d,[n]:{...d[n],...m}},x&&u<=50&&(u++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:t,floating:o,strategy:r}):x.rects),({x:p,y:f}=Ur(c,h,l))),e=-1)}return{x:p,y:f,placement:h,strategy:r,middlewareData:d}})(t,o,{...r,platform:n})};var fn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class hn extends Fo{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new U,this.revealDebouncer=new U}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return to`
|
|
664
|
+
`,fr=["start","end"],hr=["top","right","bottom","left"].reduce(((t,o)=>t.concat(o,o+"-"+fr[0],o+"-"+fr[1])),[]),dr=Math.min,ur=Math.max,yr=Math.round,gr=t=>({x:t,y:t}),br={left:"right",right:"left",bottom:"top",top:"bottom"},mr={start:"end",end:"start"};function xr(t,o,e){return ur(t,dr(o,e))}function Or(t,o){return"function"==typeof t?t(o):t}function vr(t){return t.split("-")[0]}function Sr(t){return t.split("-")[1]}function Nr(t){return"x"===t?"y":"x"}function wr(t){return"y"===t?"height":"width"}function Cr(t){return["top","bottom"].includes(vr(t))?"y":"x"}function $r(t){return Nr(Cr(t))}function Rr(t){return t.replace(/left|right|bottom|top/g,(t=>br[t]))}function Er(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ur(t,o,e){let{reference:i,floating:r}=t;const n=Cr(o),a=$r(o),s=wr(a),l=vr(o),c="y"===n,p=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let d;switch(l){case"top":d={x:p,y:i.y-r.height};break;case"bottom":d={x:p,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-r.width,y:f};break;default:d={x:i.x,y:i.y}}switch(Sr(o)){case"start":d[a]-=h*(e&&c?-1:1);break;case"end":d[a]+=h*(e&&c?-1:1)}return d}async function kr(t,o){var e;void 0===o&&(o={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=Or(o,t),u=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(d),y=s[h?"floating"===f?"reference":"floating":f],g=Er(await n.getClippingRect({element:null==(e=await(null==n.isElement?void 0:n.isElement(y)))||e?y:y.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:p,strategy:l})),b="floating"===f?{...a.floating,x:i,y:r}:a.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),x=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},O=Er(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:m,strategy:l}):b);return{top:(g.top-O.top+u.top)/x.y,bottom:(O.bottom-g.bottom+u.bottom)/x.y,left:(g.left-O.left+u.left)/x.x,right:(O.right-g.right+u.right)/x.x}}function Ir(t,o,e){return(t?[...e.filter((o=>Sr(o)===t)),...e.filter((o=>Sr(o)!==t))]:e.filter((t=>vr(t)===t))).filter((e=>!t||(Sr(e)===t||!!o&&function(t){return t.replace(/start|end/g,(t=>mr[t]))}(e)!==e)))}const Lr=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(o){var e,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=o,{crossAxis:p=!1,alignment:f,allowedPlacements:h=hr,autoAlignment:d=!0,...u}=Or(t,o),y=void 0!==f||h===hr?Ir(f||null,d,h):h,g=await kr(o,u),b=(null==(e=a.autoPlacement)?void 0:e.index)||0,m=y[b];if(null==m)return{};const x=function(t,o,e){void 0===e&&(e=!1);const i=Sr(t),r=$r(t),n=wr(r);let a="x"===r?i===(e?"end":"start")?"right":"left":"start"===i?"bottom":"top";return o.reference[n]>o.floating[n]&&(a=Rr(a)),[a,Rr(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:y[0]}};const O=[g[vr(m)],g[x[0]],g[x[1]]],v=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:O}],S=y[b+1];if(S)return{data:{index:b+1,overflows:v},reset:{placement:S}};const N=v.map((t=>{const o=Sr(t.placement);return[t.placement,o&&p?t.overflows.slice(0,2).reduce(((t,o)=>t+o),0):t.overflows[0],t.overflows]})).sort(((t,o)=>t[1]-o[1])),w=N.filter((t=>t[2].slice(0,Sr(t[0])?2:3).every((t=>t<=0)))),C=(null==(r=w[0])?void 0:r[0])||N[0][0];return C!==s?{data:{index:b+1,overflows:v},reset:{placement:C}}:{}}}};function Wr(t){return zr(t)?(t.nodeName||"").toLowerCase():"#document"}function Kr(t){var o;return(null==t||null==(o=t.ownerDocument)?void 0:o.defaultView)||window}function Fr(t){var o;return null==(o=(zr(t)?t.ownerDocument:t.document)||window.document)?void 0:o.documentElement}function zr(t){return t instanceof Node||t instanceof Kr(t).Node}function Zr(t){return t instanceof Element||t instanceof Kr(t).Element}function Br(t){return t instanceof HTMLElement||t instanceof Kr(t).HTMLElement}function Ar(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Kr(t).ShadowRoot)}function Dr(t){const{overflow:o,overflowX:e,overflowY:i,display:r}=Tr(t);return/auto|scroll|overlay|hidden|clip/.test(o+i+e)&&!["inline","contents"].includes(r)}function Mr(t){return["table","td","th"].includes(Wr(t))}function Pr(t){const o=Hr(),e=Tr(t);return"none"!==e.transform||"none"!==e.perspective||!!e.containerType&&"normal"!==e.containerType||!o&&!!e.backdropFilter&&"none"!==e.backdropFilter||!o&&!!e.filter&&"none"!==e.filter||["transform","perspective","filter"].some((t=>(e.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(e.contain||"").includes(t)))}function Hr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function jr(t){return["html","body","#document"].includes(Wr(t))}function Tr(t){return Kr(t).getComputedStyle(t)}function _r(t){return Zr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Gr(t){if("html"===Wr(t))return t;const o=t.assignedSlot||t.parentNode||Ar(t)&&t.host||Fr(t);return Ar(o)?o.host:o}function Yr(t){const o=Gr(t);return jr(o)?t.ownerDocument?t.ownerDocument.body:t.body:Br(o)&&Dr(o)?o:Yr(o)}function Vr(t,o,e){var i;void 0===o&&(o=[]),void 0===e&&(e=!0);const r=Yr(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=Kr(r);return n?o.concat(a,a.visualViewport||[],Dr(r)?r:[],a.frameElement&&e?Vr(a.frameElement):[]):o.concat(r,Vr(r,[],e))}function Jr(t){const o=Tr(t);let e=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const r=Br(t),n=r?t.offsetWidth:e,a=r?t.offsetHeight:i,s=yr(e)!==n||yr(i)!==a;return s&&(e=n,i=a),{width:e,height:i,$:s}}function qr(t){return Zr(t)?t:t.contextElement}function Xr(t){const o=qr(t);if(!Br(o))return gr(1);const e=o.getBoundingClientRect(),{width:i,height:r,$:n}=Jr(o);let a=(n?yr(e.width):e.width)/i,s=(n?yr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Qr=gr(0);function tn(t){const o=Kr(t);return Hr()&&o.visualViewport?{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}:Qr}function on(t,o,e,i){void 0===o&&(o=!1),void 0===e&&(e=!1);const r=t.getBoundingClientRect(),n=qr(t);let a=gr(1);o&&(i?Zr(i)&&(a=Xr(i)):a=Xr(t));const s=function(t,o,e){return void 0===o&&(o=!1),!(!e||o&&e!==Kr(t))&&o}(n,e,i)?tn(n):gr(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,p=r.width/a.x,f=r.height/a.y;if(n){const t=Kr(n),o=i&&Zr(i)?Kr(i):i;let e=t.frameElement;for(;e&&i&&o!==t;){const t=Xr(e),o=e.getBoundingClientRect(),i=Tr(e),r=o.left+(e.clientLeft+parseFloat(i.paddingLeft))*t.x,n=o.top+(e.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,p*=t.x,f*=t.y,l+=r,c+=n,e=Kr(e).frameElement}}return Er({width:p,height:f,x:l,y:c})}function en(t){return on(Fr(t)).left+_r(t).scrollLeft}function rn(t,o,e){let i;if("viewport"===o)i=function(t,o){const e=Kr(t),i=Fr(t),r=e.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=Hr();(!t||t&&"fixed"===o)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,e);else if("document"===o)i=function(t){const o=Fr(t),e=_r(t),i=t.ownerDocument.body,r=ur(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),n=ur(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+en(t);const s=-e.scrollTop;return"rtl"===Tr(i).direction&&(a+=ur(o.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(Fr(t));else if(Zr(o))i=function(t,o){const e=on(t,!0,"fixed"===o),i=e.top+t.clientTop,r=e.left+t.clientLeft,n=Br(t)?Xr(t):gr(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(o,e);else{const e=tn(t);i={...o,x:o.x-e.x,y:o.y-e.y}}return Er(i)}function nn(t,o){const e=Gr(t);return!(e===o||!Zr(e)||jr(e))&&("fixed"===Tr(e).position||nn(e,o))}function an(t,o,e){const i=Br(o),r=Fr(o),n="fixed"===e,a=on(t,!0,n,o);let s={scrollLeft:0,scrollTop:0};const l=gr(0);if(i||!i&&!n)if(("body"!==Wr(o)||Dr(r))&&(s=_r(o)),i){const t=on(o,!0,n,o);l.x=t.x+o.clientLeft,l.y=t.y+o.clientTop}else r&&(l.x=en(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function sn(t,o){return Br(t)&&"fixed"!==Tr(t).position?o?o(t):t.offsetParent:null}function ln(t,o){const e=Kr(t);if(!Br(t))return e;let i=sn(t,o);for(;i&&Mr(i)&&"static"===Tr(i).position;)i=sn(i,o);return i&&("html"===Wr(i)||"body"===Wr(i)&&"static"===Tr(i).position&&!Pr(i))?e:i||function(t){let o=Gr(t);for(;Br(o)&&!jr(o);){if(Pr(o))return o;o=Gr(o)}return null}(t)||e}const cn={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:o,offsetParent:e,strategy:i}=t;const r=Br(e),n=Fr(e);if(e===n)return o;let a={scrollLeft:0,scrollTop:0},s=gr(1);const l=gr(0);if((r||!r&&"fixed"!==i)&&(("body"!==Wr(e)||Dr(n))&&(a=_r(e)),Br(e))){const t=on(e);s=Xr(e),l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-a.scrollLeft*s.x+l.x,y:o.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Fr,getClippingRect:function(t){let{element:o,boundary:e,rootBoundary:i,strategy:r}=t;const n=[..."clippingAncestors"===e?function(t,o){const e=o.get(t);if(e)return e;let i=Vr(t,[],!1).filter((t=>Zr(t)&&"body"!==Wr(t))),r=null;const n="fixed"===Tr(t).position;let a=n?Gr(t):t;for(;Zr(a)&&!jr(a);){const o=Tr(a),e=Pr(a);e||"fixed"!==o.position||(r=null),(n?!e&&!r:!e&&"static"===o.position&&r&&["absolute","fixed"].includes(r.position)||Dr(a)&&!e&&nn(t,a))?i=i.filter((t=>t!==a)):r=o,a=Gr(a)}return o.set(t,i),i}(o,this._c):[].concat(e),i],a=n[0],s=n.reduce(((t,e)=>{const i=rn(o,e,r);return t.top=ur(i.top,t.top),t.right=dr(i.right,t.right),t.bottom=dr(i.bottom,t.bottom),t.left=ur(i.left,t.left),t}),rn(o,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ln,getElementRects:async function(t){let{reference:o,floating:e,strategy:i}=t;const r=this.getOffsetParent||ln,n=this.getDimensions;return{reference:an(o,await r(e),i),floating:{x:0,y:0,...await n(e)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Jr(t)},getScale:Xr,isElement:Zr,isRTL:function(t){return"rtl"===Tr(t).direction}},pn=(t,o,e)=>{const i=new Map,r={platform:cn,...e},n={...r.platform,_c:i};return(async(t,o,e)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=e,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(o));let c=await a.getElementRects({reference:t,floating:o,strategy:r}),{x:p,y:f}=Ur(c,i,l),h=i,d={},u=0;for(let e=0;e<s.length;e++){const{name:n,fn:y}=s[e],{x:g,y:b,data:m,reset:x}=await y({x:p,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:o}});p=null!=g?g:p,f=null!=b?b:f,d={...d,[n]:{...d[n],...m}},x&&u<=50&&(u++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:t,floating:o,strategy:r}):x.rects),({x:p,y:f}=Ur(c,h,l))),e=-1)}return{x:p,y:f,placement:h,strategy:r,middlewareData:d}})(t,o,{...r,platform:n})};function fn(t){return function(t){for(let o=t;o;o=hn(o))if(o instanceof Element&&"none"===getComputedStyle(o).display)return null;for(let o=hn(t);o;o=hn(o)){if(!(o instanceof Element))continue;const t=getComputedStyle(o);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return o;if("BODY"===o.tagName)return o}}return null}(t)}function hn(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var dn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class un extends Fo{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new U,this.revealDebouncer=new U}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return to`
|
|
665
665
|
<div part="container"
|
|
666
666
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
667
667
|
@mouseenter=${this.onHover}
|
|
@@ -669,7 +669,7 @@ const Si=1,Ni=2,wi=t=>(...o)=>({_$litDirective$:t,values:o});class Ci{constructo
|
|
|
669
669
|
@focusin=${this.onHover}
|
|
670
670
|
@focusout=${this.onOut}
|
|
671
671
|
@touchstart=${this.onTouch}>
|
|
672
|
-
<slot></slot>
|
|
672
|
+
<slot part="slot"></slot>
|
|
673
673
|
<div part="tooltip" role="tooltip" inert
|
|
674
674
|
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
675
675
|
?hidden=${!this.visible}>
|
|
@@ -679,20 +679,20 @@ const Si=1,Ni=2,wi=t=>(...o)=>({_$litDirective$:t,values:o});class Ci{constructo
|
|
|
679
679
|
</div>
|
|
680
680
|
</div>
|
|
681
681
|
</div>
|
|
682
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",pn(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:i,placement:r}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...l}=Or(t,o),c={x:e,y:i},p=await kr(o,l),f=Cr(vr(r)),h=Nr(f);let d=c[h],u=c[f];if(n){const t="y"===h?"bottom":"right";d=xr(d+p["y"===h?"top":"left"],d,d-p[t])}if(a){const t="y"===f?"bottom":"right";u=xr(u+p["y"===f?"top":"left"],u,u-p[t])}const y=s.fn({...o,[h]:d,[f]:u});return{...y,data:{x:y.x-e,y:y.y-i}}}}),Lr({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}
|
|
682
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",pn(this.slottedElement,this.tooltip,{platform:{...cn,getOffsetParent:t=>cn.getOffsetParent(t,fn)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:i,placement:r}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...l}=Or(t,o),c={x:e,y:i},p=await kr(o,l),f=Cr(vr(r)),h=Nr(f);let d=c[h],u=c[f];if(n){const t="y"===h?"bottom":"right";d=xr(d+p["y"===h?"top":"left"],d,d-p[t])}if(a){const t="y"===f?"bottom":"right";u=xr(u+p["y"===f?"top":"left"],u,u-p[t])}const y=s.fn({...o,[h]:d,[f]:u});return{...y,data:{x:y.x-e,y:y.y-i}}}}),Lr({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}un.elementDefinitions={"ft-typography":vi},un.styles=pr,dn([w()],un.prototype,"text",void 0),dn([w({type:Boolean})],un.prototype,"manual",void 0),dn([w({type:Boolean})],un.prototype,"inline",void 0),dn([w({type:Number})],un.prototype,"delay",void 0),dn([w()],un.prototype,"position",void 0),dn([
|
|
683
683
|
/**
|
|
684
684
|
* @license
|
|
685
685
|
* Copyright 2017 Google LLC
|
|
686
686
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
687
687
|
*/
|
|
688
|
-
function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return R(0,0,{get(){const o=this.renderRoot?.querySelector(r);return o?.assignedNodes(t)??[]}})}}()],
|
|
688
|
+
function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return R(0,0,{get(){const o=this.renderRoot?.querySelector(r);return o?.assignedNodes(t)??[]}})}}()],un.prototype,"slotNodes",void 0),dn([E(".ft-tooltip--container")],un.prototype,"container",void 0),dn([E(".ft-tooltip")],un.prototype,"tooltip",void 0),dn([E(".ft-tooltip--content")],un.prototype,"tooltipContent",void 0),dn([C()],un.prototype,"visible",void 0),dn([$({passive:!0})],un.prototype,"onTouch",null),dn([$({passive:!0})],un.prototype,"onHover",null),dn([$({passive:!0})],un.prototype,"onOut",null),I("ft-tooltip")(un);class yn extends Fo{render(){return to`
|
|
689
689
|
<div class="ft-loader">
|
|
690
690
|
<div></div>
|
|
691
691
|
<div></div>
|
|
692
692
|
<div></div>
|
|
693
693
|
<div></div>
|
|
694
694
|
</div>
|
|
695
|
-
`}}
|
|
695
|
+
`}}yn.styles=Ti,I("ft-loader")(yn);var gn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class bn extends(function(t,o){return class extends t{static get formAssociated(){return!0}get form(){return this[Go].form}constructor(...t){super(t),this[Go]=this.attachInternals(),this[Go].role=o}setFormValue(t){this[Go].setFormValue(t)}}}(Fo,"button")){constructor(){super(...arguments),this.role="button",this.type="button",this.disabled=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{var o;this.isDisabled()?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()):"submit"==this.type&&(null===(o=this.form)||void 0===o||o.requestSubmit())}}render(){return this.addTooltipIfNeeded(to`
|
|
696
696
|
<button part="button"
|
|
697
697
|
class="${or(this.buttonClasses)}"
|
|
698
698
|
aria-label="${this.getLabel()}"
|
|
@@ -715,7 +715,7 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
715
715
|
</ft-tooltip>
|
|
716
716
|
`:t}resolveIcon(){return this.loading?to`
|
|
717
717
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?to`
|
|
718
|
-
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:eo}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
718
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:eo}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}bn.elementDefinitions={"ft-ripple":ir,"ft-tooltip":un,"ft-typography":vi,"ft-icon":Ki,"ft-loader":yn},gn([w({type:String,reflect:!0})],bn.prototype,"role",void 0),gn([w()],bn.prototype,"type",void 0),gn([w({type:Boolean})],bn.prototype,"disabled",void 0),gn([w()],bn.prototype,"label",void 0),gn([w()],bn.prototype,"icon",void 0),gn([w()],bn.prototype,"iconVariant",void 0),gn([w({type:Boolean})],bn.prototype,"trailingIcon",void 0),gn([w({type:Boolean})],bn.prototype,"loading",void 0),gn([w()],bn.prototype,"tooltipPosition",void 0),gn([w({type:Boolean})],bn.prototype,"hideTooltip",void 0),gn([w({type:Boolean})],bn.prototype,"forceTooltip",void 0),gn([E(".ft-button")],bn.prototype,"button",void 0),gn([E(".ft-button--label slot")],bn.prototype,"slottedContent",void 0);var mn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class xn extends bn{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.dense=!1,this.round=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0}}get typographyVariant(){return"button"}}xn.styles=[Bo,tr],mn([w({type:Boolean})],xn.prototype,"primary",void 0),mn([w({type:Boolean})],xn.prototype,"outlined",void 0),mn([w({type:Boolean})],xn.prototype,"dense",void 0),mn([w({type:Boolean})],xn.prototype,"round",void 0);const On=[mt`
|
|
719
719
|
:host {
|
|
720
720
|
display: inline-block;
|
|
721
721
|
max-width: 100%;
|
|
@@ -933,14 +933,14 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
933
933
|
width: ${Co.smallIconOnlyWidth};
|
|
934
934
|
padding: unset;
|
|
935
935
|
}
|
|
936
|
-
`,Zo];var
|
|
936
|
+
`,Zo];var vn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Sn extends bn{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--secondary":this.secondary,"ft-button--tertiary":this.tertiary||!this.primary&&!this.secondary&&!this.neutral,"ft-button--neutral":this.neutral,"ft-button--large":!this.small,"ft-button--small":this.small,"ft-button--icon-only":!this.hasTextContent(),"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0,"ft-button--no-icon":!this.icon}}get typographyVariant(){return this.small?ie.caption1medium:ie.body2medium}}Sn.styles=[Bo,On],vn([w({type:Boolean})],Sn.prototype,"primary",void 0),vn([w({type:Boolean})],Sn.prototype,"secondary",void 0),vn([w({type:Boolean})],Sn.prototype,"tertiary",void 0),vn([w({type:Boolean})],Sn.prototype,"neutral",void 0),vn([w({type:Boolean})],Sn.prototype,"small",void 0),I("ft-button")(xn),I("ftds-button")(Sn);const Nn={zIndex:Oo.create("--ft-dialog-z-index","","NUMBER","2"),overlayBackgroundColor:Oo.create("--ft-dialog-overlay-background-color","","COLOR","rgba(0, 0, 0, 0.3)"),height:Oo.create("--ft-dialog-height","","SIZE","unset"),width:Oo.create("--ft-dialog-width","","SIZE","unset"),minWidth:Oo.create("--ft-dialog-min-width","","SIZE","unset"),paddingTop:Oo.create("--ft-dialog-padding-top","","SIZE","20px"),paddingSide:Oo.create("--ft-dialog-padding-side","","SIZE","16px"),paddingButtons:Oo.create("--ft-dialog-padding-buttons","","SIZE","20px"),colorSurface:Oo.external($o.colorSurface,"Design system"),headingColor:Oo.external($o.colorOnSurfaceMedium,"Design system"),borderRadiusS:Oo.external($o.borderRadiusS,"Design system"),elevation24:Oo.external($o.elevation24,"Design system")},wn=mt`
|
|
937
937
|
.ft-dialog {
|
|
938
938
|
position: fixed;
|
|
939
939
|
top: 0;
|
|
940
940
|
right: 0;
|
|
941
941
|
bottom: 0;
|
|
942
942
|
left: 0;
|
|
943
|
-
z-index: ${
|
|
943
|
+
z-index: ${Nn.zIndex};
|
|
944
944
|
|
|
945
945
|
display: flex;
|
|
946
946
|
flex-direction: column;
|
|
@@ -960,7 +960,7 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
960
960
|
height: 100%;
|
|
961
961
|
width: 100%;
|
|
962
962
|
|
|
963
|
-
background-color: ${
|
|
963
|
+
background-color: ${Nn.overlayBackgroundColor};
|
|
964
964
|
|
|
965
965
|
}
|
|
966
966
|
|
|
@@ -968,26 +968,26 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
968
968
|
position: fixed;
|
|
969
969
|
display: flex;
|
|
970
970
|
flex-direction: column;
|
|
971
|
-
gap: ${
|
|
971
|
+
gap: ${Nn.paddingButtons};
|
|
972
972
|
|
|
973
|
-
width: ${
|
|
974
|
-
height: ${
|
|
973
|
+
width: ${Nn.width};
|
|
974
|
+
height: ${Nn.height};
|
|
975
975
|
max-width: 95vw;
|
|
976
976
|
max-height: 95vh;
|
|
977
|
-
min-width: ${
|
|
977
|
+
min-width: ${Nn.minWidth};
|
|
978
978
|
|
|
979
|
-
padding-top: ${
|
|
980
|
-
padding-bottom: ${
|
|
979
|
+
padding-top: ${Nn.paddingTop};
|
|
980
|
+
padding-bottom: ${Nn.paddingTop};
|
|
981
981
|
|
|
982
|
-
background-color: ${
|
|
982
|
+
background-color: ${Nn.colorSurface};
|
|
983
983
|
|
|
984
|
-
border-radius: ${
|
|
985
|
-
box-shadow: ${
|
|
984
|
+
border-radius: ${Nn.borderRadiusS};
|
|
985
|
+
box-shadow: ${Nn.elevation24};
|
|
986
986
|
}
|
|
987
987
|
|
|
988
988
|
.ft-dialog-wrapper > * {
|
|
989
|
-
padding-right: ${
|
|
990
|
-
padding-left: ${
|
|
989
|
+
padding-right: ${Nn.paddingSide};
|
|
990
|
+
padding-left: ${Nn.paddingSide};
|
|
991
991
|
}
|
|
992
992
|
|
|
993
993
|
.ft-dialog-content {
|
|
@@ -1002,7 +1002,7 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1002
1002
|
align-items: center;
|
|
1003
1003
|
gap: 8px;
|
|
1004
1004
|
|
|
1005
|
-
color: ${
|
|
1005
|
+
color: ${Nn.headingColor};
|
|
1006
1006
|
}
|
|
1007
1007
|
|
|
1008
1008
|
.ft-dialog-heading * {
|
|
@@ -1018,7 +1018,7 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
1020
|
.ft-dialog-heading ft-button {
|
|
1021
|
-
${vo(Gi.color,
|
|
1021
|
+
${vo(Gi.color,Nn.headingColor)};
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
1024
|
.ft-dialog-buttons.ft-dialog-no-buttons {
|
|
@@ -1032,7 +1032,7 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1032
1032
|
gap: 8px;
|
|
1033
1033
|
}
|
|
1034
1034
|
|
|
1035
|
-
`;var
|
|
1035
|
+
`;var Cn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class $n extends Fo{constructor(){super(...arguments),this.opened=!1,this.closeOnEsc=!1,this.closeOnClickOutside=!1,this.closable=!1,this.beforeClose=()=>!0,this.heading="",this.icon="",this.watchEscapeKey=t=>{"Escape"===t.key&&this.closeOnEsc&&this.close()}}render(){return this.opened?to`
|
|
1036
1036
|
<div class="ft-dialog">
|
|
1037
1037
|
<div class="ft-dialog-overlay" @click="${()=>this.onClickOutside()}"></div>
|
|
1038
1038
|
<div class="ft-dialog-wrapper">
|
|
@@ -1058,4 +1058,4 @@ function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1058
1058
|
></slot>
|
|
1059
1059
|
</div>
|
|
1060
1060
|
</div>
|
|
1061
|
-
`:null}updated(t){super.updated(t),t.has("opened")&&(this.opened?setTimeout((()=>{document.addEventListener("keydown",this.watchEscapeKey)}),0):document.removeEventListener("keydown",this.watchEscapeKey))}close(){this.beforeClose()&&(this.opened=!1,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!1}})))}open(){this.opened=!0,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!0}}))}onClickOutside(){this.closeOnClickOutside&&this.close()}}
|
|
1061
|
+
`:null}updated(t){super.updated(t),t.has("opened")&&(this.opened?setTimeout((()=>{document.addEventListener("keydown",this.watchEscapeKey)}),0):document.removeEventListener("keydown",this.watchEscapeKey))}close(){this.beforeClose()&&(this.opened=!1,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!1}})))}open(){this.opened=!0,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!0}}))}onClickOutside(){this.closeOnClickOutside&&this.close()}}$n.elementDefinitions={"ft-typography":vi,"ft-icon":Ki,"ft-button":xn},$n.styles=wn,Cn([w({type:Boolean,hasChanged:(t,o)=>!1===o&&!0===t||!0===o&&!1===t})],$n.prototype,"opened",void 0),Cn([w({type:Boolean})],$n.prototype,"closeOnEsc",void 0),Cn([w({type:Boolean})],$n.prototype,"closeOnClickOutside",void 0),Cn([w({type:Boolean})],$n.prototype,"closable",void 0),Cn([w({type:()=>Boolean})],$n.prototype,"beforeClose",void 0),Cn([w()],$n.prototype,"heading",void 0),Cn([w()],$n.prototype,"icon",void 0),Cn([w()],$n.prototype,"iconVariant",void 0),Cn([function(t){return(o,e)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}]`:":not([name])");return R(0,0,{get(){const o=this.renderRoot?.querySelector(n),e=o?.assignedElements(t)??[];return void 0===r?e:e.filter((t=>t.matches(r)))}})}}({slot:"buttons"})],$n.prototype,"buttons",void 0),I("ft-dialog")($n),t.FtDialog=$n,t.FtDialogCssVariables=Nn,t.styles=wn}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-dialog",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "A simple dialog component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-button": "1.1.
|
|
23
|
-
"@fluid-topics/ft-icon": "1.1.
|
|
24
|
-
"@fluid-topics/ft-typography": "1.1.
|
|
25
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-button": "1.1.10",
|
|
23
|
+
"@fluid-topics/ft-icon": "1.1.10",
|
|
24
|
+
"@fluid-topics/ft-typography": "1.1.10",
|
|
25
|
+
"@fluid-topics/ft-wc-utils": "1.1.10",
|
|
26
26
|
"lit": "3.1.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "dd861ad18248198f16fe78602cb5d72049c15ec2"
|
|
29
29
|
}
|