@elyra/canvas 12.42.0 → 12.44.0

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.
Files changed (185) hide show
  1. package/dist/{canvas-constants-ff5cf88e.js → canvas-constants-089e7830.js} +2 -2
  2. package/dist/{canvas-constants-ff5cf88e.js.map → canvas-constants-089e7830.js.map} +1 -1
  3. package/dist/{canvas-constants-13b58448.js → canvas-constants-69e90162.js} +2 -2
  4. package/dist/{canvas-constants-13b58448.js.map → canvas-constants-69e90162.js.map} +1 -1
  5. package/dist/canvas-controller-3e6b8ce4.js +2 -0
  6. package/dist/canvas-controller-3e6b8ce4.js.map +1 -0
  7. package/dist/canvas-controller-c6274fad.js +2 -0
  8. package/dist/canvas-controller-c6274fad.js.map +1 -0
  9. package/dist/{canvas-logger-295dafe4.js → canvas-logger-6f4b2551.js} +2 -2
  10. package/dist/{canvas-logger-295dafe4.js.map → canvas-logger-6f4b2551.js.map} +1 -1
  11. package/dist/{canvas-logger-e07a0b4a.js → canvas-logger-ab9d9048.js} +2 -2
  12. package/dist/{canvas-logger-e07a0b4a.js.map → canvas-logger-ab9d9048.js.map} +1 -1
  13. package/dist/common-canvas-6ed21ab6.js +2 -0
  14. package/dist/common-canvas-6ed21ab6.js.map +1 -0
  15. package/dist/common-canvas-8abf016c.js +2 -0
  16. package/dist/common-canvas-8abf016c.js.map +1 -0
  17. package/dist/common-canvas.es.js +1 -1
  18. package/dist/common-canvas.es.js.map +1 -1
  19. package/dist/common-canvas.js +1 -1
  20. package/dist/common-canvas.js.map +1 -1
  21. package/dist/common-properties-88377242.js +2 -0
  22. package/dist/common-properties-88377242.js.map +1 -0
  23. package/dist/common-properties-b295acc8.js +2 -0
  24. package/dist/common-properties-b295acc8.js.map +1 -0
  25. package/dist/context-menu-wrapper-949393c7.js +2 -0
  26. package/dist/context-menu-wrapper-949393c7.js.map +1 -0
  27. package/dist/context-menu-wrapper-f62dfcdb.js +2 -0
  28. package/dist/context-menu-wrapper-f62dfcdb.js.map +1 -0
  29. package/dist/{createClass-440000a3.js → createClass-02596015.js} +2 -2
  30. package/dist/createClass-02596015.js.map +1 -0
  31. package/dist/createClass-155bf7da.js +2 -0
  32. package/dist/createClass-155bf7da.js.map +1 -0
  33. package/dist/datarecord-metadata-v3-schema-07d18e19.js +2 -0
  34. package/dist/{datarecord-metadata-v3-schema-98ec66e9.js.map → datarecord-metadata-v3-schema-07d18e19.js.map} +1 -1
  35. package/dist/datarecord-metadata-v3-schema-df939dd1.js +2 -0
  36. package/dist/{datarecord-metadata-v3-schema-dba0b214.js.map → datarecord-metadata-v3-schema-df939dd1.js.map} +1 -1
  37. package/dist/defineProperty-ad55dbff.js +2 -0
  38. package/dist/{defineProperty-3dc7d8d0.js.map → defineProperty-ad55dbff.js.map} +1 -1
  39. package/dist/{defineProperty-6d406743.js → defineProperty-bcc9968d.js} +2 -2
  40. package/dist/{defineProperty-6d406743.js.map → defineProperty-bcc9968d.js.map} +1 -1
  41. package/dist/flexible-table-c6a8b402.js +2 -0
  42. package/dist/{flexible-table-7c7de0f9.js.map → flexible-table-c6a8b402.js.map} +1 -1
  43. package/dist/flexible-table-f7b294a0.js +2 -0
  44. package/dist/{flexible-table-35e9922a.js.map → flexible-table-f7b294a0.js.map} +1 -1
  45. package/dist/{icon-9edff40c.js → icon-56b27c4f.js} +2 -2
  46. package/dist/{icon-9edff40c.js.map → icon-56b27c4f.js.map} +1 -1
  47. package/dist/{icon-e622f99b.js → icon-8ec2f0ec.js} +2 -2
  48. package/dist/{icon-e622f99b.js.map → icon-8ec2f0ec.js.map} +1 -1
  49. package/dist/index-01cbacf9.js +2 -0
  50. package/dist/{index-e2f8a935.js.map → index-01cbacf9.js.map} +1 -1
  51. package/dist/index-79543d41.js +2 -0
  52. package/dist/{index-94fec521.js.map → index-79543d41.js.map} +1 -1
  53. package/dist/inherits-42ae8426.js +2 -0
  54. package/dist/inherits-42ae8426.js.map +1 -0
  55. package/dist/inherits-75817f22.js +2 -0
  56. package/dist/inherits-75817f22.js.map +1 -0
  57. package/dist/isArrayLikeObject-04f333a5.js +1 -1
  58. package/dist/isArrayLikeObject-04f333a5.js.map +1 -1
  59. package/dist/isArrayLikeObject-7a30aa4b.js +1 -1
  60. package/dist/isArrayLikeObject-7a30aa4b.js.map +1 -1
  61. package/dist/lib/canvas-controller.es.js +1 -1
  62. package/dist/lib/canvas-controller.js +1 -1
  63. package/dist/lib/canvas.es.js +1 -1
  64. package/dist/lib/canvas.js +1 -1
  65. package/dist/lib/command-stack.es.js +1 -1
  66. package/dist/lib/command-stack.es.js.map +1 -1
  67. package/dist/lib/command-stack.js +1 -1
  68. package/dist/lib/command-stack.js.map +1 -1
  69. package/dist/lib/context-menu.es.js +1 -1
  70. package/dist/lib/context-menu.js +1 -1
  71. package/dist/lib/properties/clem.es.js +2 -0
  72. package/dist/lib/properties/clem.es.js.map +1 -0
  73. package/dist/lib/properties/clem.js +2 -0
  74. package/dist/lib/properties/clem.js.map +1 -0
  75. package/dist/lib/properties/field-picker.es.js +1 -1
  76. package/dist/lib/properties/field-picker.js +1 -1
  77. package/dist/lib/properties/flexible-table.es.js +1 -1
  78. package/dist/lib/properties/flexible-table.js +1 -1
  79. package/dist/lib/properties/getPythonHints.es.js +2 -0
  80. package/dist/lib/properties/getPythonHints.es.js.map +1 -0
  81. package/dist/lib/properties/getPythonHints.js +2 -0
  82. package/dist/lib/properties/getPythonHints.js.map +1 -0
  83. package/dist/lib/properties.es.js +1 -1
  84. package/dist/lib/properties.js +1 -1
  85. package/dist/lib/tooltip.es.js +1 -1
  86. package/dist/lib/tooltip.es.js.map +1 -1
  87. package/dist/lib/tooltip.js +1 -1
  88. package/dist/lib/tooltip.js.map +1 -1
  89. package/dist/styles/common-canvas.min.css +1 -1
  90. package/dist/styles/common-canvas.min.css.map +1 -1
  91. package/dist/toolbar-235dfb9d.js +2 -0
  92. package/dist/toolbar-235dfb9d.js.map +1 -0
  93. package/dist/toolbar-6607e35c.js +2 -0
  94. package/dist/toolbar-6607e35c.js.map +1 -0
  95. package/package.json +3 -3
  96. package/rollup.config.js +2 -0
  97. package/src/color-picker/color-picker.jsx +5 -1
  98. package/src/common-canvas/canvas-controller.js +56 -1
  99. package/src/common-canvas/cc-central-items.jsx +0 -4
  100. package/src/common-canvas/cc-toolbar.jsx +35 -13
  101. package/src/common-canvas/common-canvas-utils.js +73 -2
  102. package/src/common-canvas/common-canvas.scss +8 -8
  103. package/src/common-canvas/constants/canvas-constants.js +1 -0
  104. package/src/common-canvas/svg-canvas-d3.scss +3 -2
  105. package/src/common-canvas/svg-canvas-renderer.js +184 -94
  106. package/src/common-canvas/svg-canvas-utils-external.js +1 -1
  107. package/src/common-canvas/svg-canvas-utils-links.js +28 -32
  108. package/src/common-canvas/svg-canvas-utils-nodes.js +5 -13
  109. package/src/common-properties/components/field-picker/field-picker.jsx +4 -0
  110. package/src/common-properties/controls/checkbox/checkbox.scss +0 -1
  111. package/src/common-properties/controls/expression/expression.jsx +3 -5
  112. package/src/common-properties/controls/expression/languages/python-hint.js +18 -30
  113. package/src/common-properties/controls/expression/languages/r-hint.js +16 -8
  114. package/src/common-properties/index.js +4 -2
  115. package/src/icons/icon.scss +1 -1
  116. package/src/index.js +2 -2
  117. package/src/notification-panel/notification-panel.jsx +82 -56
  118. package/src/notification-panel/notification-panel.scss +42 -40
  119. package/src/object-model/config-utils.js +2 -2
  120. package/src/object-model/layout-dimensions.js +82 -87
  121. package/src/object-model/object-model-utils.js +271 -0
  122. package/src/object-model/object-model.js +47 -245
  123. package/src/object-model/redux/reducers/canvasinfo.js +7 -11
  124. package/src/object-model/redux/reducers/canvastoolbar.js +5 -6
  125. package/src/palette/palette-dialog-topbar.jsx +27 -38
  126. package/src/palette/palette-flyout-content-category.jsx +25 -6
  127. package/src/palette/palette.scss +8 -40
  128. package/src/toolbar/index.js +18 -0
  129. package/src/toolbar/toolbar-action-item.jsx +42 -11
  130. package/src/toolbar/toolbar-button-item.jsx +49 -21
  131. package/src/toolbar/toolbar-divider-item.jsx +1 -1
  132. package/src/toolbar/toolbar-overflow-item.jsx +14 -6
  133. package/src/toolbar/toolbar-sub-menu-item.jsx +6 -5
  134. package/src/toolbar/toolbar-sub-menu.jsx +4 -6
  135. package/src/toolbar/toolbar-sub-panel.jsx +31 -18
  136. package/src/toolbar/toolbar-sub-utils.js +21 -12
  137. package/src/toolbar/toolbar.jsx +83 -26
  138. package/src/toolbar/toolbar.scss +47 -47
  139. package/src/tooltip/tooltip.jsx +56 -10
  140. package/stats.html +1 -1
  141. package/assets/images/palette/close_32.svg +0 -1
  142. package/assets/images/palette/palette_close.svg +0 -4
  143. package/assets/images/palette/palette_grid_deselected.svg +0 -2
  144. package/assets/images/palette/palette_grid_hover.svg +0 -2
  145. package/assets/images/palette/palette_grid_selected.svg +0 -2
  146. package/assets/images/palette/palette_list_deselected.svg +0 -1
  147. package/assets/images/palette/palette_list_hover.svg +0 -1
  148. package/assets/images/palette/palette_list_selected.svg +0 -1
  149. package/assets/images/palette/palette_open.svg +0 -4
  150. package/assets/images/zoom_to_fit.svg +0 -8
  151. package/dist/canvas-controller-a53943e4.js +0 -2
  152. package/dist/canvas-controller-a53943e4.js.map +0 -1
  153. package/dist/canvas-controller-cb1d7420.js +0 -2
  154. package/dist/canvas-controller-cb1d7420.js.map +0 -1
  155. package/dist/common-canvas-42027a3f.js +0 -2
  156. package/dist/common-canvas-42027a3f.js.map +0 -1
  157. package/dist/common-canvas-f758ff42.js +0 -2
  158. package/dist/common-canvas-f758ff42.js.map +0 -1
  159. package/dist/common-properties-2e1b7ec7.js +0 -2
  160. package/dist/common-properties-2e1b7ec7.js.map +0 -1
  161. package/dist/common-properties-5e8870e3.js +0 -2
  162. package/dist/common-properties-5e8870e3.js.map +0 -1
  163. package/dist/context-menu-wrapper-49f9a1af.js +0 -2
  164. package/dist/context-menu-wrapper-49f9a1af.js.map +0 -1
  165. package/dist/context-menu-wrapper-5d6a399f.js +0 -2
  166. package/dist/context-menu-wrapper-5d6a399f.js.map +0 -1
  167. package/dist/createClass-440000a3.js.map +0 -1
  168. package/dist/createClass-5ca26865.js +0 -2
  169. package/dist/createClass-5ca26865.js.map +0 -1
  170. package/dist/datarecord-metadata-v3-schema-98ec66e9.js +0 -2
  171. package/dist/datarecord-metadata-v3-schema-dba0b214.js +0 -2
  172. package/dist/defineProperty-3dc7d8d0.js +0 -2
  173. package/dist/flexible-table-35e9922a.js +0 -2
  174. package/dist/flexible-table-7c7de0f9.js +0 -2
  175. package/dist/index-94fec521.js +0 -2
  176. package/dist/index-e2f8a935.js +0 -2
  177. package/dist/inherits-226dfdb2.js +0 -2
  178. package/dist/inherits-226dfdb2.js.map +0 -1
  179. package/dist/inherits-41673c87.js +0 -2
  180. package/dist/inherits-41673c87.js.map +0 -1
  181. package/dist/toolbar-6acda0a2.js +0 -2
  182. package/dist/toolbar-6acda0a2.js.map +0 -1
  183. package/dist/toolbar-d5647da2.js +0 -2
  184. package/dist/toolbar-d5647da2.js.map +0 -1
  185. package/src/palette/palette-dialog-topbar-three-way-icon.jsx +0 -82
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("../createClass-5ca26865.js"),e=require("../inherits-41673c87.js"),i=require("react"),o=require("react-portal"),l=require("carbon-components-react"),s=require("uuid");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(i);function p(t,i,o){return i=e._getPrototypeOf(i),e._possibleConstructorReturn(t,h()?Reflect.construct(i,o||[],e._getPrototypeOf(t).constructor):i.apply(t,o))}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}var a=function(i){function n(i){var o;return t._classCallCheck(this,n),(o=p(this,n,[i])).state={isTooltipVisible:!1},o.uuid=s.v4(),o.pendingTooltip=null,o.hideTooltipOnScrollAndResize=o.hideTooltipOnScrollAndResize.bind(e._assertThisInitialized(o)),o.tabKeyPressed=!1,o}return e._inherits(n,i),t._createClass(n,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.addEventListener("resize",this.hideTooltipOnScrollAndResize,!0),this.props.targetObj&&this.setTooltipVisible(!0)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.removeEventListener("resize",this.hideTooltipOnScrollAndResize,!0),this.pendingTooltip&&clearTimeout(this.pendingTooltip)}},{key:"setTooltipVisible",value:function(t){if((!this.showTooltip()||!t&&this.pendingTooltip)&&(clearTimeout(this.pendingTooltip),this.pendingTooltip=null,this.setState({isTooltipVisible:!1})),this.showTooltip()){var e=document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"']"));if(this.pendingTooltip=null,this.setState({isTooltipVisible:t}),t){var i=null;(i=this.props.targetObj?this.props.targetObj:document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"-trigger']")))&&e&&this.updateTooltipLayout(e,i,e.getAttribute("direction"))}}}},{key:"setKeyPressed",value:function(t){"Tab"===t.key&&(this.tabKeyPressed=!0)}},{key:"getStyleValue",value:function(t){return t+"px"}},{key:"getNewDirection",value:function(t){var e;switch(t){case"top":e="bottom";break;case"bottom":e="top";break;case"left":e="right";break;default:e="left"}return e}},{key:"showTooltip",value:function(){var t=this.canDisplayFullText(this.triggerRef);return!this.props.disable&&!this.props.showToolTipIfTruncated||!this.props.disable&&this.props.showToolTipIfTruncated&&!t}},{key:"canDisplayFullText",value:function(t){var e=this.props.truncatedRef?this.props.truncatedRef:t;if(e){var i=e.firstChild&&e.firstChild.scrollWidth&&0!==e.firstChild.scrollWidth?e.firstChild.scrollWidth:e.scrollWidth,o=e.firstChild&&e.firstChild.offsetWidth&&e.firstChild.offsetWidth||0,l=i<=(0!==o&&o<e.offsetWidth?o:e.offsetWidth);return l}return!1}},{key:"showTooltipWithDelay",value:function(){if(!this.pendingTooltip&&this.showTooltip()){var t=this;this.pendingTooltip=setTimeout((function(){t.setTooltipVisible(!0)}),this.props.delay)}}},{key:"updateTooltipLayout",value:function(t,e,i){var o=i,l=document.documentElement.clientWidth,s=document.documentElement.clientHeight,n=e.getBoundingClientRect(),r=t.querySelector("svg"),p=r.getBoundingClientRect();if(t.style.left=this.getStyleValue(n.left),t.style.top=this.getStyleValue(n.top),this.props.mousePos)this.updateLocationBasedOnMousePos(t,this.props.mousePos,i);else{if("top"===o||"bottom"===o){var h=n.left;t.offsetWidth>n.width?(h-=(t.offsetWidth-n.width)/2)<0&&(h=2):t.offsetWidth<n.width&&(h+=(n.width-t.offsetWidth)/2),t.style.left=this.getStyleValue(h),h+t.offsetWidth>l&&(t.style.left=this.getStyleValue(l-t.offsetWidth))}else if("left"===o)for(;t.offsetLeft+t.offsetWidth+p.width>Math.round(n.left);)t.style.left=this.getStyleValue(n.left-t.offsetWidth-p.width);else"right"===o&&(t.style.left=this.getStyleValue(n.right+p.width));if("top"===o)t.style.top=this.getStyleValue(n.top-p.height-t.offsetHeight);else if("bottom"===o)t.style.top=this.getStyleValue(n.bottom+p.height);else if("left"===o||"right"===o){var a=n.top;t.offsetHeight>n.height?(a-=(t.offsetHeight-n.height)/2)<0&&(a=n.top):t.offsetHeight<n.height&&(a+=(n.height-t.offsetHeight)/2),t.style.top=this.getStyleValue(a+1),s-t.offsetHeight<n.top&&(t.style.top=this.getStyleValue(s-t.offsetHeight))}"top"===o||"bottom"===o?r.style.left=this.getStyleValue(n.left-t.getBoundingClientRect().left+e.getBoundingClientRect().width/2-p.width/2+1):"left"===o?r.style.left=this.getStyleValue(t.offsetWidth-3):"right"===o&&(r.style.left=this.getStyleValue(2-p.width)),"top"===o?r.style.top=this.getStyleValue(t.offsetHeight-5):"bottom"===o?r.style.top="-11px":"left"!==o&&"right"!==o||(r.style.top=this.getStyleValue(n.top-t.getBoundingClientRect().top+e.offsetHeight/2-p.height/2))}if(this.isOutOfBounds(t)&&t.getAttribute("direction")===o){var u=this.getNewDirection(o);return this.updateTooltipLayout(t,e,u),void t.setAttribute("direction",u)}}},{key:"updateLocationBasedOnMousePos",value:function(t,e,i){var o=i,l=document.documentElement.clientWidth,s=document.documentElement.clientHeight,n=t.querySelector("svg"),r=n.getBoundingClientRect(),p=this.props.mousePos.x,h=this.props.mousePos.y;if("top"===o||"bottom"===o){var a=p-t.offsetWidth/2;l-t.offsetWidth<a?a=l-t.offsetWidth:a<0&&(a=2),t.style.left=this.getStyleValue(a)}else"left"===o?t.style.left=this.getStyleValue(p-t.offsetWidth-r.width-5):"right"===o&&(t.style.left=this.getStyleValue(p+r.width+5));if("top"===o)t.style.top=this.getStyleValue(h-r.height-t.offsetHeight);else if("bottom"===o)t.style.top=this.getStyleValue(h+2*r.height);else if("left"===o||"right"===o){var u=h-t.offsetHeight/2;s-t.offsetHeight<u?u=s-t.offsetHeight:u<0&&(u=2),t.style.top=this.getStyleValue(u+1)}"top"===o||"bottom"===o?n.style.left=this.getStyleValue(p-t.getBoundingClientRect().left-r.width/2):"left"===o?n.style.left=this.getStyleValue(t.offsetWidth-3):"right"===o&&(n.style.left=this.getStyleValue(2-r.width)),"top"===o?n.style.top=this.getStyleValue(t.offsetHeight-5):"bottom"===o?n.style.top="-11px":"left"!==o&&"right"!==o||(n.style.top=this.getStyleValue(h-t.getBoundingClientRect().top-r.height/2))}},{key:"isOutOfBounds",value:function(t){var e=parseFloat(t.style.left),i=parseFloat(t.style.top);return e+t.offsetWidth>document.documentElement.clientWidth||e<0||i<0||i+t.offsetHeight>document.documentElement.clientHeight}},{key:"toggleTooltipOnClick",value:function(t){t.stopPropagation(),t.preventDefault(),this.state.isTooltipVisible?this.setTooltipVisible(!1):this.setTooltipVisible(!0)}},{key:"hideTooltipOnScrollAndResize",value:function(t){this.state.isTooltipVisible&&this.setTooltipVisible(!1)}},{key:"render",value:function(){var e=this,i=null,s=null;if(this.props.children){s=r.default.createElement("div",{"data-id":"".concat(this.uuid,"-").concat(this.props.id,"-trigger"),className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!1)},onMouseDown:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(t){return e.toggleTooltipOnClick(t)}:null,onFocus:this.props.showToolTipOnClick?function(){return e.showTooltipWithDelay()}:null,onBlur:this.props.showToolTipOnClick?function(t){if(e.tabKeyPressed)e.setTooltipVisible(!1),e.tabKeyPressed=!1;else{var i,o,l=null==t||null===(i=t.relatedTarget)||void 0===i?void 0:i.closest(".common-canvas-tooltip");"div"===(null==l||null===(o=l.tagName)||void 0===o?void 0:o.toLowerCase())?e.setTooltipVisible(!0):e.setTooltipVisible(!1)}}:null,onKeyDown:this.props.showToolTipOnClick?function(t){return e.setKeyPressed(t)}:null,tabIndex:this.props.showToolTipOnClick?0:null,role:this.props.showToolTipOnClick?"button":null,"aria-labelledby":this.props.showToolTipOnClick?"".concat(this.uuid,"-").concat(this.props.id):null,"aria-expanded":this.props.showToolTipOnClick?this.state.isTooltipVisible:null,"aria-controls":this.props.showToolTipOnClick?"".concat(this.uuid,"-").concat(this.props.id):null,ref:function(t){return e.triggerRef=t}},this.props.children)}"string"==typeof this.props.tip?i=r.default.createElement("span",{className:"tooltipContainer"},this.props.tip):"object"===t._typeof(this.props.tip)?i=r.default.createElement("div",{className:"tooltipContainer"},this.props.tip):"function"==typeof this.props.tip&&(i=this.props.tip());var n="common-canvas-tooltip";this.props.className&&(n+=" "+this.props.className);var p=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var h=this.props.tooltipLinkHandler(this.props.link);"object"===t._typeof(h)&&h.label&&h.url&&(p=r.default.createElement(l.Link,{className:"tooltip-link",id:this.props.link.id,href:h.url,target:"_blank",rel:"noopener",visited:!1},h.label))}var a=null;return(i||p)&&(a=r.default.createElement(o.Portal,null,r.default.createElement("div",{role:"tooltip",id:"".concat(this.uuid,"-").concat(this.props.id),"data-id":"".concat(this.uuid,"-").concat(this.props.id),className:n,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction},r.default.createElement("svg",{className:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1"},r.default.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),r.default.createElement("polygon",{points:"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7"})),i,p))),r.default.createElement("div",{className:"tooltip-container"},s,a)}}]),n}(r.default.Component);a.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1},module.exports=a;
1
+ "use strict";var t=require("../createClass-155bf7da.js"),e=require("../inherits-75817f22.js"),i=require("react"),o=require("react-portal"),l=require("carbon-components-react"),s=require("uuid");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(i);function p(t,i,o){return i=e._getPrototypeOf(i),e._possibleConstructorReturn(t,h()?Reflect.construct(i,o||[],e._getPrototypeOf(t).constructor):i.apply(t,o))}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}var a=function(i){function n(e){var i;return t._classCallCheck(this,n),(i=p(this,n,[e])).state={isTooltipVisible:!1},i.uuid=s.v4(),i.pendingTooltip=null,i.hideTooltipOnScrollAndResize=i.hideTooltipOnScrollAndResize.bind(i),i.tabKeyPressed=!1,i}return e._inherits(n,i),t._createClass(n,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.addEventListener("resize",this.hideTooltipOnScrollAndResize,!0),this.props.targetObj&&this.setTooltipVisible(!0)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.removeEventListener("resize",this.hideTooltipOnScrollAndResize,!0),this.pendingTooltip&&clearTimeout(this.pendingTooltip)}},{key:"setTooltipVisible",value:function(t){if((!this.showTooltip()||!t&&this.pendingTooltip)&&(clearTimeout(this.pendingTooltip),this.pendingTooltip=null,this.setState({isTooltipVisible:!1})),this.showTooltip()){var e=document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"']"));if(this.pendingTooltip=null,this.setState({isTooltipVisible:t}),t){var i=null;(i=this.props.targetObj?this.props.targetObj:document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"-trigger']")))&&e&&this.updateTooltipLayout(e,i,e.getAttribute("direction"));var o=this.targetRef.querySelector("a");o&&o.focus()}}}},{key:"setKeyPressed",value:function(t){"Tab"===t.key&&(this.tabKeyPressed=!0),"Escape"===t.key&&(this.triggerRef.focus(),this.setTooltipVisible(!1))}},{key:"getStyleValue",value:function(t){return t+"px"}},{key:"getNewDirection",value:function(t){var e;switch(t){case"top":e="bottom";break;case"bottom":e="top";break;case"left":e="right";break;default:e="left"}return e}},{key:"showTooltip",value:function(){var t=this.canDisplayFullText(this.triggerRef);return!this.props.disable&&!this.props.showToolTipIfTruncated||!this.props.disable&&this.props.showToolTipIfTruncated&&!t}},{key:"canDisplayFullText",value:function(t){var e=this.props.truncatedRef?this.props.truncatedRef:t;if(e){var i=e.firstChild&&e.firstChild.scrollWidth&&0!==e.firstChild.scrollWidth?e.firstChild.scrollWidth:e.scrollWidth,o=e.firstChild&&e.firstChild.offsetWidth&&e.firstChild.offsetWidth||0,l=i<=(0!==o&&o<e.offsetWidth?o:e.offsetWidth);return l}return!1}},{key:"showTooltipWithDelay",value:function(){if(!this.pendingTooltip&&this.showTooltip()){var t=this;this.pendingTooltip=setTimeout((function(){t.setTooltipVisible(!0)}),this.props.delay)}}},{key:"updateTooltipLayout",value:function(t,e,i){var o=i,l=document.documentElement.clientWidth,s=document.documentElement.clientHeight,n=e.getBoundingClientRect(),r=t.querySelector("svg"),p=r.getBoundingClientRect();if(t.style.left=this.getStyleValue(n.left),t.style.top=this.getStyleValue(n.top),this.props.mousePos)this.updateLocationBasedOnMousePos(t,this.props.mousePos,i);else{if("top"===o||"bottom"===o){var h=n.left;t.offsetWidth>n.width?(h-=(t.offsetWidth-n.width)/2)<0&&(h=2):t.offsetWidth<n.width&&(h+=(n.width-t.offsetWidth)/2),t.style.left=this.getStyleValue(h),h+t.offsetWidth>l&&(t.style.left=this.getStyleValue(l-t.offsetWidth))}else if("left"===o)for(;t.offsetLeft+t.offsetWidth+p.width>Math.round(n.left);)t.style.left=this.getStyleValue(n.left-t.offsetWidth-p.width);else"right"===o&&(t.style.left=this.getStyleValue(n.right+p.width));if("top"===o)t.style.top=this.getStyleValue(n.top-p.height-t.offsetHeight);else if("bottom"===o)t.style.top=this.getStyleValue(n.bottom+p.height);else if("left"===o||"right"===o){var a=n.top;t.offsetHeight>n.height?(a-=(t.offsetHeight-n.height)/2)<0&&(a=n.top):t.offsetHeight<n.height&&(a+=(n.height-t.offsetHeight)/2),t.style.top=this.getStyleValue(a+1),s-t.offsetHeight<n.top&&(t.style.top=this.getStyleValue(s-t.offsetHeight))}"top"===o||"bottom"===o?r.style.left=this.getStyleValue(n.left-t.getBoundingClientRect().left+e.getBoundingClientRect().width/2-p.width/2+1):"left"===o?r.style.left=this.getStyleValue(t.offsetWidth-3):"right"===o&&(r.style.left=this.getStyleValue(2-p.width)),"top"===o?r.style.top=this.getStyleValue(t.offsetHeight-5):"bottom"===o?r.style.top="-11px":"left"!==o&&"right"!==o||(r.style.top=this.getStyleValue(n.top-t.getBoundingClientRect().top+e.offsetHeight/2-p.height/2))}if(this.isOutOfBounds(t)&&t.getAttribute("direction")===o){var u=this.getNewDirection(o);return this.updateTooltipLayout(t,e,u),void t.setAttribute("direction",u)}}},{key:"updateLocationBasedOnMousePos",value:function(t,e,i){var o=i,l=document.documentElement.clientWidth,s=document.documentElement.clientHeight,n=t.querySelector("svg"),r=n.getBoundingClientRect(),p=this.props.mousePos.x,h=this.props.mousePos.y;if("top"===o||"bottom"===o){var a=p-t.offsetWidth/2;l-t.offsetWidth<a?a=l-t.offsetWidth:a<0&&(a=2),t.style.left=this.getStyleValue(a)}else"left"===o?t.style.left=this.getStyleValue(p-t.offsetWidth-r.width-5):"right"===o&&(t.style.left=this.getStyleValue(p+r.width+5));if("top"===o)t.style.top=this.getStyleValue(h-r.height-t.offsetHeight);else if("bottom"===o)t.style.top=this.getStyleValue(h+2*r.height);else if("left"===o||"right"===o){var u=h-t.offsetHeight/2;s-t.offsetHeight<u?u=s-t.offsetHeight:u<0&&(u=2),t.style.top=this.getStyleValue(u+1)}"top"===o||"bottom"===o?n.style.left=this.getStyleValue(p-t.getBoundingClientRect().left-r.width/2):"left"===o?n.style.left=this.getStyleValue(t.offsetWidth-3):"right"===o&&(n.style.left=this.getStyleValue(2-r.width)),"top"===o?n.style.top=this.getStyleValue(t.offsetHeight-5):"bottom"===o?n.style.top="-11px":"left"!==o&&"right"!==o||(n.style.top=this.getStyleValue(h-t.getBoundingClientRect().top-r.height/2))}},{key:"isOutOfBounds",value:function(t){var e=parseFloat(t.style.left),i=parseFloat(t.style.top);return e+t.offsetWidth>document.documentElement.clientWidth||e<0||i<0||i+t.offsetHeight>document.documentElement.clientHeight}},{key:"toggleTooltipOnClick",value:function(t){t.stopPropagation(),t.preventDefault(),this.triggerRef.focus(),this.state.isTooltipVisible?this.setTooltipVisible(!1):this.setTooltipVisible(!0)}},{key:"hideTooltipOnScrollAndResize",value:function(t){this.state.isTooltipVisible&&this.setTooltipVisible(!1)}},{key:"render",value:function(){var e=this,i=null,s=null;if(this.props.children){s=r.default.createElement("div",{"data-id":"".concat(this.uuid,"-").concat(this.props.id,"-trigger"),className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!1)},onMouseDown:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(t){return e.toggleTooltipOnClick(t)}:null,onFocus:this.props.showToolTipOnClick?function(){return e.showTooltipWithDelay()}:null,onBlur:this.props.showToolTipOnClick?function(t){if(e.tabKeyPressed)e.setTooltipVisible(!1),e.tabKeyPressed=!1;else{var i,o,l=null==t||null===(i=t.relatedTarget)||void 0===i?void 0:i.closest(".common-canvas-tooltip");"div"===(null==l||null===(o=l.tagName)||void 0===o?void 0:o.toLowerCase())?e.setTooltipVisible(!0):e.setTooltipVisible(!1)}}:null,onKeyDown:this.props.showToolTipOnClick?function(t){return e.setKeyPressed(t)}:null,tabIndex:this.props.showToolTipOnClick?0:null,role:this.props.showToolTipOnClick?"button":null,"aria-labelledby":this.props.showToolTipOnClick?"".concat(this.uuid,"-").concat(this.props.id):null,"aria-expanded":this.props.showToolTipOnClick?this.state.isTooltipVisible:null,"aria-controls":this.props.showToolTipOnClick?"".concat(this.uuid,"-").concat(this.props.id):null,ref:function(t){return e.triggerRef=t}},this.props.children)}"string"==typeof this.props.tip?i=r.default.createElement("span",{className:"tooltipContainer"},this.props.tip):"object"===t._typeof(this.props.tip)?i=r.default.createElement("div",{className:"tooltipContainer"},this.props.tip):"function"==typeof this.props.tip&&(i=this.props.tip());var n="common-canvas-tooltip";this.props.className&&(n+=" "+this.props.className);var p=!1,h=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var a=this.props.tooltipLinkHandler(this.props.link);"object"===t._typeof(a)&&a.label&&a.url&&(h=r.default.createElement("div",{ref:function(t){return e.linkRef=t},onKeyDown:function(t){if(t.stopPropagation(),t.preventDefault(),"Escape"===t.key)e.triggerRef.focus(),e.setTooltipVisible(!1);else if("Enter"===t.key){var i=e.linkRef.children[0];i&&window.open(i,"_blank")}},onBlur:function(){p?e.setTooltipVisible(!0):(e.triggerRef.focus(),e.setTooltipVisible(!1))},onClick:function(){p=!0}},r.default.createElement(l.Link,{className:"tooltip-link",id:this.props.link.id,href:a.url,target:"_blank",rel:"noopener",visited:!1},a.label)))}var u=null;return(i||h)&&(u=r.default.createElement(o.Portal,null,r.default.createElement("div",{role:"tooltip",id:"".concat(this.uuid,"-").concat(this.props.id),"data-id":"".concat(this.uuid,"-").concat(this.props.id),className:n,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction,ref:function(t){return e.targetRef=t}},r.default.createElement("svg",{className:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1"},r.default.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),r.default.createElement("polygon",{points:"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7"})),i,h))),r.default.createElement("div",{className:"tooltip-container"},s,u)}}])}(r.default.Component);a.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1},module.exports=a;
2
2
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n\tThis code is a modified version from portal-common-api for the Elyra canvas tooltips\n*/\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Portal } from \"react-portal\";\nimport { Link } from \"carbon-components-react\";\nimport { v4 as uuid4 } from \"uuid\";\n\nclass ToolTip extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tisTooltipVisible: false\n\t\t};\n\t\tthis.uuid = uuid4();\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\n\t\tthis.tabKeyPressed = false;\n\t}\n\n\tcomponentDidMount() {\n\t\twindow.addEventListener(\"scroll\", this.hideTooltipOnScrollAndResize, true);\n\t\twindow.addEventListener(\"resize\", this.hideTooltipOnScrollAndResize, true);\n\t\tif (this.props.targetObj) {\n\t\t\tthis.setTooltipVisible(true);\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\twindow.removeEventListener(\"scroll\", this.hideTooltipOnScrollAndResize, true);\n\t\twindow.removeEventListener(\"resize\", this.hideTooltipOnScrollAndResize, true);\n\t\tif (this.pendingTooltip) {\n\t\t\tclearTimeout(this.pendingTooltip);\n\t\t}\n\t}\n\n\tsetTooltipVisible(visible) {\n\t\t// clear the display timer if set\n\t\tif (!this.showTooltip() || (!visible && this.pendingTooltip)) {\n\t\t\tclearTimeout(this.pendingTooltip);\n\t\t\tthis.pendingTooltip = null;\n\t\t\tthis.setState({\n\t\t\t\tisTooltipVisible: false\n\t\t\t});\n\t\t}\n\n\n\t\tif (this.showTooltip()) {\n\t\t\tconst tooltip = document.querySelector(`[data-id='${this.uuid}-${this.props.id}']`);\n\t\t\tthis.pendingTooltip = null;\n\t\t\tthis.setState({\n\t\t\t\tisTooltipVisible: visible\n\t\t\t});\n\t\t\t// updates the tooltip display\n\t\t\tif (visible) {\n\t\t\t\tlet tooltipTrigger = null;\n\t\t\t\tif (this.props.targetObj) {\n\t\t\t\t\ttooltipTrigger = this.props.targetObj;\n\t\t\t\t} else {\n\t\t\t\t\ttooltipTrigger = document.querySelector(`[data-id='${this.uuid}-${this.props.id}-trigger']`);\n\t\t\t\t}\n\t\t\t\tif (tooltipTrigger && tooltip) {\n\t\t\t\t\tthis.updateTooltipLayout(tooltip, tooltipTrigger, tooltip.getAttribute(\"direction\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsetKeyPressed(evt) {\n\t\tif (evt.key === \"Tab\") {\n\t\t\tthis.tabKeyPressed = true;\n\t\t}\n\t}\n\n\tgetStyleValue(value) {\n\t\treturn value + \"px\";\n\t}\n\n\tgetNewDirection(currentDirection) {\n\t\tlet newDirection;\n\t\tswitch (currentDirection) {\n\t\tcase \"top\":\n\t\t\tnewDirection = \"bottom\";\n\t\t\tbreak;\n\t\tcase \"bottom\":\n\t\t\tnewDirection = \"top\";\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\tnewDirection = \"right\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tnewDirection = \"left\";\n\t\t}\n\t\treturn newDirection;\n\t}\n\n\tshowTooltip() {\n\t\tconst canDisplayFullText = this.canDisplayFullText(this.triggerRef);\n\t\tconst showToolTip = (\n\t\t\t// show tooltip if not disabled and showToolTipIfTruncated is false\n\t\t\t(!this.props.disable && !this.props.showToolTipIfTruncated) ||\n\t\t\t// show tooltip if not disabled and showToolTipIfTruncated is true and string is truncated\n\t\t\t(!this.props.disable && this.props.showToolTipIfTruncated && !canDisplayFullText));\n\t\treturn showToolTip;\n\t}\n\n\t// Return true if the string can be displayed in the available space\n\t// Return false if the string is truncated and ellipsis is shown on the UI\n\t// (offsetWidth) is a measurement in pixels of the element's CSS width, including any borders, padding, and vertical scrollbars\n\t// (scrollWidth) value is equal to the minimum width the element would require\n\t// in order to fit all the content in the viewport without using a horizontal scrollbar\n\tcanDisplayFullText(elem) {\n\t\tconst triggerElem = this.props.truncatedRef ? this.props.truncatedRef : elem;\n\t\tif (triggerElem) {\n\t\t\tconst fullWidth = triggerElem.firstChild && triggerElem.firstChild.scrollWidth && triggerElem.firstChild.scrollWidth !== 0 ? triggerElem.firstChild.scrollWidth\n\t\t\t\t: triggerElem.scrollWidth;\n\t\t\tconst childWidth = triggerElem.firstChild && triggerElem.firstChild.offsetWidth && triggerElem.firstChild.offsetWidth || 0;\n\t\t\t// need different handling when content is within a span vs div\n\t\t\tconst displayWidth = childWidth !== 0 && childWidth < triggerElem.offsetWidth ? childWidth : triggerElem.offsetWidth;\n\t\t\tconst canDisplayFullText = fullWidth <= displayWidth;\n\t\t\treturn canDisplayFullText;\n\t\t}\n\t\treturn false; // Show tooltip if we cannot read the width (Canvas objects)\n\t}\n\n\tshowTooltipWithDelay() {\n\n\t\t// set a delay on displaying the tooltip\n\t\tif (!this.pendingTooltip && this.showTooltip()) {\n\t\t\tconst that = this;\n\t\t\tthis.pendingTooltip = setTimeout(function() {\n\t\t\t\tthat.setTooltipVisible(true);\n\t\t\t}, this.props.delay);\n\t\t}\n\n\t}\n\n\tupdateTooltipLayout(tooltip, tooltipTrigger, direction) {\n\t\tconst tooltipDirection = direction;\n\t\tconst viewPortWidth = document.documentElement.clientWidth;\n\t\tconst viewPortHeight = document.documentElement.clientHeight;\n\t\tconst triggerLayout = tooltipTrigger.getBoundingClientRect();\n\t\tconst pointer = tooltip.querySelector(\"svg\");\n\t\tconst pointerLayout = pointer.getBoundingClientRect();\n\t\tconst pointerCorrection = 1;\n\n\t\t// always initialize tooltip location so it's all visible to ensure adjustments are done on the right size\n\t\ttooltip.style.left = this.getStyleValue(triggerLayout.left);\n\t\ttooltip.style.top = this.getStyleValue(triggerLayout.top);\n\n\t\tif (this.props.mousePos) {\n\t\t\tthis.updateLocationBasedOnMousePos(tooltip, this.props.mousePos, direction);\n\t\t} else { // tooltip relativ to element\n\t\t\t// tooltip - left correction\n\t\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\t\tlet tooltipLeft = triggerLayout.left;\n\t\t\t\tif (tooltip.offsetWidth > triggerLayout.width) {\n\t\t\t\t\ttooltipLeft -= (tooltip.offsetWidth - triggerLayout.width) / 2; // distribute overlap evenly left and right\n\t\t\t\t\tif (tooltipLeft < 0) {\n\t\t\t\t\t\ttooltipLeft = 2; // hitting left border\n\t\t\t\t\t}\n\t\t\t\t} else if (tooltip.offsetWidth < triggerLayout.width) {\n\t\t\t\t\ttooltipLeft += (triggerLayout.width - tooltip.offsetWidth) / 2; // center tip within triggerLayout\n\t\t\t\t}\n\t\t\t\ttooltip.style.left = this.getStyleValue(tooltipLeft);\n\t\t\t\tif ((tooltipLeft + tooltip.offsetWidth) > viewPortWidth) {\n\t\t\t\t\ttooltip.style.left = this.getStyleValue(viewPortWidth - tooltip.offsetWidth); // hitting right border\n\t\t\t\t}\n\t\t\t} else if (tooltipDirection === \"left\") {\n\t\t\t\t// For long tooltips, tooltip.offsetWidth is updated after setting tooltip.style.left. Ensure tooltip doesn't overlap tooltipTrigger element.\n\t\t\t\twhile ((tooltip.offsetLeft + tooltip.offsetWidth + pointerLayout.width) > Math.round(triggerLayout.left)) {\n\t\t\t\t\ttooltip.style.left = this.getStyleValue(triggerLayout.left - tooltip.offsetWidth - pointerLayout.width);\n\t\t\t\t}\n\t\t\t} else if (tooltipDirection === \"right\") {\n\t\t\t\ttooltip.style.left = this.getStyleValue(triggerLayout.right + pointerLayout.width);\n\t\t\t}\n\n\t\t\t// tooltip - top correction\n\t\t\tif (tooltipDirection === \"top\") {\n\t\t\t\ttooltip.style.top = this.getStyleValue(triggerLayout.top - pointerLayout.height - tooltip.offsetHeight);\n\t\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\t\ttooltip.style.top = this.getStyleValue(triggerLayout.bottom + pointerLayout.height);\n\t\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\t\tlet tooltipTop = triggerLayout.top;\n\t\t\t\tif (tooltip.offsetHeight > triggerLayout.height) {\n\t\t\t\t\ttooltipTop -= (tooltip.offsetHeight - triggerLayout.height) / 2; // distribute overlap evenly top and bottom\n\t\t\t\t\tif (tooltipTop < 0) {\n\t\t\t\t\t\ttooltipTop = triggerLayout.top; // hitting top border\n\t\t\t\t\t}\n\t\t\t\t} else if (tooltip.offsetHeight < triggerLayout.height) {\n\t\t\t\t\ttooltipTop += (triggerLayout.height - tooltip.offsetHeight) / 2; // center tip within triggerLayout\n\t\t\t\t}\n\t\t\t\ttooltip.style.top = this.getStyleValue(tooltipTop + pointerCorrection);\n\t\t\t\tif ((viewPortHeight - tooltip.offsetHeight) < triggerLayout.top) {\n\t\t\t\t\ttooltip.style.top = this.getStyleValue(viewPortHeight - tooltip.offsetHeight); // hitting bottom border\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// pointer - left correction\n\t\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(triggerLayout.left - tooltip.getBoundingClientRect().left +\n\t\t\t\t\ttooltipTrigger.getBoundingClientRect().width / 2 - pointerLayout.width / 2\t + pointerCorrection);\n\t\t\t} else if (tooltipDirection === \"left\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(tooltip.offsetWidth - 3);\n\t\t\t} else if (tooltipDirection === \"right\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(-pointerLayout.width + 2);\n\t\t\t}\n\n\t\t\t// pointer - top correction\n\t\t\tif (tooltipDirection === \"top\") {\n\t\t\t\tpointer.style.top = this.getStyleValue(tooltip.offsetHeight - 5);\n\t\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\t\tpointer.style.top = \"-11px\";\n\t\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\t\tpointer.style.top = this.getStyleValue(triggerLayout.top - tooltip.getBoundingClientRect().top +\n\t\t\t\t\ttooltipTrigger.offsetHeight / 2 - pointerLayout.height / 2);\n\t\t\t}\n\t\t}\n\n\t\t// check if out-of-bounds at the end and if so, trigger new layout on opposite site if not already re-rendered already\n\t\tif (this.isOutOfBounds(tooltip) && tooltip.getAttribute(\"direction\") === tooltipDirection) {\n\t\t\tconst newDirection = this.getNewDirection(tooltipDirection);\n\t\t\tthis.updateTooltipLayout(tooltip, tooltipTrigger, newDirection);\n\t\t\t// update class name directly, otherwise setState triggers re-render loop in canvas\n\t\t\t// also call after updateTooltipLayout, otherwise the newDirection and class of trigger are the same\n\t\t\ttooltip.setAttribute(\"direction\", newDirection);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tupdateLocationBasedOnMousePos(tooltip, mousePos, direction) {\n\t\tconst tooltipDirection = direction;\n\t\tconst viewPortWidth = document.documentElement.clientWidth;\n\t\tconst viewPortHeight = document.documentElement.clientHeight;\n\t\tconst pointer = tooltip.querySelector(\"svg\");\n\t\tconst pointerLayout = pointer.getBoundingClientRect();\n\t\tconst pointerCorrection = 1;\n\n\t\tconst mouseX = this.props.mousePos.x;\n\t\tconst mouseY = this.props.mousePos.y;\n\t\t// if mouse position is passed in, use the cursor as reference point\n\n\t\t// tooltip - left correction\n\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\tlet tooltipLeft = mouseX - tooltip.offsetWidth / 2;\n\t\t\tif ((viewPortWidth - tooltip.offsetWidth) < tooltipLeft) {\n\t\t\t\ttooltipLeft = viewPortWidth - tooltip.offsetWidth; // hitting right border\n\t\t\t} else if (tooltipLeft < 0) {\n\t\t\t\ttooltipLeft = 2; // hitting left border\n\t\t\t}\n\t\t\ttooltip.style.left = this.getStyleValue(tooltipLeft);\n\t\t} else if (tooltipDirection === \"left\") {\n\t\t\ttooltip.style.left = this.getStyleValue(mouseX - tooltip.offsetWidth - pointerLayout.width - 5);\n\t\t} else if (tooltipDirection === \"right\") {\n\t\t\ttooltip.style.left = this.getStyleValue(mouseX + pointerLayout.width + 5);\n\t\t}\n\n\t\t// tooltip - top correction\n\t\tif (tooltipDirection === \"top\") {\n\t\t\ttooltip.style.top = this.getStyleValue(mouseY - pointerLayout.height - tooltip.offsetHeight);\n\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\ttooltip.style.top = this.getStyleValue(mouseY + 2 * pointerLayout.height);\n\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\tlet tooltipTop = mouseY - tooltip.offsetHeight / 2;\n\t\t\tif ((viewPortHeight - tooltip.offsetHeight) < tooltipTop) {\n\t\t\t\ttooltipTop = viewPortHeight - tooltip.offsetHeight; // hitting bottom border\n\t\t\t} else if (tooltipTop < 0) {\n\t\t\t\ttooltipTop = 2; // hitting top border\n\t\t\t}\n\t\t\ttooltip.style.top = this.getStyleValue(tooltipTop + pointerCorrection);\n\t\t}\n\n\t\t// pointer - left correction\n\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\tpointer.style.left = this.getStyleValue(mouseX - tooltip.getBoundingClientRect().left - pointerLayout.width / 2);\n\t\t} else if (tooltipDirection === \"left\") {\n\t\t\tpointer.style.left = this.getStyleValue(tooltip.offsetWidth - 3);\n\t\t} else if (tooltipDirection === \"right\") {\n\t\t\tpointer.style.left = this.getStyleValue(-pointerLayout.width + 2);\n\t\t}\n\n\t\t// pointer - top correction\n\t\tif (tooltipDirection === \"top\") {\n\t\t\tpointer.style.top = this.getStyleValue(tooltip.offsetHeight - 5);\n\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\tpointer.style.top = \"-11px\";\n\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\tpointer.style.top = this.getStyleValue(mouseY - tooltip.getBoundingClientRect().top - pointerLayout.height / 2);\n\t\t}\n\t}\n\n\tisOutOfBounds(tooltip) {\n\t\tconst tooltipLeft = parseFloat(tooltip.style.left);\n\t\tconst tooltipTop = parseFloat(tooltip.style.top);\n\t\treturn (((tooltipLeft + tooltip.offsetWidth) > document.documentElement.clientWidth) || // to the right\n\t\t\t\t(tooltipLeft < 0) || // to the left\n\t\t\t\t(tooltipTop < 0) || // to the top\n\t\t\t\t((tooltipTop + tooltip.offsetHeight) > document.documentElement.clientHeight)); // to the bottom\n\t}\n\n\ttoggleTooltipOnClick(evt) {\n\t\t// 'blur' event occurs before 'click' event. Because of this, onBlur function is called which hides the tooltip.\n\t\t// To prevent this default behavior, stopPropagation and preventDefault is used.\n\t\tevt.stopPropagation();\n\t\tevt.preventDefault();\n\t\tif (this.state.isTooltipVisible) {\n\t\t\t// Tooltip is visible and user clicks on trigger element again, hide tooltip\n\t\t\tthis.setTooltipVisible(false);\n\t\t} else {\n\t\t\tthis.setTooltipVisible(true);\n\t\t}\n\t}\n\n\thideTooltipOnScrollAndResize(evt) {\n\t\tif (this.state.isTooltipVisible) {\n\t\t\tthis.setTooltipVisible(false);\n\t\t}\n\t}\n\n\trender() {\n\t\tlet tooltipContent = null;\n\t\tlet triggerContent = null;\n\t\tif (this.props.children) {\n\t\t\t// when children are passed in, tooltip will handle show/hide, otherwise consumer has to hide show/hide tooltip\n\t\t\tconst mouseover = () => this.setTooltipVisible(true);\n\t\t\tconst mouseleave = () => this.setTooltipVisible(false);\n\t\t\tconst mousedown = () => this.setTooltipVisible(false);\n\t\t\t// `focus` event occurs before `click`. Adding timeout in onFocus function to ensure click is executed first.\n\t\t\t// Ref - https://stackoverflow.com/a/49512400\n\t\t\tconst onKeyDown = (evt) => this.setKeyPressed(evt);\n\t\t\tconst onFocus = () => this.showTooltipWithDelay();\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Close the tooltip if tab is click\n\t\t\t\tif (this.tabKeyPressed) {\n\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\tthis.tabKeyPressed = false;\n\t\t\t\t} else {\n\t\t\t\t\t// Check if evt.relatedTarget is a child of .common-canvas-tooltip to set tooltip visible when clicked on link\n\t\t\t\t\tconst el = evt?.relatedTarget?.closest(\".common-canvas-tooltip\");\n\t\t\t\t\tif (el?.tagName?.toLowerCase() === \"div\") {\n\t\t\t\t\t\tthis.setTooltipVisible(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Close the tooltip if evt.relatedTarget is not a child of .common-canvas-tooltip\n\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst click = (evt) => this.toggleTooltipOnClick(evt);\n\n\t\t\ttriggerContent = (<div\n\t\t\t\tdata-id={`${this.uuid}-${this.props.id}-trigger`}\n\t\t\t\tclassName=\"tooltip-trigger\"\n\t\t\t\tonMouseOver={!this.props.showToolTipOnClick ? mouseover : null}\n\t\t\t\tonMouseLeave={!this.props.showToolTipOnClick ? mouseleave : null}\n\t\t\t\tonMouseDown={!this.props.showToolTipOnClick ? mousedown : null}\n\t\t\t\tonClick={this.props.showToolTipOnClick ? click : null}\n\t\t\t\tonFocus={this.props.showToolTipOnClick ? onFocus : null} // When focused using keyboard\n\t\t\t\tonBlur={this.props.showToolTipOnClick ? onBlur : null}\n\t\t\t\tonKeyDown={this.props.showToolTipOnClick ? onKeyDown : null}\n\t\t\t\ttabIndex={this.props.showToolTipOnClick ? 0 : null}\n\t\t\t\trole={this.props.showToolTipOnClick ? \"button\" : null}\n\t\t\t\taria-labelledby={this.props.showToolTipOnClick ? `${this.uuid}-${this.props.id}` : null}\n\t\t\t\taria-expanded={this.props.showToolTipOnClick ? this.state.isTooltipVisible : null}\n\t\t\t\taria-controls={this.props.showToolTipOnClick ? `${this.uuid}-${this.props.id}` : null}\n\t\t\t\tref={(ref) => (this.triggerRef = ref)}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</div>);\n\t\t}\n\n\t\tif ((typeof this.props.tip) === \"string\") {\n\t\t\ttooltipContent = (\n\t\t\t\t<span className=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</span>\n\t\t\t);\n\t\t} else if ((typeof this.props.tip) === \"object\") {\n\t\t\ttooltipContent = (\n\t\t\t\t<div className=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else if ((typeof this.props.tip) === \"function\") {\n\t\t\ttooltipContent = this.props.tip();\n\t\t}\n\n\t\tlet tipClass = \"common-canvas-tooltip\";\n\t\tif (this.props.className) {\n\t\t\ttipClass += \" \" + this.props.className;\n\t\t}\n\n\t\tlet link = null;\n\t\tif (this.state.isTooltipVisible && this.props.tooltipLinkHandler && this.props.link) {\n\t\t\tconst linkInformation = this.props.tooltipLinkHandler(this.props.link);\n\t\t\t// Verify tooltipLinkHandler returns object in correct format\n\t\t\tif (typeof linkInformation === \"object\" && linkInformation.label && linkInformation.url) {\n\t\t\t\tlink = (<Link\n\t\t\t\t\tclassName=\"tooltip-link\"\n\t\t\t\t\tid={this.props.link.id}\n\t\t\t\t\thref={linkInformation.url}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener\"\n\t\t\t\t\tvisited={false}\n\t\t\t\t>\n\t\t\t\t\t{linkInformation.label}\n\t\t\t\t</Link>);\n\t\t\t}\n\t\t}\n\n\t\tlet tooltip = null;\n\t\tif (tooltipContent || link) {\n\t\t\ttooltip = (\n\t\t\t\t<Portal>\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tid={`${this.uuid}-${this.props.id}`}\n\t\t\t\t\t\tdata-id={`${this.uuid}-${this.props.id}`}\n\t\t\t\t\t\tclassName={tipClass}\n\t\t\t\t\t\taria-hidden={!this.state.isTooltipVisible}\n\t\t\t\t\t\tdirection={this.props.direction}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg className=\"tipArrow\" x=\"0px\" y=\"0px\" viewBox=\"0 0 9.1 16.1\">\n\t\t\t\t\t\t\t<polyline points=\"9.1,15.7 1.4,8.1 9.1,0.5\" />\n\t\t\t\t\t\t\t<polygon points=\"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t{tooltipContent}\n\t\t\t\t\t\t{link}\n\t\t\t\t\t</div>\n\t\t\t\t</Portal>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t{tooltip}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired,\n\tlink: PropTypes.object,\n\ttooltipLinkHandler: PropTypes.func,\n\tdirection: PropTypes.oneOf([\"left\", \"right\", \"top\", \"bottom\"]),\n\tchildren: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n\ttargetObj: PropTypes.object,\n\tid: PropTypes.string.isRequired,\n\tclassName: PropTypes.string,\n\tmousePos: PropTypes.object,\n\tdisable: PropTypes.bool, // Tooltip will not show if disabled\n\tshowToolTipIfTruncated: PropTypes.bool, // Set to true to only display tooltip if full text does not fit in displayable width\n\ttruncatedRef: PropTypes.object,\n\tdelay: PropTypes.number,\n\tshowToolTipOnClick: PropTypes.bool\n};\n\nToolTip.defaultProps = {\n\tdelay: 200,\n\tdirection: \"bottom\",\n\tshowToolTipIfTruncated: false, // False will always show Tooltip even when whole word can be displayed\n\tshowToolTipOnClick: false\n};\n\nexport default ToolTip;\n"],"names":["ToolTip","_React$Component","props","_this","_classCallCheck","_callSuper","state","isTooltipVisible","uuid","uuid4","pendingTooltip","hideTooltipOnScrollAndResize","bind","_assertThisInitialized","tabKeyPressed","_inherits","_createClass","key","value","window","addEventListener","this","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","document","querySelector","concat","id","tooltipTrigger","updateTooltipLayout","getAttribute","evt","currentDirection","newDirection","canDisplayFullText","triggerRef","disable","showToolTipIfTruncated","elem","triggerElem","truncatedRef","fullWidth","firstChild","scrollWidth","childWidth","offsetWidth","that","setTimeout","delay","direction","tooltipDirection","viewPortWidth","documentElement","clientWidth","viewPortHeight","clientHeight","triggerLayout","getBoundingClientRect","pointer","pointerLayout","style","left","getStyleValue","top","mousePos","updateLocationBasedOnMousePos","tooltipLeft","width","offsetLeft","Math","round","right","height","offsetHeight","bottom","tooltipTop","isOutOfBounds","getNewDirection","setAttribute","mouseX","x","mouseY","y","parseFloat","stopPropagation","preventDefault","_this2","tooltipContent","triggerContent","children","React","createElement","className","onMouseOver","showToolTipOnClick","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","_evt$relatedTarget","_el$tagName","el","relatedTarget","closest","tagName","toLowerCase","onKeyDown","setKeyPressed","tabIndex","role","ref","tip","_typeof","tipClass","link","tooltipLinkHandler","linkInformation","label","url","Link","href","target","rel","visited","Portal","viewBox","points","Component","defaultProps"],"mappings":"ukBAyBMA,WAAOC,GACZ,SAAAD,EAAYE,GAAO,IAAAC,EAQS,OARTC,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ItG,KAAKf,MAAMC,kBAAoBc,KAAKnB,MAAM0H,oBAAsBvG,KAAKnB,MAAMyH,KAAM,CACpF,IAAME,EAAkBxG,KAAKnB,MAAM0H,mBAAmBvG,KAAKnB,MAAMyH,MAElC,WAA3BF,UAAOI,IAAgCA,EAAgBC,OAASD,EAAgBE,MACnFJ,EAAQ3B,UAAAC,cAAC+B,QACR9B,UAAU,eACVjE,GAAIZ,KAAKnB,MAAMyH,KAAK1F,GACpBgG,KAAMJ,EAAgBE,IACtBG,OAAO,SACPC,IAAI,WACJC,SAAS,GAERP,EAAgBC,QAKpB,IAAIjG,EAAU,KAuBd,OAtBIgE,GAAkB8B,KACrB9F,EACCmE,UAAAC,cAACoC,cACArC,UAAAC,qBACCqB,KAAK,UACLrF,MAAED,OAAKX,KAAKb,UAAIwB,OAAIX,KAAKnB,MAAM+B,IAC/B,aAAAD,OAAYX,KAAKb,UAAIwB,OAAIX,KAAKnB,MAAM+B,IACpCiE,UAAWwB,EACX,eAAcrG,KAAKf,MAAMC,iBACzBgD,UAAWlC,KAAKnB,MAAMqD,WAEtByC,UAAAC,qBAAKC,UAAU,WAAWZ,EAAE,MAAME,EAAE,MAAM8C,QAAQ,gBACjDtC,UAAAC,0BAAUsC,OAAO,6BACjBvC,UAAAC,yBAASsC,OAAO,mDAEhB1C,EACA8B,KAOJ3B,UAAAC,qBAAKC,UAAU,qBACbJ,EACAjE,OAGH7B,CAAA,EA9aoBgG,UAAMwC,WAkc5BxI,EAAQyI,aAAe,CACtBnF,MAAO,IACPC,UAAW,SACXZ,wBAAwB,EACxByD,oBAAoB"}
1
+ {"version":3,"file":"tooltip.js","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n\tThis code is a modified version from portal-common-api for the Elyra canvas tooltips\n*/\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Portal } from \"react-portal\";\nimport { Link } from \"carbon-components-react\";\nimport { v4 as uuid4 } from \"uuid\";\n\nclass ToolTip extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tisTooltipVisible: false\n\t\t};\n\t\tthis.uuid = uuid4();\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\n\t\tthis.tabKeyPressed = false;\n\t}\n\n\tcomponentDidMount() {\n\t\twindow.addEventListener(\"scroll\", this.hideTooltipOnScrollAndResize, true);\n\t\twindow.addEventListener(\"resize\", this.hideTooltipOnScrollAndResize, true);\n\t\tif (this.props.targetObj) {\n\t\t\tthis.setTooltipVisible(true);\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\twindow.removeEventListener(\"scroll\", this.hideTooltipOnScrollAndResize, true);\n\t\twindow.removeEventListener(\"resize\", this.hideTooltipOnScrollAndResize, true);\n\t\tif (this.pendingTooltip) {\n\t\t\tclearTimeout(this.pendingTooltip);\n\t\t}\n\t}\n\n\tsetTooltipVisible(visible) {\n\t\t// clear the display timer if set\n\t\tif (!this.showTooltip() || (!visible && this.pendingTooltip)) {\n\t\t\tclearTimeout(this.pendingTooltip);\n\t\t\tthis.pendingTooltip = null;\n\t\t\tthis.setState({\n\t\t\t\tisTooltipVisible: false\n\t\t\t});\n\t\t}\n\n\n\t\tif (this.showTooltip()) {\n\t\t\tconst tooltip = document.querySelector(`[data-id='${this.uuid}-${this.props.id}']`);\n\t\t\tthis.pendingTooltip = null;\n\t\t\tthis.setState({\n\t\t\t\tisTooltipVisible: visible\n\t\t\t});\n\t\t\t// updates the tooltip display\n\t\t\tif (visible) {\n\t\t\t\tlet tooltipTrigger = null;\n\t\t\t\tif (this.props.targetObj) {\n\t\t\t\t\ttooltipTrigger = this.props.targetObj;\n\t\t\t\t} else {\n\t\t\t\t\ttooltipTrigger = document.querySelector(`[data-id='${this.uuid}-${this.props.id}-trigger']`);\n\t\t\t\t}\n\t\t\t\tif (tooltipTrigger && tooltip) {\n\t\t\t\t\tthis.updateTooltipLayout(tooltip, tooltipTrigger, tooltip.getAttribute(\"direction\"));\n\t\t\t\t}\n\n\t\t\t\tconst linkElement = this.targetRef.querySelector(\"a\");\n\n\t\t\t\t// Focus on link when tooltip with link is opened\n\t\t\t\tif (linkElement) {\n\t\t\t\t\tlinkElement.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsetKeyPressed(evt) {\n\t\tif (evt.key === \"Tab\") {\n\t\t\tthis.tabKeyPressed = true;\n\t\t}\n\t\tif (evt.key === \"Escape\") {\n\t\t\tthis.triggerRef.focus();\n\t\t\tthis.setTooltipVisible(false);\n\t\t}\n\t}\n\n\tgetStyleValue(value) {\n\t\treturn value + \"px\";\n\t}\n\n\tgetNewDirection(currentDirection) {\n\t\tlet newDirection;\n\t\tswitch (currentDirection) {\n\t\tcase \"top\":\n\t\t\tnewDirection = \"bottom\";\n\t\t\tbreak;\n\t\tcase \"bottom\":\n\t\t\tnewDirection = \"top\";\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\tnewDirection = \"right\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tnewDirection = \"left\";\n\t\t}\n\t\treturn newDirection;\n\t}\n\n\tshowTooltip() {\n\t\tconst canDisplayFullText = this.canDisplayFullText(this.triggerRef);\n\t\tconst showToolTip = (\n\t\t\t// show tooltip if not disabled and showToolTipIfTruncated is false\n\t\t\t(!this.props.disable && !this.props.showToolTipIfTruncated) ||\n\t\t\t// show tooltip if not disabled and showToolTipIfTruncated is true and string is truncated\n\t\t\t(!this.props.disable && this.props.showToolTipIfTruncated && !canDisplayFullText));\n\t\treturn showToolTip;\n\t}\n\n\t// Return true if the string can be displayed in the available space\n\t// Return false if the string is truncated and ellipsis is shown on the UI\n\t// (offsetWidth) is a measurement in pixels of the element's CSS width, including any borders, padding, and vertical scrollbars\n\t// (scrollWidth) value is equal to the minimum width the element would require\n\t// in order to fit all the content in the viewport without using a horizontal scrollbar\n\tcanDisplayFullText(elem) {\n\t\tconst triggerElem = this.props.truncatedRef ? this.props.truncatedRef : elem;\n\t\tif (triggerElem) {\n\t\t\tconst fullWidth = triggerElem.firstChild && triggerElem.firstChild.scrollWidth && triggerElem.firstChild.scrollWidth !== 0 ? triggerElem.firstChild.scrollWidth\n\t\t\t\t: triggerElem.scrollWidth;\n\t\t\tconst childWidth = triggerElem.firstChild && triggerElem.firstChild.offsetWidth && triggerElem.firstChild.offsetWidth || 0;\n\t\t\t// need different handling when content is within a span vs div\n\t\t\tconst displayWidth = childWidth !== 0 && childWidth < triggerElem.offsetWidth ? childWidth : triggerElem.offsetWidth;\n\t\t\tconst canDisplayFullText = fullWidth <= displayWidth;\n\t\t\treturn canDisplayFullText;\n\t\t}\n\t\treturn false; // Show tooltip if we cannot read the width (Canvas objects)\n\t}\n\n\tshowTooltipWithDelay() {\n\n\t\t// set a delay on displaying the tooltip\n\t\tif (!this.pendingTooltip && this.showTooltip()) {\n\t\t\tconst that = this;\n\t\t\tthis.pendingTooltip = setTimeout(function() {\n\t\t\t\tthat.setTooltipVisible(true);\n\t\t\t}, this.props.delay);\n\t\t}\n\n\t}\n\n\tupdateTooltipLayout(tooltip, tooltipTrigger, direction) {\n\t\tconst tooltipDirection = direction;\n\t\tconst viewPortWidth = document.documentElement.clientWidth;\n\t\tconst viewPortHeight = document.documentElement.clientHeight;\n\t\tconst triggerLayout = tooltipTrigger.getBoundingClientRect();\n\t\tconst pointer = tooltip.querySelector(\"svg\");\n\t\tconst pointerLayout = pointer.getBoundingClientRect();\n\t\tconst pointerCorrection = 1;\n\n\t\t// always initialize tooltip location so it's all visible to ensure adjustments are done on the right size\n\t\ttooltip.style.left = this.getStyleValue(triggerLayout.left);\n\t\ttooltip.style.top = this.getStyleValue(triggerLayout.top);\n\n\t\tif (this.props.mousePos) {\n\t\t\tthis.updateLocationBasedOnMousePos(tooltip, this.props.mousePos, direction);\n\t\t} else { // tooltip relativ to element\n\t\t\t// tooltip - left correction\n\t\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\t\tlet tooltipLeft = triggerLayout.left;\n\t\t\t\tif (tooltip.offsetWidth > triggerLayout.width) {\n\t\t\t\t\ttooltipLeft -= (tooltip.offsetWidth - triggerLayout.width) / 2; // distribute overlap evenly left and right\n\t\t\t\t\tif (tooltipLeft < 0) {\n\t\t\t\t\t\ttooltipLeft = 2; // hitting left border\n\t\t\t\t\t}\n\t\t\t\t} else if (tooltip.offsetWidth < triggerLayout.width) {\n\t\t\t\t\ttooltipLeft += (triggerLayout.width - tooltip.offsetWidth) / 2; // center tip within triggerLayout\n\t\t\t\t}\n\t\t\t\ttooltip.style.left = this.getStyleValue(tooltipLeft);\n\t\t\t\tif ((tooltipLeft + tooltip.offsetWidth) > viewPortWidth) {\n\t\t\t\t\ttooltip.style.left = this.getStyleValue(viewPortWidth - tooltip.offsetWidth); // hitting right border\n\t\t\t\t}\n\t\t\t} else if (tooltipDirection === \"left\") {\n\t\t\t\t// For long tooltips, tooltip.offsetWidth is updated after setting tooltip.style.left. Ensure tooltip doesn't overlap tooltipTrigger element.\n\t\t\t\twhile ((tooltip.offsetLeft + tooltip.offsetWidth + pointerLayout.width) > Math.round(triggerLayout.left)) {\n\t\t\t\t\ttooltip.style.left = this.getStyleValue(triggerLayout.left - tooltip.offsetWidth - pointerLayout.width);\n\t\t\t\t}\n\t\t\t} else if (tooltipDirection === \"right\") {\n\t\t\t\ttooltip.style.left = this.getStyleValue(triggerLayout.right + pointerLayout.width);\n\t\t\t}\n\n\t\t\t// tooltip - top correction\n\t\t\tif (tooltipDirection === \"top\") {\n\t\t\t\ttooltip.style.top = this.getStyleValue(triggerLayout.top - pointerLayout.height - tooltip.offsetHeight);\n\t\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\t\ttooltip.style.top = this.getStyleValue(triggerLayout.bottom + pointerLayout.height);\n\t\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\t\tlet tooltipTop = triggerLayout.top;\n\t\t\t\tif (tooltip.offsetHeight > triggerLayout.height) {\n\t\t\t\t\ttooltipTop -= (tooltip.offsetHeight - triggerLayout.height) / 2; // distribute overlap evenly top and bottom\n\t\t\t\t\tif (tooltipTop < 0) {\n\t\t\t\t\t\ttooltipTop = triggerLayout.top; // hitting top border\n\t\t\t\t\t}\n\t\t\t\t} else if (tooltip.offsetHeight < triggerLayout.height) {\n\t\t\t\t\ttooltipTop += (triggerLayout.height - tooltip.offsetHeight) / 2; // center tip within triggerLayout\n\t\t\t\t}\n\t\t\t\ttooltip.style.top = this.getStyleValue(tooltipTop + pointerCorrection);\n\t\t\t\tif ((viewPortHeight - tooltip.offsetHeight) < triggerLayout.top) {\n\t\t\t\t\ttooltip.style.top = this.getStyleValue(viewPortHeight - tooltip.offsetHeight); // hitting bottom border\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// pointer - left correction\n\t\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(triggerLayout.left - tooltip.getBoundingClientRect().left +\n\t\t\t\t\ttooltipTrigger.getBoundingClientRect().width / 2 - pointerLayout.width / 2\t + pointerCorrection);\n\t\t\t} else if (tooltipDirection === \"left\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(tooltip.offsetWidth - 3);\n\t\t\t} else if (tooltipDirection === \"right\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(-pointerLayout.width + 2);\n\t\t\t}\n\n\t\t\t// pointer - top correction\n\t\t\tif (tooltipDirection === \"top\") {\n\t\t\t\tpointer.style.top = this.getStyleValue(tooltip.offsetHeight - 5);\n\t\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\t\tpointer.style.top = \"-11px\";\n\t\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\t\tpointer.style.top = this.getStyleValue(triggerLayout.top - tooltip.getBoundingClientRect().top +\n\t\t\t\t\ttooltipTrigger.offsetHeight / 2 - pointerLayout.height / 2);\n\t\t\t}\n\t\t}\n\n\t\t// check if out-of-bounds at the end and if so, trigger new layout on opposite site if not already re-rendered already\n\t\tif (this.isOutOfBounds(tooltip) && tooltip.getAttribute(\"direction\") === tooltipDirection) {\n\t\t\tconst newDirection = this.getNewDirection(tooltipDirection);\n\t\t\tthis.updateTooltipLayout(tooltip, tooltipTrigger, newDirection);\n\t\t\t// update class name directly, otherwise setState triggers re-render loop in canvas\n\t\t\t// also call after updateTooltipLayout, otherwise the newDirection and class of trigger are the same\n\t\t\ttooltip.setAttribute(\"direction\", newDirection);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tupdateLocationBasedOnMousePos(tooltip, mousePos, direction) {\n\t\tconst tooltipDirection = direction;\n\t\tconst viewPortWidth = document.documentElement.clientWidth;\n\t\tconst viewPortHeight = document.documentElement.clientHeight;\n\t\tconst pointer = tooltip.querySelector(\"svg\");\n\t\tconst pointerLayout = pointer.getBoundingClientRect();\n\t\tconst pointerCorrection = 1;\n\n\t\tconst mouseX = this.props.mousePos.x;\n\t\tconst mouseY = this.props.mousePos.y;\n\t\t// if mouse position is passed in, use the cursor as reference point\n\n\t\t// tooltip - left correction\n\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\tlet tooltipLeft = mouseX - tooltip.offsetWidth / 2;\n\t\t\tif ((viewPortWidth - tooltip.offsetWidth) < tooltipLeft) {\n\t\t\t\ttooltipLeft = viewPortWidth - tooltip.offsetWidth; // hitting right border\n\t\t\t} else if (tooltipLeft < 0) {\n\t\t\t\ttooltipLeft = 2; // hitting left border\n\t\t\t}\n\t\t\ttooltip.style.left = this.getStyleValue(tooltipLeft);\n\t\t} else if (tooltipDirection === \"left\") {\n\t\t\ttooltip.style.left = this.getStyleValue(mouseX - tooltip.offsetWidth - pointerLayout.width - 5);\n\t\t} else if (tooltipDirection === \"right\") {\n\t\t\ttooltip.style.left = this.getStyleValue(mouseX + pointerLayout.width + 5);\n\t\t}\n\n\t\t// tooltip - top correction\n\t\tif (tooltipDirection === \"top\") {\n\t\t\ttooltip.style.top = this.getStyleValue(mouseY - pointerLayout.height - tooltip.offsetHeight);\n\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\ttooltip.style.top = this.getStyleValue(mouseY + 2 * pointerLayout.height);\n\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\tlet tooltipTop = mouseY - tooltip.offsetHeight / 2;\n\t\t\tif ((viewPortHeight - tooltip.offsetHeight) < tooltipTop) {\n\t\t\t\ttooltipTop = viewPortHeight - tooltip.offsetHeight; // hitting bottom border\n\t\t\t} else if (tooltipTop < 0) {\n\t\t\t\ttooltipTop = 2; // hitting top border\n\t\t\t}\n\t\t\ttooltip.style.top = this.getStyleValue(tooltipTop + pointerCorrection);\n\t\t}\n\n\t\t// pointer - left correction\n\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\tpointer.style.left = this.getStyleValue(mouseX - tooltip.getBoundingClientRect().left - pointerLayout.width / 2);\n\t\t} else if (tooltipDirection === \"left\") {\n\t\t\tpointer.style.left = this.getStyleValue(tooltip.offsetWidth - 3);\n\t\t} else if (tooltipDirection === \"right\") {\n\t\t\tpointer.style.left = this.getStyleValue(-pointerLayout.width + 2);\n\t\t}\n\n\t\t// pointer - top correction\n\t\tif (tooltipDirection === \"top\") {\n\t\t\tpointer.style.top = this.getStyleValue(tooltip.offsetHeight - 5);\n\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\tpointer.style.top = \"-11px\";\n\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\tpointer.style.top = this.getStyleValue(mouseY - tooltip.getBoundingClientRect().top - pointerLayout.height / 2);\n\t\t}\n\t}\n\n\tisOutOfBounds(tooltip) {\n\t\tconst tooltipLeft = parseFloat(tooltip.style.left);\n\t\tconst tooltipTop = parseFloat(tooltip.style.top);\n\t\treturn (((tooltipLeft + tooltip.offsetWidth) > document.documentElement.clientWidth) || // to the right\n\t\t\t\t(tooltipLeft < 0) || // to the left\n\t\t\t\t(tooltipTop < 0) || // to the top\n\t\t\t\t((tooltipTop + tooltip.offsetHeight) > document.documentElement.clientHeight)); // to the bottom\n\t}\n\n\ttoggleTooltipOnClick(evt) {\n\t\t// 'blur' event occurs before 'click' event. Because of this, onBlur function is called which hides the tooltip.\n\t\t// To prevent this default behavior, stopPropagation and preventDefault is used.\n\t\tevt.stopPropagation();\n\t\tevt.preventDefault();\n\n\t\t// When tooltip with link is closed and another tooltip is opened newly opened tooltip should have focus.\n\t\tthis.triggerRef.focus();\n\t\tif (this.state.isTooltipVisible) {\n\t\t\t// Tooltip is visible and user clicks on trigger element again, hide tooltip\n\t\t\tthis.setTooltipVisible(false);\n\t\t} else {\n\t\t\tthis.setTooltipVisible(true);\n\t\t}\n\t}\n\n\thideTooltipOnScrollAndResize(evt) {\n\t\tif (this.state.isTooltipVisible) {\n\t\t\tthis.setTooltipVisible(false);\n\t\t}\n\t}\n\n\trender() {\n\t\tlet tooltipContent = null;\n\t\tlet triggerContent = null;\n\t\tif (this.props.children) {\n\t\t\t// when children are passed in, tooltip will handle show/hide, otherwise consumer has to hide show/hide tooltip\n\t\t\tconst mouseover = () => this.setTooltipVisible(true);\n\t\t\tconst mouseleave = () => this.setTooltipVisible(false);\n\t\t\tconst mousedown = () => this.setTooltipVisible(false);\n\t\t\t// `focus` event occurs before `click`. Adding timeout in onFocus function to ensure click is executed first.\n\t\t\t// Ref - https://stackoverflow.com/a/49512400\n\t\t\tconst onKeyDown = (evt) => this.setKeyPressed(evt);\n\t\t\tconst onFocus = () => this.showTooltipWithDelay();\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Close the tooltip if tab is click\n\t\t\t\tif (this.tabKeyPressed) {\n\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\tthis.tabKeyPressed = false;\n\t\t\t\t} else {\n\t\t\t\t\t// Check if evt.relatedTarget is a child of .common-canvas-tooltip to set tooltip visible when clicked on link\n\t\t\t\t\tconst el = evt?.relatedTarget?.closest(\".common-canvas-tooltip\");\n\t\t\t\t\tif (el?.tagName?.toLowerCase() === \"div\") {\n\t\t\t\t\t\tthis.setTooltipVisible(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Close the tooltip if evt.relatedTarget is not a child of .common-canvas-tooltip\n\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst click = (evt) => this.toggleTooltipOnClick(evt);\n\n\t\t\ttriggerContent = (<div\n\t\t\t\tdata-id={`${this.uuid}-${this.props.id}-trigger`}\n\t\t\t\tclassName=\"tooltip-trigger\"\n\t\t\t\tonMouseOver={!this.props.showToolTipOnClick ? mouseover : null}\n\t\t\t\tonMouseLeave={!this.props.showToolTipOnClick ? mouseleave : null}\n\t\t\t\tonMouseDown={!this.props.showToolTipOnClick ? mousedown : null}\n\t\t\t\tonClick={this.props.showToolTipOnClick ? click : null}\n\t\t\t\tonFocus={this.props.showToolTipOnClick ? onFocus : null} // When focused using keyboard\n\t\t\t\tonBlur={this.props.showToolTipOnClick ? onBlur : null}\n\t\t\t\tonKeyDown={this.props.showToolTipOnClick ? onKeyDown : null}\n\t\t\t\ttabIndex={this.props.showToolTipOnClick ? 0 : null}\n\t\t\t\trole={this.props.showToolTipOnClick ? \"button\" : null}\n\t\t\t\taria-labelledby={this.props.showToolTipOnClick ? `${this.uuid}-${this.props.id}` : null}\n\t\t\t\taria-expanded={this.props.showToolTipOnClick ? this.state.isTooltipVisible : null}\n\t\t\t\taria-controls={this.props.showToolTipOnClick ? `${this.uuid}-${this.props.id}` : null}\n\t\t\t\tref={(ref) => (this.triggerRef = ref)}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</div>);\n\t\t}\n\n\t\tif ((typeof this.props.tip) === \"string\") {\n\t\t\ttooltipContent = (\n\t\t\t\t<span className=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</span>\n\t\t\t);\n\t\t} else if ((typeof this.props.tip) === \"object\") {\n\t\t\ttooltipContent = (\n\t\t\t\t<div className=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else if ((typeof this.props.tip) === \"function\") {\n\t\t\ttooltipContent = this.props.tip();\n\t\t}\n\n\t\tlet tipClass = \"common-canvas-tooltip\";\n\t\tif (this.props.className) {\n\t\t\ttipClass += \" \" + this.props.className;\n\t\t}\n\t\tlet linkClicked = false;\n\t\tlet link = null;\n\t\tif (this.state.isTooltipVisible && this.props.tooltipLinkHandler && this.props.link) {\n\t\t\tconst linkInformation = this.props.tooltipLinkHandler(this.props.link);\n\t\t\t// Verify tooltipLinkHandler returns object in correct format\n\t\t\tif (typeof linkInformation === \"object\" && linkInformation.label && linkInformation.url) {\n\t\t\t\tlink = (<div\n\t\t\t\t\tref={(ref) => (this.linkRef = ref)}\n\t\t\t\t\tonKeyDown={(evt) => {\n\t\t\t\t\t\tevt.stopPropagation();\n\t\t\t\t\t\tevt.preventDefault();\n\n\t\t\t\t\t\t// When 'Esc' is pressed shift the focus to tooltip icon so that user can navigate following elements.\n\t\t\t\t\t\tif (evt.key === \"Escape\") {\n\t\t\t\t\t\t\tthis.triggerRef.focus();\n\t\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t\t} else if (evt.key === \"Enter\") { // Open active/highlighted link when Enter or Return is clicked.\n\t\t\t\t\t\t\tconst focusedElement = this.linkRef.children[0];\n\t\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\t\twindow.open(focusedElement, \"_blank\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\tif (linkClicked) { // Keep tooltip open when link is clicked\n\t\t\t\t\t\t\tthis.setTooltipVisible(true);\n\t\t\t\t\t\t} else { // Close the tooltip and shift focus to tooltip icon\n\t\t\t\t\t\t\tthis.triggerRef.focus();\n\t\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tlinkClicked = true;\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Link\n\t\t\t\t\t\tclassName=\"tooltip-link\"\n\t\t\t\t\t\tid={this.props.link.id}\n\t\t\t\t\t\thref={linkInformation.url}\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\trel=\"noopener\"\n\t\t\t\t\t\tvisited={false}\n\t\t\t\t\t>\n\t\t\t\t\t\t{linkInformation.label}\n\t\t\t\t\t</Link>\n\t\t\t\t</div>);\n\t\t\t}\n\t\t}\n\n\t\tlet tooltip = null;\n\t\tif (tooltipContent || link) {\n\t\t\ttooltip = (\n\t\t\t\t<Portal>\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tid={`${this.uuid}-${this.props.id}`}\n\t\t\t\t\t\tdata-id={`${this.uuid}-${this.props.id}`}\n\t\t\t\t\t\tclassName={tipClass}\n\t\t\t\t\t\taria-hidden={!this.state.isTooltipVisible}\n\t\t\t\t\t\tdirection={this.props.direction}\n\t\t\t\t\t\tref={(ref) => (this.targetRef = ref)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg className=\"tipArrow\" x=\"0px\" y=\"0px\" viewBox=\"0 0 9.1 16.1\">\n\t\t\t\t\t\t\t<polyline points=\"9.1,15.7 1.4,8.1 9.1,0.5\" />\n\t\t\t\t\t\t\t<polygon points=\"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t{tooltipContent}\n\t\t\t\t\t\t{link}\n\t\t\t\t\t</div>\n\t\t\t\t</Portal>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t{tooltip}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired,\n\tlink: PropTypes.object,\n\ttooltipLinkHandler: PropTypes.func,\n\tdirection: PropTypes.oneOf([\"left\", \"right\", \"top\", \"bottom\"]),\n\tchildren: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n\ttargetObj: PropTypes.object,\n\tid: PropTypes.string.isRequired,\n\tclassName: PropTypes.string,\n\tmousePos: PropTypes.object,\n\tdisable: PropTypes.bool, // Tooltip will not show if disabled\n\tshowToolTipIfTruncated: PropTypes.bool, // Set to true to only display tooltip if full text does not fit in displayable width\n\ttruncatedRef: PropTypes.object,\n\tdelay: PropTypes.number,\n\tshowToolTipOnClick: PropTypes.bool\n};\n\nToolTip.defaultProps = {\n\tdelay: 200,\n\tdirection: \"bottom\",\n\tshowToolTipIfTruncated: false, // False will always show Tooltip even when whole word can be displayed\n\tshowToolTipOnClick: false\n};\n\nexport default ToolTip;\n"],"names":["ToolTip","_React$Component","props","_this","_classCallCheck","_callSuper","state","isTooltipVisible","uuid","uuid4","pendingTooltip","hideTooltipOnScrollAndResize","bind","tabKeyPressed","_inherits","_createClass","key","value","window","addEventListener","this","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","document","querySelector","concat","id","tooltipTrigger","updateTooltipLayout","getAttribute","linkElement","targetRef","focus","evt","triggerRef","currentDirection","newDirection","canDisplayFullText","disable","showToolTipIfTruncated","elem","triggerElem","truncatedRef","fullWidth","firstChild","scrollWidth","childWidth","offsetWidth","that","setTimeout","delay","direction","tooltipDirection","viewPortWidth","documentElement","clientWidth","viewPortHeight","clientHeight","triggerLayout","getBoundingClientRect","pointer","pointerLayout","style","left","getStyleValue","top","mousePos","updateLocationBasedOnMousePos","tooltipLeft","width","offsetLeft","Math","round","right","height","offsetHeight","bottom","tooltipTop","isOutOfBounds","getNewDirection","setAttribute","mouseX","x","mouseY","y","parseFloat","stopPropagation","preventDefault","_this2","tooltipContent","triggerContent","children","React","createElement","className","onMouseOver","showToolTipOnClick","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","_evt$relatedTarget","_el$tagName","el","relatedTarget","closest","tagName","toLowerCase","onKeyDown","setKeyPressed","tabIndex","role","ref","tip","_typeof","tipClass","linkClicked","link","tooltipLinkHandler","linkInformation","label","url","linkRef","focusedElement","open","Link","href","target","rel","visited","Portal","viewBox","points","Component","defaultProps"],"mappings":"ukBAyBMA,WAAOC,GACZ,SAAAD,EAAYE,GAAO,IAAAC,EAQS,OARTC,uBAAAJ,IAClBG,EAAAE,OAAAL,GAAME,KACDI,MAAQ,CACZC,kBAAkB,GAEnBJ,EAAKK,KAAOC,OACZN,EAAKO,eAAiB,KACtBP,EAAKQ,6BAA+BR,EAAKQ,6BAA6BC,KAAIT,GAC1EA,EAAKU,eAAgB,EAAMV,EAC3B,OAAAW,YAAAd,EAAAC,GAAAc,eAAAf,IAAAgB,wBAAAC,MAED,WACCC,OAAOC,iBAAiB,SAAUC,KAAKT,8BAA8B,GACrEO,OAAOC,iBAAiB,SAAUC,KAAKT,8BAA8B,GACjES,KAAKlB,MAAMmB,WACdD,KAAKE,mBAAkB,MAExBN,2BAAAC,MAED,WACCC,OAAOK,oBAAoB,SAAUH,KAAKT,8BAA8B,GACxEO,OAAOK,oBAAoB,SAAUH,KAAKT,8BAA8B,GACpES,KAAKV,gBACRc,aAAaJ,KAAKV,mBAEnBM,wBAAAC,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