@elyra/canvas 13.43.2 → 13.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.nvmrc +1 -0
  2. package/dist/Close-00f026a1.js +2 -0
  3. package/dist/{Close-46e688b8.js.map → Close-00f026a1.js.map} +1 -1
  4. package/dist/Close-3a206dc0.js +2 -0
  5. package/dist/{Close-ced84b07.js.map → Close-3a206dc0.js.map} +1 -1
  6. package/dist/canvas-controller-42118244.js +2 -0
  7. package/dist/canvas-controller-42118244.js.map +1 -0
  8. package/dist/canvas-controller-897a5f51.js +2 -0
  9. package/dist/canvas-controller-897a5f51.js.map +1 -0
  10. package/dist/common-canvas-7e31f7ac.js +2 -0
  11. package/dist/common-canvas-7e31f7ac.js.map +1 -0
  12. package/dist/common-canvas-d4a073a3.js +2 -0
  13. package/dist/common-canvas-d4a073a3.js.map +1 -0
  14. package/dist/common-canvas.cjs +2 -0
  15. package/dist/common-canvas.cjs.map +1 -0
  16. package/dist/common-canvas.js +1 -1
  17. package/dist/common-canvas.js.map +1 -1
  18. package/dist/common-properties-3d129050.js +2 -0
  19. package/dist/{common-properties-36906b79.js.map → common-properties-3d129050.js.map} +1 -1
  20. package/dist/common-properties-d1008563.js +2 -0
  21. package/dist/{common-properties-5695fc39.js.map → common-properties-d1008563.js.map} +1 -1
  22. package/dist/flexible-table-1b07a6ff.js +2 -0
  23. package/dist/{flexible-table-d624ee4e.js.map → flexible-table-1b07a6ff.js.map} +1 -1
  24. package/dist/flexible-table-40f665e8.js +2 -0
  25. package/dist/{flexible-table-d1d15df2.js.map → flexible-table-40f665e8.js.map} +1 -1
  26. package/dist/index-653a393b.js +2 -0
  27. package/dist/{index-5383b802.js.map → index-653a393b.js.map} +1 -1
  28. package/dist/index-a6a232be.js +2 -0
  29. package/dist/{index-50b29b6d.js.map → index-a6a232be.js.map} +1 -1
  30. package/dist/lib/canvas-controller.cjs +2 -0
  31. package/dist/lib/canvas-controller.cjs.map +1 -0
  32. package/dist/lib/canvas-controller.js +1 -1
  33. package/dist/lib/canvas.cjs +2 -0
  34. package/dist/lib/canvas.cjs.map +1 -0
  35. package/dist/lib/canvas.js +1 -1
  36. package/dist/lib/command-stack.cjs +2 -0
  37. package/dist/lib/command-stack.cjs.map +1 -0
  38. package/dist/lib/command-stack.js +1 -1
  39. package/dist/lib/command-stack.js.map +1 -1
  40. package/dist/lib/context-menu.cjs +2 -0
  41. package/dist/lib/context-menu.cjs.map +1 -0
  42. package/dist/lib/context-menu.js +1 -1
  43. package/dist/lib/properties/clem.cjs +2 -0
  44. package/dist/lib/properties/clem.cjs.map +1 -0
  45. package/dist/lib/properties/clem.js +1 -1
  46. package/dist/lib/properties/clem.js.map +1 -1
  47. package/dist/lib/properties/field-picker.cjs +2 -0
  48. package/dist/lib/properties/field-picker.cjs.map +1 -0
  49. package/dist/lib/properties/field-picker.js +1 -1
  50. package/dist/lib/properties/flexible-table.cjs +2 -0
  51. package/dist/lib/properties/flexible-table.cjs.map +1 -0
  52. package/dist/lib/properties/flexible-table.js +1 -1
  53. package/dist/lib/properties/getPythonHints.cjs +2 -0
  54. package/dist/lib/properties/getPythonHints.cjs.map +1 -0
  55. package/dist/lib/properties/getPythonHints.js +1 -1
  56. package/dist/lib/properties/getPythonHints.js.map +1 -1
  57. package/dist/lib/properties.cjs +2 -0
  58. package/dist/lib/properties.cjs.map +1 -0
  59. package/dist/lib/properties.js +1 -1
  60. package/dist/lib/tooltip.cjs +2 -0
  61. package/dist/lib/tooltip.cjs.map +1 -0
  62. package/dist/lib/tooltip.js +1 -1
  63. package/dist/lib/tooltip.js.map +1 -1
  64. package/dist/styles/common-canvas.min.css +1 -1
  65. package/dist/styles/common-canvas.min.css.map +1 -1
  66. package/locales/common-canvas/locales/de.json +0 -1
  67. package/locales/common-canvas/locales/es.json +0 -1
  68. package/locales/common-canvas/locales/fr.json +0 -1
  69. package/locales/common-canvas/locales/it.json +0 -1
  70. package/locales/common-canvas/locales/ja.json +0 -1
  71. package/locales/common-canvas/locales/ko.json +0 -1
  72. package/locales/common-canvas/locales/pt-BR.json +0 -1
  73. package/locales/common-canvas/locales/sv.json +0 -1
  74. package/locales/common-canvas/locales/zh-CN.json +0 -1
  75. package/locales/common-canvas/locales/zh-TW.json +0 -1
  76. package/locales/common-properties/locales/de.json +1 -0
  77. package/locales/common-properties/locales/es.json +1 -0
  78. package/locales/common-properties/locales/fr.json +1 -0
  79. package/locales/common-properties/locales/it.json +1 -0
  80. package/locales/common-properties/locales/ja.json +1 -0
  81. package/locales/common-properties/locales/ko.json +1 -0
  82. package/locales/common-properties/locales/pt-BR.json +1 -0
  83. package/locales/common-properties/locales/sv.json +1 -0
  84. package/locales/common-properties/locales/zh-CN.json +1 -0
  85. package/locales/common-properties/locales/zh-TW.json +1 -0
  86. package/locales/palette/locales/de.json +4 -1
  87. package/locales/palette/locales/es.json +4 -1
  88. package/locales/palette/locales/fr.json +4 -1
  89. package/locales/palette/locales/it.json +4 -1
  90. package/locales/palette/locales/ja.json +4 -1
  91. package/locales/palette/locales/ko.json +4 -1
  92. package/locales/palette/locales/pt-BR.json +4 -1
  93. package/locales/palette/locales/sv.json +4 -1
  94. package/locales/palette/locales/zh-CN.json +4 -1
  95. package/locales/palette/locales/zh-TW.json +4 -1
  96. package/locales/toolbar/locales/de.json +1 -5
  97. package/locales/toolbar/locales/es.json +1 -5
  98. package/locales/toolbar/locales/fr.json +1 -5
  99. package/locales/toolbar/locales/it.json +1 -5
  100. package/locales/toolbar/locales/ja.json +1 -5
  101. package/locales/toolbar/locales/ko.json +1 -5
  102. package/locales/toolbar/locales/pt-BR.json +1 -5
  103. package/locales/toolbar/locales/sv.json +1 -5
  104. package/locales/toolbar/locales/zh-CN.json +1 -5
  105. package/locales/toolbar/locales/zh-TW.json +1 -5
  106. package/package.json +12 -6
  107. package/rollup.config.js +2 -2
  108. package/src/common-canvas/canvas-controller.js +8 -0
  109. package/src/common-canvas/svg-canvas-renderer.js +41 -20
  110. package/src/common-canvas/svg-canvas-utils-drag-objects.js +0 -6
  111. package/src/common-canvas/svg-canvas-utils-textarea.js +4 -2
  112. package/src/common-properties/controls/expression/expression.scss +16 -3
  113. package/src/object-model/api-pipeline.js +4 -0
  114. package/src/object-model/pipeline-in-handler.js +3 -0
  115. package/src/object-model/pipeline-out-handler.js +5 -0
  116. package/src/object-model/redux/reducers/canvasinfo.js +1 -0
  117. package/src/object-model/redux/reducers/links.js +10 -0
  118. package/stats.html +1 -1
  119. package/types/canvas-controller.d.ts +27 -0
  120. package/types/index.d.cts +21 -0
  121. package/dist/Close-46e688b8.js +0 -2
  122. package/dist/Close-ced84b07.js +0 -2
  123. package/dist/canvas-controller-129092b6.js +0 -2
  124. package/dist/canvas-controller-129092b6.js.map +0 -1
  125. package/dist/canvas-controller-a0473a44.js +0 -2
  126. package/dist/canvas-controller-a0473a44.js.map +0 -1
  127. package/dist/common-canvas-08eacbb2.js +0 -2
  128. package/dist/common-canvas-08eacbb2.js.map +0 -1
  129. package/dist/common-canvas-dcc39cb1.js +0 -2
  130. package/dist/common-canvas-dcc39cb1.js.map +0 -1
  131. package/dist/common-canvas.es.js +0 -2
  132. package/dist/common-canvas.es.js.map +0 -1
  133. package/dist/common-properties-36906b79.js +0 -2
  134. package/dist/common-properties-5695fc39.js +0 -2
  135. package/dist/flexible-table-d1d15df2.js +0 -2
  136. package/dist/flexible-table-d624ee4e.js +0 -2
  137. package/dist/index-50b29b6d.js +0 -2
  138. package/dist/index-5383b802.js +0 -2
  139. package/dist/lib/canvas-controller.es.js +0 -2
  140. package/dist/lib/canvas-controller.es.js.map +0 -1
  141. package/dist/lib/canvas.es.js +0 -2
  142. package/dist/lib/canvas.es.js.map +0 -1
  143. package/dist/lib/command-stack.es.js +0 -2
  144. package/dist/lib/command-stack.es.js.map +0 -1
  145. package/dist/lib/context-menu.es.js +0 -2
  146. package/dist/lib/context-menu.es.js.map +0 -1
  147. package/dist/lib/properties/clem.es.js +0 -2
  148. package/dist/lib/properties/clem.es.js.map +0 -1
  149. package/dist/lib/properties/field-picker.es.js +0 -2
  150. package/dist/lib/properties/field-picker.es.js.map +0 -1
  151. package/dist/lib/properties/flexible-table.es.js +0 -2
  152. package/dist/lib/properties/flexible-table.es.js.map +0 -1
  153. package/dist/lib/properties/getPythonHints.es.js +0 -2
  154. package/dist/lib/properties/getPythonHints.es.js.map +0 -1
  155. package/dist/lib/properties.es.js +0 -2
  156. package/dist/lib/properties.es.js.map +0 -1
  157. package/dist/lib/tooltip.es.js +0 -2
  158. package/dist/lib/tooltip.es.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";require("../createClass-df7b07d6.js"),require("../en-48c97a88.js"),require("../isArrayLikeObject-4737a54a.js"),require("../common-canvas-utils-272fb8c4.js");var e=require("../canvas-controller-897a5f51.js");require("./command-stack.cjs"),require("../canvas-logger-8c01664d.js"),require("../defineProperty-d68f985b.js"),require("../inherits-74e481d1.js"),require("../datarecord-metadata-v3-schema-46edaa7d.js"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),require("immutable"),module.exports=e.CanvasController;
2
+ //# sourceMappingURL=canvas-controller.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas-controller.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";require("../createClass-df7b07d6.js"),require("../en-48c97a88.js"),require("../isArrayLikeObject-4737a54a.js"),require("../common-canvas-utils-272fb8c4.js");var e=require("../canvas-controller-129092b6.js");require("./command-stack.js"),require("../canvas-logger-8c01664d.js"),require("../defineProperty-d68f985b.js"),require("../inherits-74e481d1.js"),require("../datarecord-metadata-v3-schema-46edaa7d.js"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),require("immutable"),module.exports=e.CanvasController;
1
+ import"../createClass-a140e270.js";import"../en-dceabf36.js";import"../isArrayLikeObject-8496ff7c.js";import"../common-canvas-utils-7ef1d091.js";export{C as default}from"../canvas-controller-42118244.js";import"./command-stack.js";import"../canvas-logger-3584cb6d.js";import"../defineProperty-f3298a15.js";import"../inherits-860188e5.js";import"../datarecord-metadata-v3-schema-73031f6a.js";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";import"immutable";
2
2
  //# sourceMappingURL=canvas-controller.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-canvas-d4a073a3.js"),r=require("../canvas-controller-897a5f51.js");require("../createClass-df7b07d6.js"),require("../inherits-74e481d1.js"),require("react"),require("react-redux"),require("react-intl"),require("../Close-00f026a1.js"),require("../common-canvas-utils-272fb8c4.js"),require("../toInteger-b7d805dd.js"),require("../isArrayLikeObject-4737a54a.js"),require("../datarecord-metadata-v3-schema-46edaa7d.js"),require("../en-48c97a88.js"),require("../keyboard-utils-b5a20c84.js"),require("prop-types"),require("./tooltip.cjs"),require("react-portal"),require("@carbon/react"),require("uuid"),require("react-inlinesvg"),require("../Time-b0f9a9cb.js"),require("../ChevronRight-362f2dfd.js"),require("../canvas-logger-8c01664d.js"),require("../context-menu-wrapper-39831e91.js"),require("../defineProperty-d68f985b.js"),require("markdown-it"),require("react-dom"),require("./command-stack.cjs"),require("immutable"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),exports.CommonCanvas=e.commonCanvas,exports.CanvasController=r.CanvasController;
2
+ //# sourceMappingURL=canvas.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-canvas-dcc39cb1.js"),r=require("../canvas-controller-129092b6.js");require("../createClass-df7b07d6.js"),require("../inherits-74e481d1.js"),require("react"),require("react-redux"),require("react-intl"),require("../Close-46e688b8.js"),require("../common-canvas-utils-272fb8c4.js"),require("../toInteger-b7d805dd.js"),require("../isArrayLikeObject-4737a54a.js"),require("../datarecord-metadata-v3-schema-46edaa7d.js"),require("../en-48c97a88.js"),require("../keyboard-utils-b5a20c84.js"),require("prop-types"),require("./tooltip.js"),require("react-portal"),require("@carbon/react"),require("uuid"),require("react-inlinesvg"),require("../Time-b0f9a9cb.js"),require("../ChevronRight-362f2dfd.js"),require("../canvas-logger-8c01664d.js"),require("../context-menu-wrapper-39831e91.js"),require("../defineProperty-d68f985b.js"),require("markdown-it"),require("react-dom"),require("./command-stack.js"),require("immutable"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),exports.CommonCanvas=e.commonCanvas,exports.CanvasController=r.CanvasController;
1
+ export{c as CommonCanvas}from"../common-canvas-7e31f7ac.js";export{C as CanvasController}from"../canvas-controller-42118244.js";import"../createClass-a140e270.js";import"../inherits-860188e5.js";import"react";import"react-redux";import"react-intl";import"../Close-3a206dc0.js";import"../common-canvas-utils-7ef1d091.js";import"../toInteger-ea444724.js";import"../isArrayLikeObject-8496ff7c.js";import"../datarecord-metadata-v3-schema-73031f6a.js";import"../en-dceabf36.js";import"../keyboard-utils-a23c5d52.js";import"prop-types";import"./tooltip.js";import"react-portal";import"@carbon/react";import"uuid";import"react-inlinesvg";import"../Time-e622883c.js";import"../ChevronRight-f4724ce3.js";import"../canvas-logger-3584cb6d.js";import"../context-menu-wrapper-9f1b71a8.js";import"../defineProperty-f3298a15.js";import"markdown-it";import"react-dom";import"./command-stack.js";import"immutable";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";
2
2
  //# sourceMappingURL=canvas.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";var n=require("../createClass-df7b07d6.js"),e=require("immutable"),t=function(){return n._createClass(function t(){n._classCallCheck(this,t);var s=new e.Record({undoCmnds:new e.List,redoCmnds:new e.Stack});this.rec=s()},[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new e.Stack}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),s=function(){return n._createClass(function e(){n._classCallCheck(this,e),this.commands=new t},[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getAllRedoCommands",value:function(){return this.commands.getRedoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new t}}])}();module.exports=s;
2
+ //# sourceMappingURL=command-stack.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-stack.cjs","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\tgetAllRedoCommands() {\n\t\treturn this.commands.getRedoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","getRedoCommands","undos","redos"],"mappings":"gFAoBqBA,EAAa,WAShC,OAAAC,EAAAA,aAPD,SAAAD,IAAcE,uBAAAF,GACb,IAAMG,EAAS,IAAIC,SAAO,CACzBC,UAAW,IAAIC,EAAAA,KACfC,UAAW,IAAIC,EAAAA,QAGhBC,KAAKC,IAAMP,GACZ,EAAC,CAAA,CAAAQ,IAAA,KAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,EAAAA,QAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,EAAO,IACR,GAAC,CAAAF,IAAA,OAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,MACN,CACD,GAAC,CAAAZ,IAAA,OAAAC,MAED,WACC,GAAIH,KAAKe,UAAW,CACnB,IAAMC,EAAOhB,KAAKiB,UAClBjB,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKU,GACnClB,UAAWE,KAAKC,IAAIH,UAAUe,QAE/BG,EAAKE,MACN,CACD,GAAC,CAAAhB,IAAA,UAAAC,MAED,WACC,OAAQH,KAAKC,IAAIL,UAAUuB,SAC5B,GAAC,CAAAjB,IAAA,UAAAC,MAED,WACC,OAAQH,KAAKC,IAAIH,UAAUqB,SAC5B,GAAC,CAAAjB,IAAA,cAAAC,MAED,WAC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2 @@
1
- "use strict";var n=require("../createClass-df7b07d6.js"),e=require("immutable"),t=function(){return n._createClass(function t(){n._classCallCheck(this,t);var s=new e.Record({undoCmnds:new e.List,redoCmnds:new e.Stack});this.rec=s()},[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new e.Stack}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),s=function(){return n._createClass(function e(){n._classCallCheck(this,e),this.commands=new t},[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getAllRedoCommands",value:function(){return this.commands.getRedoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new t}}])}();module.exports=s;
1
+ import{_ as n,a as e}from"../createClass-a140e270.js";import{Stack as o,Record as t,List as s}from"immutable";var d=function(){return n(function n(){e(this,n);var d=new t({undoCmnds:new s,redoCmnds:new o});this.rec=d()},[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new o}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),r=function(){return n(function n(){e(this,n),this.commands=new d},[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getAllRedoCommands",value:function(){return this.commands.getRedoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new d}}])}();export{r as default};
2
2
  //# sourceMappingURL=command-stack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-stack.js","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\tgetAllRedoCommands() {\n\t\treturn this.commands.getRedoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","getRedoCommands","undos","redos"],"mappings":"gFAoBqBA,EAAa,WAShC,OAAAC,EAAAA,aAPD,SAAAD,IAAcE,uBAAAF,GACb,IAAMG,EAAS,IAAIC,SAAO,CACzBC,UAAW,IAAIC,EAAAA,KACfC,UAAW,IAAIC,EAAAA,QAGhBC,KAAKC,IAAMP,GACZ,EAAC,CAAA,CAAAQ,IAAA,KAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,EAAAA,QAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,EAAO,IACR,GAAC,CAAAF,IAAA,OAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,MACN,CACD,GAAC,CAAAZ,IAAA,OAAAC,MAED,WACC,GAAIH,KAAKe,UAAW,CACnB,IAAMC,EAAOhB,KAAKiB,UAClBjB,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAI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vBI,MAAS7B,KAAKuB,SAASI,kBAEzB,GAAC,CAAAzB,IAAA,UAAAC,MAED,WACC,OAAOH,KAAKuB,SAASb,SACtB,GAAC,CAAAR,IAAA,UAAAC,MAED,WACC,OAAOH,KAAKuB,SAASR,SACtB,GAAC,CAAAb,IAAA,oBAAAC,MAED,WACCH,KAAKuB,SAAW,IAAIhC,CACrB,IAAC,CA1D+B"}
1
+ {"version":3,"file":"command-stack.js","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\tgetAllRedoCommands() {\n\t\treturn this.commands.getRedoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","getRedoCommands","undos","redos"],"mappings":"8GAkBA,IAEqBA,EAAa,WAShC,OAAAC,EAPD,SAAAD,IAAcE,OAAAF,GACb,IAAMG,EAAS,IAAIC,EAAO,CACzBC,UAAW,IAAIC,EACfC,UAAW,IAAIC,IAGhBC,KAAKC,IAAMP,GACZ,EAAC,CAAA,CAAAQ,IAAA,KAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,IAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,EAAO,IACR,GAAC,CAAAF,IAAA,OAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,MACN,CACD,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,CAAAxB,IAAA,qBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASI,kBAAkBD,SACxC,GAEA,CAAAxB,IAAA,WAAAC,MACA,WACC,MAAO,CACNyB,MAAS5B,KAAKuB,SAASE,kBACvBI,MAAS7B,KAAKuB,SAASI,kBAEzB,GAAC,CAAAzB,IAAA,UAAAC,MAED,WACC,OAAOH,KAAKuB,SAASb,SACtB,GAAC,CAAAR,IAAA,UAAAC,MAED,WACC,OAAOH,KAAKuB,SAASR,SACtB,GAAC,CAAAb,IAAA,oBAAAC,MAED,WACCH,KAAKuB,SAAW,IAAIhC,CACrB,IAAC,CA1D+B"}
@@ -0,0 +1,2 @@
1
+ "use strict";require("../createClass-df7b07d6.js"),require("../inherits-74e481d1.js"),require("react");var e=require("../context-menu-wrapper-39831e91.js");require("../defineProperty-d68f985b.js"),require("../ChevronRight-362f2dfd.js"),require("../keyboard-utils-b5a20c84.js"),require("../common-canvas-utils-272fb8c4.js"),require("prop-types"),require("../canvas-logger-8c01664d.js"),module.exports=e.ContextMenuWrapper;
2
+ //# sourceMappingURL=context-menu.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";require("../createClass-df7b07d6.js"),require("../inherits-74e481d1.js"),require("react");var e=require("../context-menu-wrapper-39831e91.js");require("../defineProperty-d68f985b.js"),require("../ChevronRight-362f2dfd.js"),require("../keyboard-utils-b5a20c84.js"),require("../common-canvas-utils-272fb8c4.js"),require("prop-types"),require("../canvas-logger-8c01664d.js"),module.exports=e.ContextMenuWrapper;
1
+ import"../createClass-a140e270.js";import"../inherits-860188e5.js";import"react";export{C as default}from"../context-menu-wrapper-9f1b71a8.js";import"../defineProperty-f3298a15.js";import"../ChevronRight-f4724ce3.js";import"../keyboard-utils-a23c5d52.js";import"../common-canvas-utils-7ef1d091.js";import"prop-types";import"../canvas-logger-3584cb6d.js";
2
2
  //# sourceMappingURL=context-menu.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@codemirror/language"),t=require("@codemirror/autocomplete"),n="@BLANK @DIFF1 @DIFF2 @FIELD @FIELDS_BETWEEN @FIELDS_MATCHING @GLOBAL_MAX @GLOBAL_MEAN @GLOBAL_MIN @GLOBAL_SDEV @GLOBAL_SUM @INDEX @LAST_NON_BLANK @MAX @MEAN @MIN @MULTI_RESPONSE_SET @NULL @OFFSET @PARTITION_FIELD @PREDICTED @SDEV @SINCE @SINCE0 @SUM @TARGET @TESTING_PARTITION @THIS @TODAY @TRAINING_PARTITION @VALIDATION_PARTITION abs allbutfirst allbutlast alphabefore and arccos arccosh arcsin arcsinh arctan arctan2 arctanh area cdf_chisq cdf_f cdf_normal cdf_t close_to COND1 and COND2 COND1 or COND2 cos cosh count_equal count_greater_than count_less_than count_non_nulls count_not_equal count_nulls count_substring crosses date_before date_days_difference date_from_ywd date_in_days date_in_months date_in_weeks date_in_years date_iso_day date_iso_week date_iso_year date_months_difference date_weeks_difference date_years_difference datetime_date datetime_day datetime_day_name datetime_day_short_name datetime_hour datetime_in_seconds datetime_minute datetime_month datetime_month_name datetime_month_short_name datetime_now datetime_second datetime_time datetime_timestamp datetime_weekday datetime_year distance div endstring exp first_index first_non_null first_non_null_index fracof hasendstring hasmidstring hasstartstring hassubstring hassubstring if then else elseif endif integer_bitcount integer_leastbit integer_length intof is_date is_datetime is_integer is_number is_real is_string is_time is_timestamp isalphacode isendstring islowercode ismidstring isnumbercode isstartstring issubstring issubstring issubstring_count issubstring_lim isuppercode last last_index last_non_null last_non_null_index length locchar locchar_back log log10 lowertoupper max max_index max_n MEAN mean_n member min min_index min_n negate not num_points oneof or overlap pi random random0 rem replace replicate round sdev_n sign sin sinh skipchar skipchar_back soundex soundex_difference sqrt startstring stb_centroid_latitude stb_centroid_longitude stripchar strmember subscrs substring substring_between sum_n tan tanh testbit time_before time_hours_difference time_in_hours time_in_mins time_in_secs time_mins_difference".split(" "),i=n.map(function(e){return{label:e,type:"keyword"}}),r=/[\[\]{}\(\),;\:\.]/,a=/\d/,s=/[\w\.]/,_=/[\w\$_]/,o=/[+\-*&%=<>!?|\/]/;function d(e,t){var i=e.next();if("#"===i&&t.startOfLine)return e.skipToEnd(),"meta";if('"'===i)return function(e,t,n){var i,r=!1;for(;void 0!==(i=t.next());)if(i===e){r=!0;break}r&&(n.tokenize=null)}(i,e,t),"string";if("'"===i)return function(e,t,n){var i,r=!1;for(;void 0!==(i=t.next());)if(i===e){r=!0;break}r&&(n.tokenize=null)}(i,e,t),"variable";if(r.test(i))return null;if(a.test(i))return e.eatWhile(s),"number";if(o.test(i))return e.eatWhile(o),"operator";e.eatWhile(_);var d=e.current();return-1!==n.indexOf(d)?"keyword":"variable"}var u=e.StreamLanguage.define({name:"CLEM",startState:function(){return{tokenize:null}},token:function(e,t){return e.eatSpace()?null:(t.tokenize||d)(e,t)}}),m=u.data.of({autocomplete:t.completeFromList(i)});exports.clem=function(){return new e.LanguageSupport(u,[m])};
2
+ //# sourceMappingURL=clem.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clem.cjs","sources":["../../../src/common-properties/controls/expression/languages/CLEM-hint.js"],"sourcesContent":["/*\n * Copyright 2017-2024 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/* eslint no-useless-escape: \"off\" */\nimport { LanguageSupport, StreamLanguage } from \"@codemirror/language\";\nimport { completeFromList } from \"@codemirror/autocomplete\";\n\nconst keywords = (\"@BLANK @DIFF1 @DIFF2 @FIELD @FIELDS_BETWEEN @FIELDS_MATCHING \" +\n\"@GLOBAL_MAX @GLOBAL_MEAN @GLOBAL_MIN @GLOBAL_SDEV @GLOBAL_SUM @INDEX @LAST_NON_BLANK \" +\n\"@MAX @MEAN @MIN @MULTI_RESPONSE_SET @NULL @OFFSET @PARTITION_FIELD @PREDICTED \" +\n\"@SDEV @SINCE @SINCE0 @SUM @TARGET @TESTING_PARTITION @THIS @TODAY @TRAINING_PARTITION \" +\n\"@VALIDATION_PARTITION abs allbutfirst allbutlast alphabefore and arccos arccosh arcsin \" +\n\"arcsinh arctan arctan2 arctanh area cdf_chisq cdf_f cdf_normal cdf_t close_to COND1 \" +\n\"and COND2 COND1 or COND2 cos cosh count_equal count_greater_than count_less_than \" +\n\"count_non_nulls count_not_equal count_nulls count_substring crosses date_before \" +\n\"date_days_difference date_from_ywd date_in_days date_in_months date_in_weeks date_in_years \" +\n\"date_iso_day date_iso_week date_iso_year date_months_difference date_weeks_difference \" +\n\"date_years_difference datetime_date datetime_day datetime_day_name datetime_day_short_name \" +\n\"datetime_hour datetime_in_seconds datetime_minute datetime_month datetime_month_name \" +\n\"datetime_month_short_name datetime_now datetime_second datetime_time datetime_timestamp \" +\n\"datetime_weekday datetime_year distance div endstring exp first_index first_non_null \" +\n\"first_non_null_index fracof hasendstring hasmidstring hasstartstring hassubstring hassubstring \" +\n\"if then else elseif endif integer_bitcount integer_leastbit integer_length intof is_date \" +\n\"is_datetime is_integer is_number is_real is_string is_time is_timestamp isalphacode \" +\n\"isendstring islowercode ismidstring isnumbercode isstartstring issubstring issubstring \" +\n\"issubstring_count issubstring_lim isuppercode last last_index last_non_null last_non_null_index \" +\n\"length locchar locchar_back log log10 lowertoupper max max_index max_n MEAN mean_n member \" +\n\"min min_index min_n negate not num_points oneof or overlap pi random random0 rem replace \" +\n\"replicate round sdev_n sign sin sinh skipchar skipchar_back soundex soundex_difference sqrt \" +\n\"startstring stb_centroid_latitude stb_centroid_longitude stripchar strmember subscrs substring \" +\n\"substring_between sum_n tan tanh testbit time_before time_hours_difference time_in_hours \" +\n\"time_in_mins time_in_secs time_mins_difference\").split(\" \");\n\nconst clemKeywords = keywords.map((keyword) => ({ label: keyword, type: \"keyword\" }));\n\nconst isSpecialChar = /[\\[\\]{}\\(\\),;\\:\\.]/;\nconst isDigit = /\\d/;\nconst isNumberChar = /[\\w\\.]/;\nconst isWordChar = /[\\w\\$_]/;\nconst isOperatorChar = /[+\\-*&%=<>!?|\\/]/;\n\nfunction tokenResolve(stream, state) {\n\tconst ch = stream.next();\n\tif (ch === \"#\" && state.startOfLine) {\n\t\tstream.skipToEnd();\n\t\treturn \"meta\";\n\t}\n\n\tif (ch === \"\\\"\") {\n\t\ttokenString(ch, stream, state);\n\t\treturn \"string\";\n\t}\n\n\tif (ch === \"'\") {\n\t\ttokenVariable(ch, stream, state);\n\t\treturn \"variable\";\n\t}\n\n\tif (isSpecialChar.test(ch)) {\n\t\treturn null;\n\t}\n\n\tif (isDigit.test(ch)) {\n\t\tstream.eatWhile(isNumberChar);\n\t\treturn \"number\";\n\t}\n\tif (isOperatorChar.test(ch)) {\n\t\tstream.eatWhile(isOperatorChar);\n\t\treturn \"operator\";\n\t}\n\n\tstream.eatWhile(isWordChar);\n\tconst cur = stream.current();\n\tif (keywords.indexOf(cur) !== -1) {\n\t\treturn \"keyword\";\n\t}\n\treturn \"variable\";\n}\n\nfunction tokenString(quote, stream, state) {\n\tlet next;\n\tlet end = false;\n\twhile (typeof (next = stream.next()) !== \"undefined\") {\n\t\tif (next === quote) {\n\t\t\tend = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end) {\n\t\tstate.tokenize = null;\n\t}\n\treturn \"string\";\n}\n\nfunction tokenVariable(quote, stream, state) {\n\tlet next;\n\tlet end = false;\n\twhile (typeof (next = stream.next()) !== \"undefined\") {\n\t\tif (next === quote) {\n\t\t\tend = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end) {\n\t\tstate.tokenize = null;\n\t}\n\treturn \"variable\";\n}\n\n// Define CLEM language\nconst clemLanguage = StreamLanguage.define({\n\tname: \"CLEM\",\n\tstartState: function() {\n\t\treturn { tokenize: null };\n\t},\n\ttoken: function(stream, state) {\n\t\tif (stream.eatSpace()) {\n\t\t\treturn null;\n\t\t}\n\t\tconst style = (state.tokenize || tokenResolve)(stream, state);\n\t\treturn style;\n\t},\n});\n\n// Autocompletions\nconst clemCompletion = clemLanguage.data.of({\n\tautocomplete: completeFromList(clemKeywords)\n});\n\nfunction clem() {\n\treturn new LanguageSupport(clemLanguage, [clemCompletion]);\n}\n\nexport {\n\tclem\n};\n"],"names":["keywords","split","clemKeywords","map","keyword","label","type","isSpecialChar","isDigit","isNumberChar","isWordChar","isOperatorChar","tokenResolve","stream","state","ch","next","startOfLine","skipToEnd","quote","end","tokenize","tokenString","tokenVariable","test","eatWhile","cur","current","indexOf","clemLanguage","StreamLanguage","define","name","startState","token","eatSpace","clemCompletion","data","of","autocomplete","completeFromList","LanguageSupport"],"mappings":"gJAoBMA,EAAW,2kEAwBiCC,MAAM,KAElDC,EAAeF,EAASG,IAAI,SAACC,GAAO,MAAM,CAAEC,MAAOD,EAASE,KAAM,UAAW,GAE7EC,EAAgB,qBAChBC,EAAU,KACVC,EAAe,SACfC,EAAa,UACbC,EAAiB,mBAEvB,SAASC,EAAaC,EAAQC,GAC7B,IAAMC,EAAKF,EAAOG,OAClB,GAAW,MAAPD,GAAcD,EAAMG,YAEvB,OADAJ,EAAOK,YACA,OAGR,GAAW,MAAPH,EAEH,OA6BF,SAAqBI,EAAON,EAAQC,GACnC,IAAIE,EACAI,GAAM,EACV,UAAyC,KAA1BJ,EAAOH,EAAOG,SAC5B,GAAIA,IAASG,EAAO,CACnBC,GAAM,EACN,KACD,CAEGA,IACHN,EAAMO,SAAW,KAGnB,CA3CEC,CAAYP,EAAIF,EAAQC,GACjB,SAGR,GAAW,MAAPC,EAEH,OAuCF,SAAuBI,EAAON,EAAQC,GACrC,IAAIE,EACAI,GAAM,EACV,UAAyC,KAA1BJ,EAAOH,EAAOG,SAC5B,GAAIA,IAASG,EAAO,CACnBC,GAAM,EACN,KACD,CAEGA,IACHN,EAAMO,SAAW,KAGnB,CArDEE,CAAcR,EAAIF,EAAQC,GACnB,WAGR,GAAIP,EAAciB,KAAKT,GACtB,OAAO,KAGR,GAAIP,EAAQgB,KAAKT,GAEhB,OADAF,EAAOY,SAAShB,GACT,SAER,GAAIE,EAAea,KAAKT,GAEvB,OADAF,EAAOY,SAASd,GACT,WAGRE,EAAOY,SAASf,GAChB,IAAMgB,EAAMb,EAAOc,UACnB,OAA+B,IAA3B3B,EAAS4B,QAAQF,GACb,UAED,UACR,CAiCA,IAAMG,EAAeC,EAAcA,eAACC,OAAO,CAC1CC,KAAM,OACNC,WAAY,WACX,MAAO,CAAEZ,SAAU,KACnB,EACDa,MAAO,SAASrB,EAAQC,GACvB,OAAID,EAAOsB,WACH,MAEOrB,EAAMO,UAAYT,GAAcC,EAAQC,EAExD,IAIKsB,EAAiBP,EAAaQ,KAAKC,GAAG,CAC3CC,aAAcC,EAAgBA,iBAACtC,kBAGhC,WACC,OAAO,IAAIuC,EAAAA,gBAAgBZ,EAAc,CAACO,GAC3C"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@codemirror/language"),t=require("@codemirror/autocomplete"),n="@BLANK @DIFF1 @DIFF2 @FIELD @FIELDS_BETWEEN @FIELDS_MATCHING @GLOBAL_MAX @GLOBAL_MEAN @GLOBAL_MIN @GLOBAL_SDEV @GLOBAL_SUM @INDEX @LAST_NON_BLANK @MAX @MEAN @MIN @MULTI_RESPONSE_SET @NULL @OFFSET @PARTITION_FIELD @PREDICTED @SDEV @SINCE @SINCE0 @SUM @TARGET @TESTING_PARTITION @THIS @TODAY @TRAINING_PARTITION @VALIDATION_PARTITION abs allbutfirst allbutlast alphabefore and arccos arccosh arcsin arcsinh arctan arctan2 arctanh area cdf_chisq cdf_f cdf_normal cdf_t close_to COND1 and COND2 COND1 or COND2 cos cosh count_equal count_greater_than count_less_than count_non_nulls count_not_equal count_nulls count_substring crosses date_before date_days_difference date_from_ywd date_in_days date_in_months date_in_weeks date_in_years date_iso_day date_iso_week date_iso_year date_months_difference date_weeks_difference date_years_difference datetime_date datetime_day datetime_day_name datetime_day_short_name datetime_hour datetime_in_seconds datetime_minute datetime_month datetime_month_name datetime_month_short_name datetime_now datetime_second datetime_time datetime_timestamp datetime_weekday datetime_year distance div endstring exp first_index first_non_null first_non_null_index fracof hasendstring hasmidstring hasstartstring hassubstring hassubstring if then else elseif endif integer_bitcount integer_leastbit integer_length intof is_date is_datetime is_integer is_number is_real is_string is_time is_timestamp isalphacode isendstring islowercode ismidstring isnumbercode isstartstring issubstring issubstring issubstring_count issubstring_lim isuppercode last last_index last_non_null last_non_null_index length locchar locchar_back log log10 lowertoupper max max_index max_n MEAN mean_n member min min_index min_n negate not num_points oneof or overlap pi random random0 rem replace replicate round sdev_n sign sin sinh skipchar skipchar_back soundex soundex_difference sqrt startstring stb_centroid_latitude stb_centroid_longitude stripchar strmember subscrs substring substring_between sum_n tan tanh testbit time_before time_hours_difference time_in_hours time_in_mins time_in_secs time_mins_difference".split(" "),i=n.map(function(e){return{label:e,type:"keyword"}}),r=/[\[\]{}\(\),;\:\.]/,a=/\d/,s=/[\w\.]/,_=/[\w\$_]/,o=/[+\-*&%=<>!?|\/]/;function d(e,t){var i=e.next();if("#"===i&&t.startOfLine)return e.skipToEnd(),"meta";if('"'===i)return function(e,t,n){var i,r=!1;for(;void 0!==(i=t.next());)if(i===e){r=!0;break}r&&(n.tokenize=null)}(i,e,t),"string";if("'"===i)return function(e,t,n){var i,r=!1;for(;void 0!==(i=t.next());)if(i===e){r=!0;break}r&&(n.tokenize=null)}(i,e,t),"variable";if(r.test(i))return null;if(a.test(i))return e.eatWhile(s),"number";if(o.test(i))return e.eatWhile(o),"operator";e.eatWhile(_);var d=e.current();return-1!==n.indexOf(d)?"keyword":"variable"}var u=e.StreamLanguage.define({name:"CLEM",startState:function(){return{tokenize:null}},token:function(e,t){return e.eatSpace()?null:(t.tokenize||d)(e,t)}}),m=u.data.of({autocomplete:t.completeFromList(i)});exports.clem=function(){return new e.LanguageSupport(u,[m])};
1
+ import{StreamLanguage as e,LanguageSupport as t}from"@codemirror/language";import{completeFromList as n}from"@codemirror/autocomplete";var i="@BLANK @DIFF1 @DIFF2 @FIELD @FIELDS_BETWEEN @FIELDS_MATCHING @GLOBAL_MAX @GLOBAL_MEAN @GLOBAL_MIN @GLOBAL_SDEV @GLOBAL_SUM @INDEX @LAST_NON_BLANK @MAX @MEAN @MIN @MULTI_RESPONSE_SET @NULL @OFFSET @PARTITION_FIELD @PREDICTED @SDEV @SINCE @SINCE0 @SUM @TARGET @TESTING_PARTITION @THIS @TODAY @TRAINING_PARTITION @VALIDATION_PARTITION abs allbutfirst allbutlast alphabefore and arccos arccosh arcsin arcsinh arctan arctan2 arctanh area cdf_chisq cdf_f cdf_normal cdf_t close_to COND1 and COND2 COND1 or COND2 cos cosh count_equal count_greater_than count_less_than count_non_nulls count_not_equal count_nulls count_substring crosses date_before date_days_difference date_from_ywd date_in_days date_in_months date_in_weeks date_in_years date_iso_day date_iso_week date_iso_year date_months_difference date_weeks_difference date_years_difference datetime_date datetime_day datetime_day_name datetime_day_short_name datetime_hour datetime_in_seconds datetime_minute datetime_month datetime_month_name datetime_month_short_name datetime_now datetime_second datetime_time datetime_timestamp datetime_weekday datetime_year distance div endstring exp first_index first_non_null first_non_null_index fracof hasendstring hasmidstring hasstartstring hassubstring hassubstring if then else elseif endif integer_bitcount integer_leastbit integer_length intof is_date is_datetime is_integer is_number is_real is_string is_time is_timestamp isalphacode isendstring islowercode ismidstring isnumbercode isstartstring issubstring issubstring issubstring_count issubstring_lim isuppercode last last_index last_non_null last_non_null_index length locchar locchar_back log log10 lowertoupper max max_index max_n MEAN mean_n member min min_index min_n negate not num_points oneof or overlap pi random random0 rem replace replicate round sdev_n sign sin sinh skipchar skipchar_back soundex soundex_difference sqrt startstring stb_centroid_latitude stb_centroid_longitude stripchar strmember subscrs substring substring_between sum_n tan tanh testbit time_before time_hours_difference time_in_hours time_in_mins time_in_secs time_mins_difference".split(" "),r=i.map(function(e){return{label:e,type:"keyword"}}),a=/[\[\]{}\(\),;\:\.]/,s=/\d/,_=/[\w\.]/,o=/[\w\$_]/,d=/[+\-*&%=<>!?|\/]/;function m(e,t){var n=e.next();if("#"===n&&t.startOfLine)return e.skipToEnd(),"meta";if('"'===n)return function(e,t,n){var i,r=!1;for(;void 0!==(i=t.next());)if(i===e){r=!0;break}r&&(n.tokenize=null)}(n,e,t),"string";if("'"===n)return function(e,t,n){var i,r=!1;for(;void 0!==(i=t.next());)if(i===e){r=!0;break}r&&(n.tokenize=null)}(n,e,t),"variable";if(a.test(n))return null;if(s.test(n))return e.eatWhile(_),"number";if(d.test(n))return e.eatWhile(d),"operator";e.eatWhile(o);var r=e.current();return-1!==i.indexOf(r)?"keyword":"variable"}var u=e.define({name:"CLEM",startState:function(){return{tokenize:null}},token:function(e,t){return e.eatSpace()?null:(t.tokenize||m)(e,t)}}),c=u.data.of({autocomplete:n(r)});function l(){return new t(u,[c])}export{l as clem};
2
2
  //# sourceMappingURL=clem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clem.js","sources":["../../../src/common-properties/controls/expression/languages/CLEM-hint.js"],"sourcesContent":["/*\n * Copyright 2017-2024 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/* eslint no-useless-escape: \"off\" */\nimport { LanguageSupport, StreamLanguage } from \"@codemirror/language\";\nimport { completeFromList } from \"@codemirror/autocomplete\";\n\nconst keywords = (\"@BLANK @DIFF1 @DIFF2 @FIELD @FIELDS_BETWEEN @FIELDS_MATCHING \" +\n\"@GLOBAL_MAX @GLOBAL_MEAN @GLOBAL_MIN @GLOBAL_SDEV @GLOBAL_SUM @INDEX @LAST_NON_BLANK \" +\n\"@MAX @MEAN @MIN @MULTI_RESPONSE_SET @NULL @OFFSET @PARTITION_FIELD @PREDICTED \" +\n\"@SDEV @SINCE @SINCE0 @SUM @TARGET @TESTING_PARTITION @THIS @TODAY @TRAINING_PARTITION \" +\n\"@VALIDATION_PARTITION abs allbutfirst allbutlast alphabefore and arccos arccosh arcsin \" +\n\"arcsinh arctan arctan2 arctanh area cdf_chisq cdf_f cdf_normal cdf_t close_to COND1 \" +\n\"and COND2 COND1 or COND2 cos cosh count_equal count_greater_than count_less_than \" +\n\"count_non_nulls count_not_equal count_nulls count_substring crosses date_before \" +\n\"date_days_difference date_from_ywd date_in_days date_in_months date_in_weeks date_in_years \" +\n\"date_iso_day date_iso_week date_iso_year date_months_difference date_weeks_difference \" +\n\"date_years_difference datetime_date datetime_day datetime_day_name datetime_day_short_name \" +\n\"datetime_hour datetime_in_seconds datetime_minute datetime_month datetime_month_name \" +\n\"datetime_month_short_name datetime_now datetime_second datetime_time datetime_timestamp \" +\n\"datetime_weekday datetime_year distance div endstring exp first_index first_non_null \" +\n\"first_non_null_index fracof hasendstring hasmidstring hasstartstring hassubstring hassubstring \" +\n\"if then else elseif endif integer_bitcount integer_leastbit integer_length intof is_date \" +\n\"is_datetime is_integer is_number is_real is_string is_time is_timestamp isalphacode \" +\n\"isendstring islowercode ismidstring isnumbercode isstartstring issubstring issubstring \" +\n\"issubstring_count issubstring_lim isuppercode last last_index last_non_null last_non_null_index \" +\n\"length locchar locchar_back log log10 lowertoupper max max_index max_n MEAN mean_n member \" +\n\"min min_index min_n negate not num_points oneof or overlap pi random random0 rem replace \" +\n\"replicate round sdev_n sign sin sinh skipchar skipchar_back soundex soundex_difference sqrt \" +\n\"startstring stb_centroid_latitude stb_centroid_longitude stripchar strmember subscrs substring \" +\n\"substring_between sum_n tan tanh testbit time_before time_hours_difference time_in_hours \" +\n\"time_in_mins time_in_secs time_mins_difference\").split(\" \");\n\nconst clemKeywords = keywords.map((keyword) => ({ label: keyword, type: \"keyword\" }));\n\nconst isSpecialChar = /[\\[\\]{}\\(\\),;\\:\\.]/;\nconst isDigit = /\\d/;\nconst isNumberChar = /[\\w\\.]/;\nconst isWordChar = /[\\w\\$_]/;\nconst isOperatorChar = /[+\\-*&%=<>!?|\\/]/;\n\nfunction tokenResolve(stream, state) {\n\tconst ch = stream.next();\n\tif (ch === \"#\" && state.startOfLine) {\n\t\tstream.skipToEnd();\n\t\treturn \"meta\";\n\t}\n\n\tif (ch === \"\\\"\") {\n\t\ttokenString(ch, stream, state);\n\t\treturn \"string\";\n\t}\n\n\tif (ch === \"'\") {\n\t\ttokenVariable(ch, stream, state);\n\t\treturn \"variable\";\n\t}\n\n\tif (isSpecialChar.test(ch)) {\n\t\treturn null;\n\t}\n\n\tif (isDigit.test(ch)) {\n\t\tstream.eatWhile(isNumberChar);\n\t\treturn \"number\";\n\t}\n\tif (isOperatorChar.test(ch)) {\n\t\tstream.eatWhile(isOperatorChar);\n\t\treturn \"operator\";\n\t}\n\n\tstream.eatWhile(isWordChar);\n\tconst cur = stream.current();\n\tif (keywords.indexOf(cur) !== -1) {\n\t\treturn \"keyword\";\n\t}\n\treturn \"variable\";\n}\n\nfunction tokenString(quote, stream, state) {\n\tlet next;\n\tlet end = false;\n\twhile (typeof (next = stream.next()) !== \"undefined\") {\n\t\tif (next === quote) {\n\t\t\tend = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end) {\n\t\tstate.tokenize = null;\n\t}\n\treturn \"string\";\n}\n\nfunction tokenVariable(quote, stream, state) {\n\tlet next;\n\tlet end = false;\n\twhile (typeof (next = stream.next()) !== \"undefined\") {\n\t\tif (next === quote) {\n\t\t\tend = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end) {\n\t\tstate.tokenize = null;\n\t}\n\treturn \"variable\";\n}\n\n// Define CLEM language\nconst clemLanguage = StreamLanguage.define({\n\tname: \"CLEM\",\n\tstartState: function() {\n\t\treturn { tokenize: null };\n\t},\n\ttoken: function(stream, state) {\n\t\tif (stream.eatSpace()) {\n\t\t\treturn null;\n\t\t}\n\t\tconst style = (state.tokenize || tokenResolve)(stream, state);\n\t\treturn style;\n\t},\n});\n\n// Autocompletions\nconst clemCompletion = clemLanguage.data.of({\n\tautocomplete: completeFromList(clemKeywords)\n});\n\nfunction clem() {\n\treturn new LanguageSupport(clemLanguage, [clemCompletion]);\n}\n\nexport {\n\tclem\n};\n"],"names":["keywords","split","clemKeywords","map","keyword","label","type","isSpecialChar","isDigit","isNumberChar","isWordChar","isOperatorChar","tokenResolve","stream","state","ch","next","startOfLine","skipToEnd","quote","end","tokenize","tokenString","tokenVariable","test","eatWhile","cur","current","indexOf","clemLanguage","StreamLanguage","define","name","startState","token","eatSpace","clemCompletion","data","of","autocomplete","completeFromList","LanguageSupport"],"mappings":"gJAoBMA,EAAW,2kEAwBiCC,MAAM,KAElDC,EAAeF,EAASG,IAAI,SAACC,GAAO,MAAM,CAAEC,MAAOD,EAASE,KAAM,UAAW,GAE7EC,EAAgB,qBAChBC,EAAU,KACVC,EAAe,SACfC,EAAa,UACbC,EAAiB,mBAEvB,SAASC,EAAaC,EAAQC,GAC7B,IAAMC,EAAKF,EAAOG,OAClB,GAAW,MAAPD,GAAcD,EAAMG,YAEvB,OADAJ,EAAOK,YACA,OAGR,GAAW,MAAPH,EAEH,OA6BF,SAAqBI,EAAON,EAAQC,GACnC,IAAIE,EACAI,GAAM,EACV,UAAyC,KAA1BJ,EAAOH,EAAOG,SAC5B,GAAIA,IAASG,EAAO,CACnBC,GAAM,EACN,KACD,CAEGA,IACHN,EAAMO,SAAW,KAGnB,CA3CEC,CAAYP,EAAIF,EAAQC,GACjB,SAGR,GAAW,MAAPC,EAEH,OAuCF,SAAuBI,EAAON,EAAQC,GACrC,IAAIE,EACAI,GAAM,EACV,UAAyC,KAA1BJ,EAAOH,EAAOG,SAC5B,GAAIA,IAASG,EAAO,CACnBC,GAAM,EACN,KACD,CAEGA,IACHN,EAAMO,SAAW,KAGnB,CArDEE,CAAcR,EAAIF,EAAQC,GACnB,WAGR,GAAIP,EAAciB,KAAKT,GACtB,OAAO,KAGR,GAAIP,EAAQgB,KAAKT,GAEhB,OADAF,EAAOY,SAAShB,GACT,SAER,GAAIE,EAAea,KAAKT,GAEvB,OADAF,EAAOY,SAASd,GACT,WAGRE,EAAOY,SAASf,GAChB,IAAMgB,EAAMb,EAAOc,UACnB,OAA+B,IAA3B3B,EAAS4B,QAAQF,GACb,UAED,UACR,CAiCA,IAAMG,EAAeC,EAAcA,eAACC,OAAO,CAC1CC,KAAM,OACNC,WAAY,WACX,MAAO,CAAEZ,SAAU,KACnB,EACDa,MAAO,SAASrB,EAAQC,GACvB,OAAID,EAAOsB,WACH,MAEOrB,EAAMO,UAAYT,GAAcC,EAAQC,EAExD,IAIKsB,EAAiBP,EAAaQ,KAAKC,GAAG,CAC3CC,aAAcC,EAAgBA,iBAACtC,kBAGhC,WACC,OAAO,IAAIuC,EAAAA,gBAAgBZ,EAAc,CAACO,GAC3C"}
1
+ {"version":3,"file":"clem.js","sources":["../../../src/common-properties/controls/expression/languages/CLEM-hint.js"],"sourcesContent":["/*\n * Copyright 2017-2024 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/* eslint no-useless-escape: \"off\" */\nimport { LanguageSupport, StreamLanguage } from \"@codemirror/language\";\nimport { completeFromList } from \"@codemirror/autocomplete\";\n\nconst keywords = (\"@BLANK @DIFF1 @DIFF2 @FIELD @FIELDS_BETWEEN @FIELDS_MATCHING \" +\n\"@GLOBAL_MAX @GLOBAL_MEAN @GLOBAL_MIN @GLOBAL_SDEV @GLOBAL_SUM @INDEX @LAST_NON_BLANK \" +\n\"@MAX @MEAN @MIN @MULTI_RESPONSE_SET @NULL @OFFSET @PARTITION_FIELD @PREDICTED \" +\n\"@SDEV @SINCE @SINCE0 @SUM @TARGET @TESTING_PARTITION @THIS @TODAY @TRAINING_PARTITION \" +\n\"@VALIDATION_PARTITION abs allbutfirst allbutlast alphabefore and arccos arccosh arcsin \" +\n\"arcsinh arctan arctan2 arctanh area cdf_chisq cdf_f cdf_normal cdf_t close_to COND1 \" +\n\"and COND2 COND1 or COND2 cos cosh count_equal count_greater_than count_less_than \" +\n\"count_non_nulls count_not_equal count_nulls count_substring crosses date_before \" +\n\"date_days_difference date_from_ywd date_in_days date_in_months date_in_weeks date_in_years \" +\n\"date_iso_day date_iso_week date_iso_year date_months_difference date_weeks_difference \" +\n\"date_years_difference datetime_date datetime_day datetime_day_name datetime_day_short_name \" +\n\"datetime_hour datetime_in_seconds datetime_minute datetime_month datetime_month_name \" +\n\"datetime_month_short_name datetime_now datetime_second datetime_time datetime_timestamp \" +\n\"datetime_weekday datetime_year distance div endstring exp first_index first_non_null \" +\n\"first_non_null_index fracof hasendstring hasmidstring hasstartstring hassubstring hassubstring \" +\n\"if then else elseif endif integer_bitcount integer_leastbit integer_length intof is_date \" +\n\"is_datetime is_integer is_number is_real is_string is_time is_timestamp isalphacode \" +\n\"isendstring islowercode ismidstring isnumbercode isstartstring issubstring issubstring \" +\n\"issubstring_count issubstring_lim isuppercode last last_index last_non_null last_non_null_index \" +\n\"length locchar locchar_back log log10 lowertoupper max max_index max_n MEAN mean_n member \" +\n\"min min_index min_n negate not num_points oneof or overlap pi random random0 rem replace \" +\n\"replicate round sdev_n sign sin sinh skipchar skipchar_back soundex soundex_difference sqrt \" +\n\"startstring stb_centroid_latitude stb_centroid_longitude stripchar strmember subscrs substring \" +\n\"substring_between sum_n tan tanh testbit time_before time_hours_difference time_in_hours \" +\n\"time_in_mins time_in_secs time_mins_difference\").split(\" \");\n\nconst clemKeywords = keywords.map((keyword) => ({ label: keyword, type: \"keyword\" }));\n\nconst isSpecialChar = /[\\[\\]{}\\(\\),;\\:\\.]/;\nconst isDigit = /\\d/;\nconst isNumberChar = /[\\w\\.]/;\nconst isWordChar = /[\\w\\$_]/;\nconst isOperatorChar = /[+\\-*&%=<>!?|\\/]/;\n\nfunction tokenResolve(stream, state) {\n\tconst ch = stream.next();\n\tif (ch === \"#\" && state.startOfLine) {\n\t\tstream.skipToEnd();\n\t\treturn \"meta\";\n\t}\n\n\tif (ch === \"\\\"\") {\n\t\ttokenString(ch, stream, state);\n\t\treturn \"string\";\n\t}\n\n\tif (ch === \"'\") {\n\t\ttokenVariable(ch, stream, state);\n\t\treturn \"variable\";\n\t}\n\n\tif (isSpecialChar.test(ch)) {\n\t\treturn null;\n\t}\n\n\tif (isDigit.test(ch)) {\n\t\tstream.eatWhile(isNumberChar);\n\t\treturn \"number\";\n\t}\n\tif (isOperatorChar.test(ch)) {\n\t\tstream.eatWhile(isOperatorChar);\n\t\treturn \"operator\";\n\t}\n\n\tstream.eatWhile(isWordChar);\n\tconst cur = stream.current();\n\tif (keywords.indexOf(cur) !== -1) {\n\t\treturn \"keyword\";\n\t}\n\treturn \"variable\";\n}\n\nfunction tokenString(quote, stream, state) {\n\tlet next;\n\tlet end = false;\n\twhile (typeof (next = stream.next()) !== \"undefined\") {\n\t\tif (next === quote) {\n\t\t\tend = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end) {\n\t\tstate.tokenize = null;\n\t}\n\treturn \"string\";\n}\n\nfunction tokenVariable(quote, stream, state) {\n\tlet next;\n\tlet end = false;\n\twhile (typeof (next = stream.next()) !== \"undefined\") {\n\t\tif (next === quote) {\n\t\t\tend = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end) {\n\t\tstate.tokenize = null;\n\t}\n\treturn \"variable\";\n}\n\n// Define CLEM language\nconst clemLanguage = StreamLanguage.define({\n\tname: \"CLEM\",\n\tstartState: function() {\n\t\treturn { tokenize: null };\n\t},\n\ttoken: function(stream, state) {\n\t\tif (stream.eatSpace()) {\n\t\t\treturn null;\n\t\t}\n\t\tconst style = (state.tokenize || tokenResolve)(stream, state);\n\t\treturn style;\n\t},\n});\n\n// Autocompletions\nconst clemCompletion = clemLanguage.data.of({\n\tautocomplete: completeFromList(clemKeywords)\n});\n\nfunction clem() {\n\treturn new LanguageSupport(clemLanguage, [clemCompletion]);\n}\n\nexport {\n\tclem\n};\n"],"names":["keywords","split","clemKeywords","map","keyword","label","type","isSpecialChar","isDigit","isNumberChar","isWordChar","isOperatorChar","tokenResolve","stream","state","ch","next","startOfLine","skipToEnd","quote","end","tokenize","tokenString","tokenVariable","test","eatWhile","cur","current","indexOf","clemLanguage","StreamLanguage","define","name","startState","token","eatSpace","clemCompletion","data","of","autocomplete","completeFromList","clem","LanguageSupport"],"mappings":"uIAoBA,IAAMA,EAAW,2kEAwBiCC,MAAM,KAElDC,EAAeF,EAASG,IAAI,SAACC,GAAO,MAAM,CAAEC,MAAOD,EAASE,KAAM,UAAW,GAE7EC,EAAgB,qBAChBC,EAAU,KACVC,EAAe,SACfC,EAAa,UACbC,EAAiB,mBAEvB,SAASC,EAAaC,EAAQC,GAC7B,IAAMC,EAAKF,EAAOG,OAClB,GAAW,MAAPD,GAAcD,EAAMG,YAEvB,OADAJ,EAAOK,YACA,OAGR,GAAW,MAAPH,EAEH,OA6BF,SAAqBI,EAAON,EAAQC,GACnC,IAAIE,EACAI,GAAM,EACV,UAAyC,KAA1BJ,EAAOH,EAAOG,SAC5B,GAAIA,IAASG,EAAO,CACnBC,GAAM,EACN,KACD,CAEGA,IACHN,EAAMO,SAAW,KAGnB,CA3CEC,CAAYP,EAAIF,EAAQC,GACjB,SAGR,GAAW,MAAPC,EAEH,OAuCF,SAAuBI,EAAON,EAAQC,GACrC,IAAIE,EACAI,GAAM,EACV,UAAyC,KAA1BJ,EAAOH,EAAOG,SAC5B,GAAIA,IAASG,EAAO,CACnBC,GAAM,EACN,KACD,CAEGA,IACHN,EAAMO,SAAW,KAGnB,CArDEE,CAAcR,EAAIF,EAAQC,GACnB,WAGR,GAAIP,EAAciB,KAAKT,GACtB,OAAO,KAGR,GAAIP,EAAQgB,KAAKT,GAEhB,OADAF,EAAOY,SAAShB,GACT,SAER,GAAIE,EAAea,KAAKT,GAEvB,OADAF,EAAOY,SAASd,GACT,WAGRE,EAAOY,SAASf,GAChB,IAAMgB,EAAMb,EAAOc,UACnB,OAA+B,IAA3B3B,EAAS4B,QAAQF,GACb,UAED,UACR,CAiCA,IAAMG,EAAeC,EAAeC,OAAO,CAC1CC,KAAM,OACNC,WAAY,WACX,MAAO,CAAEZ,SAAU,KACnB,EACDa,MAAO,SAASrB,EAAQC,GACvB,OAAID,EAAOsB,WACH,MAEOrB,EAAMO,UAAYT,GAAcC,EAAQC,EAExD,IAIKsB,EAAiBP,EAAaQ,KAAKC,GAAG,CAC3CC,aAAcC,EAAiBtC,KAGhC,SAASuC,IACR,OAAO,IAAIC,EAAgBb,EAAc,CAACO,GAC3C"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../../index-653a393b.js");require("../../flexible-table-1b07a6ff.js"),require("../../createClass-df7b07d6.js"),require("../../inherits-74e481d1.js"),require("../../isArrayLikeObject-4737a54a.js"),require("../../common-canvas-utils-272fb8c4.js"),require("react"),require("react-intl"),require("@carbon/react"),require("../../toInteger-b7d805dd.js"),require("@tanstack/react-table"),require("@tanstack/react-virtual"),require("../../keyboard-utils-b5a20c84.js"),require("prop-types"),require("../tooltip.cjs"),require("react-portal"),require("uuid"),require("react-virtualized"),require("react-draggable"),require("../../defineProperty-d68f985b.js"),require("../../en-48c97a88.js"),require("react-inlinesvg"),require("../../Time-b0f9a9cb.js"),require("../../ChevronRight-362f2dfd.js"),module.exports=e.FieldPicker;
2
+ //# sourceMappingURL=field-picker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-picker.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../index-5383b802.js");require("../../flexible-table-d624ee4e.js"),require("../../createClass-df7b07d6.js"),require("../../inherits-74e481d1.js"),require("../../isArrayLikeObject-4737a54a.js"),require("../../common-canvas-utils-272fb8c4.js"),require("react"),require("react-intl"),require("@carbon/react"),require("../../toInteger-b7d805dd.js"),require("@tanstack/react-table"),require("@tanstack/react-virtual"),require("../../keyboard-utils-b5a20c84.js"),require("prop-types"),require("../tooltip.js"),require("react-portal"),require("uuid"),require("react-virtualized"),require("react-draggable"),require("../../defineProperty-d68f985b.js"),require("../../en-48c97a88.js"),require("react-inlinesvg"),require("../../Time-b0f9a9cb.js"),require("../../ChevronRight-362f2dfd.js"),module.exports=e.FieldPicker;
1
+ export{F as default}from"../../index-a6a232be.js";import"../../flexible-table-40f665e8.js";import"../../createClass-a140e270.js";import"../../inherits-860188e5.js";import"../../isArrayLikeObject-8496ff7c.js";import"../../common-canvas-utils-7ef1d091.js";import"react";import"react-intl";import"@carbon/react";import"../../toInteger-ea444724.js";import"@tanstack/react-table";import"@tanstack/react-virtual";import"../../keyboard-utils-a23c5d52.js";import"prop-types";import"../tooltip.js";import"react-portal";import"uuid";import"react-virtualized";import"react-draggable";import"../../defineProperty-f3298a15.js";import"../../en-dceabf36.js";import"react-inlinesvg";import"../../Time-e622883c.js";import"../../ChevronRight-f4724ce3.js";
2
2
  //# sourceMappingURL=field-picker.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../../flexible-table-1b07a6ff.js");require("../../createClass-df7b07d6.js"),require("../../inherits-74e481d1.js"),require("../../isArrayLikeObject-4737a54a.js"),require("../../common-canvas-utils-272fb8c4.js"),require("react"),require("react-intl"),require("@carbon/react"),require("../../toInteger-b7d805dd.js"),require("@tanstack/react-table"),require("@tanstack/react-virtual"),require("../../keyboard-utils-b5a20c84.js"),require("prop-types"),require("../tooltip.cjs"),require("react-portal"),require("uuid"),require("react-virtualized"),require("react-draggable"),module.exports=e.FlexibleTable;
2
+ //# sourceMappingURL=flexible-table.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flexible-table.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../flexible-table-d624ee4e.js");require("../../createClass-df7b07d6.js"),require("../../inherits-74e481d1.js"),require("../../isArrayLikeObject-4737a54a.js"),require("../../common-canvas-utils-272fb8c4.js"),require("react"),require("react-intl"),require("@carbon/react"),require("../../toInteger-b7d805dd.js"),require("@tanstack/react-table"),require("@tanstack/react-virtual"),require("../../keyboard-utils-b5a20c84.js"),require("prop-types"),require("../tooltip.js"),require("react-portal"),require("uuid"),require("react-virtualized"),require("react-draggable"),module.exports=e.FlexibleTable;
1
+ import{F as t}from"../../flexible-table-40f665e8.js";export{F as default}from"../../flexible-table-40f665e8.js";import"../../createClass-a140e270.js";import"../../inherits-860188e5.js";import"../../isArrayLikeObject-8496ff7c.js";import"../../common-canvas-utils-7ef1d091.js";import"react";import"react-intl";import"@carbon/react";import"../../toInteger-ea444724.js";import"@tanstack/react-table";import"@tanstack/react-virtual";import"../../keyboard-utils-a23c5d52.js";import"prop-types";import"../tooltip.js";import"react-portal";import"uuid";import"react-virtualized";import"react-draggable";
2
2
  //# sourceMappingURL=flexible-table.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=["await","else","pass","break","except","in","raise","finally","is","return","and","continue","lambda","as","nonlocal","assert","del","global","not","with","async","elif","or","yield"],t=[];exports.getPythonHints=function(){var n=[];return e.forEach(function(e){return n.push({label:e,type:"keyword"})}),t.forEach(function(e){return n.push({label:e,type:"function"})}),n};
2
+ //# sourceMappingURL=getPythonHints.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPythonHints.cjs","sources":["../../../src/common-properties/controls/expression/languages/python-hint.js"],"sourcesContent":["/*\n * Copyright 2017-2024 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// Ref: https://docs.python.org/3.12/reference/lexical_analysis.html#keywords\nconst pythonKeywords = [\n\t\"await\",\n\t\"else\",\n\t\"pass\",\n\t\"break\",\n\t\"except\",\n\t\"in\",\n\t\"raise\",\n\t\"finally\",\n\t\"is\",\n\t\"return\",\n\t\"and\",\n\t\"continue\",\n\t\"lambda\",\n\t\"as\",\n\t\"nonlocal\",\n\t\"assert\",\n\t\"del\",\n\t\"global\",\n\t\"not\",\n\t\"with\",\n\t\"async\",\n\t\"elif\",\n\t\"or\",\n\t\"yield\"\n];\n\n// Ref: https://docs.python.org/3/library/functions.html\nconst pythonFunctions = [];\n\nfunction getPythonHints() {\n\tconst pythonHints = [];\n\n\tpythonKeywords.forEach((keyword) => pythonHints.push({ label: keyword, type: \"keyword\" }));\n\n\tpythonFunctions.forEach((func) => pythonHints.push({ label: func, type: \"function\" }));\n\n\treturn pythonHints;\n}\n\nexport {\n\tgetPythonHints\n};\n"],"names":["pythonKeywords","pythonFunctions","pythonHints","forEach","keyword","push","label","type","func"],"mappings":"oEAiBA,IAAMA,EAAiB,CACtB,QACA,OACA,OACA,QACA,SACA,KACA,QACA,UACA,KACA,SACA,MACA,WACA,SACA,KACA,WACA,SACA,MACA,SACA,MACA,OACA,QACA,OACA,KACA,SAIKC,EAAkB,0BAExB,WACC,IAAMC,EAAc,GAMpB,OAJAF,EAAeG,QAAQ,SAACC,GAAO,OAAKF,EAAYG,KAAK,CAAEC,MAAOF,EAASG,KAAM,cAE7EN,EAAgBE,QAAQ,SAACK,GAAI,OAAKN,EAAYG,KAAK,CAAEC,MAAOE,EAAMD,KAAM,eAEjEL,CACR"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=["await","else","pass","break","except","in","raise","finally","is","return","and","continue","lambda","as","nonlocal","assert","del","global","not","with","async","elif","or","yield"],t=[];exports.getPythonHints=function(){var n=[];return e.forEach(function(e){return n.push({label:e,type:"keyword"})}),t.forEach(function(e){return n.push({label:e,type:"function"})}),n};
1
+ var e=["await","else","pass","break","except","in","raise","finally","is","return","and","continue","lambda","as","nonlocal","assert","del","global","not","with","async","elif","or","yield"],n=[];function a(){var a=[];return e.forEach(function(e){return a.push({label:e,type:"keyword"})}),n.forEach(function(e){return a.push({label:e,type:"function"})}),a}export{a as getPythonHints};
2
2
  //# sourceMappingURL=getPythonHints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPythonHints.js","sources":["../../../src/common-properties/controls/expression/languages/python-hint.js"],"sourcesContent":["/*\n * Copyright 2017-2024 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// Ref: https://docs.python.org/3.12/reference/lexical_analysis.html#keywords\nconst pythonKeywords = [\n\t\"await\",\n\t\"else\",\n\t\"pass\",\n\t\"break\",\n\t\"except\",\n\t\"in\",\n\t\"raise\",\n\t\"finally\",\n\t\"is\",\n\t\"return\",\n\t\"and\",\n\t\"continue\",\n\t\"lambda\",\n\t\"as\",\n\t\"nonlocal\",\n\t\"assert\",\n\t\"del\",\n\t\"global\",\n\t\"not\",\n\t\"with\",\n\t\"async\",\n\t\"elif\",\n\t\"or\",\n\t\"yield\"\n];\n\n// Ref: https://docs.python.org/3/library/functions.html\nconst pythonFunctions = [];\n\nfunction getPythonHints() {\n\tconst pythonHints = [];\n\n\tpythonKeywords.forEach((keyword) => pythonHints.push({ label: keyword, type: \"keyword\" }));\n\n\tpythonFunctions.forEach((func) => pythonHints.push({ label: func, type: \"function\" }));\n\n\treturn pythonHints;\n}\n\nexport {\n\tgetPythonHints\n};\n"],"names":["pythonKeywords","pythonFunctions","pythonHints","forEach","keyword","push","label","type","func"],"mappings":"oEAiBA,IAAMA,EAAiB,CACtB,QACA,OACA,OACA,QACA,SACA,KACA,QACA,UACA,KACA,SACA,MACA,WACA,SACA,KACA,WACA,SACA,MACA,SACA,MACA,OACA,QACA,OACA,KACA,SAIKC,EAAkB,0BAExB,WACC,IAAMC,EAAc,GAMpB,OAJAF,EAAeG,QAAQ,SAACC,GAAO,OAAKF,EAAYG,KAAK,CAAEC,MAAOF,EAASG,KAAM,cAE7EN,EAAgBE,QAAQ,SAACK,GAAI,OAAKN,EAAYG,KAAK,CAAEC,MAAOE,EAAMD,KAAM,eAEjEL,CACR"}
1
+ {"version":3,"file":"getPythonHints.js","sources":["../../../src/common-properties/controls/expression/languages/python-hint.js"],"sourcesContent":["/*\n * Copyright 2017-2024 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// Ref: https://docs.python.org/3.12/reference/lexical_analysis.html#keywords\nconst pythonKeywords = [\n\t\"await\",\n\t\"else\",\n\t\"pass\",\n\t\"break\",\n\t\"except\",\n\t\"in\",\n\t\"raise\",\n\t\"finally\",\n\t\"is\",\n\t\"return\",\n\t\"and\",\n\t\"continue\",\n\t\"lambda\",\n\t\"as\",\n\t\"nonlocal\",\n\t\"assert\",\n\t\"del\",\n\t\"global\",\n\t\"not\",\n\t\"with\",\n\t\"async\",\n\t\"elif\",\n\t\"or\",\n\t\"yield\"\n];\n\n// Ref: https://docs.python.org/3/library/functions.html\nconst pythonFunctions = [];\n\nfunction getPythonHints() {\n\tconst pythonHints = [];\n\n\tpythonKeywords.forEach((keyword) => pythonHints.push({ label: keyword, type: \"keyword\" }));\n\n\tpythonFunctions.forEach((func) => pythonHints.push({ label: func, type: \"function\" }));\n\n\treturn pythonHints;\n}\n\nexport {\n\tgetPythonHints\n};\n"],"names":["pythonKeywords","pythonFunctions","getPythonHints","pythonHints","forEach","keyword","push","label","type","func"],"mappings":"AAiBA,IAAMA,EAAiB,CACtB,QACA,OACA,OACA,QACA,SACA,KACA,QACA,UACA,KACA,SACA,MACA,WACA,SACA,KACA,WACA,SACA,MACA,SACA,MACA,OACA,QACA,OACA,KACA,SAIKC,EAAkB,GAExB,SAASC,IACR,IAAMC,EAAc,GAMpB,OAJAH,EAAeI,QAAQ,SAACC,GAAO,OAAKF,EAAYG,KAAK,CAAEC,MAAOF,EAASG,KAAM,cAE7EP,EAAgBG,QAAQ,SAACK,GAAI,OAAKN,EAAYG,KAAK,CAAEC,MAAOE,EAAMD,KAAM,eAEjEL,CACR"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-properties-d1008563.js"),r=require("../flexible-table-1b07a6ff.js"),i=require("../index-653a393b.js"),t=require("./properties/clem.cjs"),o=require("./properties/getPythonHints.cjs");require("../createClass-df7b07d6.js"),require("../inherits-74e481d1.js"),require("react"),require("../Close-00f026a1.js"),require("../common-canvas-utils-272fb8c4.js"),require("../toInteger-b7d805dd.js"),require("../isArrayLikeObject-4737a54a.js"),require("../datarecord-metadata-v3-schema-46edaa7d.js"),require("../en-48c97a88.js"),require("../keyboard-utils-b5a20c84.js"),require("prop-types"),require("./tooltip.cjs"),require("react-portal"),require("@carbon/react"),require("uuid"),require("react-inlinesvg"),require("../Time-b0f9a9cb.js"),require("../ChevronRight-362f2dfd.js"),require("react-intl"),require("react-redux"),require("../defineProperty-d68f985b.js"),require("redux"),require("seedrandom"),require("./command-stack.cjs"),require("immutable"),require("date-fns"),require("@codemirror/view"),require("@codemirror/commands"),require("@codemirror/search"),require("@codemirror/autocomplete"),require("@codemirror/state"),require("@codemirror/language"),require("@codemirror/lang-python"),require("@codemirror/lang-sql"),require("@codemirror/lang-javascript"),require("@codemirror/lang-json"),require("jsonschema"),require("@tanstack/react-table"),require("@tanstack/react-virtual"),require("react-virtualized"),require("react-draggable"),exports.CommonProperties=e.commonProperties,exports.PropertiesController=e.PropertiesController,exports.FlexibleTable=r.FlexibleTable,exports.FieldPicker=i.FieldPicker,exports.clem=t.clem,exports.getPythonHints=o.getPythonHints;
2
+ //# sourceMappingURL=properties.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-properties-5695fc39.js"),r=require("../flexible-table-d624ee4e.js"),i=require("../index-5383b802.js"),t=require("./properties/clem.js"),o=require("./properties/getPythonHints.js");require("../createClass-df7b07d6.js"),require("../inherits-74e481d1.js"),require("react"),require("../Close-46e688b8.js"),require("../common-canvas-utils-272fb8c4.js"),require("../toInteger-b7d805dd.js"),require("../isArrayLikeObject-4737a54a.js"),require("../datarecord-metadata-v3-schema-46edaa7d.js"),require("../en-48c97a88.js"),require("../keyboard-utils-b5a20c84.js"),require("prop-types"),require("./tooltip.js"),require("react-portal"),require("@carbon/react"),require("uuid"),require("react-inlinesvg"),require("../Time-b0f9a9cb.js"),require("../ChevronRight-362f2dfd.js"),require("react-intl"),require("react-redux"),require("../defineProperty-d68f985b.js"),require("redux"),require("seedrandom"),require("./command-stack.js"),require("immutable"),require("date-fns"),require("@codemirror/view"),require("@codemirror/commands"),require("@codemirror/search"),require("@codemirror/autocomplete"),require("@codemirror/state"),require("@codemirror/language"),require("@codemirror/lang-python"),require("@codemirror/lang-sql"),require("@codemirror/lang-javascript"),require("@codemirror/lang-json"),require("jsonschema"),require("@tanstack/react-table"),require("@tanstack/react-virtual"),require("react-virtualized"),require("react-draggable"),exports.CommonProperties=e.commonProperties,exports.PropertiesController=e.PropertiesController,exports.FlexibleTable=r.FlexibleTable,exports.FieldPicker=i.FieldPicker,exports.clem=t.clem,exports.getPythonHints=o.getPythonHints;
1
+ export{c as CommonProperties,P as PropertiesController}from"../common-properties-3d129050.js";export{F as FlexibleTable}from"../flexible-table-40f665e8.js";export{F as FieldPicker}from"../index-a6a232be.js";export{clem}from"./properties/clem.js";export{getPythonHints}from"./properties/getPythonHints.js";import"../createClass-a140e270.js";import"../inherits-860188e5.js";import"react";import"../Close-3a206dc0.js";import"../common-canvas-utils-7ef1d091.js";import"../toInteger-ea444724.js";import"../isArrayLikeObject-8496ff7c.js";import"../datarecord-metadata-v3-schema-73031f6a.js";import"../en-dceabf36.js";import"../keyboard-utils-a23c5d52.js";import"prop-types";import"./tooltip.js";import"react-portal";import"@carbon/react";import"uuid";import"react-inlinesvg";import"../Time-e622883c.js";import"../ChevronRight-f4724ce3.js";import"react-intl";import"react-redux";import"../defineProperty-f3298a15.js";import"redux";import"seedrandom";import"./command-stack.js";import"immutable";import"date-fns";import"@codemirror/view";import"@codemirror/commands";import"@codemirror/search";import"@codemirror/autocomplete";import"@codemirror/state";import"@codemirror/language";import"@codemirror/lang-python";import"@codemirror/lang-sql";import"@codemirror/lang-javascript";import"@codemirror/lang-json";import"jsonschema";import"@tanstack/react-table";import"@tanstack/react-virtual";import"react-virtualized";import"react-draggable";
2
2
  //# sourceMappingURL=properties.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";var t=require("../createClass-df7b07d6.js"),e=require("../inherits-74e481d1.js"),i=require("react"),o=require("react-portal"),l=require("@carbon/react"),s=require("uuid");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(i);function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}var a=function(i){function n(i){var o,l,r,a;return t._classCallCheck(this,n),l=this,r=n,a=[i],r=e._getPrototypeOf(r),(o=e._possibleConstructorReturn(l,p()?Reflect.construct(r,a||[],e._getPrototypeOf(l).constructor):r.apply(l,a))).state={isTooltipVisible:!1},o.uuid=s.v4(),o.pendingTooltip=null,o.hideTooltipOnScrollAndResize=o.hideTooltipOnScrollAndResize.bind(o),o.handleMouseOverOtherTrigger=o.handleMouseOverOtherTrigger.bind(o),o.stopEventPropagation=o.stopEventPropagation.bind(o),o.tabKeyPressed=!1,o.linkClicked=!1,o.inTooltip=!1,o}return e._inherits(n,i),t._createClass(n,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.addEventListener("resize",this.hideTooltipOnScrollAndResize,!0),document.addEventListener("mouseover",this.handleMouseOverOtherTrigger,!0),this.props.targetObj&&this.setTooltipVisible(!0)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.removeEventListener("resize",this.hideTooltipOnScrollAndResize,!0),document.removeEventListener("mouseover",this.handleMouseOverOtherTrigger,!0),this.pendingTooltip&&clearTimeout(this.pendingTooltip)}},{key:"setTooltipVisible",value:function(t){if((!this.showTooltip()||!t&&this.pendingTooltip)&&(clearTimeout(this.pendingTooltip),this.pendingTooltip=null,this.setState({isTooltipVisible:!1})),this.showTooltip()){var e=document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"']"));if(this.pendingTooltip=null,this.setState({isTooltipVisible:t}),t){var i,o=null;(o=this.props.targetObj?this.props.targetObj:document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"-trigger']")))&&e&&this.updateTooltipLayout(e,o,e.getAttribute("direction"));var l=null===(i=this.targetRef)||void 0===i?void 0:i.querySelector("a");l&&l.focus()}}}},{key:"setKeyPressed",value:function(t){"Tab"===t.key&&(this.tabKeyPressed=!0),"Escape"===t.key&&(this.triggerRef.focus(),this.setTooltipVisible(!1))}},{key:"getStyleValue",value:function(t){return t+"px"}},{key:"getNewDirection",value:function(t){var e;switch(t){case"top":e="bottom";break;case"bottom":e="top";break;case"left":e="right";break;default:e="left"}return e}},{key:"showTooltip",value:function(){var t=this.canDisplayFullText(this.triggerRef);return!this.props.disable&&!this.props.showToolTipIfTruncated||!this.props.disable&&this.props.showToolTipIfTruncated&&!t}},{key:"stopEventPropagation",value:function(t){t.stopPropagation()}},{key:"canDisplayFullText",value:function(t){var e=t;if(this.props.truncatedRef&&(e=this.props.truncatedRef.current?this.props.truncatedRef.current:this.props.truncatedRef),e){var i=e.firstChild&&e.firstChild.scrollWidth&&0!==e.firstChild.scrollWidth?e.firstChild.scrollWidth:e.scrollWidth,o=e.firstChild&&e.firstChild.offsetWidth&&e.firstChild.offsetWidth||0;return i<=(0!==o&&o<e.offsetWidth?o:e.offsetWidth)}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 a=n.left;t.offsetWidth>n.width?(a-=(t.offsetWidth-n.width)/2)<0&&(a=2):t.offsetWidth<n.width&&(a+=(n.width-t.offsetWidth)/2),t.style.left=this.getStyleValue(a),a+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 h=n.top;t.offsetHeight>n.height?(h-=(t.offsetHeight-n.height)/2)<0&&(h=n.top):t.offsetHeight<n.height&&(h+=(n.height-t.offsetHeight)/2),t.style.top=this.getStyleValue(h+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,a=this.props.mousePos.y;if("top"===o||"bottom"===o){var h=p-t.offsetWidth/2;l-t.offsetWidth<h?h=l-t.offsetWidth:h<0&&(h=2),t.style.left=this.getStyleValue(h)}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(a-r.height-t.offsetHeight);else if("bottom"===o)t.style.top=this.getStyleValue(a+2*r.height);else if("left"===o||"right"===o){var u=a-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(a-t.getBoundingClientRect().top-r.height/2))}},{key:"isOutOfBounds",value:function(t){var e=parseFloat(t.style.left),i=parseFloat(t.style.top);return e+t.offsetWidth>document.documentElement.clientWidth||e<0||i<0||i+t.offsetHeight>document.documentElement.clientHeight}},{key:"toggleTooltipOnClick",value:function(t){t.stopPropagation(),t.preventDefault(),this.triggerRef.focus(),this.state.isTooltipVisible?this.setTooltipVisible(!1):this.setTooltipVisible(!0)}},{key:"hideTooltipOnScrollAndResize",value:function(t){this.state.isTooltipVisible&&!this.linkClicked&&this.setTooltipVisible(!1)}},{key:"handleMouseOverOtherTrigger",value:function(t){var e=t.target.closest(".tooltip-trigger");e&&e!==this.triggerRef&&this.state.isTooltipVisible&&this.setTooltipVisible(!1)}},{key:"render",value:function(){var e=this,i=null,s=null;if(this.props.children){var n;n=this.props.hoverable?function(){setTimeout(function(){e.inTooltip||e.setTooltipVisible(!1)},100)}:function(){return e.setTooltipVisible(!1)};var p=this.canDisplayFullText(this.triggerRef),a=this.props.showToolTipIfTruncated&&!p,h=this.props.showToolTipOnClick||a||!this.props.disable;s=r.default.createElement("div",{"data-id":"".concat(this.uuid,"-").concat(this.props.id,"-trigger"),className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:n,onMouseDown:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(t){return e.toggleTooltipOnClick(t)}:null,onFocus:h?function(){e.props.showToolTipOnClick?e.showTooltipWithDelay():e.setTooltipVisible(!0)}:null,onBlur:h?function(t){if(e.tabKeyPressed)e.setTooltipVisible(!1),e.tabKeyPressed=!1;else{var i,o,l=null==t||null===(i=t.relatedTarget)||void 0===i?void 0:i.closest(".common-canvas-tooltip");"div"===(null==l||null===(o=l.tagName)||void 0===o?void 0:o.toLowerCase())?e.setTooltipVisible(!0):e.setTooltipVisible(!1)}}:null,onKeyDown:this.props.showToolTipOnClick?function(t){return e.setKeyPressed(t)}:null,tabIndex:this.props.showToolTipOnClick||a?0:null,role:this.props.showToolTipOnClick||a?"button":null,"aria-labelledby":this.props.showToolTipOnClick||a?"".concat(this.uuid,"-").concat(this.props.id):null,"aria-expanded":this.props.showToolTipOnClick||a?this.state.isTooltipVisible:null,"aria-controls":this.props.showToolTipOnClick||a?"".concat(this.uuid,"-").concat(this.props.id):null,ref:function(t){return e.triggerRef=t}},this.props.children)}"string"==typeof this.props.tip?i=r.default.createElement("span",{className:"tooltipContainer"},this.props.tip):"object"===t._typeof(this.props.tip)?i=r.default.createElement("div",{className:"tooltipContainer"},this.props.tip):"function"==typeof this.props.tip&&(i=this.props.tip());var u="common-canvas-tooltip";this.props.className&&(u+=" "+this.props.className),this.linkClicked=!1;var c=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var f=this.props.tooltipLinkHandler(this.props.link);"object"===t._typeof(f)&&f.label&&f.url&&(c=r.default.createElement("div",{ref:function(t){return e.linkRef=t},onKeyDown:function(t){if(t.stopPropagation(),t.preventDefault(),"Escape"===t.key)e.triggerRef.focus(),e.setTooltipVisible(!1);else if("Enter"===t.key){var i=e.linkRef.children[0];i&&window.open(i,"_blank")}},onBlur:function(){e.linkClicked?e.setTooltipVisible(!0):(e.triggerRef.focus(),e.linkClicked=!1,e.setTooltipVisible(!1))},onClick:function(){e.linkClicked=!0}},r.default.createElement(l.Link,{className:"tooltip-link",id:this.props.link.id,href:f.url,target:"_blank",rel:"noopener",visited:!1,onMouseDown:function(t){t.preventDefault()}},f.label)))}var d=null;return(i||c)&&(d=r.default.createElement(o.Portal,null,r.default.createElement("div",{role:"tooltip",id:"".concat(this.uuid,"-").concat(this.props.id),"data-id":"".concat(this.uuid,"-").concat(this.props.id),className:u,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction,ref:function(t){return e.targetRef=t},onMouseEnter:function(){e.inTooltip=!0},onMouseLeave:function(){e.inTooltip=!1,e.setTooltipVisible(!1)},onClick:this.stopEventPropagation,onMouseDown:this.stopEventPropagation},r.default.createElement("svg",{className:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1","aria-hidden":!0},r.default.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),r.default.createElement("polygon",{points:"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7"})),i,c))),r.default.createElement("div",{className:"tooltip-container"},s,d)}}])}(r.default.Component);a.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1,hoverable:!1},module.exports=a;
2
+ //# sourceMappingURL=tooltip.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.cjs","sources":["../../src/tooltip/tooltip.jsx"],"sourcesContent":["/*\n * Copyright 2017-2026 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/react\";\nimport { v4 as uuid4 } from \"uuid\";\n\nclass ToolTip extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tisTooltipVisible: false\n\t\t};\n\t\tthis.uuid = uuid4();\n\t\tthis.pendingTooltip = null;\n\t\tthis.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);\n\t\tthis.handleMouseOverOtherTrigger = this.handleMouseOverOtherTrigger.bind(this);\n\t\tthis.stopEventPropagation = this.stopEventPropagation.bind(this);\n\t\tthis.tabKeyPressed = false;\n\t\t// Tooltip should not close if link inside tooltip is clicked.\n\t\tthis.linkClicked = false;\n\t\tthis.inTooltip = false; // A boolean variable that determines if the cursor is over the tooltip\n\t}\n\n\tcomponentDidMount() {\n\t\twindow.addEventListener(\"scroll\", this.hideTooltipOnScrollAndResize, true);\n\t\twindow.addEventListener(\"resize\", this.hideTooltipOnScrollAndResize, true);\n\t\tdocument.addEventListener(\"mouseover\", this.handleMouseOverOtherTrigger, 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\tdocument.removeEventListener(\"mouseover\", this.handleMouseOverOtherTrigger, true);\n\t\tif (this.pendingTooltip) {\n\t\t\tclearTimeout(this.pendingTooltip);\n\t\t}\n\t}\n\n\tsetTooltipVisible(visible) {\n\t\t// clear the display timer if set\n\t\tif (!this.showTooltip() || (!visible && this.pendingTooltip)) {\n\t\t\tclearTimeout(this.pendingTooltip);\n\t\t\tthis.pendingTooltip = null;\n\t\t\tthis.setState({\n\t\t\t\tisTooltipVisible: false\n\t\t\t});\n\t\t}\n\n\n\t\tif (this.showTooltip()) {\n\t\t\tconst tooltip = document.querySelector(`[data-id='${this.uuid}-${this.props.id}']`);\n\t\t\tthis.pendingTooltip = null;\n\t\t\tthis.setState({\n\t\t\t\tisTooltipVisible: visible\n\t\t\t});\n\t\t\t// updates the tooltip display\n\t\t\tif (visible) {\n\t\t\t\tlet tooltipTrigger = null;\n\t\t\t\tif (this.props.targetObj) {\n\t\t\t\t\ttooltipTrigger = this.props.targetObj;\n\t\t\t\t} else {\n\t\t\t\t\ttooltipTrigger = document.querySelector(`[data-id='${this.uuid}-${this.props.id}-trigger']`);\n\t\t\t\t}\n\t\t\t\tif (tooltipTrigger && tooltip) {\n\t\t\t\t\tthis.updateTooltipLayout(tooltip, tooltipTrigger, tooltip.getAttribute(\"direction\"));\n\t\t\t\t}\n\n\t\t\t\tconst linkElement = this.targetRef?.querySelector(\"a\");\n\n\t\t\t\t// Focus on link when tooltip with link is opened\n\t\t\t\tif (linkElement) {\n\t\t\t\t\tlinkElement.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsetKeyPressed(evt) {\n\t\tif (evt.key === \"Tab\") {\n\t\t\tthis.tabKeyPressed = true;\n\t\t}\n\t\tif (evt.key === \"Escape\") {\n\t\t\tthis.triggerRef.focus();\n\t\t\tthis.setTooltipVisible(false);\n\t\t}\n\t}\n\n\tgetStyleValue(value) {\n\t\treturn value + \"px\";\n\t}\n\n\tgetNewDirection(currentDirection) {\n\t\tlet newDirection;\n\t\tswitch (currentDirection) {\n\t\tcase \"top\":\n\t\t\tnewDirection = \"bottom\";\n\t\t\tbreak;\n\t\tcase \"bottom\":\n\t\t\tnewDirection = \"top\";\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\tnewDirection = \"right\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tnewDirection = \"left\";\n\t\t}\n\t\treturn newDirection;\n\t}\n\n\tshowTooltip() {\n\t\tconst canDisplayFullText = this.canDisplayFullText(this.triggerRef);\n\t\tconst showToolTip = (\n\t\t\t// show tooltip if not disabled and showToolTipIfTruncated is false\n\t\t\t(!this.props.disable && !this.props.showToolTipIfTruncated) ||\n\t\t\t// show tooltip if not disabled and showToolTipIfTruncated is true and string is truncated\n\t\t\t(!this.props.disable && this.props.showToolTipIfTruncated && !canDisplayFullText));\n\t\treturn showToolTip;\n\t}\n\n\tstopEventPropagation(evt) {\n\t\tevt.stopPropagation();\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\tlet triggerElem = elem;\n\t\tif (this.props.truncatedRef) {\n\t\t\tif (this.props.truncatedRef.current) {\n\t\t\t\t// Textfield controls within a table will not get rendered until after the table is rendered.\n\t\t\t\t// The ref passed in initially will be undefined so do not access current until it is available.\n\t\t\t\ttriggerElem = this.props.truncatedRef.current;\n\t\t\t} else {\n\t\t\t\ttriggerElem = this.props.truncatedRef;\n\t\t\t}\n\t\t}\n\t\tif (triggerElem) {\n\t\t\tconst fullWidth = triggerElem.firstChild && triggerElem.firstChild.scrollWidth && triggerElem.firstChild.scrollWidth !== 0 ? triggerElem.firstChild.scrollWidth\n\t\t\t\t: triggerElem.scrollWidth;\n\t\t\tconst childWidth = triggerElem.firstChild && triggerElem.firstChild.offsetWidth && triggerElem.firstChild.offsetWidth || 0;\n\t\t\t// need different handling when content is within a span vs div\n\t\t\tconst displayWidth = childWidth !== 0 && childWidth < triggerElem.offsetWidth ? childWidth : triggerElem.offsetWidth;\n\t\t\tconst canDisplayFullText = fullWidth <= displayWidth;\n\t\t\treturn canDisplayFullText;\n\t\t}\n\t\treturn false; // Show tooltip if we cannot read the width (Canvas objects)\n\t}\n\n\tshowTooltipWithDelay() {\n\n\t\t// set a delay on displaying the tooltip\n\t\tif (!this.pendingTooltip && this.showTooltip()) {\n\t\t\tconst that = this;\n\t\t\tthis.pendingTooltip = setTimeout(function() {\n\t\t\t\tthat.setTooltipVisible(true);\n\t\t\t}, this.props.delay);\n\t\t}\n\n\t}\n\n\tupdateTooltipLayout(tooltip, tooltipTrigger, direction) {\n\t\tconst tooltipDirection = direction;\n\t\tconst viewPortWidth = document.documentElement.clientWidth;\n\t\tconst viewPortHeight = document.documentElement.clientHeight;\n\t\tconst triggerLayout = tooltipTrigger.getBoundingClientRect();\n\t\tconst pointer = tooltip.querySelector(\"svg\");\n\t\tconst pointerLayout = pointer.getBoundingClientRect();\n\t\tconst pointerCorrection = 1;\n\n\t\t// always initialize tooltip location so it's all visible to ensure adjustments are done on the right size\n\t\ttooltip.style.left = this.getStyleValue(triggerLayout.left);\n\t\ttooltip.style.top = this.getStyleValue(triggerLayout.top);\n\n\t\tif (this.props.mousePos) {\n\t\t\tthis.updateLocationBasedOnMousePos(tooltip, this.props.mousePos, direction);\n\t\t} else { // tooltip relative to element\n\t\t\t// tooltip - left correction\n\t\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\t\tlet tooltipLeft = triggerLayout.left;\n\t\t\t\tif (tooltip.offsetWidth > triggerLayout.width) {\n\t\t\t\t\ttooltipLeft -= (tooltip.offsetWidth - triggerLayout.width) / 2; // distribute overlap evenly left and right\n\t\t\t\t\tif (tooltipLeft < 0) {\n\t\t\t\t\t\ttooltipLeft = 2; // hitting left border\n\t\t\t\t\t}\n\t\t\t\t} else if (tooltip.offsetWidth < triggerLayout.width) {\n\t\t\t\t\ttooltipLeft += (triggerLayout.width - tooltip.offsetWidth) / 2; // center tip within triggerLayout\n\t\t\t\t}\n\t\t\t\ttooltip.style.left = this.getStyleValue(tooltipLeft);\n\t\t\t\tif ((tooltipLeft + tooltip.offsetWidth) > viewPortWidth) {\n\t\t\t\t\ttooltip.style.left = this.getStyleValue(viewPortWidth - tooltip.offsetWidth); // hitting right border\n\t\t\t\t}\n\t\t\t} else if (tooltipDirection === \"left\") {\n\t\t\t\t// For long tooltips, tooltip.offsetWidth is updated after setting tooltip.style.left. Ensure tooltip doesn't overlap tooltipTrigger element.\n\t\t\t\twhile ((tooltip.offsetLeft + tooltip.offsetWidth + pointerLayout.width) > Math.round(triggerLayout.left)) {\n\t\t\t\t\ttooltip.style.left = this.getStyleValue(triggerLayout.left - tooltip.offsetWidth - pointerLayout.width);\n\t\t\t\t}\n\t\t\t} else if (tooltipDirection === \"right\") {\n\t\t\t\ttooltip.style.left = this.getStyleValue(triggerLayout.right + pointerLayout.width);\n\t\t\t}\n\n\t\t\t// tooltip - top correction\n\t\t\tif (tooltipDirection === \"top\") {\n\t\t\t\ttooltip.style.top = this.getStyleValue(triggerLayout.top - pointerLayout.height - tooltip.offsetHeight);\n\t\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\t\ttooltip.style.top = this.getStyleValue(triggerLayout.bottom + pointerLayout.height);\n\t\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\t\tlet tooltipTop = triggerLayout.top;\n\t\t\t\tif (tooltip.offsetHeight > triggerLayout.height) {\n\t\t\t\t\ttooltipTop -= (tooltip.offsetHeight - triggerLayout.height) / 2; // distribute overlap evenly top and bottom\n\t\t\t\t\tif (tooltipTop < 0) {\n\t\t\t\t\t\ttooltipTop = triggerLayout.top; // hitting top border\n\t\t\t\t\t}\n\t\t\t\t} else if (tooltip.offsetHeight < triggerLayout.height) {\n\t\t\t\t\ttooltipTop += (triggerLayout.height - tooltip.offsetHeight) / 2; // center tip within triggerLayout\n\t\t\t\t}\n\t\t\t\ttooltip.style.top = this.getStyleValue(tooltipTop + pointerCorrection);\n\t\t\t\tif ((viewPortHeight - tooltip.offsetHeight) < triggerLayout.top) {\n\t\t\t\t\ttooltip.style.top = this.getStyleValue(viewPortHeight - tooltip.offsetHeight); // hitting bottom border\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// pointer - left correction\n\t\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(triggerLayout.left - tooltip.getBoundingClientRect().left +\n\t\t\t\t\ttooltipTrigger.getBoundingClientRect().width / 2 - pointerLayout.width / 2\t + pointerCorrection);\n\t\t\t} else if (tooltipDirection === \"left\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(tooltip.offsetWidth - 3);\n\t\t\t} else if (tooltipDirection === \"right\") {\n\t\t\t\tpointer.style.left = this.getStyleValue(-pointerLayout.width + 2);\n\t\t\t}\n\n\t\t\t// pointer - top correction\n\t\t\tif (tooltipDirection === \"top\") {\n\t\t\t\tpointer.style.top = this.getStyleValue(tooltip.offsetHeight - 5);\n\t\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\t\tpointer.style.top = \"-11px\";\n\t\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\t\tpointer.style.top = this.getStyleValue(triggerLayout.top - tooltip.getBoundingClientRect().top +\n\t\t\t\t\ttooltipTrigger.offsetHeight / 2 - pointerLayout.height / 2);\n\t\t\t}\n\t\t}\n\n\t\t// check if out-of-bounds at the end and if so, trigger new layout on opposite site if not already re-rendered already\n\t\tif (this.isOutOfBounds(tooltip) && tooltip.getAttribute(\"direction\") === tooltipDirection) {\n\t\t\tconst newDirection = this.getNewDirection(tooltipDirection);\n\t\t\tthis.updateTooltipLayout(tooltip, tooltipTrigger, newDirection);\n\t\t\t// update class name directly, otherwise setState triggers re-render loop in canvas\n\t\t\t// also call after updateTooltipLayout, otherwise the newDirection and class of trigger are the same\n\t\t\ttooltip.setAttribute(\"direction\", newDirection);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tupdateLocationBasedOnMousePos(tooltip, mousePos, direction) {\n\t\tconst tooltipDirection = direction;\n\t\tconst viewPortWidth = document.documentElement.clientWidth;\n\t\tconst viewPortHeight = document.documentElement.clientHeight;\n\t\tconst pointer = tooltip.querySelector(\"svg\");\n\t\tconst pointerLayout = pointer.getBoundingClientRect();\n\t\tconst pointerCorrection = 1;\n\n\t\tconst mouseX = this.props.mousePos.x;\n\t\tconst mouseY = this.props.mousePos.y;\n\t\t// if mouse position is passed in, use the cursor as reference point\n\n\t\t// tooltip - left correction\n\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\tlet tooltipLeft = mouseX - tooltip.offsetWidth / 2;\n\t\t\tif ((viewPortWidth - tooltip.offsetWidth) < tooltipLeft) {\n\t\t\t\ttooltipLeft = viewPortWidth - tooltip.offsetWidth; // hitting right border\n\t\t\t} else if (tooltipLeft < 0) {\n\t\t\t\ttooltipLeft = 2; // hitting left border\n\t\t\t}\n\t\t\ttooltip.style.left = this.getStyleValue(tooltipLeft);\n\t\t} else if (tooltipDirection === \"left\") {\n\t\t\ttooltip.style.left = this.getStyleValue(mouseX - tooltip.offsetWidth - pointerLayout.width - 5);\n\t\t} else if (tooltipDirection === \"right\") {\n\t\t\ttooltip.style.left = this.getStyleValue(mouseX + pointerLayout.width + 5);\n\t\t}\n\n\t\t// tooltip - top correction\n\t\tif (tooltipDirection === \"top\") {\n\t\t\ttooltip.style.top = this.getStyleValue(mouseY - pointerLayout.height - tooltip.offsetHeight);\n\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\ttooltip.style.top = this.getStyleValue(mouseY + 2 * pointerLayout.height);\n\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\tlet tooltipTop = mouseY - tooltip.offsetHeight / 2;\n\t\t\tif ((viewPortHeight - tooltip.offsetHeight) < tooltipTop) {\n\t\t\t\ttooltipTop = viewPortHeight - tooltip.offsetHeight; // hitting bottom border\n\t\t\t} else if (tooltipTop < 0) {\n\t\t\t\ttooltipTop = 2; // hitting top border\n\t\t\t}\n\t\t\ttooltip.style.top = this.getStyleValue(tooltipTop + pointerCorrection);\n\t\t}\n\n\t\t// pointer - left correction\n\t\tif (tooltipDirection === \"top\" || tooltipDirection === \"bottom\") {\n\t\t\tpointer.style.left = this.getStyleValue(mouseX - tooltip.getBoundingClientRect().left - pointerLayout.width / 2);\n\t\t} else if (tooltipDirection === \"left\") {\n\t\t\tpointer.style.left = this.getStyleValue(tooltip.offsetWidth - 3);\n\t\t} else if (tooltipDirection === \"right\") {\n\t\t\tpointer.style.left = this.getStyleValue(-pointerLayout.width + 2);\n\t\t}\n\n\t\t// pointer - top correction\n\t\tif (tooltipDirection === \"top\") {\n\t\t\tpointer.style.top = this.getStyleValue(tooltip.offsetHeight - 5);\n\t\t} else if (tooltipDirection === \"bottom\") {\n\t\t\tpointer.style.top = \"-11px\";\n\t\t} else if (tooltipDirection === \"left\" || tooltipDirection === \"right\") {\n\t\t\tpointer.style.top = this.getStyleValue(mouseY - tooltip.getBoundingClientRect().top - pointerLayout.height / 2);\n\t\t}\n\t}\n\n\tisOutOfBounds(tooltip) {\n\t\tconst tooltipLeft = parseFloat(tooltip.style.left);\n\t\tconst tooltipTop = parseFloat(tooltip.style.top);\n\t\treturn (((tooltipLeft + tooltip.offsetWidth) > document.documentElement.clientWidth) || // to the right\n\t\t\t\t(tooltipLeft < 0) || // to the left\n\t\t\t\t(tooltipTop < 0) || // to the top\n\t\t\t\t((tooltipTop + tooltip.offsetHeight) > document.documentElement.clientHeight)); // to the bottom\n\t}\n\n\ttoggleTooltipOnClick(evt) {\n\t\t// 'blur' event occurs before 'click' event. Because of this, onBlur function is called which hides the tooltip.\n\t\t// To prevent this default behavior, stopPropagation and preventDefault is used.\n\t\tevt.stopPropagation();\n\t\tevt.preventDefault();\n\n\t\t// When tooltip with link is closed and another tooltip is opened newly opened tooltip should have focus.\n\t\tthis.triggerRef.focus();\n\t\tif (this.state.isTooltipVisible) {\n\t\t\t// Tooltip is visible and user clicks on trigger element again, hide tooltip\n\t\t\tthis.setTooltipVisible(false);\n\t\t} else {\n\t\t\tthis.setTooltipVisible(true);\n\t\t}\n\t}\n\n\thideTooltipOnScrollAndResize(evt) {\n\t\tif (this.state.isTooltipVisible && !this.linkClicked) {\n\t\t\tthis.setTooltipVisible(false);\n\t\t}\n\t}\n\n\t// Handles mouseover events on the document to detect when the user hovers\n\t// over a different tooltip trigger element. If detected, closes the current\n\t// tooltip to prevent multiple tooltips from being displayed simultaneously.\n\thandleMouseOverOtherTrigger(evt) {\n\t\tconst target = evt.target.closest(\".tooltip-trigger\");\n\t\tif (target && target !== this.triggerRef && this.state.isTooltipVisible) {\n\t\t\tthis.setTooltipVisible(false);\n\t\t}\n\t}\n\n\trender() {\n\t\tlet tooltipContent = null;\n\t\tlet triggerContent = null;\n\t\tif (this.props.children) {\n\t\t\t// when children are passed in, tooltip will handle show/hide, otherwise consumer has to hide show/hide tooltip\n\t\t\tconst mouseover = () => this.setTooltipVisible(true);\n\t\t\tlet mouseleave;\n\t\t\tif (this.props.hoverable) {\n\t\t\t\tmouseleave = () => {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (!this.inTooltip) {\n\t\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 100);\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tmouseleave = () => this.setTooltipVisible(false);\n\t\t\t}\n\t\t\tconst mousedown = () => this.setTooltipVisible(false);\n\t\t\t// `focus` event occurs before `click`. Adding timeout in onFocus function to ensure click is executed first.\n\t\t\t// Ref - https://stackoverflow.com/a/49512400\n\t\t\tconst onKeyDown = (evt) => this.setKeyPressed(evt);\n\t\t\tconst onFocus = () => {\n\t\t\t\tif (this.props.showToolTipOnClick) {\n\t\t\t\t\tthis.showTooltipWithDelay();\n\t\t\t\t} else {\n\t\t\t\t\t// For regular hover tooltips, show immediately on focus for better keyboard accessibility\n\t\t\t\t\tthis.setTooltipVisible(true);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst onBlur = (evt) => {\n\t\t\t\t// Close the tooltip if tab is clicked\n\t\t\t\tif (this.tabKeyPressed) {\n\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\tthis.tabKeyPressed = false;\n\t\t\t\t} else {\n\t\t\t\t\t// Check if evt.relatedTarget is a child of .common-canvas-tooltip to set tooltip visible when clicked on link\n\t\t\t\t\tconst el = evt?.relatedTarget?.closest(\".common-canvas-tooltip\");\n\t\t\t\t\tif (el?.tagName?.toLowerCase() === \"div\") {\n\t\t\t\t\t\tthis.setTooltipVisible(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Close the tooltip if evt.relatedTarget is not a child of .common-canvas-tooltip\n\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst click = (evt) => this.toggleTooltipOnClick(evt);\n\n\t\t\t// If the content has a tooltip that can be shown via hover, then it must also be doable via keyboard\n\t\t\tconst canDisplayFullText = this.canDisplayFullText(this.triggerRef);\n\t\t\tconst textOverflowing = this.props.showToolTipIfTruncated && !canDisplayFullText;\n\n\t\t\t// If the children wrapped by the tooltip can be focused, then the tooltip should be shown on focus\n\t\t\tconst enableKeyboardAccess = this.props.showToolTipOnClick || textOverflowing || !this.props.disable;\n\n\t\t\ttriggerContent = (<div\n\t\t\t\tdata-id={`${this.uuid}-${this.props.id}-trigger`}\n\t\t\t\tclassName=\"tooltip-trigger\"\n\t\t\t\tonMouseOver={!this.props.showToolTipOnClick ? mouseover : null}\n\t\t\t\tonMouseLeave={!this.props.showToolTipOnClick ? mouseleave : null}\n\t\t\t\tonMouseDown={!this.props.showToolTipOnClick ? mousedown : null}\n\t\t\t\tonClick={this.props.showToolTipOnClick ? click : null}\n\t\t\t\tonFocus={enableKeyboardAccess ? onFocus : null} // When focused using keyboard\n\t\t\t\tonBlur={enableKeyboardAccess ? onBlur : null}\n\t\t\t\tonKeyDown={this.props.showToolTipOnClick ? onKeyDown : null}\n\t\t\t\ttabIndex={this.props.showToolTipOnClick || textOverflowing ? 0 : null}\n\t\t\t\trole={this.props.showToolTipOnClick || textOverflowing ? \"button\" : null}\n\t\t\t\taria-labelledby={this.props.showToolTipOnClick || textOverflowing ? `${this.uuid}-${this.props.id}` : null}\n\t\t\t\taria-expanded={this.props.showToolTipOnClick || textOverflowing ? this.state.isTooltipVisible : null}\n\t\t\t\taria-controls={this.props.showToolTipOnClick || textOverflowing ? `${this.uuid}-${this.props.id}` : null}\n\t\t\t\tref={(ref) => (this.triggerRef = ref)}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</div>);\n\t\t}\n\n\t\tif ((typeof this.props.tip) === \"string\") {\n\t\t\ttooltipContent = (\n\t\t\t\t<span className=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</span>\n\t\t\t);\n\t\t} else if ((typeof this.props.tip) === \"object\") {\n\t\t\ttooltipContent = (\n\t\t\t\t<div className=\"tooltipContainer\">\n\t\t\t\t\t{this.props.tip}\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else if ((typeof this.props.tip) === \"function\") {\n\t\t\ttooltipContent = this.props.tip();\n\t\t}\n\n\t\tlet tipClass = \"common-canvas-tooltip\";\n\t\tif (this.props.className) {\n\t\t\ttipClass += \" \" + this.props.className;\n\t\t}\n\t\tthis.linkClicked = false;\n\t\tlet link = null;\n\t\tif (this.state.isTooltipVisible && this.props.tooltipLinkHandler && this.props.link) {\n\t\t\tconst linkInformation = this.props.tooltipLinkHandler(this.props.link);\n\t\t\t// Verify tooltipLinkHandler returns object in correct format\n\t\t\tif (typeof linkInformation === \"object\" && linkInformation.label && linkInformation.url) {\n\t\t\t\tlink = (<div\n\t\t\t\t\tref={(ref) => (this.linkRef = ref)}\n\t\t\t\t\tonKeyDown={(evt) => {\n\t\t\t\t\t\tevt.stopPropagation();\n\t\t\t\t\t\tevt.preventDefault();\n\n\t\t\t\t\t\t// When 'Esc' is pressed shift the focus to tooltip icon so that user can navigate following elements.\n\t\t\t\t\t\tif (evt.key === \"Escape\") {\n\t\t\t\t\t\t\tthis.triggerRef.focus();\n\t\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t\t} else if (evt.key === \"Enter\") { // Open active/highlighted link when Enter or Return is clicked.\n\t\t\t\t\t\t\tconst focusedElement = this.linkRef.children[0];\n\t\t\t\t\t\t\tif (focusedElement) {\n\t\t\t\t\t\t\t\twindow.open(focusedElement, \"_blank\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\tif (this.linkClicked) { // Keep tooltip open when link is clicked\n\t\t\t\t\t\t\tthis.setTooltipVisible(true);\n\t\t\t\t\t\t} else { // Close the tooltip and shift focus to tooltip icon\n\t\t\t\t\t\t\tthis.triggerRef.focus();\n\t\t\t\t\t\t\tthis.linkClicked = false;\n\t\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tthis.linkClicked = true;\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Link\n\t\t\t\t\t\tclassName=\"tooltip-link\"\n\t\t\t\t\t\tid={this.props.link.id}\n\t\t\t\t\t\thref={linkInformation.url}\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\trel=\"noopener\"\n\t\t\t\t\t\tvisited={false}\n\t\t\t\t\t\tonMouseDown={(evt) => {\n\t\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{linkInformation.label}\n\t\t\t\t\t</Link>\n\t\t\t\t</div>);\n\t\t\t}\n\t\t}\n\n\t\tlet tooltip = null;\n\t\tif (tooltipContent || link) {\n\t\t\ttooltip = (\n\t\t\t\t<Portal>\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tid={`${this.uuid}-${this.props.id}`}\n\t\t\t\t\t\tdata-id={`${this.uuid}-${this.props.id}`}\n\t\t\t\t\t\tclassName={tipClass}\n\t\t\t\t\t\taria-hidden={!this.state.isTooltipVisible}\n\t\t\t\t\t\tdirection={this.props.direction}\n\t\t\t\t\t\tref={(ref) => (this.targetRef = ref)}\n\t\t\t\t\t\tonMouseEnter={() => {\n\t\t\t\t\t\t\tthis.inTooltip = true;\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonMouseLeave={() => {\n\t\t\t\t\t\t\tthis.inTooltip = false;\n\t\t\t\t\t\t\tthis.setTooltipVisible(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t// Stop event propagation to prevent tooltip from performing toolbar button click\n\t\t\t\t\t\tonClick={this.stopEventPropagation}\n\t\t\t\t\t\tonMouseDown={this.stopEventPropagation}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg className=\"tipArrow\" x=\"0px\" y=\"0px\" viewBox=\"0 0 9.1 16.1\" aria-hidden>\n\t\t\t\t\t\t\t<polyline points=\"9.1,15.7 1.4,8.1 9.1,0.5\" />\n\t\t\t\t\t\t\t<polygon points=\"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t{tooltipContent}\n\t\t\t\t\t\t{link}\n\t\t\t\t\t</div>\n\t\t\t\t</Portal>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"tooltip-container\">\n\t\t\t\t{triggerContent}\n\t\t\t\t{tooltip}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolTip.propTypes = {\n\ttip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired,\n\tlink: PropTypes.object,\n\ttooltipLinkHandler: PropTypes.func,\n\tdirection: PropTypes.oneOf([\"left\", \"right\", \"top\", \"bottom\"]),\n\tchildren: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n\ttargetObj: PropTypes.object,\n\tid: PropTypes.string.isRequired,\n\tclassName: PropTypes.string,\n\tmousePos: PropTypes.object,\n\tdisable: PropTypes.bool, // Tooltip will not show if disabled\n\tshowToolTipIfTruncated: PropTypes.bool, // Set to true to only display tooltip if full text does not fit in displayable width\n\ttruncatedRef: PropTypes.object,\n\tdelay: PropTypes.number,\n\tshowToolTipOnClick: PropTypes.bool,\n\thoverable: PropTypes.bool, // If true, mouse cursor can be hovered over to the tooltip, instead of immediately disappearing.\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\thoverable: false\n};\n\nexport default ToolTip;\n"],"names":["ToolTip","_React$Component","props","_this","_classCallCheck","state","isTooltipVisible","uuid","uuid4","pendingTooltip","hideTooltipOnScrollAndResize","bind","handleMouseOverOtherTrigger","stopEventPropagation","tabKeyPressed","linkClicked","inTooltip","_inherits","_createClass","key","value","window","addEventListener","this","document","targetObj","setTooltipVisible","removeEventListener","clearTimeout","visible","showTooltip","setState","tooltip","querySelector","concat","id","_this$targetRef","tooltipTrigger","updateTooltipLayout","getAttribute","linkElement","targetRef","focus","evt","triggerRef","currentDirection","newDirection","canDisplayFullText","disable","showToolTipIfTruncated","stopPropagation","elem","triggerElem","truncatedRef","current","fullWidth","firstChild","scrollWidth","childWidth","offsetWidth","that","setTimeout","delay","direction","tooltipDirection","viewPortWidth","documentElement","clientWidth","viewPortHeight","clientHeight","triggerLayout","getBoundingClientRect","pointer","pointerLayout","style","left","getStyleValue","top","mousePos","updateLocationBasedOnMousePos","tooltipLeft","width","offsetLeft","Math","round","right","height","offsetHeight","bottom","tooltipTop","isOutOfBounds","getNewDirection","setAttribute","mouseX","x","mouseY","y","parseFloat","preventDefault","target","closest","_this2","tooltipContent","triggerContent","children","mouseleave","hoverable","textOverflowing","enableKeyboardAccess","showToolTipOnClick","React","createElement","className","onMouseOver","onMouseLeave","onMouseDown","onClick","toggleTooltipOnClick","onFocus","showTooltipWithDelay","onBlur","_evt$relatedTarget","_el$tagName","el","relatedTarget","tagName","toLowerCase","onKeyDown","setKeyPressed","tabIndex","role","ref","tip","_typeof","tipClass","link","tooltipLinkHandler","linkInformation","label","url","linkRef","focusedElement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BoB8E,EAAAA,QAAMyC,WAsjB5BvJ,EAAQwJ,aAAe,CACtB1F,MAAO,IACPC,UAAW,SACXd,wBAAwB,EACxB4D,oBAAoB,EACpBH,WAAW"}
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("../createClass-df7b07d6.js"),e=require("../inherits-74e481d1.js"),i=require("react"),o=require("react-portal"),l=require("@carbon/react"),s=require("uuid");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(i);function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}var a=function(i){function n(i){var o,l,r,a;return t._classCallCheck(this,n),l=this,r=n,a=[i],r=e._getPrototypeOf(r),(o=e._possibleConstructorReturn(l,p()?Reflect.construct(r,a||[],e._getPrototypeOf(l).constructor):r.apply(l,a))).state={isTooltipVisible:!1},o.uuid=s.v4(),o.pendingTooltip=null,o.hideTooltipOnScrollAndResize=o.hideTooltipOnScrollAndResize.bind(o),o.handleMouseOverOtherTrigger=o.handleMouseOverOtherTrigger.bind(o),o.stopEventPropagation=o.stopEventPropagation.bind(o),o.tabKeyPressed=!1,o.linkClicked=!1,o.inTooltip=!1,o}return e._inherits(n,i),t._createClass(n,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.addEventListener("resize",this.hideTooltipOnScrollAndResize,!0),document.addEventListener("mouseover",this.handleMouseOverOtherTrigger,!0),this.props.targetObj&&this.setTooltipVisible(!0)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.removeEventListener("resize",this.hideTooltipOnScrollAndResize,!0),document.removeEventListener("mouseover",this.handleMouseOverOtherTrigger,!0),this.pendingTooltip&&clearTimeout(this.pendingTooltip)}},{key:"setTooltipVisible",value:function(t){if((!this.showTooltip()||!t&&this.pendingTooltip)&&(clearTimeout(this.pendingTooltip),this.pendingTooltip=null,this.setState({isTooltipVisible:!1})),this.showTooltip()){var e=document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"']"));if(this.pendingTooltip=null,this.setState({isTooltipVisible:t}),t){var i,o=null;(o=this.props.targetObj?this.props.targetObj:document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"-trigger']")))&&e&&this.updateTooltipLayout(e,o,e.getAttribute("direction"));var l=null===(i=this.targetRef)||void 0===i?void 0:i.querySelector("a");l&&l.focus()}}}},{key:"setKeyPressed",value:function(t){"Tab"===t.key&&(this.tabKeyPressed=!0),"Escape"===t.key&&(this.triggerRef.focus(),this.setTooltipVisible(!1))}},{key:"getStyleValue",value:function(t){return t+"px"}},{key:"getNewDirection",value:function(t){var e;switch(t){case"top":e="bottom";break;case"bottom":e="top";break;case"left":e="right";break;default:e="left"}return e}},{key:"showTooltip",value:function(){var t=this.canDisplayFullText(this.triggerRef);return!this.props.disable&&!this.props.showToolTipIfTruncated||!this.props.disable&&this.props.showToolTipIfTruncated&&!t}},{key:"stopEventPropagation",value:function(t){t.stopPropagation()}},{key:"canDisplayFullText",value:function(t){var e=t;if(this.props.truncatedRef&&(e=this.props.truncatedRef.current?this.props.truncatedRef.current:this.props.truncatedRef),e){var i=e.firstChild&&e.firstChild.scrollWidth&&0!==e.firstChild.scrollWidth?e.firstChild.scrollWidth:e.scrollWidth,o=e.firstChild&&e.firstChild.offsetWidth&&e.firstChild.offsetWidth||0;return i<=(0!==o&&o<e.offsetWidth?o:e.offsetWidth)}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 a=n.left;t.offsetWidth>n.width?(a-=(t.offsetWidth-n.width)/2)<0&&(a=2):t.offsetWidth<n.width&&(a+=(n.width-t.offsetWidth)/2),t.style.left=this.getStyleValue(a),a+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 h=n.top;t.offsetHeight>n.height?(h-=(t.offsetHeight-n.height)/2)<0&&(h=n.top):t.offsetHeight<n.height&&(h+=(n.height-t.offsetHeight)/2),t.style.top=this.getStyleValue(h+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,a=this.props.mousePos.y;if("top"===o||"bottom"===o){var h=p-t.offsetWidth/2;l-t.offsetWidth<h?h=l-t.offsetWidth:h<0&&(h=2),t.style.left=this.getStyleValue(h)}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(a-r.height-t.offsetHeight);else if("bottom"===o)t.style.top=this.getStyleValue(a+2*r.height);else if("left"===o||"right"===o){var u=a-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(a-t.getBoundingClientRect().top-r.height/2))}},{key:"isOutOfBounds",value:function(t){var e=parseFloat(t.style.left),i=parseFloat(t.style.top);return e+t.offsetWidth>document.documentElement.clientWidth||e<0||i<0||i+t.offsetHeight>document.documentElement.clientHeight}},{key:"toggleTooltipOnClick",value:function(t){t.stopPropagation(),t.preventDefault(),this.triggerRef.focus(),this.state.isTooltipVisible?this.setTooltipVisible(!1):this.setTooltipVisible(!0)}},{key:"hideTooltipOnScrollAndResize",value:function(t){this.state.isTooltipVisible&&!this.linkClicked&&this.setTooltipVisible(!1)}},{key:"handleMouseOverOtherTrigger",value:function(t){var e=t.target.closest(".tooltip-trigger");e&&e!==this.triggerRef&&this.state.isTooltipVisible&&this.setTooltipVisible(!1)}},{key:"render",value:function(){var e=this,i=null,s=null;if(this.props.children){var n;n=this.props.hoverable?function(){setTimeout(function(){e.inTooltip||e.setTooltipVisible(!1)},100)}:function(){return e.setTooltipVisible(!1)};var p=this.canDisplayFullText(this.triggerRef),a=this.props.showToolTipIfTruncated&&!p,h=this.props.showToolTipOnClick||a||!this.props.disable;s=r.default.createElement("div",{"data-id":"".concat(this.uuid,"-").concat(this.props.id,"-trigger"),className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:n,onMouseDown:this.props.showToolTipOnClick?null:function(){return e.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(t){return e.toggleTooltipOnClick(t)}:null,onFocus:h?function(){e.props.showToolTipOnClick?e.showTooltipWithDelay():e.setTooltipVisible(!0)}:null,onBlur:h?function(t){if(e.tabKeyPressed)e.setTooltipVisible(!1),e.tabKeyPressed=!1;else{var i,o,l=null==t||null===(i=t.relatedTarget)||void 0===i?void 0:i.closest(".common-canvas-tooltip");"div"===(null==l||null===(o=l.tagName)||void 0===o?void 0:o.toLowerCase())?e.setTooltipVisible(!0):e.setTooltipVisible(!1)}}:null,onKeyDown:this.props.showToolTipOnClick?function(t){return e.setKeyPressed(t)}:null,tabIndex:this.props.showToolTipOnClick||a?0:null,role:this.props.showToolTipOnClick||a?"button":null,"aria-labelledby":this.props.showToolTipOnClick||a?"".concat(this.uuid,"-").concat(this.props.id):null,"aria-expanded":this.props.showToolTipOnClick||a?this.state.isTooltipVisible:null,"aria-controls":this.props.showToolTipOnClick||a?"".concat(this.uuid,"-").concat(this.props.id):null,ref:function(t){return e.triggerRef=t}},this.props.children)}"string"==typeof this.props.tip?i=r.default.createElement("span",{className:"tooltipContainer"},this.props.tip):"object"===t._typeof(this.props.tip)?i=r.default.createElement("div",{className:"tooltipContainer"},this.props.tip):"function"==typeof this.props.tip&&(i=this.props.tip());var u="common-canvas-tooltip";this.props.className&&(u+=" "+this.props.className),this.linkClicked=!1;var c=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var f=this.props.tooltipLinkHandler(this.props.link);"object"===t._typeof(f)&&f.label&&f.url&&(c=r.default.createElement("div",{ref:function(t){return e.linkRef=t},onKeyDown:function(t){if(t.stopPropagation(),t.preventDefault(),"Escape"===t.key)e.triggerRef.focus(),e.setTooltipVisible(!1);else if("Enter"===t.key){var i=e.linkRef.children[0];i&&window.open(i,"_blank")}},onBlur:function(){e.linkClicked?e.setTooltipVisible(!0):(e.triggerRef.focus(),e.linkClicked=!1,e.setTooltipVisible(!1))},onClick:function(){e.linkClicked=!0}},r.default.createElement(l.Link,{className:"tooltip-link",id:this.props.link.id,href:f.url,target:"_blank",rel:"noopener",visited:!1,onMouseDown:function(t){t.preventDefault()}},f.label)))}var d=null;return(i||c)&&(d=r.default.createElement(o.Portal,null,r.default.createElement("div",{role:"tooltip",id:"".concat(this.uuid,"-").concat(this.props.id),"data-id":"".concat(this.uuid,"-").concat(this.props.id),className:u,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction,ref:function(t){return e.targetRef=t},onMouseEnter:function(){e.inTooltip=!0},onMouseLeave:function(){e.inTooltip=!1,e.setTooltipVisible(!1)},onClick:this.stopEventPropagation,onMouseDown:this.stopEventPropagation},r.default.createElement("svg",{className:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1","aria-hidden":!0},r.default.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),r.default.createElement("polygon",{points:"8.1,16.1 0,8.1 8.1,0 8.1,1.4 1.4,8.1 8.1,14.7"})),i,c))),r.default.createElement("div",{className:"tooltip-container"},s,d)}}])}(r.default.Component);a.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1,hoverable:!1},module.exports=a;
1
+ import{_ as t,b as e,a as i}from"../createClass-a140e270.js";import{_ as o,a as s,b as l}from"../inherits-860188e5.js";import n from"react";import{Portal as r}from"react-portal";import{Link as p}from"@carbon/react";import{v4 as h}from"uuid";function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(a=function(){return!!t})()}var u=function(u){function c(t){var e,o,n,r;return i(this,c),o=this,r=[t],n=s(n=c),(e=l(o,a()?Reflect.construct(n,r||[],s(o).constructor):n.apply(o,r))).state={isTooltipVisible:!1},e.uuid=h(),e.pendingTooltip=null,e.hideTooltipOnScrollAndResize=e.hideTooltipOnScrollAndResize.bind(e),e.handleMouseOverOtherTrigger=e.handleMouseOverOtherTrigger.bind(e),e.stopEventPropagation=e.stopEventPropagation.bind(e),e.tabKeyPressed=!1,e.linkClicked=!1,e.inTooltip=!1,e}return o(c,u),t(c,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.addEventListener("resize",this.hideTooltipOnScrollAndResize,!0),document.addEventListener("mouseover",this.handleMouseOverOtherTrigger,!0),this.props.targetObj&&this.setTooltipVisible(!0)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScrollAndResize,!0),window.removeEventListener("resize",this.hideTooltipOnScrollAndResize,!0),document.removeEventListener("mouseover",this.handleMouseOverOtherTrigger,!0),this.pendingTooltip&&clearTimeout(this.pendingTooltip)}},{key:"setTooltipVisible",value:function(t){if((!this.showTooltip()||!t&&this.pendingTooltip)&&(clearTimeout(this.pendingTooltip),this.pendingTooltip=null,this.setState({isTooltipVisible:!1})),this.showTooltip()){var e=document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"']"));if(this.pendingTooltip=null,this.setState({isTooltipVisible:t}),t){var i,o=null;(o=this.props.targetObj?this.props.targetObj:document.querySelector("[data-id='".concat(this.uuid,"-").concat(this.props.id,"-trigger']")))&&e&&this.updateTooltipLayout(e,o,e.getAttribute("direction"));var s=null===(i=this.targetRef)||void 0===i?void 0:i.querySelector("a");s&&s.focus()}}}},{key:"setKeyPressed",value:function(t){"Tab"===t.key&&(this.tabKeyPressed=!0),"Escape"===t.key&&(this.triggerRef.focus(),this.setTooltipVisible(!1))}},{key:"getStyleValue",value:function(t){return t+"px"}},{key:"getNewDirection",value:function(t){var e;switch(t){case"top":e="bottom";break;case"bottom":e="top";break;case"left":e="right";break;default:e="left"}return e}},{key:"showTooltip",value:function(){var t=this.canDisplayFullText(this.triggerRef);return!this.props.disable&&!this.props.showToolTipIfTruncated||!this.props.disable&&this.props.showToolTipIfTruncated&&!t}},{key:"stopEventPropagation",value:function(t){t.stopPropagation()}},{key:"canDisplayFullText",value:function(t){var e=t;if(this.props.truncatedRef&&(e=this.props.truncatedRef.current?this.props.truncatedRef.current:this.props.truncatedRef),e){var i=e.firstChild&&e.firstChild.scrollWidth&&0!==e.firstChild.scrollWidth?e.firstChild.scrollWidth:e.scrollWidth,o=e.firstChild&&e.firstChild.offsetWidth&&e.firstChild.offsetWidth||0;return i<=(0!==o&&o<e.offsetWidth?o:e.offsetWidth)}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,s=document.documentElement.clientWidth,l=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>s&&(t.style.left=this.getStyleValue(s-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),l-t.offsetHeight<n.top&&(t.style.top=this.getStyleValue(l-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,s=document.documentElement.clientWidth,l=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;s-t.offsetWidth<a?a=s-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;l-t.offsetHeight<u?u=l-t.offsetHeight:u<0&&(u=2),t.style.top=this.getStyleValue(u+1)}"top"===o||"bottom"===o?n.style.left=this.getStyleValue(p-t.getBoundingClientRect().left-r.width/2):"left"===o?n.style.left=this.getStyleValue(t.offsetWidth-3):"right"===o&&(n.style.left=this.getStyleValue(2-r.width)),"top"===o?n.style.top=this.getStyleValue(t.offsetHeight-5):"bottom"===o?n.style.top="-11px":"left"!==o&&"right"!==o||(n.style.top=this.getStyleValue(h-t.getBoundingClientRect().top-r.height/2))}},{key:"isOutOfBounds",value:function(t){var e=parseFloat(t.style.left),i=parseFloat(t.style.top);return e+t.offsetWidth>document.documentElement.clientWidth||e<0||i<0||i+t.offsetHeight>document.documentElement.clientHeight}},{key:"toggleTooltipOnClick",value:function(t){t.stopPropagation(),t.preventDefault(),this.triggerRef.focus(),this.state.isTooltipVisible?this.setTooltipVisible(!1):this.setTooltipVisible(!0)}},{key:"hideTooltipOnScrollAndResize",value:function(t){this.state.isTooltipVisible&&!this.linkClicked&&this.setTooltipVisible(!1)}},{key:"handleMouseOverOtherTrigger",value:function(t){var e=t.target.closest(".tooltip-trigger");e&&e!==this.triggerRef&&this.state.isTooltipVisible&&this.setTooltipVisible(!1)}},{key:"render",value:function(){var t=this,i=null,o=null;if(this.props.children){var s;s=this.props.hoverable?function(){setTimeout(function(){t.inTooltip||t.setTooltipVisible(!1)},100)}:function(){return t.setTooltipVisible(!1)};var l=this.canDisplayFullText(this.triggerRef),h=this.props.showToolTipIfTruncated&&!l,a=this.props.showToolTipOnClick||h||!this.props.disable;o=n.createElement("div",{"data-id":"".concat(this.uuid,"-").concat(this.props.id,"-trigger"),className:"tooltip-trigger",onMouseOver:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!0)},onMouseLeave:this.props.showToolTipOnClick?null:s,onMouseDown:this.props.showToolTipOnClick?null:function(){return t.setTooltipVisible(!1)},onClick:this.props.showToolTipOnClick?function(e){return t.toggleTooltipOnClick(e)}:null,onFocus:a?function(){t.props.showToolTipOnClick?t.showTooltipWithDelay():t.setTooltipVisible(!0)}:null,onBlur:a?function(e){if(t.tabKeyPressed)t.setTooltipVisible(!1),t.tabKeyPressed=!1;else{var i,o,s=null==e||null===(i=e.relatedTarget)||void 0===i?void 0:i.closest(".common-canvas-tooltip");"div"===(null==s||null===(o=s.tagName)||void 0===o?void 0:o.toLowerCase())?t.setTooltipVisible(!0):t.setTooltipVisible(!1)}}:null,onKeyDown:this.props.showToolTipOnClick?function(e){return t.setKeyPressed(e)}:null,tabIndex:this.props.showToolTipOnClick||h?0:null,role:this.props.showToolTipOnClick||h?"button":null,"aria-labelledby":this.props.showToolTipOnClick||h?"".concat(this.uuid,"-").concat(this.props.id):null,"aria-expanded":this.props.showToolTipOnClick||h?this.state.isTooltipVisible:null,"aria-controls":this.props.showToolTipOnClick||h?"".concat(this.uuid,"-").concat(this.props.id):null,ref:function(e){return t.triggerRef=e}},this.props.children)}"string"==typeof this.props.tip?i=n.createElement("span",{className:"tooltipContainer"},this.props.tip):"object"===e(this.props.tip)?i=n.createElement("div",{className:"tooltipContainer"},this.props.tip):"function"==typeof this.props.tip&&(i=this.props.tip());var u="common-canvas-tooltip";this.props.className&&(u+=" "+this.props.className),this.linkClicked=!1;var c=null;if(this.state.isTooltipVisible&&this.props.tooltipLinkHandler&&this.props.link){var f=this.props.tooltipLinkHandler(this.props.link);"object"===e(f)&&f.label&&f.url&&(c=n.createElement("div",{ref:function(e){return t.linkRef=e},onKeyDown:function(e){if(e.stopPropagation(),e.preventDefault(),"Escape"===e.key)t.triggerRef.focus(),t.setTooltipVisible(!1);else if("Enter"===e.key){var i=t.linkRef.children[0];i&&window.open(i,"_blank")}},onBlur:function(){t.linkClicked?t.setTooltipVisible(!0):(t.triggerRef.focus(),t.linkClicked=!1,t.setTooltipVisible(!1))},onClick:function(){t.linkClicked=!0}},n.createElement(p,{className:"tooltip-link",id:this.props.link.id,href:f.url,target:"_blank",rel:"noopener",visited:!1,onMouseDown:function(t){t.preventDefault()}},f.label)))}var d=null;return(i||c)&&(d=n.createElement(r,null,n.createElement("div",{role:"tooltip",id:"".concat(this.uuid,"-").concat(this.props.id),"data-id":"".concat(this.uuid,"-").concat(this.props.id),className:u,"aria-hidden":!this.state.isTooltipVisible,direction:this.props.direction,ref:function(e){return t.targetRef=e},onMouseEnter:function(){t.inTooltip=!0},onMouseLeave:function(){t.inTooltip=!1,t.setTooltipVisible(!1)},onClick:this.stopEventPropagation,onMouseDown:this.stopEventPropagation},n.createElement("svg",{className:"tipArrow",x:"0px",y:"0px",viewBox:"0 0 9.1 16.1","aria-hidden":!0},n.createElement("polyline",{points:"9.1,15.7 1.4,8.1 9.1,0.5"}),n.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,c))),n.createElement("div",{className:"tooltip-container"},o,d)}}])}(n.Component);u.defaultProps={delay:200,direction:"bottom",showToolTipIfTruncated:!1,showToolTipOnClick:!1,hoverable:!1};export{u as default};
2
2
  //# sourceMappingURL=tooltip.js.map