@fluid-topics/ft-dialog 1.2.49 → 1.2.51

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.
@@ -542,7 +542,7 @@ Also for action icons.`,r.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
542
542
  </div>
543
543
  </div>
544
544
  </div>
545
- `}updated(o){o.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(o)}contentAvailableCallback(o){super.contentAvailableCallback(o),["visible","text"].some(a=>o.has(a))&&this.visible&&this.positionTooltip()}async show(o){this.visible=!0,o!=null&&await this.hideDebounce.run(()=>{this.hide()},o)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var o;return((o=this.slotNodes)!==null&&o!==void 0?o:[]).filter(a=>a.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let o=this.tooltipContent.style;switch(o.transition="none",this.validPosition){case"top":o.top=this.tooltip.clientHeight+"px",o.left="0";break;case"bottom":o.top=-this.tooltip.clientHeight+"px",o.left="0";break;case"left":o.top="0",o.left=this.tooltip.clientWidth+"px";break;case"right":o.top="0",o.left=-this.tooltip.clientWidth+"px";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",fa(this.slottedElement,this.tooltip,this.position).then(({x:o,y:a})=>{this.tooltip&&(this.tooltip.style.left=`${o}px`,this.tooltip.style.top=`${a}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",o=>{o.composedPath().includes(this.container)||this.onOut()},{once:!0}),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(o,a){return Math.max(o,Math.min(0,-a))}};B.elementDefinitions={"ft-typography":J};B.styles=Ur;Q([(0,H.property)()],B.prototype,"text",void 0);Q([(0,H.property)({type:Boolean})],B.prototype,"manual",void 0);Q([(0,H.property)({type:Boolean})],B.prototype,"inline",void 0);Q([(0,H.property)({type:Number})],B.prototype,"delay",void 0);Q([(0,H.property)()],B.prototype,"position",void 0);Q([(0,H.queryAssignedNodes)()],B.prototype,"slotNodes",void 0);Q([(0,H.query)(".ft-tooltip--container")],B.prototype,"container",void 0);Q([(0,H.query)(".ft-tooltip")],B.prototype,"tooltip",void 0);Q([(0,H.query)(".ft-tooltip--content")],B.prototype,"tooltipContent",void 0);Q([(0,H.state)()],B.prototype,"visible",void 0);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onTouch",null);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onHover",null);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onOut",null);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onClick",null);(0,ua.customElement)("ft-tooltip")(B);var ha=x(E());var ga=x(U()),ma=x(E());var Pt=class extends ma.FtLitElement{render(){return ga.html`
545
+ `}updated(o){o.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(o)}contentAvailableCallback(o){super.contentAvailableCallback(o),["visible","text"].some(a=>o.has(a))&&this.visible&&this.positionTooltip()}async show(o){this.visible=!0,o!=null&&await this.hideDebounce.run(()=>{this.hide()},o)}async showTemporaryText(o,a){let i=this.manual;this.manual=!0;let c=this.text;this.text=o,await this.show(a),this.text=c,this.manual=i}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var o;return((o=this.slotNodes)!==null&&o!==void 0?o:[]).filter(a=>a.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let o=this.tooltipContent.style;switch(o.transition="none",this.validPosition){case"top":o.top=this.tooltip.clientHeight+"px",o.left="0";break;case"bottom":o.top=-this.tooltip.clientHeight+"px",o.left="0";break;case"left":o.top="0",o.left=this.tooltip.clientWidth+"px";break;case"right":o.top="0",o.left=-this.tooltip.clientWidth+"px";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",fa(this.slottedElement,this.tooltip,this.position).then(({x:o,y:a})=>{this.tooltip&&(this.tooltip.style.left=`${o}px`,this.tooltip.style.top=`${a}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",o=>{o.composedPath().includes(this.container)||this.onOut()},{once:!0}),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(o,a){return Math.max(o,Math.min(0,-a))}};B.elementDefinitions={"ft-typography":J};B.styles=Ur;Q([(0,H.property)()],B.prototype,"text",void 0);Q([(0,H.property)({type:Boolean})],B.prototype,"manual",void 0);Q([(0,H.property)({type:Boolean})],B.prototype,"inline",void 0);Q([(0,H.property)({type:Number})],B.prototype,"delay",void 0);Q([(0,H.property)()],B.prototype,"position",void 0);Q([(0,H.queryAssignedNodes)()],B.prototype,"slotNodes",void 0);Q([(0,H.query)(".ft-tooltip--container")],B.prototype,"container",void 0);Q([(0,H.query)(".ft-tooltip")],B.prototype,"tooltip",void 0);Q([(0,H.query)(".ft-tooltip--content")],B.prototype,"tooltipContent",void 0);Q([(0,H.state)()],B.prototype,"visible",void 0);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onTouch",null);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onHover",null);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onOut",null);Q([(0,H.eventOptions)({passive:!0})],B.prototype,"onClick",null);(0,ua.customElement)("ft-tooltip")(B);var ha=x(E());var ga=x(U()),ma=x(E());var Pt=class extends ma.FtLitElement{render(){return ga.html`
546
546
  <div class="ft-loader">
547
547
  <div></div>
548
548
  <div></div>
@@ -586,7 +586,7 @@ Also for action icons.`,r.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
586
586
  <ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
587
587
  `:Et.html`
588
588
  <slot part="icon" name="icon"></slot>
589
- `}focus(){var o;(o=this.button)===null||o===void 0||o.focus()}focusWithoutTooltip(){var o;this.setTooltipManual(!0),(o=this.button)===null||o===void 0||o.focus(),this.setTooltipManual(!1)}setTooltipManual(o){this.tooltip&&(this.tooltip.manual=o)}click(){var o;(o=this.button)===null||o===void 0||o.click()}getLabel(){return this.label||this.textContent}get textContent(){return(0,Rt.unslotText)(this.slottedContent).trim()}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}};L.elementDefinitions={"ft-ripple":A,"ft-tooltip":B,"ft-typography":J,"ft-icon":j,"ft-loader":Pt};Z([(0,_.property)()],L.prototype,"href",void 0);Z([(0,_.property)()],L.prototype,"target",void 0);Z([(0,_.property)({type:String,reflect:!0})],L.prototype,"role",void 0);Z([(0,_.property)()],L.prototype,"type",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"disabled",void 0);Z([(0,_.property)()],L.prototype,"label",void 0);Z([(0,_.property)()],L.prototype,"icon",void 0);Z([(0,_.property)()],L.prototype,"iconVariant",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"trailingIcon",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"loading",void 0);Z([(0,_.property)({attribute:"aria-label"})],L.prototype,"ariaLabel",void 0);Z([(0,_.property)()],L.prototype,"tooltipPosition",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"hideTooltip",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"forceTooltip",void 0);Z([(0,_.query)(".ft-button")],L.prototype,"button",void 0);Z([(0,_.query)(".ft-button--label slot")],L.prototype,"slottedContent",void 0);Z([(0,_.query)("[part=tooltip]")],L.prototype,"tooltip",void 0);var Le=function(e,o,a,i){var c=arguments.length,l=c<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,a):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,o,a,i);else for(var p=e.length-1;p>=0;p--)(d=e[p])&&(l=(c<3?d(l):c>3?d(o,a,l):d(o,a))||l);return c>3&&l&&Object.defineProperty(o,a,l),l},at=class extends L{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"}};at.styles=[ba.safariEllipsisFix,kr];Le([(0,fe.property)({type:Boolean})],at.prototype,"primary",void 0);Le([(0,fe.property)({type:Boolean})],at.prototype,"outlined",void 0);Le([(0,fe.property)({type:Boolean})],at.prototype,"dense",void 0);Le([(0,fe.property)({type:Boolean})],at.prototype,"round",void 0);var ye=x(pt());var Be=x(E());var xa=x(U()),f=x(E());var Sa=[xa.css`
589
+ `}focus(){var o;(o=this.button)===null||o===void 0||o.focus()}focusWithoutTooltip(){var o;this.setTooltipManual(!0),(o=this.button)===null||o===void 0||o.focus(),this.setTooltipManual(!1)}showTemporaryTooltip(o,a){var i;return(i=this.tooltip)===null||i===void 0?void 0:i.showTemporaryText(o,a)}setTooltipManual(o){this.tooltip&&(this.tooltip.manual=o)}click(){var o;(o=this.button)===null||o===void 0||o.click()}getLabel(){return this.label||this.textContent}get textContent(){return(0,Rt.unslotText)(this.slottedContent).trim()}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}};L.elementDefinitions={"ft-ripple":A,"ft-tooltip":B,"ft-typography":J,"ft-icon":j,"ft-loader":Pt};Z([(0,_.property)()],L.prototype,"href",void 0);Z([(0,_.property)()],L.prototype,"target",void 0);Z([(0,_.property)({type:String,reflect:!0})],L.prototype,"role",void 0);Z([(0,_.property)()],L.prototype,"type",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"disabled",void 0);Z([(0,_.property)()],L.prototype,"label",void 0);Z([(0,_.property)()],L.prototype,"icon",void 0);Z([(0,_.property)()],L.prototype,"iconVariant",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"trailingIcon",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"loading",void 0);Z([(0,_.property)({attribute:"aria-label"})],L.prototype,"ariaLabel",void 0);Z([(0,_.property)()],L.prototype,"tooltipPosition",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"hideTooltip",void 0);Z([(0,_.property)({type:Boolean})],L.prototype,"forceTooltip",void 0);Z([(0,_.query)(".ft-button")],L.prototype,"button",void 0);Z([(0,_.query)(".ft-button--label slot")],L.prototype,"slottedContent",void 0);Z([(0,_.query)("[part=tooltip]")],L.prototype,"tooltip",void 0);var Le=function(e,o,a,i){var c=arguments.length,l=c<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,a):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,o,a,i);else for(var p=e.length-1;p>=0;p--)(d=e[p])&&(l=(c<3?d(l):c>3?d(o,a,l):d(o,a))||l);return c>3&&l&&Object.defineProperty(o,a,l),l},at=class extends L{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"}};at.styles=[ba.safariEllipsisFix,kr];Le([(0,fe.property)({type:Boolean})],at.prototype,"primary",void 0);Le([(0,fe.property)({type:Boolean})],at.prototype,"outlined",void 0);Le([(0,fe.property)({type:Boolean})],at.prototype,"dense",void 0);Le([(0,fe.property)({type:Boolean})],at.prototype,"round",void 0);var ye=x(pt());var Be=x(E());var xa=x(U()),f=x(E());var Sa=[xa.css`
590
590
  :host {
591
591
  display: inline-block;
592
592
  max-width: 100%;