@elyra/canvas 12.12.1 → 12.13.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 (172) hide show
  1. package/.stylelintrc.json +17 -16
  2. package/README.md +1 -1
  3. package/dist/{canvas-controller-851afae4.js → canvas-controller-40beba7d.js} +2 -2
  4. package/dist/{canvas-controller-851afae4.js.map → canvas-controller-40beba7d.js.map} +1 -1
  5. package/dist/{canvas-controller-b856cfa3.js → canvas-controller-f62a8ef7.js} +2 -2
  6. package/dist/{canvas-controller-b856cfa3.js.map → canvas-controller-f62a8ef7.js.map} +1 -1
  7. package/dist/common-canvas-f0f1afd7.js +2 -0
  8. package/dist/common-canvas-f0f1afd7.js.map +1 -0
  9. package/dist/common-canvas-feb8cd7a.js +2 -0
  10. package/dist/common-canvas-feb8cd7a.js.map +1 -0
  11. package/dist/common-canvas.es.js +1 -1
  12. package/dist/common-canvas.js +1 -1
  13. package/dist/common-properties-1d4c875b.js +2 -0
  14. package/dist/common-properties-1d4c875b.js.map +1 -0
  15. package/dist/common-properties-da3999f5.js +2 -0
  16. package/dist/common-properties-da3999f5.js.map +1 -0
  17. package/dist/datarecord-metadata-v3-schema-6b6384ff.js.map +1 -1
  18. package/dist/datarecord-metadata-v3-schema-81228a9a.js.map +1 -1
  19. package/dist/en-8647c347.js.map +1 -1
  20. package/dist/{extends-cf86ca1c.js → extends-1139e06f.js} +2 -2
  21. package/dist/{extends-cf86ca1c.js.map → extends-1139e06f.js.map} +1 -1
  22. package/dist/extends-8d17c85c.js +7 -0
  23. package/dist/extends-8d17c85c.js.map +1 -0
  24. package/dist/{flexible-table-f0c164d2.js → flexible-table-b31e92b8.js} +2 -2
  25. package/dist/flexible-table-b31e92b8.js.map +1 -0
  26. package/dist/{flexible-table-d4a68ebb.js → flexible-table-f88dfef1.js} +2 -2
  27. package/dist/flexible-table-f88dfef1.js.map +1 -0
  28. package/dist/getPrototypeOf-a1c3fe64.js +2 -0
  29. package/dist/getPrototypeOf-a1c3fe64.js.map +1 -0
  30. package/dist/getPrototypeOf-bf88242f.js +2 -0
  31. package/dist/getPrototypeOf-bf88242f.js.map +1 -0
  32. package/dist/{icon-c85b53bd.js → icon-4882a57f.js} +2 -2
  33. package/dist/{icon-c85b53bd.js.map → icon-4882a57f.js.map} +1 -1
  34. package/dist/{icon-caf4caca.js → icon-918d2dd3.js} +2 -2
  35. package/dist/{icon-caf4caca.js.map → icon-918d2dd3.js.map} +1 -1
  36. package/dist/{index-fb90b885.js → index-b6f098b8.js} +2 -2
  37. package/dist/{index-fb90b885.js.map → index-b6f098b8.js.map} +1 -1
  38. package/dist/{index-beefcd21.js → index-f44d40bc.js} +2 -2
  39. package/dist/{index-beefcd21.js.map → index-f44d40bc.js.map} +1 -1
  40. package/dist/isArrayLikeObject-a9c7973b.js.map +1 -1
  41. package/dist/isArrayLikeObject-f3b27f64.js.map +1 -1
  42. package/dist/lib/canvas-controller.es.js +1 -1
  43. package/dist/lib/canvas-controller.js +1 -1
  44. package/dist/lib/canvas.es.js +1 -1
  45. package/dist/lib/canvas.js +1 -1
  46. package/dist/lib/context-menu.es.js +1 -1
  47. package/dist/lib/context-menu.js +1 -1
  48. package/dist/lib/properties/field-picker.es.js +1 -1
  49. package/dist/lib/properties/field-picker.js +1 -1
  50. package/dist/lib/properties/flexible-table.es.js +1 -1
  51. package/dist/lib/properties/flexible-table.js +1 -1
  52. package/dist/lib/properties.es.js +1 -1
  53. package/dist/lib/properties.js +1 -1
  54. package/dist/lib/tooltip.es.js +1 -1
  55. package/dist/lib/tooltip.es.js.map +1 -1
  56. package/dist/lib/tooltip.js +1 -1
  57. package/dist/lib/tooltip.js.map +1 -1
  58. package/dist/styles/common-canvas.min.css +1 -1
  59. package/dist/styles/common-canvas.min.css.map +1 -1
  60. package/dist/{toolbar-a5ec3435.js → toolbar-2baadd0f.js} +2 -2
  61. package/dist/{toolbar-a5ec3435.js.map → toolbar-2baadd0f.js.map} +1 -1
  62. package/dist/{toolbar-cca1d9a9.js → toolbar-d07d4d8a.js} +2 -2
  63. package/dist/{toolbar-cca1d9a9.js.map → toolbar-d07d4d8a.js.map} +1 -1
  64. package/locales/command-actions/locales/de.json +50 -8
  65. package/locales/command-actions/locales/en.json +1 -1
  66. package/locales/command-actions/locales/es.json +50 -8
  67. package/locales/command-actions/locales/fr.json +50 -8
  68. package/locales/command-actions/locales/index.js +2 -2
  69. package/locales/command-actions/locales/it.json +50 -8
  70. package/locales/command-actions/locales/ja.json +50 -8
  71. package/locales/command-actions/locales/ko.json +42 -0
  72. package/locales/command-actions/locales/pt-br.json +50 -8
  73. package/locales/command-actions/locales/zh-CN.json +51 -0
  74. package/locales/command-actions/locales/zh-TW.json +51 -0
  75. package/locales/common-canvas/locales/de.json +36 -26
  76. package/locales/common-canvas/locales/en.json +1 -1
  77. package/locales/common-canvas/locales/es.json +36 -26
  78. package/locales/common-canvas/locales/fr.json +36 -26
  79. package/locales/common-canvas/locales/index.js +2 -2
  80. package/locales/common-canvas/locales/it.json +36 -26
  81. package/locales/common-canvas/locales/ja.json +36 -26
  82. package/locales/common-canvas/locales/ko.json +7 -2
  83. package/locales/common-canvas/locales/pt-br.json +36 -26
  84. package/locales/common-canvas/locales/zh-CN.json +37 -0
  85. package/locales/common-canvas/locales/zh-TW.json +37 -0
  86. package/locales/common-properties/locales/de.json +92 -92
  87. package/locales/common-properties/locales/en.json +1 -1
  88. package/locales/common-properties/locales/es.json +92 -92
  89. package/locales/common-properties/locales/fr.json +92 -92
  90. package/locales/common-properties/locales/index.js +2 -2
  91. package/locales/common-properties/locales/it.json +92 -92
  92. package/locales/common-properties/locales/ja.json +92 -92
  93. package/locales/common-properties/locales/ko.json +1 -1
  94. package/locales/common-properties/locales/pt-br.json +92 -92
  95. package/locales/common-properties/locales/zh-CN.json +93 -0
  96. package/locales/common-properties/locales/zh-TW.json +93 -0
  97. package/locales/palette/locales/de.json +9 -9
  98. package/locales/palette/locales/en.json +6 -6
  99. package/locales/palette/locales/es.json +9 -9
  100. package/locales/palette/locales/fr.json +9 -9
  101. package/locales/palette/locales/index.js +2 -2
  102. package/locales/palette/locales/it.json +9 -9
  103. package/locales/palette/locales/ja.json +9 -9
  104. package/locales/palette/locales/pt-br.json +9 -9
  105. package/locales/palette/locales/zh-CN.json +10 -0
  106. package/locales/palette/locales/zh-TW.json +10 -0
  107. package/locales/toolbar/locales/de.json +7 -7
  108. package/locales/toolbar/locales/en.json +1 -1
  109. package/locales/toolbar/locales/es.json +7 -7
  110. package/locales/toolbar/locales/fr.json +7 -7
  111. package/locales/toolbar/locales/index.js +2 -2
  112. package/locales/toolbar/locales/it.json +7 -7
  113. package/locales/toolbar/locales/ja.json +7 -7
  114. package/locales/toolbar/locales/pt-br.json +7 -7
  115. package/locales/toolbar/locales/zh-CN.json +8 -0
  116. package/locales/toolbar/locales/zh-TW.json +8 -0
  117. package/package.json +2 -2
  118. package/src/command-actions/sizeAndPositionObjectsAction.js +4 -4
  119. package/src/common-canvas/canvas-controller.js +6 -6
  120. package/src/common-canvas/cc-contents.jsx +0 -3
  121. package/src/common-canvas/common-canvas.scss +4 -2
  122. package/src/common-canvas/svg-canvas-renderer.js +69 -62
  123. package/src/common-properties/components/flexible-table/flexible-table.jsx +14 -3
  124. package/src/common-properties/components/flexible-table/flexible-table.scss +20 -0
  125. package/src/common-properties/controls/abstract-table.jsx +2 -0
  126. package/src/common-properties/controls/expression/expression-builder/expression-builder.jsx +6 -5
  127. package/src/common-properties/controls/expression/expression.jsx +9 -3
  128. package/src/common-properties/controls/list/list.jsx +1 -0
  129. package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +1 -0
  130. package/src/common-properties/controls/someofselect/someofselect.jsx +1 -0
  131. package/src/common-properties/form/EditorForm.js +21 -3
  132. package/src/common-properties/panels/action-panel/action-panel.jsx +38 -3
  133. package/src/common-properties/panels/action-panel/action-panel.scss +3 -0
  134. package/src/common-properties/panels/text-panel/text-panel.jsx +38 -7
  135. package/src/common-properties/panels/text-panel/text-panel.scss +4 -3
  136. package/src/common-properties/properties-controller.js +16 -2
  137. package/src/common-properties/ui-conditions/conditions-utils.js +14 -8
  138. package/src/palette/palette-content-list-item.jsx +12 -2
  139. package/src/palette/palette-content-list.jsx +11 -19
  140. package/src/palette/palette-dialog-content-grid.jsx +1 -6
  141. package/src/palette/palette-dialog-content.jsx +13 -11
  142. package/src/palette/palette-flyout-content-category.jsx +26 -24
  143. package/src/palette/palette-flyout-content.jsx +4 -24
  144. package/src/palette/palette.scss +71 -43
  145. package/src/tooltip/tooltip.jsx +1 -1
  146. package/stats.html +1 -1
  147. package/dist/common-canvas-65512584.js +0 -2
  148. package/dist/common-canvas-65512584.js.map +0 -1
  149. package/dist/common-canvas-a2d6b5af.js +0 -2
  150. package/dist/common-canvas-a2d6b5af.js.map +0 -1
  151. package/dist/common-properties-8727d6f9.js +0 -2
  152. package/dist/common-properties-8727d6f9.js.map +0 -1
  153. package/dist/common-properties-87fef545.js +0 -2
  154. package/dist/common-properties-87fef545.js.map +0 -1
  155. package/dist/extends-e9462902.js +0 -7
  156. package/dist/extends-e9462902.js.map +0 -1
  157. package/dist/flexible-table-d4a68ebb.js.map +0 -1
  158. package/dist/flexible-table-f0c164d2.js.map +0 -1
  159. package/dist/getPrototypeOf-0bf77a9e.js +0 -2
  160. package/dist/getPrototypeOf-0bf77a9e.js.map +0 -1
  161. package/dist/getPrototypeOf-97272efe.js +0 -2
  162. package/dist/getPrototypeOf-97272efe.js.map +0 -1
  163. package/locales/command-actions/locales/zh-cn.json +0 -9
  164. package/locales/command-actions/locales/zh-tw.json +0 -9
  165. package/locales/common-canvas/locales/zh-cn.json +0 -27
  166. package/locales/common-canvas/locales/zh-tw.json +0 -27
  167. package/locales/common-properties/locales/zh-cn.json +0 -93
  168. package/locales/common-properties/locales/zh-tw.json +0 -93
  169. package/locales/palette/locales/zh-cn.json +0 -10
  170. package/locales/palette/locales/zh-tw.json +0 -10
  171. package/locales/toolbar/locales/zh-cn.json +0 -8
  172. package/locales/toolbar/locales/zh-tw.json +0 -8
@@ -1,2 +1,2 @@
1
- import"../createClass-32a0cf0f.js";import"../isArrayLikeObject-a9c7973b.js";export{C as default}from"../canvas-controller-b856cfa3.js";import"./command-stack.es.js";import"../canvas-constants-3c09c7f6.js";import"../canvas-logger-815781bb.js";import"../getPrototypeOf-97272efe.js";import"../datarecord-metadata-v3-schema-81228a9a.js";import"../en-8647c347.js";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";import"immutable";
1
+ import"../createClass-32a0cf0f.js";import"../isArrayLikeObject-a9c7973b.js";export{C as default}from"../canvas-controller-f62a8ef7.js";import"./command-stack.es.js";import"../canvas-constants-3c09c7f6.js";import"../canvas-logger-815781bb.js";import"../getPrototypeOf-a1c3fe64.js";import"../datarecord-metadata-v3-schema-81228a9a.js";import"../en-8647c347.js";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";import"immutable";
2
2
  //# sourceMappingURL=canvas-controller.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";require("../createClass-6db89a23.js"),require("../isArrayLikeObject-f3b27f64.js");var e=require("../canvas-controller-851afae4.js");require("./command-stack.js"),require("../canvas-constants-34cdb7df.js"),require("../canvas-logger-a0f1beaa.js"),require("../getPrototypeOf-0bf77a9e.js"),require("../datarecord-metadata-v3-schema-6b6384ff.js"),require("../en-7a0f1db1.js"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),require("immutable"),module.exports=e.CanvasController;
1
+ "use strict";require("../createClass-6db89a23.js"),require("../isArrayLikeObject-f3b27f64.js");var e=require("../canvas-controller-40beba7d.js");require("./command-stack.js"),require("../canvas-constants-34cdb7df.js"),require("../canvas-logger-a0f1beaa.js"),require("../getPrototypeOf-bf88242f.js"),require("../datarecord-metadata-v3-schema-6b6384ff.js"),require("../en-7a0f1db1.js"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),require("immutable"),module.exports=e.CanvasController;
2
2
  //# sourceMappingURL=canvas-controller.js.map
@@ -1,2 +1,2 @@
1
- export{c as CommonCanvas}from"../common-canvas-65512584.js";export{C as CanvasController}from"../canvas-controller-b856cfa3.js";import"../createClass-32a0cf0f.js";import"../getPrototypeOf-97272efe.js";import"react";import"react-redux";import"react-intl";import"../isArrayLikeObject-a9c7973b.js";import"../icon-caf4caca.js";import"../extends-cf86ca1c.js";import"react-inlinesvg";import"@carbon/icons-react";import"../canvas-constants-3c09c7f6.js";import"../toolbar-a5ec3435.js";import"../datarecord-metadata-v3-schema-81228a9a.js";import"../en-8647c347.js";import"react-resize-detector";import"./tooltip.es.js";import"react-portal";import"carbon-components-react";import"../canvas-logger-815781bb.js";import"./context-menu.es.js";import"react-contextmenu";import"../_baseForOwn-d38b560e.js";import"./command-stack.es.js";import"immutable";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";
1
+ export{c as CommonCanvas}from"../common-canvas-feb8cd7a.js";export{C as CanvasController}from"../canvas-controller-f62a8ef7.js";import"../createClass-32a0cf0f.js";import"../getPrototypeOf-a1c3fe64.js";import"react";import"react-redux";import"react-intl";import"../isArrayLikeObject-a9c7973b.js";import"../icon-918d2dd3.js";import"../extends-1139e06f.js";import"react-inlinesvg";import"@carbon/icons-react";import"../canvas-constants-3c09c7f6.js";import"../toolbar-2baadd0f.js";import"../datarecord-metadata-v3-schema-81228a9a.js";import"../en-8647c347.js";import"react-resize-detector";import"./tooltip.es.js";import"react-portal";import"carbon-components-react";import"../canvas-logger-815781bb.js";import"./context-menu.es.js";import"react-contextmenu";import"../_baseForOwn-d38b560e.js";import"./command-stack.es.js";import"immutable";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";
2
2
  //# sourceMappingURL=canvas.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-canvas-a2d6b5af.js"),r=require("../canvas-controller-851afae4.js");require("../createClass-6db89a23.js"),require("../getPrototypeOf-0bf77a9e.js"),require("react"),require("react-redux"),require("react-intl"),require("../isArrayLikeObject-f3b27f64.js"),require("../icon-c85b53bd.js"),require("../extends-e9462902.js"),require("react-inlinesvg"),require("@carbon/icons-react"),require("../canvas-constants-34cdb7df.js"),require("../toolbar-cca1d9a9.js"),require("../datarecord-metadata-v3-schema-6b6384ff.js"),require("../en-7a0f1db1.js"),require("react-resize-detector"),require("./tooltip.js"),require("react-portal"),require("carbon-components-react"),require("../canvas-logger-a0f1beaa.js"),require("./context-menu.js"),require("react-contextmenu"),require("../_baseForOwn-7d4e8506.js"),require("./command-stack.js"),require("immutable"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),exports.CommonCanvas=e.commonCanvas,exports.CanvasController=r.CanvasController;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-canvas-f0f1afd7.js"),r=require("../canvas-controller-40beba7d.js");require("../createClass-6db89a23.js"),require("../getPrototypeOf-bf88242f.js"),require("react"),require("react-redux"),require("react-intl"),require("../isArrayLikeObject-f3b27f64.js"),require("../icon-4882a57f.js"),require("../extends-8d17c85c.js"),require("react-inlinesvg"),require("@carbon/icons-react"),require("../canvas-constants-34cdb7df.js"),require("../toolbar-d07d4d8a.js"),require("../datarecord-metadata-v3-schema-6b6384ff.js"),require("../en-7a0f1db1.js"),require("react-resize-detector"),require("./tooltip.js"),require("react-portal"),require("carbon-components-react"),require("../canvas-logger-a0f1beaa.js"),require("./context-menu.js"),require("react-contextmenu"),require("../_baseForOwn-7d4e8506.js"),require("./command-stack.js"),require("immutable"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),exports.CommonCanvas=e.commonCanvas,exports.CanvasController=r.CanvasController;
2
2
  //# sourceMappingURL=canvas.js.map
@@ -1,2 +1,2 @@
1
- import{_ as e,a as t}from"../createClass-32a0cf0f.js";import{_ as n,a as o,b as c,c as r}from"../getPrototypeOf-97272efe.js";import i from"react";import{_ as a,C as l}from"../canvas-constants-3c09c7f6.js";import{_ as u}from"../extends-cf86ca1c.js";import{MenuItem as s,SubMenu as d}from"react-contextmenu";import{I as m}from"../icon-caf4caca.js";import{L as f}from"../canvas-logger-815781bb.js";import"react-inlinesvg";import"@carbon/icons-react";function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}var h=function(o){n(a,o);var c=p(a);function a(t){var n;return e(this,a),(n=c.call(this,t)).logger=new f("CC-ContextMenu"),n.onClick=n.onClick.bind(r(n)),n}return t(a,[{key:"onClick",value:function(e){var t=e.target.dataset.color;this.props.clickActionHandler(t)}},{key:"render",value:function(){return this.logger.log("render"),i.createElement("div",{className:"color-picker-panel",onClick:this.onClick},i.createElement("div",{tabIndex:"0","data-color":"bkg-col-white-0",className:"color-picker-item white-0"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-yellow-20",className:"color-picker-item yellow-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-20",className:"color-picker-item gray-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-20",className:"color-picker-item green-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-20",className:"color-picker-item teal-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-20",className:"color-picker-item cyan-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-red-50",className:"color-picker-item red-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-orange-40",className:"color-picker-item orange-40"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-50",className:"color-picker-item gray-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-50",className:"color-picker-item green-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-50",className:"color-picker-item teal-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-50",className:"color-picker-item cyan-50"}))}}]),a}(i.Component);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}var k=function(o){n(f,o);var c=v(f);function f(t){var n;return e(this,f),(n=c.call(this,t)).state={},n.itemSelected=n.itemSelected.bind(r(n)),n.colorClicked=n.colorClicked.bind(r(n)),n}return t(f,[{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"itemSelected",value:function(e,t){this.props.contextHandler(e),t&&t.stopPropagation()}},{key:"colorClicked",value:function(e){this.props.contextHandler("colorSelectedObjects",{color:e})}},{key:"calculateMenuSize",value:function(e){for(var t=0,n=0;n<e.length;++n){e[n].divider&&t++}return{height:30*(e.length-t)+1*t,width:160}}},{key:"calculateMenuPos",value:function(e,t,n){var o={x:e.x,y:e.y};return e.y+t.height>n.height&&(o.y=n.height-t.height-5,o.y<0&&(o.y=0)),e.x+t.width>n.width&&(o.x-=t.width),o}},{key:"areAllSubmenuItemsDisabled",value:function(e){var t=0,n=0;return e.forEach((function(e){e.divider||t++,!1===e.enable&&n++})),n===t}},{key:"buildMenu",value:function(e,t,n,o){for(var c={className:"contextmenu-divider"},r=[],a=0,l=!1,d=0;d<e.length;++d){var m=e[d].divider,f=e[d].submenu;if(m)l||(r.push(i.createElement(s,{attributes:c,key:d+1,onClick:function(){},divider:!0})),a+=1,l=!0);else if(f)if(l=!1,"colorPicker"===e[d].menu){var p={width:160,height:50},h=this.buildColorPickerPanel(),v=this.buildSubMenu(e,d,h,a,n,t,p,o,!1);r.push(v),a+=30}else{var k={disabled:this.areAllSubmenuItemsDisabled(e[d].menu)},b=this.calculateMenuSize(e[d].menu),y=this.buildMenu(e[d].menu,t,n,o),g=this.buildSubMenu(e,d,y,a,n,t,b,o,k);r.push(g),a+=30}else{l=!1;var x={disabled:!1===e[d].enable};r.push(i.createElement(s,u({onClick:this.itemSelected.bind(null,e[d].action),key:d+1},x),e[d].label)),a+=30}}return r}},{key:"buildColorPickerPanel",value:function(){return i.createElement(h,a({clickActionHandler:this.colorPickHandler},"clickActionHandler",this.colorClicked))}},{key:"buildSubMenu",value:function(e,t,n,o,c,r,a,s,f){var p=this.buildRtlState(c,r,a,s),h=this.buildSubMenuPosStyle(o,c,a,s),v=i.createElement(m,{type:l.CHEVRONARROWS.RIGHT,disabled:!1,className:"react-contextmenu-submenu-icon"}),k=i.createElement("div",null,e[t].label,v," ");return i.createElement(d,u({title:k,key:t+1,className:"contextmenu-submenu",rtl:p},f),i.createElement("div",{key:t+1,style:h,className:"context-menu-popover"},n))}},{key:"buildRtlState",value:function(e,t,n,o){return e.x+t.width+n.width>o.right}},{key:"buildSubMenuPosStyle",value:function(e,t,n,o){var c=o.bottom-(t.y+e+n.height);return{top:(c>0?0:c-5)+"px"}}},{key:"render",value:function(){var e=this.calculateMenuSize(this.props.menuDefinition),t=this.calculateMenuPos(this.props.mousePos,e,this.props.canvasRect),n={left:t.x+"px",top:t.y+"px"},o=this.buildMenu(this.props.menuDefinition,e,t,this.props.canvasRect);return i.createElement("div",{id:"context-menu-popover",className:"context-menu-popover",style:n,onContextMenu:this.onContextMenu},o)}}]),f}(i.Component);function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}var y=function(o){n(a,o);var c=b(a);function a(t){var n;return e(this,a),(n=c.call(this,t)).state={},n.contextMenuClicked=n.contextMenuClicked.bind(r(n)),n.handleClickOutside=n.handleClickOutside.bind(r(n)),n}return t(a,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"getCanvasRect",value:function(){var e=document.getElementById(this.props.containingDivId).getBoundingClientRect();return{top:0,bottom:e.bottom-e.top,left:0,right:e.right-e.left,height:e.height,width:e.width}}},{key:"handleClickOutside",value:function(e){if(2===e.button||e.ctrlKey)e.stopPropagation();else{var t=document.getElementById("context-menu-popover");t&&!t.contains(e.target)&&(this.props.stopPropagation&&e.stopPropagation(),this.props.closeContextMenu())}}},{key:"contextMenuClicked",value:function(e,t){this.props.contextMenuActionHandler(e,t)}},{key:"render",value:function(){return i.createElement(k,{contextHandler:this.contextMenuClicked,menuDefinition:this.props.contextMenuDef,canvasRect:this.getCanvasRect(),mousePos:this.props.contextMenuPos})}}]),a}(i.Component);export{y as default};
1
+ import{_ as e,a as t}from"../createClass-32a0cf0f.js";import{_ as n,a as o,b as c,c as r}from"../getPrototypeOf-a1c3fe64.js";import i from"react";import{_ as a,C as l}from"../canvas-constants-3c09c7f6.js";import{_ as u}from"../extends-1139e06f.js";import{MenuItem as s,SubMenu as d}from"react-contextmenu";import{I as m}from"../icon-918d2dd3.js";import{L as f}from"../canvas-logger-815781bb.js";import"react-inlinesvg";import"@carbon/icons-react";function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}var h=function(o){n(a,o);var c=p(a);function a(t){var n;return e(this,a),(n=c.call(this,t)).logger=new f("CC-ContextMenu"),n.onClick=n.onClick.bind(r(n)),n}return t(a,[{key:"onClick",value:function(e){var t=e.target.dataset.color;this.props.clickActionHandler(t)}},{key:"render",value:function(){return this.logger.log("render"),i.createElement("div",{className:"color-picker-panel",onClick:this.onClick},i.createElement("div",{tabIndex:"0","data-color":"bkg-col-white-0",className:"color-picker-item white-0"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-yellow-20",className:"color-picker-item yellow-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-20",className:"color-picker-item gray-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-20",className:"color-picker-item green-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-20",className:"color-picker-item teal-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-20",className:"color-picker-item cyan-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-red-50",className:"color-picker-item red-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-orange-40",className:"color-picker-item orange-40"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-50",className:"color-picker-item gray-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-50",className:"color-picker-item green-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-50",className:"color-picker-item teal-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-50",className:"color-picker-item cyan-50"}))}}]),a}(i.Component);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}var k=function(o){n(f,o);var c=v(f);function f(t){var n;return e(this,f),(n=c.call(this,t)).state={},n.itemSelected=n.itemSelected.bind(r(n)),n.colorClicked=n.colorClicked.bind(r(n)),n}return t(f,[{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"itemSelected",value:function(e,t){this.props.contextHandler(e),t&&t.stopPropagation()}},{key:"colorClicked",value:function(e){this.props.contextHandler("colorSelectedObjects",{color:e})}},{key:"calculateMenuSize",value:function(e){for(var t=0,n=0;n<e.length;++n){e[n].divider&&t++}return{height:30*(e.length-t)+1*t,width:160}}},{key:"calculateMenuPos",value:function(e,t,n){var o={x:e.x,y:e.y};return e.y+t.height>n.height&&(o.y=n.height-t.height-5,o.y<0&&(o.y=0)),e.x+t.width>n.width&&(o.x-=t.width),o}},{key:"areAllSubmenuItemsDisabled",value:function(e){var t=0,n=0;return e.forEach((function(e){e.divider||t++,!1===e.enable&&n++})),n===t}},{key:"buildMenu",value:function(e,t,n,o){for(var c={className:"contextmenu-divider"},r=[],a=0,l=!1,d=0;d<e.length;++d){var m=e[d].divider,f=e[d].submenu;if(m)l||(r.push(i.createElement(s,{attributes:c,key:d+1,onClick:function(){},divider:!0})),a+=1,l=!0);else if(f)if(l=!1,"colorPicker"===e[d].menu){var p={width:160,height:50},h=this.buildColorPickerPanel(),v=this.buildSubMenu(e,d,h,a,n,t,p,o,!1);r.push(v),a+=30}else{var k={disabled:this.areAllSubmenuItemsDisabled(e[d].menu)},b=this.calculateMenuSize(e[d].menu),y=this.buildMenu(e[d].menu,t,n,o),g=this.buildSubMenu(e,d,y,a,n,t,b,o,k);r.push(g),a+=30}else{l=!1;var x={disabled:!1===e[d].enable};r.push(i.createElement(s,u({onClick:this.itemSelected.bind(null,e[d].action),key:d+1},x),e[d].label)),a+=30}}return r}},{key:"buildColorPickerPanel",value:function(){return i.createElement(h,a({clickActionHandler:this.colorPickHandler},"clickActionHandler",this.colorClicked))}},{key:"buildSubMenu",value:function(e,t,n,o,c,r,a,s,f){var p=this.buildRtlState(c,r,a,s),h=this.buildSubMenuPosStyle(o,c,a,s),v=i.createElement(m,{type:l.CHEVRONARROWS.RIGHT,disabled:!1,className:"react-contextmenu-submenu-icon"}),k=i.createElement("div",null,e[t].label,v," ");return i.createElement(d,u({title:k,key:t+1,className:"contextmenu-submenu",rtl:p},f),i.createElement("div",{key:t+1,style:h,className:"context-menu-popover"},n))}},{key:"buildRtlState",value:function(e,t,n,o){return e.x+t.width+n.width>o.right}},{key:"buildSubMenuPosStyle",value:function(e,t,n,o){var c=o.bottom-(t.y+e+n.height);return{top:(c>0?0:c-5)+"px"}}},{key:"render",value:function(){var e=this.calculateMenuSize(this.props.menuDefinition),t=this.calculateMenuPos(this.props.mousePos,e,this.props.canvasRect),n={left:t.x+"px",top:t.y+"px"},o=this.buildMenu(this.props.menuDefinition,e,t,this.props.canvasRect);return i.createElement("div",{id:"context-menu-popover",className:"context-menu-popover",style:n,onContextMenu:this.onContextMenu},o)}}]),f}(i.Component);function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}var y=function(o){n(a,o);var c=b(a);function a(t){var n;return e(this,a),(n=c.call(this,t)).state={},n.contextMenuClicked=n.contextMenuClicked.bind(r(n)),n.handleClickOutside=n.handleClickOutside.bind(r(n)),n}return t(a,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"getCanvasRect",value:function(){var e=document.getElementById(this.props.containingDivId).getBoundingClientRect();return{top:0,bottom:e.bottom-e.top,left:0,right:e.right-e.left,height:e.height,width:e.width}}},{key:"handleClickOutside",value:function(e){if(2===e.button||e.ctrlKey)e.stopPropagation();else{var t=document.getElementById("context-menu-popover");t&&!t.contains(e.target)&&(this.props.stopPropagation&&e.stopPropagation(),this.props.closeContextMenu())}}},{key:"contextMenuClicked",value:function(e,t){this.props.contextMenuActionHandler(e,t)}},{key:"render",value:function(){return i.createElement(k,{contextHandler:this.contextMenuClicked,menuDefinition:this.props.contextMenuDef,canvasRect:this.getCanvasRect(),mousePos:this.props.contextMenuPos})}}]),a}(i.Component);export{y as default};
2
2
  //# sourceMappingURL=context-menu.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../createClass-6db89a23.js"),t=require("../getPrototypeOf-0bf77a9e.js"),n=require("react"),r=require("../canvas-constants-34cdb7df.js"),o=require("../extends-e9462902.js"),i=require("react-contextmenu"),c=require("../icon-c85b53bd.js"),l=require("../canvas-logger-a0f1beaa.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("react-inlinesvg"),require("@carbon/icons-react");var u=a(n);function s(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var d=function(n){t._inherits(o,n);var r=s(o);function o(n){var i;return e._classCallCheck(this,o),(i=r.call(this,n)).logger=new l.Logger("CC-ContextMenu"),i.onClick=i.onClick.bind(t._assertThisInitialized(i)),i}return e._createClass(o,[{key:"onClick",value:function(e){var t=e.target.dataset.color;this.props.clickActionHandler(t)}},{key:"render",value:function(){return this.logger.log("render"),u.default.createElement("div",{className:"color-picker-panel",onClick:this.onClick},u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-white-0",className:"color-picker-item white-0"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-yellow-20",className:"color-picker-item yellow-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-20",className:"color-picker-item gray-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-20",className:"color-picker-item green-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-20",className:"color-picker-item teal-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-20",className:"color-picker-item cyan-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-red-50",className:"color-picker-item red-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-orange-40",className:"color-picker-item orange-40"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-50",className:"color-picker-item gray-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-50",className:"color-picker-item green-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-50",className:"color-picker-item teal-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-50",className:"color-picker-item cyan-50"}))}}]),o}(u.default.Component);function f(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var h=function(n){t._inherits(a,n);var l=f(a);function a(n){var r;return e._classCallCheck(this,a),(r=l.call(this,n)).state={},r.itemSelected=r.itemSelected.bind(t._assertThisInitialized(r)),r.colorClicked=r.colorClicked.bind(t._assertThisInitialized(r)),r}return e._createClass(a,[{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"itemSelected",value:function(e,t){this.props.contextHandler(e),t&&t.stopPropagation()}},{key:"colorClicked",value:function(e){this.props.contextHandler("colorSelectedObjects",{color:e})}},{key:"calculateMenuSize",value:function(e){for(var t=0,n=0;n<e.length;++n){e[n].divider&&t++}return{height:30*(e.length-t)+1*t,width:160}}},{key:"calculateMenuPos",value:function(e,t,n){var r={x:e.x,y:e.y};return e.y+t.height>n.height&&(r.y=n.height-t.height-5,r.y<0&&(r.y=0)),e.x+t.width>n.width&&(r.x-=t.width),r}},{key:"areAllSubmenuItemsDisabled",value:function(e){var t=0,n=0;return e.forEach((function(e){e.divider||t++,!1===e.enable&&n++})),n===t}},{key:"buildMenu",value:function(e,t,n,r){for(var c={className:"contextmenu-divider"},l=[],a=0,s=!1,d=0;d<e.length;++d){var f=e[d].divider,h=e[d].submenu;if(f)s||(l.push(u.default.createElement(i.MenuItem,{attributes:c,key:d+1,onClick:function(){},divider:!0})),a+=1,s=!0);else if(h)if(s=!1,"colorPicker"===e[d].menu){var p={width:160,height:50},m=this.buildColorPickerPanel(),v=this.buildSubMenu(e,d,m,a,n,t,p,r,!1);l.push(v),a+=30}else{var k={disabled:this.areAllSubmenuItemsDisabled(e[d].menu)},b=this.calculateMenuSize(e[d].menu),y=this.buildMenu(e[d].menu,t,n,r),g=this.buildSubMenu(e,d,y,a,n,t,b,r,k);l.push(g),a+=30}else{s=!1;var C={disabled:!1===e[d].enable};l.push(u.default.createElement(i.MenuItem,o._extends({onClick:this.itemSelected.bind(null,e[d].action),key:d+1},C),e[d].label)),a+=30}}return l}},{key:"buildColorPickerPanel",value:function(){return u.default.createElement(d,r._defineProperty({clickActionHandler:this.colorPickHandler},"clickActionHandler",this.colorClicked))}},{key:"buildSubMenu",value:function(e,t,n,l,a,s,d,f,h){var p=this.buildRtlState(a,s,d,f),m=this.buildSubMenuPosStyle(l,a,d,f),v=u.default.createElement(c.Icon,{type:r.CONTEXT_MENU_CARBON_ICONS.CHEVRONARROWS.RIGHT,disabled:!1,className:"react-contextmenu-submenu-icon"}),k=u.default.createElement("div",null,e[t].label,v," ");return u.default.createElement(i.SubMenu,o._extends({title:k,key:t+1,className:"contextmenu-submenu",rtl:p},h),u.default.createElement("div",{key:t+1,style:m,className:"context-menu-popover"},n))}},{key:"buildRtlState",value:function(e,t,n,r){return e.x+t.width+n.width>r.right}},{key:"buildSubMenuPosStyle",value:function(e,t,n,r){var o=r.bottom-(t.y+e+n.height);return{top:(o>0?0:o-5)+"px"}}},{key:"render",value:function(){var e=this.calculateMenuSize(this.props.menuDefinition),t=this.calculateMenuPos(this.props.mousePos,e,this.props.canvasRect),n={left:t.x+"px",top:t.y+"px"},r=this.buildMenu(this.props.menuDefinition,e,t,this.props.canvasRect);return u.default.createElement("div",{id:"context-menu-popover",className:"context-menu-popover",style:n,onContextMenu:this.onContextMenu},r)}}]),a}(u.default.Component);function p(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var m=function(n){t._inherits(o,n);var r=p(o);function o(n){var i;return e._classCallCheck(this,o),(i=r.call(this,n)).state={},i.contextMenuClicked=i.contextMenuClicked.bind(t._assertThisInitialized(i)),i.handleClickOutside=i.handleClickOutside.bind(t._assertThisInitialized(i)),i}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"getCanvasRect",value:function(){var e=document.getElementById(this.props.containingDivId).getBoundingClientRect();return{top:0,bottom:e.bottom-e.top,left:0,right:e.right-e.left,height:e.height,width:e.width}}},{key:"handleClickOutside",value:function(e){if(2===e.button||e.ctrlKey)e.stopPropagation();else{var t=document.getElementById("context-menu-popover");t&&!t.contains(e.target)&&(this.props.stopPropagation&&e.stopPropagation(),this.props.closeContextMenu())}}},{key:"contextMenuClicked",value:function(e,t){this.props.contextMenuActionHandler(e,t)}},{key:"render",value:function(){return u.default.createElement(h,{contextHandler:this.contextMenuClicked,menuDefinition:this.props.contextMenuDef,canvasRect:this.getCanvasRect(),mousePos:this.props.contextMenuPos})}}]),o}(u.default.Component);module.exports=m;
1
+ "use strict";var e=require("../createClass-6db89a23.js"),t=require("../getPrototypeOf-bf88242f.js"),n=require("react"),r=require("../canvas-constants-34cdb7df.js"),o=require("../extends-8d17c85c.js"),i=require("react-contextmenu"),c=require("../icon-4882a57f.js"),l=require("../canvas-logger-a0f1beaa.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("react-inlinesvg"),require("@carbon/icons-react");var u=a(n);function s(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var d=function(n){t._inherits(o,n);var r=s(o);function o(n){var i;return e._classCallCheck(this,o),(i=r.call(this,n)).logger=new l.Logger("CC-ContextMenu"),i.onClick=i.onClick.bind(t._assertThisInitialized(i)),i}return e._createClass(o,[{key:"onClick",value:function(e){var t=e.target.dataset.color;this.props.clickActionHandler(t)}},{key:"render",value:function(){return this.logger.log("render"),u.default.createElement("div",{className:"color-picker-panel",onClick:this.onClick},u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-white-0",className:"color-picker-item white-0"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-yellow-20",className:"color-picker-item yellow-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-20",className:"color-picker-item gray-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-20",className:"color-picker-item green-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-20",className:"color-picker-item teal-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-20",className:"color-picker-item cyan-20"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-red-50",className:"color-picker-item red-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-orange-40",className:"color-picker-item orange-40"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-50",className:"color-picker-item gray-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-50",className:"color-picker-item green-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-50",className:"color-picker-item teal-50"}),u.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-50",className:"color-picker-item cyan-50"}))}}]),o}(u.default.Component);function f(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var h=function(n){t._inherits(a,n);var l=f(a);function a(n){var r;return e._classCallCheck(this,a),(r=l.call(this,n)).state={},r.itemSelected=r.itemSelected.bind(t._assertThisInitialized(r)),r.colorClicked=r.colorClicked.bind(t._assertThisInitialized(r)),r}return e._createClass(a,[{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"itemSelected",value:function(e,t){this.props.contextHandler(e),t&&t.stopPropagation()}},{key:"colorClicked",value:function(e){this.props.contextHandler("colorSelectedObjects",{color:e})}},{key:"calculateMenuSize",value:function(e){for(var t=0,n=0;n<e.length;++n){e[n].divider&&t++}return{height:30*(e.length-t)+1*t,width:160}}},{key:"calculateMenuPos",value:function(e,t,n){var r={x:e.x,y:e.y};return e.y+t.height>n.height&&(r.y=n.height-t.height-5,r.y<0&&(r.y=0)),e.x+t.width>n.width&&(r.x-=t.width),r}},{key:"areAllSubmenuItemsDisabled",value:function(e){var t=0,n=0;return e.forEach((function(e){e.divider||t++,!1===e.enable&&n++})),n===t}},{key:"buildMenu",value:function(e,t,n,r){for(var c={className:"contextmenu-divider"},l=[],a=0,s=!1,d=0;d<e.length;++d){var f=e[d].divider,h=e[d].submenu;if(f)s||(l.push(u.default.createElement(i.MenuItem,{attributes:c,key:d+1,onClick:function(){},divider:!0})),a+=1,s=!0);else if(h)if(s=!1,"colorPicker"===e[d].menu){var p={width:160,height:50},m=this.buildColorPickerPanel(),v=this.buildSubMenu(e,d,m,a,n,t,p,r,!1);l.push(v),a+=30}else{var k={disabled:this.areAllSubmenuItemsDisabled(e[d].menu)},b=this.calculateMenuSize(e[d].menu),y=this.buildMenu(e[d].menu,t,n,r),g=this.buildSubMenu(e,d,y,a,n,t,b,r,k);l.push(g),a+=30}else{s=!1;var C={disabled:!1===e[d].enable};l.push(u.default.createElement(i.MenuItem,o._extends({onClick:this.itemSelected.bind(null,e[d].action),key:d+1},C),e[d].label)),a+=30}}return l}},{key:"buildColorPickerPanel",value:function(){return u.default.createElement(d,r._defineProperty({clickActionHandler:this.colorPickHandler},"clickActionHandler",this.colorClicked))}},{key:"buildSubMenu",value:function(e,t,n,l,a,s,d,f,h){var p=this.buildRtlState(a,s,d,f),m=this.buildSubMenuPosStyle(l,a,d,f),v=u.default.createElement(c.Icon,{type:r.CONTEXT_MENU_CARBON_ICONS.CHEVRONARROWS.RIGHT,disabled:!1,className:"react-contextmenu-submenu-icon"}),k=u.default.createElement("div",null,e[t].label,v," ");return u.default.createElement(i.SubMenu,o._extends({title:k,key:t+1,className:"contextmenu-submenu",rtl:p},h),u.default.createElement("div",{key:t+1,style:m,className:"context-menu-popover"},n))}},{key:"buildRtlState",value:function(e,t,n,r){return e.x+t.width+n.width>r.right}},{key:"buildSubMenuPosStyle",value:function(e,t,n,r){var o=r.bottom-(t.y+e+n.height);return{top:(o>0?0:o-5)+"px"}}},{key:"render",value:function(){var e=this.calculateMenuSize(this.props.menuDefinition),t=this.calculateMenuPos(this.props.mousePos,e,this.props.canvasRect),n={left:t.x+"px",top:t.y+"px"},r=this.buildMenu(this.props.menuDefinition,e,t,this.props.canvasRect);return u.default.createElement("div",{id:"context-menu-popover",className:"context-menu-popover",style:n,onContextMenu:this.onContextMenu},r)}}]),a}(u.default.Component);function p(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var m=function(n){t._inherits(o,n);var r=p(o);function o(n){var i;return e._classCallCheck(this,o),(i=r.call(this,n)).state={},i.contextMenuClicked=i.contextMenuClicked.bind(t._assertThisInitialized(i)),i.handleClickOutside=i.handleClickOutside.bind(t._assertThisInitialized(i)),i}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"getCanvasRect",value:function(){var e=document.getElementById(this.props.containingDivId).getBoundingClientRect();return{top:0,bottom:e.bottom-e.top,left:0,right:e.right-e.left,height:e.height,width:e.width}}},{key:"handleClickOutside",value:function(e){if(2===e.button||e.ctrlKey)e.stopPropagation();else{var t=document.getElementById("context-menu-popover");t&&!t.contains(e.target)&&(this.props.stopPropagation&&e.stopPropagation(),this.props.closeContextMenu())}}},{key:"contextMenuClicked",value:function(e,t){this.props.contextMenuActionHandler(e,t)}},{key:"render",value:function(){return u.default.createElement(h,{contextHandler:this.contextMenuClicked,menuDefinition:this.props.contextMenuDef,canvasRect:this.getCanvasRect(),mousePos:this.props.contextMenuPos})}}]),o}(u.default.Component);module.exports=m;
2
2
  //# sourceMappingURL=context-menu.js.map
@@ -1,2 +1,2 @@
1
- export{F as default}from"../../index-beefcd21.js";import"../../createClass-32a0cf0f.js";import"../../getPrototypeOf-97272efe.js";import"../../isArrayLikeObject-a9c7973b.js";import"../../flexible-table-d4a68ebb.js";import"../../extends-cf86ca1c.js";import"react";import"react-intl";import"react-dom";import"carbon-components-react";import"../../_baseForOwn-d38b560e.js";import"react-virtualized";import"react-draggable";import"@carbon/icons-react";import"../tooltip.es.js";import"react-portal";import"uuid";import"react-resize-detector";import"../../canvas-constants-3c09c7f6.js";import"../../en-8647c347.js";import"../../icon-caf4caca.js";import"react-inlinesvg";
1
+ export{F as default}from"../../index-f44d40bc.js";import"../../createClass-32a0cf0f.js";import"../../getPrototypeOf-a1c3fe64.js";import"../../isArrayLikeObject-a9c7973b.js";import"../../flexible-table-f88dfef1.js";import"../../extends-1139e06f.js";import"react";import"react-intl";import"react-dom";import"carbon-components-react";import"../../_baseForOwn-d38b560e.js";import"react-virtualized";import"react-draggable";import"@carbon/icons-react";import"../tooltip.es.js";import"react-portal";import"uuid";import"react-resize-detector";import"../../canvas-constants-3c09c7f6.js";import"../../en-8647c347.js";import"../../icon-918d2dd3.js";import"react-inlinesvg";
2
2
  //# sourceMappingURL=field-picker.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../index-fb90b885.js");require("../../createClass-6db89a23.js"),require("../../getPrototypeOf-0bf77a9e.js"),require("../../isArrayLikeObject-f3b27f64.js"),require("../../flexible-table-f0c164d2.js"),require("../../extends-e9462902.js"),require("react"),require("react-intl"),require("react-dom"),require("carbon-components-react"),require("../../_baseForOwn-7d4e8506.js"),require("react-virtualized"),require("react-draggable"),require("@carbon/icons-react"),require("../tooltip.js"),require("react-portal"),require("uuid"),require("react-resize-detector"),require("../../canvas-constants-34cdb7df.js"),require("../../en-7a0f1db1.js"),require("../../icon-c85b53bd.js"),require("react-inlinesvg"),module.exports=e.FieldPicker;
1
+ "use strict";var e=require("../../index-b6f098b8.js");require("../../createClass-6db89a23.js"),require("../../getPrototypeOf-bf88242f.js"),require("../../isArrayLikeObject-f3b27f64.js"),require("../../flexible-table-b31e92b8.js"),require("../../extends-8d17c85c.js"),require("react"),require("react-intl"),require("react-dom"),require("carbon-components-react"),require("../../_baseForOwn-7d4e8506.js"),require("react-virtualized"),require("react-draggable"),require("@carbon/icons-react"),require("../tooltip.js"),require("react-portal"),require("uuid"),require("react-resize-detector"),require("../../canvas-constants-34cdb7df.js"),require("../../en-7a0f1db1.js"),require("../../icon-4882a57f.js"),require("react-inlinesvg"),module.exports=e.FieldPicker;
2
2
  //# sourceMappingURL=field-picker.js.map
@@ -1,2 +1,2 @@
1
- import{F as t}from"../../flexible-table-d4a68ebb.js";export{F as default}from"../../flexible-table-d4a68ebb.js";import"../../extends-cf86ca1c.js";import"../../getPrototypeOf-97272efe.js";import"../../createClass-32a0cf0f.js";import"../../isArrayLikeObject-a9c7973b.js";import"react";import"react-intl";import"react-dom";import"carbon-components-react";import"../../_baseForOwn-d38b560e.js";import"react-virtualized";import"react-draggable";import"@carbon/icons-react";import"../tooltip.es.js";import"react-portal";import"uuid";import"react-resize-detector";
1
+ import{F as t}from"../../flexible-table-f88dfef1.js";export{F as default}from"../../flexible-table-f88dfef1.js";import"../../extends-1139e06f.js";import"../../getPrototypeOf-a1c3fe64.js";import"../../createClass-32a0cf0f.js";import"../../isArrayLikeObject-a9c7973b.js";import"react";import"react-intl";import"react-dom";import"carbon-components-react";import"../../_baseForOwn-d38b560e.js";import"react-virtualized";import"react-draggable";import"@carbon/icons-react";import"../tooltip.es.js";import"react-portal";import"uuid";import"react-resize-detector";
2
2
  //# sourceMappingURL=flexible-table.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../flexible-table-f0c164d2.js");require("../../extends-e9462902.js"),require("../../getPrototypeOf-0bf77a9e.js"),require("../../createClass-6db89a23.js"),require("../../isArrayLikeObject-f3b27f64.js"),require("react"),require("react-intl"),require("react-dom"),require("carbon-components-react"),require("../../_baseForOwn-7d4e8506.js"),require("react-virtualized"),require("react-draggable"),require("@carbon/icons-react"),require("../tooltip.js"),require("react-portal"),require("uuid"),require("react-resize-detector"),module.exports=e.FlexibleTable;
1
+ "use strict";var e=require("../../flexible-table-b31e92b8.js");require("../../extends-8d17c85c.js"),require("../../getPrototypeOf-bf88242f.js"),require("../../createClass-6db89a23.js"),require("../../isArrayLikeObject-f3b27f64.js"),require("react"),require("react-intl"),require("react-dom"),require("carbon-components-react"),require("../../_baseForOwn-7d4e8506.js"),require("react-virtualized"),require("react-draggable"),require("@carbon/icons-react"),require("../tooltip.js"),require("react-portal"),require("uuid"),require("react-resize-detector"),module.exports=e.FlexibleTable;
2
2
  //# sourceMappingURL=flexible-table.js.map
@@ -1,2 +1,2 @@
1
- export{c as CommonProperties,P as PropertiesController}from"../common-properties-87fef545.js";export{F as FlexibleTable}from"../flexible-table-d4a68ebb.js";export{F as FieldPicker}from"../index-beefcd21.js";import"../createClass-32a0cf0f.js";import"../getPrototypeOf-97272efe.js";import"react";import"../en-8647c347.js";import"../isArrayLikeObject-a9c7973b.js";import"../datarecord-metadata-v3-schema-81228a9a.js";import"carbon-components-react";import"../extends-cf86ca1c.js";import"react-portal";import"react-redux";import"@carbon/icons-react";import"react-dom";import"../icon-caf4caca.js";import"react-inlinesvg";import"../canvas-constants-3c09c7f6.js";import"uuid";import"./tooltip.es.js";import"redux";import"seedrandom";import"./command-stack.es.js";import"immutable";import"react-intl";import"date-fns";import"prop-types";import"../toolbar-a5ec3435.js";import"react-resize-detector";import"react-codemirror2";import"jsonschema";import"../_baseForOwn-d38b560e.js";import"react-virtualized";import"react-draggable";
1
+ export{c as CommonProperties,P as PropertiesController}from"../common-properties-1d4c875b.js";export{F as FlexibleTable}from"../flexible-table-f88dfef1.js";export{F as FieldPicker}from"../index-f44d40bc.js";import"../createClass-32a0cf0f.js";import"../getPrototypeOf-a1c3fe64.js";import"react";import"../en-8647c347.js";import"../isArrayLikeObject-a9c7973b.js";import"../datarecord-metadata-v3-schema-81228a9a.js";import"carbon-components-react";import"../extends-1139e06f.js";import"react-portal";import"react-redux";import"@carbon/icons-react";import"react-dom";import"../icon-918d2dd3.js";import"react-inlinesvg";import"../canvas-constants-3c09c7f6.js";import"uuid";import"./tooltip.es.js";import"redux";import"seedrandom";import"./command-stack.es.js";import"immutable";import"react-intl";import"date-fns";import"prop-types";import"../toolbar-2baadd0f.js";import"react-resize-detector";import"react-codemirror2";import"jsonschema";import"../_baseForOwn-d38b560e.js";import"react-virtualized";import"react-draggable";
2
2
  //# sourceMappingURL=properties.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-properties-8727d6f9.js"),r=require("../flexible-table-f0c164d2.js"),i=require("../index-fb90b885.js");require("../createClass-6db89a23.js"),require("../getPrototypeOf-0bf77a9e.js"),require("react"),require("../en-7a0f1db1.js"),require("../isArrayLikeObject-f3b27f64.js"),require("../datarecord-metadata-v3-schema-6b6384ff.js"),require("carbon-components-react"),require("../extends-e9462902.js"),require("react-portal"),require("react-redux"),require("@carbon/icons-react"),require("react-dom"),require("../icon-c85b53bd.js"),require("react-inlinesvg"),require("../canvas-constants-34cdb7df.js"),require("uuid"),require("./tooltip.js"),require("redux"),require("seedrandom"),require("./command-stack.js"),require("immutable"),require("react-intl"),require("date-fns"),require("prop-types"),require("../toolbar-cca1d9a9.js"),require("react-resize-detector"),require("react-codemirror2"),require("jsonschema"),require("../_baseForOwn-7d4e8506.js"),require("react-virtualized"),require("react-draggable"),exports.CommonProperties=e.commonProperties,exports.PropertiesController=e.PropertiesController,exports.FlexibleTable=r.FlexibleTable,exports.FieldPicker=i.FieldPicker;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-properties-da3999f5.js"),r=require("../flexible-table-b31e92b8.js"),i=require("../index-b6f098b8.js");require("../createClass-6db89a23.js"),require("../getPrototypeOf-bf88242f.js"),require("react"),require("../en-7a0f1db1.js"),require("../isArrayLikeObject-f3b27f64.js"),require("../datarecord-metadata-v3-schema-6b6384ff.js"),require("carbon-components-react"),require("../extends-8d17c85c.js"),require("react-portal"),require("react-redux"),require("@carbon/icons-react"),require("react-dom"),require("../icon-4882a57f.js"),require("react-inlinesvg"),require("../canvas-constants-34cdb7df.js"),require("uuid"),require("./tooltip.js"),require("redux"),require("seedrandom"),require("./command-stack.js"),require("immutable"),require("react-intl"),require("date-fns"),require("prop-types"),require("../toolbar-d07d4d8a.js"),require("react-resize-detector"),require("react-codemirror2"),require("jsonschema"),require("../_baseForOwn-7d4e8506.js"),require("react-virtualized"),require("react-draggable"),exports.CommonProperties=e.commonProperties,exports.PropertiesController=e.PropertiesController,exports.FlexibleTable=r.FlexibleTable,exports.FieldPicker=i.FieldPicker;
2
2
  //# sourceMappingURL=properties.js.map
@@ -1,2 +1,2 @@
1
- import{_ as t,a as e,b as i,c as o,d as l}from"../getPrototypeOf-97272efe.js";import{_ as s,a as n}from"../createClass-32a0cf0f.js";import r from"react";import{Portal as p}from"react-portal";import{Link as h}from"carbon-components-react";function a(t){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var l,s=e(t);if(o){var n=e(this).constructor;l=Reflect.construct(s,arguments,n)}else l=s.apply(this,arguments);return i(this,l)}}var u=function(e){t(u,e);var i=a(u);function u(t){var e;return s(this,u),(e=i.call(this,t)).state={isTooltipVisible:!1},e.pendingTooltip=null,e.hideTooltipOnScrollAndResize=e.hideTooltipOnScrollAndResize.bind(o(e)),e}return n(u,[{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='"+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='"+this.props.id+"-trigger']"))&&e&&this.updateTooltipLayout(e,i,e.getAttribute("direction"))}}}},{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){if(t){var e=t.firstChild&&t.firstChild.scrollWidth?t.firstChild.scrollWidth:0,i=t.offsetWidth,o=e;0===e&&(o=t.scrollWidth);var l=o<=i;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>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:"tooltipLinkOnClick",value:function(t){window.open(t,"_blank","noopener")}},{key:"render",value:function(){var t=this,e=null,i=null;if(this.props.children){i=r.createElement("div",{"data-id":this.props.id+"-trigger",className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!1)},onMouseDown:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(e){return t.toggleTooltipOnClick(e)}:null,onFocus:this.props.showToolTipOnClick?function(){return t.showTooltipWithDelay()}:null,onBlur:this.props.showToolTipOnClick?function(e){null!==e.relatedTarget&&t.setTooltipVisible(!1)}:null,tabIndex:this.props.showToolTipOnClick?0:null,ref:function(e){return t.triggerRef=e}},this.props.children)}"string"==typeof this.props.tip?e=r.createElement("span",{id:"tooltipContainer"},this.props.tip):"object"===l(this.props.tip)&&(e=r.createElement("div",{id:"tooltipContainer"},this.props.tip));var o="common-canvas-tooltip";this.props.className&&(o+=" "+this.props.className);var s=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var n=this.props.tooltipLinkHandler(this.props.link);"object"===l(n)&&n.label&&n.url&&(s=r.createElement(h,{className:"tooltip-link",id:this.props.link.id,onClick:this.tooltipLinkOnClick.bind(this,n.url)},n.label))}return r.createElement("div",{className:"tooltip-container"},i,r.createElement(p,null,r.createElement("div",{"data-id":this.props.id,className:o,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction},r.createElement("svg",{id:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1"},r.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),r.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"})),e,s)))}}]),u}(r.Component);u.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1};export{u as default};
1
+ import{_ as t,a as e,b as i,c as o,d as l}from"../getPrototypeOf-a1c3fe64.js";import{_ as s,a as n}from"../createClass-32a0cf0f.js";import r from"react";import{Portal as p}from"react-portal";import{Link as h}from"carbon-components-react";function a(t){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var l,s=e(t);if(o){var n=e(this).constructor;l=Reflect.construct(s,arguments,n)}else l=s.apply(this,arguments);return i(this,l)}}var u=function(e){t(u,e);var i=a(u);function u(t){var e;return s(this,u),(e=i.call(this,t)).state={isTooltipVisible:!1},e.pendingTooltip=null,e.hideTooltipOnScrollAndResize=e.hideTooltipOnScrollAndResize.bind(o(e)),e}return n(u,[{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='"+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='"+this.props.id+"-trigger']"))&&e&&this.updateTooltipLayout(e,i,e.getAttribute("direction"))}}}},{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){if(t){var e=t.firstChild&&t.firstChild.scrollWidth?t.firstChild.scrollWidth:0,i=t.offsetWidth,o=e;0===e&&(o=t.scrollWidth);var l=o<=i;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:"tooltipLinkOnClick",value:function(t){window.open(t,"_blank","noopener")}},{key:"render",value:function(){var t=this,e=null,i=null;if(this.props.children){i=r.createElement("div",{"data-id":this.props.id+"-trigger",className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!1)},onMouseDown:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(e){return t.toggleTooltipOnClick(e)}:null,onFocus:this.props.showToolTipOnClick?function(){return t.showTooltipWithDelay()}:null,onBlur:this.props.showToolTipOnClick?function(e){null!==e.relatedTarget&&t.setTooltipVisible(!1)}:null,tabIndex:this.props.showToolTipOnClick?0:null,ref:function(e){return t.triggerRef=e}},this.props.children)}"string"==typeof this.props.tip?e=r.createElement("span",{id:"tooltipContainer"},this.props.tip):"object"===l(this.props.tip)&&(e=r.createElement("div",{id:"tooltipContainer"},this.props.tip));var o="common-canvas-tooltip";this.props.className&&(o+=" "+this.props.className);var s=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var n=this.props.tooltipLinkHandler(this.props.link);"object"===l(n)&&n.label&&n.url&&(s=r.createElement(h,{className:"tooltip-link",id:this.props.link.id,onClick:this.tooltipLinkOnClick.bind(this,n.url)},n.label))}return r.createElement("div",{className:"tooltip-container"},i,r.createElement(p,null,r.createElement("div",{"data-id":this.props.id,className:o,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction},r.createElement("svg",{id:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1"},r.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),r.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"})),e,s)))}}]),u}(r.Component);u.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1};export{u as default};
2
2
  //# sourceMappingURL=tooltip.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.es.js","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2022 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\";\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\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\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.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.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\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\tif (elem) {\n\t\t\tconst firstChildWidth = elem.firstChild && elem.firstChild.scrollWidth ? elem.firstChild.scrollWidth : 0;\n\t\t\tconst displayWidth = elem.offsetWidth;\n\t\t\tlet fullWidth = firstChildWidth;\n\t\t\tif (firstChildWidth === 0) {\n\t\t\t\tfullWidth = elem.scrollWidth;\n\t\t\t}\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) > 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\ttooltipLinkOnClick(url) {\n\t\twindow.open(url, \"_blank\", \"noopener\");\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 onFocus = () => this.showTooltipWithDelay();\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Keep tooltip visible when clicked on a link.\n\t\t\t\t// Since link is an anchor tag without \"href\" attribute, it has relatedTarget=null\n\t\t\t\tif (evt.relatedTarget !== null) {\n\t\t\t\t\tthis.setTooltipVisible(false);\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.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\ttabIndex={this.props.showToolTipOnClick ? 0 : 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 id=\"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 id=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\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\tonClick={this.tooltipLinkOnClick.bind(this, linkInformation.url)}\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\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t<Portal>\n\t\t\t\t\t<div data-id={this.props.id} className={tipClass} aria-hidden={!this.state.isTooltipVisible} direction={this.props.direction}>\n\t\t\t\t\t\t<svg id=\"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</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).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\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","props","_classCallCheck","_this","state","isTooltipVisible","pendingTooltip","hideTooltipOnScrollAndResize","bind","window","addEventListener","this","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","document","querySelector","id","tooltipTrigger","updateTooltipLayout","getAttribute","value","currentDirection","newDirection","canDisplayFullText","triggerRef","disable","showToolTipIfTruncated","elem","firstChildWidth","firstChild","scrollWidth","displayWidth","offsetWidth","fullWidth","that","setTimeout","delay","direction","tooltipDirection","viewPortWidth","documentElement","clientWidth","viewPortHeight","clientHeight","triggerLayout","getBoundingClientRect","pointer","pointerLayout","style","left","getStyleValue","top","mousePos","updateLocationBasedOnMousePos","tooltipLeft","width","offsetLeft","right","height","offsetHeight","bottom","tooltipTop","isOutOfBounds","getNewDirection","setAttribute","mouseX","x","mouseY","y","parseFloat","evt","stopPropagation","preventDefault","url","open","tooltipContent","triggerContent","children","React","className","onMouseOver","showToolTipOnClick","_this2","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","relatedTarget","tabIndex","ref","tip","_typeof","tipClass","link","tooltipLinkHandler","linkInformation","label","Link","tooltipLinkOnClick","Portal","viewBox","points","Component","defaultProps"],"mappings":"ypBAwBMA,gCACL,WAAYC,GAAO,MAAA,OAAAC,WAClBC,cAAMF,IACDG,MAAQ,CACZC,kBAAkB,GAGnBF,EAAKG,eAAiB,KACtBH,EAAKI,6BAA+BJ,EAAKI,6BAA6BC,wDAGvE,WACCC,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACrEE,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACjEI,KAAKV,MAAMW,WACdD,KAAKE,mBAAkB,uCAIzB,WACCJ,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACxEE,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACpEI,KAAKL,gBACRS,aAAaJ,KAAKL,iDAIpB,SAAkBU,GAWjB,KATKL,KAAKM,gBAAmBD,GAAWL,KAAKL,kBAC5CS,aAAaJ,KAAKL,gBAClBK,KAAKL,eAAiB,KACtBK,KAAKO,SAAS,CACbb,kBAAkB,KAKhBM,KAAKM,cAAe,CACvB,IAAME,EAAUC,SAASC,cAAc,aAAeV,KAAKV,MAAMqB,GAAK,MAMtE,GALAX,KAAKL,eAAiB,KACtBK,KAAKO,SAAS,CACbb,iBAAkBW,IAGfA,EAAS,CACZ,IAAIO,EAAiB,MAEpBA,EADGZ,KAAKV,MAAMW,UACGD,KAAKV,MAAMW,UAEXQ,SAASC,cAAc,aAAeV,KAAKV,MAAMqB,GAAK,gBAElDH,GACrBR,KAAKa,oBAAoBL,EAASI,EAAgBJ,EAAQM,aAAa,6CAM3E,SAAcC,GACb,OAAOA,EAAQ,oCAGhB,SAAgBC,GACf,IAAIC,EACJ,OAAQD,GACR,IAAK,MACJC,EAAe,SACf,MACD,IAAK,SACJA,EAAe,MACf,MAC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W,wBACX1F,KAAKV,MAAMoF,YACdgB,GAAY,IAAM1F,KAAKV,MAAMoF,WAG9B,IAAIiB,EAAO,KACX,GAAI3F,KAAKP,MAAMC,kBAAoBM,KAAKV,MAAMsG,oBAAsB5F,KAAKV,MAAMqG,KAAM,CACpF,IAAME,EAAkB7F,KAAKV,MAAMsG,mBAAmB5F,KAAKV,MAAMqG,MAElC,WAA3BF,EAAOI,IAAgCA,EAAgBC,OAASD,EAAgBzB,MACnFuB,EAAQlB,gBAACsB,GACRrB,UAAU,eACV/D,GAAIX,KAAKV,MAAMqG,KAAKhF,GACpBqE,QAAShF,KAAKgG,mBAAmBnG,KAAKG,KAAM6F,EAAgBzB,MAE3DyB,EAAgBC,QAKpB,OACCrB,uBAAKC,UAAU,qBACbH,EACDE,gBAACwB,OACAxB,uBAAK,UAASzE,KAAKV,MAAMqB,GAAI+D,UAAWgB,EAAU,eAAc1F,KAAKP,MAAMC,iBAAkBsC,UAAWhC,KAAKV,MAAM0C,WAClHyC,uBAAK9D,GAAG,WAAWkD,EAAE,MAAME,EAAE,MAAMmC,QAAQ,gBAC1CzB,4BAAU0B,OAAO,6BACjB1B,2BAAS0B,OAAO,mDAEhB7B,EACAqB,YApYelB,EAAM2B,WA4Z5B/G,EAAQgH,aAAe,CACtBtE,MAAO,IACPC,UAAW,SACXX,wBAAwB,EACxBuD,oBAAoB"}
1
+ {"version":3,"file":"tooltip.es.js","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2022 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\";\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\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\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.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.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\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\tif (elem) {\n\t\t\tconst firstChildWidth = elem.firstChild && elem.firstChild.scrollWidth ? elem.firstChild.scrollWidth : 0;\n\t\t\tconst displayWidth = elem.offsetWidth;\n\t\t\tlet fullWidth = firstChildWidth;\n\t\t\tif (firstChildWidth === 0) {\n\t\t\t\tfullWidth = elem.scrollWidth;\n\t\t\t}\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\ttooltipLinkOnClick(url) {\n\t\twindow.open(url, \"_blank\", \"noopener\");\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 onFocus = () => this.showTooltipWithDelay();\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Keep tooltip visible when clicked on a link.\n\t\t\t\t// Since link is an anchor tag without \"href\" attribute, it has relatedTarget=null\n\t\t\t\tif (evt.relatedTarget !== null) {\n\t\t\t\t\tthis.setTooltipVisible(false);\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.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\ttabIndex={this.props.showToolTipOnClick ? 0 : 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 id=\"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 id=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\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\tonClick={this.tooltipLinkOnClick.bind(this, linkInformation.url)}\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\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t<Portal>\n\t\t\t\t\t<div data-id={this.props.id} className={tipClass} aria-hidden={!this.state.isTooltipVisible} direction={this.props.direction}>\n\t\t\t\t\t\t<svg id=\"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</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).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\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","props","_classCallCheck","_this","state","isTooltipVisible","pendingTooltip","hideTooltipOnScrollAndResize","bind","window","addEventListener","this","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","document","querySelector","id","tooltipTrigger","updateTooltipLayout","getAttribute","value","currentDirection","newDirection","canDisplayFullText","triggerRef","disable","showToolTipIfTruncated","elem","firstChildWidth","firstChild","scrollWidth","displayWidth","offsetWidth","fullWidth","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","evt","stopPropagation","preventDefault","url","open","tooltipContent","triggerContent","children","React","className","onMouseOver","showToolTipOnClick","_this2","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","relatedTarget","tabIndex","ref","tip","_typeof","tipClass","link","tooltipLinkHandler","linkInformation","label","Link","tooltipLinkOnClick","Portal","viewBox","points","Component","defaultProps"],"mappings":"ypBAwBMA,gCACL,WAAYC,GAAO,MAAA,OAAAC,WAClBC,cAAMF,IACDG,MAAQ,CACZC,kBAAkB,GAGnBF,EAAKG,eAAiB,KACtBH,EAAKI,6BAA+BJ,EAAKI,6BAA6BC,wDAGvE,WACCC,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACrEE,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACjEI,KAAKV,MAAMW,WACdD,KAAKE,mBAAkB,uCAIzB,WACCJ,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACxEE,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACpEI,KAAKL,gBACRS,aAAaJ,KAAKL,iDAIpB,SAAkBU,GAWjB,KATKL,KAAKM,gBAAmBD,GAAWL,KAAKL,kBAC5CS,aAAaJ,KAAKL,gBAClBK,KAAKL,eAAiB,KACtBK,KAAKO,SAAS,CACbb,kBAAkB,KAKhBM,KAAKM,cAAe,CACvB,IAAME,EAAUC,SAASC,cAAc,aAAeV,KAAKV,MAAMqB,GAAK,MAMtE,GALAX,KAAKL,eAAiB,KACtBK,KAAKO,SAAS,CACbb,iBAAkBW,IAGfA,EAAS,CACZ,IAAIO,EAAiB,MAEpBA,EADGZ,KAAKV,MAAMW,UACGD,KAAKV,MAAMW,UAEXQ,SAASC,cAAc,aAAeV,KAAKV,MAAMqB,GAAK,gBAElDH,GACrBR,KAAKa,oBAAoBL,EAASI,EAAgBJ,EAAQM,aAAa,6CAM3E,SAAcC,GACb,OAAOA,EAAQ,oCAGhB,SAAgBC,GACf,IAAIC,EACJ,OAAQD,GACR,IAAK,MACJC,EAAe,SACf,MACD,IAAK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oG,MAKf,IAAIE,EAAW,wBACX5F,KAAKV,MAAMsF,YACdgB,GAAY,IAAM5F,KAAKV,MAAMsF,WAG9B,IAAIiB,EAAO,KACX,GAAI7F,KAAKP,MAAMC,kBAAoBM,KAAKV,MAAMwG,oBAAsB9F,KAAKV,MAAMuG,KAAM,CACpF,IAAME,EAAkB/F,KAAKV,MAAMwG,mBAAmB9F,KAAKV,MAAMuG,MAElC,WAA3BF,EAAOI,IAAgCA,EAAgBC,OAASD,EAAgBzB,MACnFuB,EAAQlB,gBAACsB,GACRrB,UAAU,eACVjE,GAAIX,KAAKV,MAAMuG,KAAKlF,GACpBuE,QAASlF,KAAKkG,mBAAmBrG,KAAKG,KAAM+F,EAAgBzB,MAE3DyB,EAAgBC,QAKpB,OACCrB,uBAAKC,UAAU,qBACbH,EACDE,gBAACwB,OACAxB,uBAAK,UAAS3E,KAAKV,MAAMqB,GAAIiE,UAAWgB,EAAU,eAAc5F,KAAKP,MAAMC,iBAAkBsC,UAAWhC,KAAKV,MAAM0C,WAClH2C,uBAAKhE,GAAG,WAAWoD,EAAE,MAAME,EAAE,MAAMmC,QAAQ,gBAC1CzB,4BAAU0B,OAAO,6BACjB1B,2BAAS0B,OAAO,mDAEhB7B,EACAqB,YApYelB,EAAM2B,WA4Z5BjH,EAAQkH,aAAe,CACtBxE,MAAO,IACPC,UAAW,SACXX,wBAAwB,EACxByD,oBAAoB"}
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("../getPrototypeOf-0bf77a9e.js"),e=require("../createClass-6db89a23.js"),i=require("react"),o=require("react-portal"),l=require("carbon-components-react");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=s(i);function r(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,l=t._getPrototypeOf(e);if(i){var s=t._getPrototypeOf(this).constructor;o=Reflect.construct(l,arguments,s)}else o=l.apply(this,arguments);return t._possibleConstructorReturn(this,o)}}var p=function(i){t._inherits(p,i);var s=r(p);function p(i){var o;return e._classCallCheck(this,p),(o=s.call(this,i)).state={isTooltipVisible:!1},o.pendingTooltip=null,o.hideTooltipOnScrollAndResize=o.hideTooltipOnScrollAndResize.bind(t._assertThisInitialized(o)),o}return e._createClass(p,[{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='"+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='"+this.props.id+"-trigger']"))&&e&&this.updateTooltipLayout(e,i,e.getAttribute("direction"))}}}},{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){if(t){var e=t.firstChild&&t.firstChild.scrollWidth?t.firstChild.scrollWidth:0,i=t.offsetWidth,o=e;0===e&&(o=t.scrollWidth);var l=o<=i;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>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 u=n.top;t.offsetHeight>n.height?(u-=(t.offsetHeight-n.height)/2)<0&&(u=n.top):t.offsetHeight<n.height&&(u+=(n.height-t.offsetHeight)/2),t.style.top=this.getStyleValue(u+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 a=this.getNewDirection(o);return this.updateTooltipLayout(t,e,a),void t.setAttribute("direction",a)}}},{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 u=p-t.offsetWidth/2;l-t.offsetWidth<u?u=l-t.offsetWidth:u<0&&(u=2),t.style.left=this.getStyleValue(u)}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 a=h-t.offsetHeight/2;s-t.offsetHeight<a?a=s-t.offsetHeight:a<0&&(a=2),t.style.top=this.getStyleValue(a+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:"tooltipLinkOnClick",value:function(t){window.open(t,"_blank","noopener")}},{key:"render",value:function(){var e=this,i=null,s=null;if(this.props.children){s=n.default.createElement("div",{"data-id":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){null!==t.relatedTarget&&e.setTooltipVisible(!1)}:null,tabIndex:this.props.showToolTipOnClick?0:null,ref:function(t){return e.triggerRef=t}},this.props.children)}"string"==typeof this.props.tip?i=n.default.createElement("span",{id:"tooltipContainer"},this.props.tip):"object"===t._typeof(this.props.tip)&&(i=n.default.createElement("div",{id:"tooltipContainer"},this.props.tip));var r="common-canvas-tooltip";this.props.className&&(r+=" "+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=n.default.createElement(l.Link,{className:"tooltip-link",id:this.props.link.id,onClick:this.tooltipLinkOnClick.bind(this,h.url)},h.label))}return n.default.createElement("div",{className:"tooltip-container"},s,n.default.createElement(o.Portal,null,n.default.createElement("div",{"data-id":this.props.id,className:r,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction},n.default.createElement("svg",{id:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1"},n.default.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),n.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)))}}]),p}(n.default.Component);p.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1},module.exports=p;
1
+ "use strict";var t=require("../getPrototypeOf-bf88242f.js"),e=require("../createClass-6db89a23.js"),i=require("react"),o=require("react-portal"),l=require("carbon-components-react");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=s(i);function r(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,l=t._getPrototypeOf(e);if(i){var s=t._getPrototypeOf(this).constructor;o=Reflect.construct(l,arguments,s)}else o=l.apply(this,arguments);return t._possibleConstructorReturn(this,o)}}var p=function(i){t._inherits(p,i);var s=r(p);function p(i){var o;return e._classCallCheck(this,p),(o=s.call(this,i)).state={isTooltipVisible:!1},o.pendingTooltip=null,o.hideTooltipOnScrollAndResize=o.hideTooltipOnScrollAndResize.bind(t._assertThisInitialized(o)),o}return e._createClass(p,[{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='"+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='"+this.props.id+"-trigger']"))&&e&&this.updateTooltipLayout(e,i,e.getAttribute("direction"))}}}},{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){if(t){var e=t.firstChild&&t.firstChild.scrollWidth?t.firstChild.scrollWidth:0,i=t.offsetWidth,o=e;0===e&&(o=t.scrollWidth);var l=o<=i;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 u=n.top;t.offsetHeight>n.height?(u-=(t.offsetHeight-n.height)/2)<0&&(u=n.top):t.offsetHeight<n.height&&(u+=(n.height-t.offsetHeight)/2),t.style.top=this.getStyleValue(u+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 a=this.getNewDirection(o);return this.updateTooltipLayout(t,e,a),void t.setAttribute("direction",a)}}},{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 u=p-t.offsetWidth/2;l-t.offsetWidth<u?u=l-t.offsetWidth:u<0&&(u=2),t.style.left=this.getStyleValue(u)}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 a=h-t.offsetHeight/2;s-t.offsetHeight<a?a=s-t.offsetHeight:a<0&&(a=2),t.style.top=this.getStyleValue(a+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:"tooltipLinkOnClick",value:function(t){window.open(t,"_blank","noopener")}},{key:"render",value:function(){var e=this,i=null,s=null;if(this.props.children){s=n.default.createElement("div",{"data-id":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){null!==t.relatedTarget&&e.setTooltipVisible(!1)}:null,tabIndex:this.props.showToolTipOnClick?0:null,ref:function(t){return e.triggerRef=t}},this.props.children)}"string"==typeof this.props.tip?i=n.default.createElement("span",{id:"tooltipContainer"},this.props.tip):"object"===t._typeof(this.props.tip)&&(i=n.default.createElement("div",{id:"tooltipContainer"},this.props.tip));var r="common-canvas-tooltip";this.props.className&&(r+=" "+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=n.default.createElement(l.Link,{className:"tooltip-link",id:this.props.link.id,onClick:this.tooltipLinkOnClick.bind(this,h.url)},h.label))}return n.default.createElement("div",{className:"tooltip-container"},s,n.default.createElement(o.Portal,null,n.default.createElement("div",{"data-id":this.props.id,className:r,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction},n.default.createElement("svg",{id:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1"},n.default.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),n.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)))}}]),p}(n.default.Component);p.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1},module.exports=p;
2
2
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2022 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\";\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\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\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.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.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\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\tif (elem) {\n\t\t\tconst firstChildWidth = elem.firstChild && elem.firstChild.scrollWidth ? elem.firstChild.scrollWidth : 0;\n\t\t\tconst displayWidth = elem.offsetWidth;\n\t\t\tlet fullWidth = firstChildWidth;\n\t\t\tif (firstChildWidth === 0) {\n\t\t\t\tfullWidth = elem.scrollWidth;\n\t\t\t}\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) > 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\ttooltipLinkOnClick(url) {\n\t\twindow.open(url, \"_blank\", \"noopener\");\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 onFocus = () => this.showTooltipWithDelay();\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Keep tooltip visible when clicked on a link.\n\t\t\t\t// Since link is an anchor tag without \"href\" attribute, it has relatedTarget=null\n\t\t\t\tif (evt.relatedTarget !== null) {\n\t\t\t\t\tthis.setTooltipVisible(false);\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.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\ttabIndex={this.props.showToolTipOnClick ? 0 : 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 id=\"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 id=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\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\tonClick={this.tooltipLinkOnClick.bind(this, linkInformation.url)}\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\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t<Portal>\n\t\t\t\t\t<div data-id={this.props.id} className={tipClass} aria-hidden={!this.state.isTooltipVisible} direction={this.props.direction}>\n\t\t\t\t\t\t<svg id=\"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</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).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\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","props","_classCallCheck","_this","state","isTooltipVisible","pendingTooltip","hideTooltipOnScrollAndResize","bind","window","addEventListener","this","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","document","querySelector","id","tooltipTrigger","updateTooltipLayout","getAttribute","value","currentDirection","newDirection","canDisplayFullText","triggerRef","disable","showToolTipIfTruncated","elem","firstChildWidth","firstChild","scrollWidth","displayWidth","offsetWidth","fullWidth","that","setTimeout","delay","direction","tooltipDirection","viewPortWidth","documentElement","clientWidth","viewPortHeight","clientHeight","triggerLayout","getBoundingClientRect","pointer","pointerLayout","style","left","getStyleValue","top","mousePos","updateLocationBasedOnMousePos","tooltipLeft","width","offsetLeft","right","height","offsetHeight","bottom","tooltipTop","isOutOfBounds","getNewDirection","setAttribute","mouseX","x","mouseY","y","parseFloat","evt","stopPropagation","preventDefault","url","open","tooltipContent","triggerContent","children","React","className","onMouseOver","showToolTipOnClick","_this2","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","relatedTarget","tabIndex","ref","tip","_typeof","tipClass","link","tooltipLinkHandler","linkInformation","label","Link","tooltipLinkOnClick","Portal","viewBox","points","Component","defaultProps"],"mappings":"+uBAwBMA,0CACL,WAAYC,GAAO,MAAA,OAAAC,2BAClBC,cAAMF,IACDG,MAAQ,CACZC,kBAAkB,GAGnBF,EAAKG,eAAiB,KACtBH,EAAKI,6BAA+BJ,EAAKI,6BAA6BC,4FAGvE,WACCC,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACrEE,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACjEI,KAAKV,MAAMW,WACdD,KAAKE,mBAAkB,uCAIzB,WACCJ,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACxEE,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACpEI,KAAKL,gB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WhC,KAAKV,MAAM0C,WAClHyC,+BAAK9D,GAAG,WAAWkD,EAAE,MAAME,EAAE,MAAMmC,QAAQ,gBAC1CzB,oCAAU0B,OAAO,6BACjB1B,mCAAS0B,OAAO,mDAEhB7B,EACAqB,YApYelB,UAAM2B,WA4Z5B/G,EAAQgH,aAAe,CACtBtE,MAAO,IACPC,UAAW,SACXX,wBAAwB,EACxBuD,oBAAoB"}
1
+ {"version":3,"file":"tooltip.js","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2022 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\";\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\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\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.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.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\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\tif (elem) {\n\t\t\tconst firstChildWidth = elem.firstChild && elem.firstChild.scrollWidth ? elem.firstChild.scrollWidth : 0;\n\t\t\tconst displayWidth = elem.offsetWidth;\n\t\t\tlet fullWidth = firstChildWidth;\n\t\t\tif (firstChildWidth === 0) {\n\t\t\t\tfullWidth = elem.scrollWidth;\n\t\t\t}\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\ttooltipLinkOnClick(url) {\n\t\twindow.open(url, \"_blank\", \"noopener\");\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 onFocus = () => this.showTooltipWithDelay();\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Keep tooltip visible when clicked on a link.\n\t\t\t\t// Since link is an anchor tag without \"href\" attribute, it has relatedTarget=null\n\t\t\t\tif (evt.relatedTarget !== null) {\n\t\t\t\t\tthis.setTooltipVisible(false);\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.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\ttabIndex={this.props.showToolTipOnClick ? 0 : 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 id=\"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 id=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\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\tonClick={this.tooltipLinkOnClick.bind(this, linkInformation.url)}\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\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t<Portal>\n\t\t\t\t\t<div data-id={this.props.id} className={tipClass} aria-hidden={!this.state.isTooltipVisible} direction={this.props.direction}>\n\t\t\t\t\t\t<svg id=\"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</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).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\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","props","_classCallCheck","_this","state","isTooltipVisible","pendingTooltip","hideTooltipOnScrollAndResize","bind","window","addEventListener","this","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","document","querySelector","id","tooltipTrigger","updateTooltipLayout","getAttribute","value","currentDirection","newDirection","canDisplayFullText","triggerRef","disable","showToolTipIfTruncated","elem","firstChildWidth","firstChild","scrollWidth","displayWidth","offsetWidth","fullWidth","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","evt","stopPropagation","preventDefault","url","open","tooltipContent","triggerContent","children","React","className","onMouseOver","showToolTipOnClick","_this2","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","relatedTarget","tabIndex","ref","tip","_typeof","tipClass","link","tooltipLinkHandler","linkInformation","label","Link","tooltipLinkOnClick","Portal","viewBox","points","Component","defaultProps"],"mappings":"+uBAwBMA,0CACL,WAAYC,GAAO,MAAA,OAAAC,2BAClBC,cAAMF,IACDG,MAAQ,CACZC,kBAAkB,GAGnBF,EAAKG,eAAiB,KACtBH,EAAKI,6BAA+BJ,EAAKI,6BAA6BC,4FAGvE,WACCC,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACrEE,OAAOC,iBAAiB,SAAUC,KAAKJ,8BAA8B,GACjEI,KAAKV,MAAMW,WACdD,KAAKE,mBAAkB,uCAIzB,WACCJ,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8B,GACxEE,OAAOK,oBAAoB,SAAUH,KAAKJ,8BAA8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